SmagorinskyLilly#
- class fridom.nonhydro.modules.closures.smagorinsky_lilly.SmagorinskyLilly(background_viscosity: float = 1.05e-06, background_diffusivity: float = 1.46e-07, turbulent_prandtl_number: float = 1.0, smagorinsky_constant: float = 0.16, buoyancy_multiplier: float | None = None)[source]#
Bases:
ModuleA Smagorinsky-Lilly closure model for the non-hydrostatic model.
Description#
The Smagorinsky-Lilly model is a subgrid-scale turbulence model proposed by Smagorinsky (1963) and Lilly (1962). This implementation is based on the implementation in Oceananigans (https://clima.github.io/OceananigansDocumentation/v0.91.5/appendix/library/#Oceananigans.TurbulenceClosures.SmagorinskyLilly-Union{Tuple{},%20Tuple{TD},%20Tuple{TD,%20Any}}%20where%20TD).
The closure for the velocity field \(\boldsymbol{u}\) and a scalar tracer \(\phi\) is given by:
\[\Delta \boldsymbol{u} = \nabla \cdot \mathbf{\tau}\]\[\Delta \phi = \nabla \cdot \left( \kappa_t \nabla \phi \right)\]with the stress tensor \(\boldsymbol{\tau}\) and turbulent diffusivity \(\kappa_t\) given by:
\[\mathbf{\tau} = \nu_t \mathbf{\Sigma}\]\[\nu_t = \nu_s + \nu_{\text{background}}\]\[\kappa_t = \frac{\nu_s}{\text{Pr}} + \nu_{\text{background}}\]where \(\mathbf{\Sigma}\) is the strain rate tensor given by:
\[\mathbf{\Sigma} = \frac{1}{2} \left( \nabla \boldsymbol{u} + (\nabla \boldsymbol{u})^T \right)\]and \(\nu_s\) is the Smagorinsky viscosity given by:
\[\nu_s = \left( C_s \sqrt[3]{\Delta V} \right)^2 |\mathbf{\Sigma}| \Gamma(\text{Ri})\]where \(C_s\) is the Smagorinsky constant, \(\Delta V\) is the grid cell volume, \(|\mathbf{\Sigma}|\) is the magnitude of the strain rate tensor, and \(\Gamma(\text{Ri})\) is the stratification damping factor given by:
\[\Gamma(\text{Ri}) = \sqrt{1 - \min(\beta \text{Ri}, 1)}\]where \(\beta\) is the buoyancy multiplier and \(\text{Ri}\) is the resolved Richardson number given by:
\[\text{Ri} = \frac{N^2}{|\mathbf{\Sigma}|}\]where \(N^2\) is the buoyancy frequency:
\[N^2 = \partial_z b + N^2_{\text{background}}\]where \(b\) is the buoyancy field and \(N^2_{\text{background}}\) is the background buoyancy frequency. The magnitude of the strain rate tensor is given by:
\[|\mathbf{\Sigma}|^2 = \sum_{i=1}^3 \sum_{j=1}^3 \Sigma_{ij}^2\]Parameters#
- background_viscosityfloat, (default=1.05e-6)
The background viscosity for velocity fields.
- background_diffusivityfloat, (default=1.46e-7)
The background diffusivity for tracer fields.
- turbulent_prandtl_numberfloat, (default=1.0)
The turbulent Prandtl number.
- smagorinsky_constantfloat, (default=0.16)
The Smagorinsky constant.
- buoyancy_multiplierfloat | None, (default=None)
The buoyancy multiplier. If None, the buoyancy multiplier is set to \(1 / \text{turbulent_prandtl_number}\).
- __init__(background_viscosity: float = 1.05e-06, background_diffusivity: float = 1.46e-07, turbulent_prandtl_number: float = 1.0, smagorinsky_constant: float = 0.16, buoyancy_multiplier: float | None = None) None[source]#
Methods
__init__([background_viscosity, ...])disable()Disable the module.
enable()Enable the module.
is_enabled()Whether the module is enabled or not.
reset()Stop and start the module.
setup(mset[, setup_mode])Set the module up.
smagorinsky_lilly_operator(z, dz)start()Start the module.
stop()Stop the module.
update(mz)Update the model state.
Attributes
diff_moduleThe differentiation module to be used by this module.
gridThe grid of the model settings.
infoReturn a dictionary with information about the time stepper.
interp_moduleThe interpolation module to be used by this module.
is_setupWhether the module is set up.
msetThe model settings.
required_haloThe required halo points for this module.
Examples using
fridom.nonhydro.modules.closures.SmagorinskyLilly#- name = 'Smagorinsky-Lilly'#
- update(mz: ModelState) ModelState[source]#
Update the model state.
Description#
This method is called by the model at each time step. Child classes should overwrite this method to update the module. Make sure to decorate the method with the @module_method decorator.
Parameters#
- mzfr.ModelState
The model state at the current time step.
Returns#
- fr.ModelState
The updated model state.