|
DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
|
RANS turbulence model functions (eddy viscosity, viscous flux, source terms). More...
Namespaces | |
| namespace | SA |
| Spalart-Allmaras model constants used across multiple files. | |
Functions | |
| template<int dim, class TU , class TDiffU > | |
| real | GetMut_RealizableKe (TU &&UMeanXy, TDiffU &&DiffUxy, real muf, real d) |
| Compute turbulent viscosity mu_t from the Shih et al. realizable k-epsilon model. | |
| template<int dim, class TU , class TN , class TDiffU , class TVFlux > | |
| void | GetVisFlux_RealizableKe (TU &&UMeanXy, TDiffU &&DiffUxyPrim, TN &&uNorm, real mut, real d, real muPhy, TVFlux &vFlux) |
| Compute the RANS viscous flux for the realizable k-epsilon transport equations. | |
| template<int dim, class TU , class TDiffU , class TSource > | |
| void | GetSource_RealizableKe (TU &&UMeanXy, TDiffU &&DiffUxy, real muf, real d, TSource &source, int mode) |
| Compute source terms for the realizable k-epsilon transport equations. | |
| template<int dim, class TU > | |
| std::tuple< real, real > | SolveZeroGradEquilibrium (TU &u, real muPhy) |
| Attempt to find equilibrium epsilon for zero-gradient (freestream) conditions via Newton iteration. | |
| template<int dim, class TU , class TDiffU , class TSource > | |
| void | GetSourceJacobianDiag_RealizableKe (TU &&UMeanXy, TDiffU &&DiffUxy, real muf, TSource &source) |
| Compute the analytical diagonal of the source Jacobian for the realizable k-epsilon model. | |
| template<int dim, class TU , class TDiffU , class TSource > | |
| void | GetSourceJacobianDiag_RealizableKe_ND (TU &&UMeanXy, TDiffU &&DiffUxy, real muf, TSource &source) |
| Compute the numerical (finite-difference) diagonal of the source Jacobian for the realizable k-epsilon model. | |
| template<int dim, class TU , class TDiffU > | |
| real | GetMut_SST (TU &&UMeanXy, TDiffU &&DiffUxy, real muf, real d) |
| Compute turbulent viscosity mu_t from Menter's k-omega SST model. | |
| template<int dim, class TU , class TN , class TDiffU , class TVFlux > | |
| void | GetVisFlux_SST (TU &&UMeanXy, TDiffU &&DiffUxyPrim, TN &&uNorm, real mutIn, real d, real muf, TVFlux &vFlux) |
| Compute the RANS viscous flux for the k-omega SST transport equations. | |
| template<int dim, class TU , class TDiffU , class TSource > | |
| void | GetSource_SST (TU &&UMeanXy, TDiffU &&DiffUxy, real muf, real d, real lLES, TSource &source, int mode) |
| Compute source terms for the k-omega SST transport equations. | |
| template<int dim, class TU , class TDiffU > | |
| real | GetMut_KOWilcox (TU &&UMeanXy, TDiffU &&DiffUxy, real muf, real d) |
| Compute turbulent viscosity mu_t from the Wilcox k-omega model. | |
| template<int dim, class TU , class TN , class TDiffU , class TVFlux > | |
| void | GetVisFlux_KOWilcox (TU &&UMeanXy, TDiffU &&DiffUxyPrim, TN &&uNorm, real mutIn, real d, real muf, TVFlux &vFlux) |
| Compute the RANS viscous flux for the Wilcox k-omega transport equations. | |
| template<int dim, class TU , class TDiffU , class TSource > | |
| void | GetSource_KOWilcox (TU &&UMeanXy, TDiffU &&DiffUxy, real muf, real d, TSource &source, int mode) |
| Compute source terms for the Wilcox k-omega transport equations. | |
| template<int dim, class TU , class TDiffU , class TSource > | |
| void | GetSource_SA (TU &&UMeanXy, TDiffU &&DiffUxy, real muRef, real mufPhy, real gamma, real d, real lLES, real hMax, int DESMode, TSource &source, int rotCor, int mode) |
| Compute source terms for the Spalart-Allmaras one-equation turbulence model. | |
RANS turbulence model functions (eddy viscosity, viscous flux, source terms).
| real DNDS::Euler::RANS::GetMut_KOWilcox | ( | TU && | UMeanXy, |
| TDiffU && | DiffUxy, | ||
| real | muf, | ||
| real | d | ||
| ) |
Compute turbulent viscosity mu_t from the Wilcox k-omega model.
Evaluates the eddy viscosity mu_t = rho * k / omega_tilde, where omega_tilde depends on the selected model version (KW_WILCOX_VER):
Optional upper bound of 1e5 * mu_laminar when KW_WILCOX_LIMIT_MUT is enabled.
| dim | Spatial dimension (2 or 3). |
| TU | Eigen-compatible type for the conservative state vector. |
| TDiffU | Eigen-compatible type for the gradient tensor (dim × nVars, conservative variables). |
| UMeanXy | Conservative state vector [rho, rhoU, ..., rhoE, rho*k, rho*omega]. |
| DiffUxy | Gradient tensor of conservative variables, size dim × nVars. |
| muf | Laminar (molecular) dynamic viscosity. |
| d | Wall distance (unused in this model but kept for interface consistency). |
Definition at line 715 of file RANS_ke.hpp.
| real DNDS::Euler::RANS::GetMut_RealizableKe | ( | TU && | UMeanXy, |
| TDiffU && | DiffUxy, | ||
| real | muf, | ||
| real | d | ||
| ) |
Compute turbulent viscosity mu_t from the Shih et al. realizable k-epsilon model.
Evaluates the eddy viscosity using the realizable k-epsilon formulation with:
KE_LIMIT_MUT is enabled.| dim | Spatial dimension (2 or 3). |
| TU | Eigen-compatible type for the conservative state vector. |
| TDiffU | Eigen-compatible type for the gradient tensor (dim × nVars, conservative variables). |
| UMeanXy | Conservative state vector [rho, rhoU, ..., rhoE, rho*k, rho*epsilon]. |
| DiffUxy | Gradient tensor of conservative variables, size dim × nVars. |
| muf | Laminar (molecular) dynamic viscosity. |
| d | Wall distance (unused in this model but kept for interface consistency). |
Definition at line 91 of file RANS_ke.hpp.
| real DNDS::Euler::RANS::GetMut_SST | ( | TU && | UMeanXy, |
| TDiffU && | DiffUxy, | ||
| real | muf, | ||
| real | d | ||
| ) |
Compute turbulent viscosity mu_t from Menter's k-omega SST model.
Evaluates the SST eddy viscosity with:
KW_SST_LIMIT_MUT is enabled.| dim | Spatial dimension (2 or 3). |
| TU | Eigen-compatible type for the conservative state vector. |
| TDiffU | Eigen-compatible type for the gradient tensor (dim × nVars, conservative variables). |
| UMeanXy | Conservative state vector [rho, rhoU, ..., rhoE, rho*k, rho*omega]. |
| DiffUxy | Gradient tensor of conservative variables, size dim × nVars. |
| muf | Laminar (molecular) dynamic viscosity. |
| d | Wall distance. |
Definition at line 443 of file RANS_ke.hpp.
| void DNDS::Euler::RANS::GetSource_KOWilcox | ( | TU && | UMeanXy, |
| TDiffU && | DiffUxy, | ||
| real | muf, | ||
| real | d, | ||
| TSource & | source, | ||
| int | mode | ||
| ) |
Compute source terms for the Wilcox k-omega transport equations.
Evaluates production, destruction, and cross-diffusion source contributions for the k and omega equations following the Wilcox k-omega model. The version-dependent behavior is controlled by KW_WILCOX_VER:
Production of k is optionally capped at 20 * beta* * rho * k * omega (CFL3D-style) when KW_WILCOX_PROD_LIMITS is enabled.
When mode == 0, the full source vector is returned:
When mode == 1, the implicit diagonal contribution (positive) is returned:
| dim | Spatial dimension (2 or 3). |
| TU | Eigen-compatible type for the conservative state vector. |
| TDiffU | Eigen-compatible type for the gradient tensor (dim × nVars, conservative variables). |
| TSource | Eigen-compatible type for the output source vector. |
| UMeanXy | Conservative state vector. | |
| DiffUxy | Gradient tensor of conservative variables, size dim × nVars. | |
| muf | Laminar (molecular) dynamic viscosity. | |
| d | Wall distance (unused here, kept for interface consistency). | |
| [out] | source | Output source vector; entries at I4+1 and I4+2 are set. |
| mode | Source computation mode: 0 = full source, 1 = implicit diagonal (destruction only). |
Definition at line 850 of file RANS_ke.hpp.
| void DNDS::Euler::RANS::GetSource_RealizableKe | ( | TU && | UMeanXy, |
| TDiffU && | DiffUxy, | ||
| real | muf, | ||
| real | d, | ||
| TSource & | source, | ||
| int | mode | ||
| ) |
Compute source terms for the realizable k-epsilon transport equations.
Evaluates production, destruction, and extra source contributions for the k and epsilon equations following the Shih et al. realizable k-epsilon model.
Key terms computed:
When mode == 0, the full source vector is returned:
When mode == 1, the implicit diagonal contribution (positive) is returned for use in implicit time stepping:
| dim | Spatial dimension (2 or 3). |
| TU | Eigen-compatible type for the conservative state vector. |
| TDiffU | Eigen-compatible type for the gradient tensor (dim × nVars, conservative variables). |
| TSource | Eigen-compatible type for the output source vector. |
| UMeanXy | Conservative state vector. | |
| DiffUxy | Gradient tensor of conservative variables, size dim × nVars. | |
| muf | Laminar (molecular) dynamic viscosity. | |
| d | Wall distance (unused here, kept for interface consistency). | |
| [out] | source | Output source vector; entries at I4+1 and I4+2 are set. |
| mode | Source computation mode: 0 = full source, 1 = implicit diagonal (destruction only). |
Definition at line 192 of file RANS_ke.hpp.
| void DNDS::Euler::RANS::GetSource_SA | ( | TU && | UMeanXy, |
| TDiffU && | DiffUxy, | ||
| real | muRef, | ||
| real | mufPhy, | ||
| real | gamma, | ||
| real | d, | ||
| real | lLES, | ||
| real | hMax, | ||
| int | DESMode, | ||
| TSource & | source, | ||
| int | rotCor, | ||
| int | mode | ||
| ) |
Compute source terms for the Spalart-Allmaras one-equation turbulence model.
Evaluates the full SA source term including production, destruction, diffusion, and optional DES/DDES/IDDES/WMLES length-scale modification. The SA model solves a single transport equation for the modified kinematic viscosity nuTilde (stored as rho * nuTilde at index I4+1 in the conservative state vector).
Key terms computed:
rotCor is enabled.SA_USE_FT2_TERM.DES/DDES/IDDES length-scale modification:
When mode == 0, the full source is returned at source(I4+1). When mode == 1, the implicit diagonal contribution -dS/dU (positive, suitable for augmenting the implicit operator) is returned at source(I4+1).
| dim | Spatial dimension (2 or 3). |
| TU | Eigen-compatible type for the conservative state vector. |
| TDiffU | Eigen-compatible type for the gradient tensor (dim × nVars, conservative variables). |
| TSource | Eigen-compatible type for the output source vector. |
| UMeanXy | Conservative state vector [rho, rhoU, ..., rhoE, rho*nuTilde]. | |
| DiffUxy | Gradient tensor of conservative variables, size dim × nVars. | |
| muRef | Reference viscosity scale used to non-dimensionalise nuTilde (nuTilde_physical = UMeanXy(I4+1) * muRef / rho). | |
| mufPhy | Physical (dimensional) laminar dynamic viscosity. | |
| gamma | Ratio of specific heats (used for pressure gradient in optional helicity correction). | |
| d | Wall distance. | |
| lLES | LES length scale for DES shielding (set to a large value to disable DES). | |
| hMax | Maximum cell size (used in IDDES alpha parameter: alpha = 0.25 - d/hMax). | |
| DESMode | DES operating mode: 0 = pure RANS, 1 = IDDES, 2 = WMLES. | |
| [out] | source | Output source vector; entry at I4+1 is set. |
| rotCor | Rotation correction flag: 0 = disabled, nonzero = enabled (c_rot = 2.0). | |
| mode | Source computation mode: 0 = full source, 1 = implicit diagonal (positive). |
note that psi has lower bound of 1
super subs
Definition at line 986 of file RANS_ke.hpp.
| void DNDS::Euler::RANS::GetSource_SST | ( | TU && | UMeanXy, |
| TDiffU && | DiffUxy, | ||
| real | muf, | ||
| real | d, | ||
| real | lLES, | ||
| TSource & | source, | ||
| int | mode | ||
| ) |
Compute source terms for the k-omega SST transport equations.
Evaluates production, destruction, and cross-diffusion source contributions for the k and omega equations following Menter's SST model. Supports DES/DDES capability via the RANS-to-LES length scale ratio.
Key terms:
KW_SST_PROD_LIMITS is enabled).KW_SST_PROD_OMEGA_VERSION (0 = classical, 1 = strain-rate, 2 = vorticity).When mode == 0, the full source vector is returned. When mode == 1, the implicit diagonal contribution (positive) is returned:
| dim | Spatial dimension (2 or 3). |
| TU | Eigen-compatible type for the conservative state vector. |
| TDiffU | Eigen-compatible type for the gradient tensor (dim × nVars, conservative variables). |
| TSource | Eigen-compatible type for the output source vector. |
| UMeanXy | Conservative state vector. | |
| DiffUxy | Gradient tensor of conservative variables, size dim × nVars. | |
| muf | Laminar (molecular) dynamic viscosity. | |
| d | Wall distance. | |
| lLES | LES length scale for DES/DDES shielding (set to a large value to disable DES). | |
| [out] | source | Output source vector; entries at I4+1 and I4+2 are set. |
| mode | Source computation mode: 0 = full source, 1 = implicit diagonal (destruction only). |
Definition at line 609 of file RANS_ke.hpp.
| void DNDS::Euler::RANS::GetSourceJacobianDiag_RealizableKe | ( | TU && | UMeanXy, |
| TDiffU && | DiffUxy, | ||
| real | muf, | ||
| TSource & | source | ||
| ) |
Compute the analytical diagonal of the source Jacobian for the realizable k-epsilon model.
Evaluates -dS/dU diagonal entries for implicit time stepping of the k and epsilon transport equations. The diagonal entries approximate the linearised destruction terms:
These positive values are used to augment the implicit operator diagonal, improving stability of the coupled RANS system.
| dim | Spatial dimension (2 or 3). |
| TU | Eigen-compatible type for the conservative state vector. |
| TDiffU | Eigen-compatible type for the gradient tensor (dim × nVars, conservative variables). |
| TSource | Eigen-compatible type for the output Jacobian diagonal vector. |
| UMeanXy | Conservative state vector. | |
| DiffUxy | Gradient tensor of conservative variables, size dim × nVars. | |
| muf | Laminar (molecular) dynamic viscosity. | |
| [out] | source | Output Jacobian diagonal vector; entries at I4+1 and I4+2 are set. |
Definition at line 335 of file RANS_ke.hpp.
| void DNDS::Euler::RANS::GetSourceJacobianDiag_RealizableKe_ND | ( | TU && | UMeanXy, |
| TDiffU && | DiffUxy, | ||
| real | muf, | ||
| TSource & | source | ||
| ) |
Compute the numerical (finite-difference) diagonal of the source Jacobian for the realizable k-epsilon model.
Evaluates -dS_i/dU_i by forward finite-difference perturbation of rho*k and rho*epsilon independently. The perturbation step is proportional to sqrt(smallReal) times the variable magnitude. Results are clamped to non-negative values and amplified by a factor of 10 for enhanced implicit stability.
This is a fallback when the analytical Jacobian diagonal (GetSourceJacobianDiag_RealizableKe) is suspected of inaccuracy.
| dim | Spatial dimension (2 or 3). |
| TU | Eigen-compatible type for the conservative state vector. |
| TDiffU | Eigen-compatible type for the gradient tensor (dim × nVars, conservative variables). |
| TSource | Eigen-compatible type for the output Jacobian diagonal vector. |
| UMeanXy | Conservative state vector. | |
| DiffUxy | Gradient tensor of conservative variables, size dim × nVars. | |
| muf | Laminar (molecular) dynamic viscosity. | |
| [out] | source | Output numerical Jacobian diagonal vector; entries at I4+1 and I4+2 are set. |
Definition at line 400 of file RANS_ke.hpp.
| void DNDS::Euler::RANS::GetVisFlux_KOWilcox | ( | TU && | UMeanXy, |
| TDiffU && | DiffUxyPrim, | ||
| TN && | uNorm, | ||
| real | mutIn, | ||
| real | d, | ||
| real | muf, | ||
| TVFlux & | vFlux | ||
| ) |
Compute the RANS viscous flux for the Wilcox k-omega transport equations.
Evaluates the diffusion (viscous) flux contributions for the k and omega equations projected onto the face normal direction. The Wilcox model uses constant diffusion coefficients:
Effective diffusivity: mu_laminar + mu_t * sigma_{k,omega}.
| dim | Spatial dimension (2 or 3). |
| TU | Eigen-compatible type for the conservative state vector. |
| TN | Eigen-compatible type for the face unit normal vector. |
| TDiffU | Eigen-compatible type for the gradient tensor (dim × nVars, primitive variables). |
| TVFlux | Eigen-compatible type for the output viscous flux vector. |
| UMeanXy | Conservative state vector. | |
| DiffUxyPrim | Gradient tensor of primitive variables, size dim × nVars. | |
| uNorm | Outward-pointing face unit normal vector (length dim). | |
| mutIn | Turbulent dynamic viscosity (precomputed). | |
| d | Wall distance (unused here, kept for interface consistency). | |
| muf | Laminar (molecular) dynamic viscosity. | |
| [out] | vFlux | Output viscous flux vector; entries at I4+1 and I4+2 are set. |
Definition at line 776 of file RANS_ke.hpp.
| void DNDS::Euler::RANS::GetVisFlux_RealizableKe | ( | TU && | UMeanXy, |
| TDiffU && | DiffUxyPrim, | ||
| TN && | uNorm, | ||
| real | mut, | ||
| real | d, | ||
| real | muPhy, | ||
| TVFlux & | vFlux | ||
| ) |
Compute the RANS viscous flux for the realizable k-epsilon transport equations.
Evaluates the diffusion (viscous) flux contributions for the k and epsilon equations projected onto the face normal direction. The effective diffusivities are:
| dim | Spatial dimension (2 or 3). |
| TU | Eigen-compatible type for the conservative state vector. |
| TN | Eigen-compatible type for the face unit normal vector. |
| TDiffU | Eigen-compatible type for the gradient tensor (dim × nVars, primitive variables). |
| TVFlux | Eigen-compatible type for the output viscous flux vector. |
| UMeanXy | Conservative state vector. | |
| DiffUxyPrim | Gradient tensor of primitive variables, size dim × nVars. | |
| uNorm | Outward-pointing face unit normal vector (length dim). | |
| mut | Turbulent dynamic viscosity (precomputed). | |
| d | Wall distance (unused here, kept for interface consistency). | |
| muPhy | Laminar (molecular) dynamic viscosity. | |
| [out] | vFlux | Output viscous flux vector; entries at I4+1 and I4+2 are set. |
Definition at line 148 of file RANS_ke.hpp.
| void DNDS::Euler::RANS::GetVisFlux_SST | ( | TU && | UMeanXy, |
| TDiffU && | DiffUxyPrim, | ||
| TN && | uNorm, | ||
| real | mutIn, | ||
| real | d, | ||
| real | muf, | ||
| TVFlux & | vFlux | ||
| ) |
Compute the RANS viscous flux for the k-omega SST transport equations.
Evaluates the diffusion (viscous) flux contributions for the k and omega equations projected onto the face normal direction. The effective diffusion coefficients are blended between the inner-layer (set 1) and outer-layer (set 2) values using the SST blending function F1:
Effective diffusivity for each equation: mu_laminar + mu_t * sigma_{k,omega}.
| dim | Spatial dimension (2 or 3). |
| TU | Eigen-compatible type for the conservative state vector. |
| TN | Eigen-compatible type for the face unit normal vector. |
| TDiffU | Eigen-compatible type for the gradient tensor (dim × nVars, primitive variables). |
| TVFlux | Eigen-compatible type for the output viscous flux vector. |
| UMeanXy | Conservative state vector. | |
| DiffUxyPrim | Gradient tensor of primitive variables, size dim × nVars. | |
| uNorm | Outward-pointing face unit normal vector (length dim). | |
| mutIn | Turbulent dynamic viscosity (precomputed, used for diffusion coefficients). | |
| d | Wall distance. | |
| muf | Laminar (molecular) dynamic viscosity. | |
| [out] | vFlux | Output viscous flux vector; entries at I4+1 and I4+2 are set. |
Definition at line 511 of file RANS_ke.hpp.
| std::tuple< real, real > DNDS::Euler::RANS::SolveZeroGradEquilibrium | ( | TU & | u, |
| real | muPhy | ||
| ) |
Attempt to find equilibrium epsilon for zero-gradient (freestream) conditions via Newton iteration.
Iteratively solves for the epsilon value that zeroes the k-equation source term when all spatial gradients are zero. Uses a simple Newton-Raphson loop with finite-difference Jacobian evaluation.
| dim | Spatial dimension (2 or 3). |
| TU | Eigen-compatible type for the conservative state vector. |
| [in,out] | u | Conservative state vector; u(I4+2) (rho*epsilon) is updated in place. |
| muPhy | Laminar (molecular) dynamic viscosity. |
Definition at line 275 of file RANS_ke.hpp.