DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
DNDS::Euler::EulerModelTraits< model > Struct Template Reference

Compile-time traits for EulerModel variants. More...

#include <Euler.hpp>

Static Public Attributes

static constexpr int nVarsFixed = getnVarsFixed(model)
 Number of fixed conservative variables (Eigen::Dynamic for NS_EX).
 
static constexpr int dim = getDim_Fixed(model)
 Physics spatial dimension (2 for NS_2D, 3 for all others).
 
static constexpr int gDim = getGeomDim_Fixed(model)
 Geometry (mesh) spatial dimension.
 
static constexpr bool hasSA = (model == NS_SA || model == NS_SA_3D)
 True for Spalart-Allmaras models (NS_SA, NS_SA_3D).
 
static constexpr bool has2EQ = (model == NS_2EQ || model == NS_2EQ_3D)
 True for 2-equation RANS models (NS_2EQ, NS_2EQ_3D).
 
static constexpr bool hasRANS = hasSA || has2EQ
 True for any RANS turbulence model (SA or 2-equation).
 
static constexpr int nRANSVars = hasSA ? 1 : (has2EQ ? 2 : 0)
 Number of extra RANS transport variables (0, 1, or 2).
 
static constexpr bool isExtended = (model == NS_EX || model == NS_EX_3D)
 True for extended/dynamic models (NS_EX, NS_EX_3D).
 
static constexpr bool isPlainNS = !hasRANS && !isExtended
 True for plain NS without turbulence or extensions.
 
static constexpr bool isGeom2D = (gDim == 2)
 True for 2D geometry models.
 
static constexpr bool isGeom3D = (gDim == 3)
 True for 3D geometry models.
 

Detailed Description

template<EulerModel model>
struct DNDS::Euler::EulerModelTraits< model >

Compile-time traits for EulerModel variants.

Bundles all model-dependent compile-time constants (variable count, dimensions, feature flags) into a single struct, replacing scattered if constexpr chains with clean named traits. All members are static constexpr.

Usage example:

static_assert(Traits::nVarsFixed == 6);
static_assert(Traits::dim == 3);
static_assert(Traits::gDim == 3);
static_assert(Traits::hasSA);
static_assert(Traits::hasRANS);
static_assert(Traits::nRANSVars == 1);
Compile-time traits for EulerModel variants.
Definition Euler.hpp:1086

Future models (reactive, multi-species) should add traits here rather than adding new if-constexpr chains.

Template Parameters
modelThe EulerModel enumerant to query traits for.

Definition at line 1085 of file Euler.hpp.

Member Data Documentation

◆ dim

template<EulerModel model>
constexpr int DNDS::Euler::EulerModelTraits< model >::dim = getDim_Fixed(model)
staticconstexpr

Physics spatial dimension (2 for NS_2D, 3 for all others).

Definition at line 1090 of file Euler.hpp.

◆ gDim

template<EulerModel model>
constexpr int DNDS::Euler::EulerModelTraits< model >::gDim = getGeomDim_Fixed(model)
staticconstexpr

Geometry (mesh) spatial dimension.

Definition at line 1092 of file Euler.hpp.

◆ has2EQ

template<EulerModel model>
constexpr bool DNDS::Euler::EulerModelTraits< model >::has2EQ = (model == NS_2EQ || model == NS_2EQ_3D)
staticconstexpr

True for 2-equation RANS models (NS_2EQ, NS_2EQ_3D).

Definition at line 1097 of file Euler.hpp.

◆ hasRANS

template<EulerModel model>
constexpr bool DNDS::Euler::EulerModelTraits< model >::hasRANS = hasSA || has2EQ
staticconstexpr

True for any RANS turbulence model (SA or 2-equation).

Definition at line 1099 of file Euler.hpp.

◆ hasSA

template<EulerModel model>
constexpr bool DNDS::Euler::EulerModelTraits< model >::hasSA = (model == NS_SA || model == NS_SA_3D)
staticconstexpr

True for Spalart-Allmaras models (NS_SA, NS_SA_3D).

Definition at line 1095 of file Euler.hpp.

◆ isExtended

template<EulerModel model>
constexpr bool DNDS::Euler::EulerModelTraits< model >::isExtended = (model == NS_EX || model == NS_EX_3D)
staticconstexpr

True for extended/dynamic models (NS_EX, NS_EX_3D).

Definition at line 1104 of file Euler.hpp.

◆ isGeom2D

template<EulerModel model>
constexpr bool DNDS::Euler::EulerModelTraits< model >::isGeom2D = (gDim == 2)
staticconstexpr

True for 2D geometry models.

Definition at line 1108 of file Euler.hpp.

◆ isGeom3D

template<EulerModel model>
constexpr bool DNDS::Euler::EulerModelTraits< model >::isGeom3D = (gDim == 3)
staticconstexpr

True for 3D geometry models.

Definition at line 1110 of file Euler.hpp.

◆ isPlainNS

template<EulerModel model>
constexpr bool DNDS::Euler::EulerModelTraits< model >::isPlainNS = !hasRANS && !isExtended
staticconstexpr

True for plain NS without turbulence or extensions.

Definition at line 1106 of file Euler.hpp.

◆ nRANSVars

template<EulerModel model>
constexpr int DNDS::Euler::EulerModelTraits< model >::nRANSVars = hasSA ? 1 : (has2EQ ? 2 : 0)
staticconstexpr

Number of extra RANS transport variables (0, 1, or 2).

Definition at line 1101 of file Euler.hpp.

◆ nVarsFixed

template<EulerModel model>
constexpr int DNDS::Euler::EulerModelTraits< model >::nVarsFixed = getnVarsFixed(model)
staticconstexpr

Number of fixed conservative variables (Eigen::Dynamic for NS_EX).

Definition at line 1088 of file Euler.hpp.


The documentation for this struct was generated from the following file: