72 template <DeviceBackend B,
class TUL,
class TUR,
class TULPrim,
class TURPrim>
74 TULPrim &&ULPrim, TURPrim &&URPrim,
84 real sqrtRhoLm = std::sqrt(UL(0));
85 real sqrtRhoRm = std::sqrt(UR(0));
89 for (
int d = 0; d < 3; d++)
90 veloRoe(d) = (sqrtRhoLm * ULPrim(d + 1) + sqrtRhoRm * URPrim(d + 1)) / (sqrtRhoLm + sqrtRhoRm);
91 vsqrRoe = veloRoe.squaredNorm();
92 HRoe = (sqrtRhoLm * HLm + sqrtRhoRm * HRm) / (sqrtRhoLm + sqrtRhoRm);
95 rhoRoe = sqrtRhoLm * sqrtRhoRm;
130 template <DeviceBackend B>
146 real veloRoeN = veloRoe.dot(
n);
148 TVec alpha23V =
U123(incU) - incU(0) * veloRoe;
149 TVec alpha23VT = alpha23V -
n * alpha23V.dot(
n);
150 real incU4b = incU(I4) - alpha23VT.dot(veloRoe);
151 real alpha0, alpha1, alpha4;
153 veloRoeN, HRoe, asqrRoe, aRoe,
155 alpha0, alpha1, alpha4);
165 F(0) -= alpha0 + alpha1 + alpha4;
166 F(I4) -= (HRoe - veloRoeN * aRoe) * alpha0 + 0.5 * vsqrRoe * alpha1 +
167 (HRoe + veloRoeN * aRoe) * alpha4 + alpha23VT.dot(veloRoe);
168 for (
int d = 0; d < 3; d++)
170 (veloRoe(d) - aRoe *
n(d)) * alpha0 + (veloRoe(d) + aRoe *
n(d)) * alpha4 +
171 veloRoe(d) * alpha1 + alpha23VT(d);
173 for (
int i = 0; i < nVarsFlow; i++)
#define DNDS_DEVICE_CALLABLE
Physics model definitions for the EulerP module: gas properties, state conversions,...
Namespace for the EulerP alternative evaluator module with GPU support.
DNDS_DEVICE_CALLABLE void RoeAverageNS(TUL &&UL, TUR &&UR, TULPrim &&ULPrim, TURPrim &&URPrim, int nVars, real pL, real pR, PhysicsDeviceView< B > &phy, Geom::tPoint &veloRoe, real &vsqrRoe, real &HRoe, real &rhoRoe, real &aSqrRoe)
Computes Roe-averaged quantities from left and right states.
DNDS_DEVICE_CALLABLE void GasInviscidFlux_XY(TU &&U, int nVars, real vn, real vgn, TVecN &&n, real p, TF &F)
Computes the inviscid (Euler) flux projected onto a face normal direction.
DNDS_DEVICE_CALLABLE void RoeFluxFlow(const TU &UL, const TU &UR, real pL, real pR, const Geom::tPoint &veloRoe, real vsqrRoe, real vgn, const Geom::tPoint &n, real asqrRoe, real aRoe, real HRoe, PhysicsDeviceView< B > &phy, real lam0, real lam123, real lam4, TU &F)
Computes the complete Roe numerical flux for the 5-equation flow system.
DNDS_DEVICE_CALLABLE DNDS_FORCEINLINE auto U123(TU &&v)
Extracts the momentum components (indices 1,2,3) from a state vector as a 3x1 block.
Eigen::Vector< real, nVarsFlow > TU
Fixed-size 5-component conservative state vector (rho, rhoU, rhoV, rhoW, E).
DNDS_DEVICE_CALLABLE void RoeEigenValueFixer(real aL, real aR, real vnL, real vnR, real dLambda, real fixScale, real &lam0, real &lam123, real &lam4)
Applies entropy fix to Roe eigenvalues to prevent expansion shocks.
DNDS_DEVICE_CALLABLE real 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 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).
DNDS_DEVICE_CALLABLE void 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.
double real
Canonical floating-point scalar used throughout DNDSR (double precision).
Device-callable view of physics parameters providing thermodynamic operations.
DNDS_DEVICE_CALLABLE real Pressure2Enthalpy(tU &&U, int nVars, real p) const
Computes specific total enthalpy from conservative state and pressure.
PhysicsParams params
Gas physical parameters (copied to device).
real gamma
only simple data here allowed
Eigen::Vector3d n(1.0, 0.0, 0.0)