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

Shared ideal-gas thermodynamics and Roe-flux primitives. More...

#include "DNDS/Defines.hpp"
#include <cmath>
Include dependency graph for IdealGasPhysics.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::IdealGas
 

Enumerations

enum class  DNDS::IdealGas::PrimVariable { DNDS::IdealGas::Pressure , DNDS::IdealGas::InternalEnergy }
 

Functions

DNDS_DEVICE_CALLABLE void DNDS::IdealGas::IdealGasThermal (real E, real rho, real vSqr, real gamma, real &p, real &asqr, real &H)
 Compute pressure, speed-of-sound squared, and specific enthalpy from total energy, density, and velocity squared.
 
DNDS_DEVICE_CALLABLE real DNDS::IdealGas::Pressure_From_InternalEnergy (real e, real gamma)
 Pressure from internal energy: p = (gamma - 1) * e.
 
DNDS_DEVICE_CALLABLE real DNDS::IdealGas::InternalEnergy_From_Pressure (real p, real gamma)
 Internal energy from pressure: e = p / (gamma - 1)
 
DNDS_DEVICE_CALLABLE real DNDS::IdealGas::Enthalpy (real E, real rho, real p)
 Specific enthalpy from conservative state: H = (E + p) / rho.
 
DNDS_DEVICE_CALLABLE real DNDS::IdealGas::SpeedOfSoundSqr (real gamma, real p, real rho)
 Speed of sound squared: a^2 = gamma * p / rho.
 
template<PrimVariable prim>
DNDS_DEVICE_CALLABLE real DNDS::IdealGas::Cons2PrimEnergy (real E, real rho, real vSqr, real gamma)
 Convert conservative energy to primitive energy-index value.
 
template<PrimVariable prim>
DNDS_DEVICE_CALLABLE real DNDS::IdealGas::Prim2ConsEnergy (real primE, real rho, real vSqr, real gamma)
 Convert primitive energy-index value to conservative total energy.
 
template<PrimVariable prim>
DNDS_DEVICE_CALLABLE real DNDS::IdealGas::PrimE2Pressure (real primE, real gamma)
 Get pressure from the primitive energy-index value.
 
DNDS_DEVICE_CALLABLE real DNDS::IdealGas::RoeSpeedOfSoundSqr (real gamma, real HRoe, real vsqrRoe)
 Roe-averaged speed of sound squared: a^2 = (gamma-1)(H - 0.5*v^2).
 
DNDS_DEVICE_CALLABLE void DNDS::IdealGas::RoeAlphaDecomposition (real incU0, real incU123N, real incU4b, real veloRoeN, real HRoe, real asqrRoe, real aRoe, real gamma, real &alpha0, real &alpha1, real &alpha4)
 Roe alpha-decomposition coefficients for the 1D wave structure.
 
DNDS_DEVICE_CALLABLE void DNDS::IdealGas::EntropyFix_HCorrHY (real aL, real aR, real vnL, real vnR, real dLambda, real fixScale, real &lam0, real &lam123, real &lam4)
 H-correction + Harten-Yee entropy fix (scheme 8 in Euler module).
 

Detailed Description

Shared ideal-gas thermodynamics and Roe-flux primitives.

All functions are DNDS_DEVICE_CALLABLE (host + device) and operate on scalar arguments only, so they can be called from both the Eigen-based Euler module and the scalar-loop EulerP module.

Primitive variable convention is parameterized via PrimVariable:

  • Pressure: prim[I4] stores pressure p (used by Euler)
  • InternalEnergy: prim[I4] stores rho * e_internal (used by EulerP)

Definition in file IdealGasPhysics.hpp.