DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
RANS_ke.hpp File Reference

RANS two-equation turbulence model implementations for the DNDSR CFD solver. More...

#include "Euler.hpp"
Include dependency graph for RANS_ke.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  DNDS
 the host side operators are provided as implemented
 
namespace  DNDS::Euler
 
namespace  DNDS::Euler::RANS
 RANS turbulence model functions (eddy viscosity, viscous flux, source terms).
 
namespace  DNDS::Euler::RANS::SA
 Spalart-Allmaras model constants used across multiple files.
 

Macros

#define KE_LIMIT_MUT   1
 When set to 1, cap turbulent viscosity at 1e5 * mu_laminar for k-epsilon.
 
#define KW_WILCOX_VER   1
 Select Wilcox k-omega model version: 0 = original 1988, 1 = 2006 with stress limiter, 2 = simplified.
 
#define KW_WILCOX_PROD_LIMITS   1
 When set to 1, enable production limiters for Wilcox k-omega (CFL3D-style capping).
 
#define KW_WILCOX_LIMIT_MUT   1
 When set to 1, cap turbulent viscosity at 1e5 * mu_laminar for Wilcox k-omega.
 
#define KW_SST_LIMIT_MUT   1
 When set to 1, cap turbulent viscosity at 1e5 * mu_laminar for SST.
 
#define KW_SST_PROD_LIMITS   1
 When set to 1, enable production limiters for SST (CFL3D-style capping).
 
#define KW_SST_PROD_OMEGA_VERSION   1
 Select omega production formulation for SST: 0 = classical, 1 = strain-rate based, 2 = vorticity based.
 
#define SA_USE_FT2_TERM   1
 When set to 1, enable the ft2 laminar suppression term in Spalart-Allmaras. Setting to 0 disables ft2.
 

Functions

template<int dim, class TU , class TDiffU >
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.
 
template<int dim, class TU , class TN , class TDiffU , class TVFlux >
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.
 
template<int dim, class TU , class TDiffU , class TSource >
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.
 
template<int dim, class TU >
std::tuple< real, realDNDS::Euler::RANS::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 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.
 
template<int dim, class TU , class TDiffU , class TSource >
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.
 
template<int dim, class TU , class TDiffU >
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.
 
template<int dim, class TU , class TN , class TDiffU , class TVFlux >
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.
 
template<int dim, class TU , class TDiffU , class TSource >
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.
 
template<int dim, class TU , class TDiffU >
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.
 
template<int dim, class TU , class TN , class TDiffU , class TVFlux >
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.
 
template<int dim, class TU , class TDiffU , class TSource >
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.
 
template<int dim, class TU , class TDiffU , class TSource >
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.
 

Detailed Description

RANS two-equation turbulence model implementations for the DNDSR CFD solver.

Provides template functions for computing eddy viscosity, viscous fluxes, and source terms for several widely-used RANS turbulence closures:

  • Realizable k-epsilon (Shih et al.) with f_mu damping and realizability constraint.
  • k-omega SST (Menter) with F1/F2 blending, cross-diffusion, and DES/DDES/IDDES support.
  • k-omega Wilcox (1988 / 2006 variants) with stress limiter and f_beta correction.
  • Spalart-Allmaras (SA) one-equation model with optional rotation correction, negative-nuTilde extension, and DES/DDES/IDDES/WMLES length-scale modification.

All functions are templated on spatial dimension dim and accept Eigen-compatible expression types for the conservative state vector UMeanXy and the gradient tensor DiffUxy (dim × nVars). The convention for variable layout is:

  • Indices 0..dim: density and momentum components.
  • Index I4 = dim+1: total energy.
  • Index I4+1: first RANS variable (k or nuTilde).
  • Index I4+2: second RANS variable (epsilon or omega), where applicable.

Compile-time macros control model variants and limiters; see definitions below.

Note
This file is included by other Euler module headers and should not normally be included directly by application code.

Definition in file RANS_ke.hpp.

Macro Definition Documentation

◆ KE_LIMIT_MUT

#define KE_LIMIT_MUT   1

When set to 1, cap turbulent viscosity at 1e5 * mu_laminar for k-epsilon.

Definition at line 31 of file RANS_ke.hpp.

◆ KW_SST_LIMIT_MUT

#define KW_SST_LIMIT_MUT   1

When set to 1, cap turbulent viscosity at 1e5 * mu_laminar for SST.

Definition at line 41 of file RANS_ke.hpp.

◆ KW_SST_PROD_LIMITS

#define KW_SST_PROD_LIMITS   1

When set to 1, enable production limiters for SST (CFL3D-style capping).

Definition at line 43 of file RANS_ke.hpp.

◆ KW_SST_PROD_OMEGA_VERSION

#define KW_SST_PROD_OMEGA_VERSION   1

Select omega production formulation for SST: 0 = classical, 1 = strain-rate based, 2 = vorticity based.

Definition at line 45 of file RANS_ke.hpp.

◆ KW_WILCOX_LIMIT_MUT

#define KW_WILCOX_LIMIT_MUT   1

When set to 1, cap turbulent viscosity at 1e5 * mu_laminar for Wilcox k-omega.

Definition at line 38 of file RANS_ke.hpp.

◆ KW_WILCOX_PROD_LIMITS

#define KW_WILCOX_PROD_LIMITS   1

When set to 1, enable production limiters for Wilcox k-omega (CFL3D-style capping).

Definition at line 36 of file RANS_ke.hpp.

◆ KW_WILCOX_VER

#define KW_WILCOX_VER   1

Select Wilcox k-omega model version: 0 = original 1988, 1 = 2006 with stress limiter, 2 = simplified.

Definition at line 34 of file RANS_ke.hpp.

◆ SA_USE_FT2_TERM

#define SA_USE_FT2_TERM   1

When set to 1, enable the ft2 laminar suppression term in Spalart-Allmaras. Setting to 0 disables ft2.

Definition at line 48 of file RANS_ke.hpp.