rft: separate vertical and full strain #4073
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request refactors the computation of strain rate tensors throughout the codebase to clarify the distinction between vertical-only and full (vertical + horizontal) strain rate calculations. It introduces new, more explicit utility functions for these computations, updates all relevant usages to call the appropriate function, and adds improved documentation to guide future development.
Key changes include:
Refactoring and API Improvements:
Introduced
compute_strain_rate_center_verticalandcompute_strain_rate_face_verticalfunctions to explicitly compute strain rate tensors using only vertical gradients, replacing the more genericcompute_strain_rate_centerandcompute_strain_rate_facein all relevant locations. [1] [2] [3] [4] [5] [6] [7]Added new functions
compute_strain_rate_center_full!andcompute_strain_rate_face_full!to compute the full strain rate tensor (including both vertical and horizontal gradients) at cell centers and faces, respectively, with detailed documentation and guidance for use.Documentation and Usability:
Expanded and clarified docstrings for all strain rate computation functions, making it clear which functions use only vertical gradients and which compute the full tensor, and providing usage notes and references for future developers.
Added a new
strain_rate_normutility function to compute the norm of the strain rate tensor, with optional projection onto specific axes.These changes improve code clarity, ensure correct usage of strain rate computations, and provide a stronger foundation for future development and maintenance.