Skip to content

Conversation

@haakon-e
Copy link
Member

@haakon-e haakon-e commented Oct 24, 2025

This pull request refactors and extends the Smagorinsky-Lilly subgrid turbulence model implementation, making it more flexible and adding diagnostics and configuration options. The model can now be applied in specific directions (currently only UVW, i.e., all directions), and new diagnostics for horizontal and vertical diffusivities and strain rates are available. The changes affect configuration files, model initialization, diagnostics, and the main turbulence model code.

Key changes:

Smagorinsky-Lilly Model Refactor and Extension

  • Refactored the SmagorinskyLilly type to a parametric struct (SmagorinskyLilly{DIR}), allowing specification of which directions the model applies to (currently only :UVW is supported). Added utility functions to check model directionality, enabling more flexible and explicit control over turbulence modeling.
  • Updated the Smagorinsky-Lilly turbulence implementation to separately compute and store horizontal and vertical strain rates, eddy viscosities, and diffusivities. The main tendency routines now use these directional quantities, and the precomputation logic has been modularized for clarity and extensibility. [1] [2] [3]

Diagnostics and Postprocessing

  • Added new diagnostic variables for horizontal and vertical Smagorinsky diffusivities (Dh_smag, Dv_smag) and strain rate magnitudes (strainh_smag, strainv_smag). These are now available for output and analysis.
  • Updated the CI plotting script to include the new Smagorinsky diagnostics and vertical diffusivity in the list of variables plotted, improving postprocessing capabilities.

Configuration and Model Selection

  • Changed the configuration options for the Smagorinsky-Lilly model in YAML files: the parameter now accepts "UVW" (all directions) or nothing (disabled), replacing the previous boolean flag. Updated model getter logic to parse and instantiate the correct model variant. [1] [2] [3] [4]

Integration with Other Model Components

  • Modified the Jacobian assembly for implicit vertical diffusion to support vertical Smagorinsky-Lilly diffusivity, ensuring correct treatment when the model is active in the vertical direction.

Minor Improvements

  • Various code cleanups, improved documentation, and more consistent use of variable names and lazy evaluation for performance and clarity.

These changes collectively make the turbulence modeling more flexible, improve diagnostics, and streamline configuration and code structure.

@haakon-e
Copy link
Member Author

haakon-e commented Oct 24, 2025

This change is part of the following stack:

Change managed by git-spice.

@haakon-e haakon-e force-pushed the he/rft-vert-full-strain branch from 6be1adf to 80820b8 Compare October 24, 2025 17:32
@haakon-e haakon-e force-pushed the he/rft-smag-for-h-v-split branch from f208904 to 5b71280 Compare October 24, 2025 17:32
@haakon-e haakon-e force-pushed the he/rft-vert-full-strain branch from 80820b8 to cfe233d Compare October 24, 2025 18:06
@haakon-e haakon-e force-pushed the he/rft-smag-for-h-v-split branch 2 times, most recently from 096387a to c5146ea Compare October 24, 2025 18:10
@haakon-e haakon-e requested a review from trontrytel October 24, 2025 18:10
@haakon-e haakon-e force-pushed the he/rft-vert-full-strain branch from cfe233d to 706a428 Compare October 24, 2025 21:40
@haakon-e haakon-e force-pushed the he/rft-smag-for-h-v-split branch 2 times, most recently from 5735cee to 87a105c Compare October 24, 2025 22:00
@haakon-e
Copy link
Member Author

buildkite should pass once #4072 is merged so that ClimaCore is bumped to v0.14.41

@haakon-e haakon-e force-pushed the he/rft-smag-for-h-v-split branch from 87a105c to 2469091 Compare October 27, 2025 17:00
@haakon-e haakon-e force-pushed the he/rft-vert-full-strain branch from 706a428 to c8317c7 Compare October 27, 2025 18:20
@haakon-e haakon-e force-pushed the he/rft-smag-for-h-v-split branch from 2469091 to 8c5c1b8 Compare October 27, 2025 18:20
@haakon-e haakon-e force-pushed the he/rft-vert-full-strain branch from c8317c7 to e5987ed Compare October 27, 2025 21:13
Base automatically changed from he/rft-vert-full-strain to main October 28, 2025 00:39
@haakon-e haakon-e force-pushed the he/rft-smag-for-h-v-split branch from 8c5c1b8 to ec7aa18 Compare October 28, 2025 01:17
@haakon-e haakon-e force-pushed the he/rft-smag-for-h-v-split branch from ec7aa18 to a82a107 Compare October 28, 2025 01:17
@haakon-e haakon-e enabled auto-merge October 28, 2025 01:22
@haakon-e haakon-e added this pull request to the merge queue Oct 28, 2025
Merged via the queue into main with commit 981154f Oct 28, 2025
18 of 20 checks passed
@haakon-e haakon-e deleted the he/rft-smag-for-h-v-split branch October 28, 2025 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants