35#ifndef NEKTAR_SOLVERS_COMPRESSIBLEFLOWSOLVER_RIEMANNSOLVER_ROESOLVER
36#define NEKTAR_SOLVERS_COMPRESSIBLEFLOWSOLVER_RIEMANNSOLVER_ROESOLVER
62 ND rhouR,
ND rhovR,
ND rhowR,
ND ER,
ND &rhof,
ND &rhouf,
63 ND &rhovf,
ND &rhowf,
ND &Ef)
final;
70template <
class T,
typename =
typename std::enable_if<
71 std::is_floating_point<T>::value ||
73inline void RoeKernel(T &rhoL, T &rhouL, T &rhovL, T &rhowL, T &EL, T &rhoR,
74 T &rhouR, T &rhovR, T &rhowR, T &ER, T &rhof, T &rhouf,
75 T &rhovf, T &rhowf, T &Ef,
NekDouble gamma)
86 T pL = (gamma - 1.0) * (EL - 0.5 * (rhouL * uL + rhovL * vL + rhowL * wL));
87 T pR = (gamma - 1.0) * (ER - 0.5 * (rhouR * uR + rhovR * vR + rhowR * wR));
90 T hL = (EL + pL) / rhoL;
91 T hR = (ER + pR) / rhoR;
99 T uRoe = (srL * uL + srR * uR) / srLR;
100 T vRoe = (srL * vL + srR * vR) / srLR;
101 T wRoe = (srL * wL + srR * wR) / srLR;
102 T hRoe = (srL * hL + srR * hR) / srLR;
103 T URoe = (uRoe * uRoe + vRoe * vRoe + wRoe * wRoe);
104 T cRoe =
sqrt((gamma - 1.0) * (hRoe - 0.5 * URoe));
107 T k[5][5] = {{1., uRoe - cRoe, vRoe, wRoe, hRoe - uRoe * cRoe},
108 {1., uRoe, vRoe, wRoe, 0.5 * URoe},
109 {0., 0., 1., 0., vRoe},
110 {0., 0., 0., 1., wRoe},
111 {1., uRoe + cRoe, vRoe, wRoe, hRoe + uRoe * cRoe}};
114 T jump[5] = {rhoR - rhoL, rhouR - rhouL, rhovR - rhovL, rhowR - rhowL,
118 T jumpbar = jump[4] - (jump[2] - vRoe * jump[0]) * vRoe -
119 (jump[3] - wRoe * jump[0]) * wRoe;
123 alpha[1] = (gamma - 1.0) *
124 (jump[0] * (hRoe - uRoe * uRoe) + uRoe * jump[1] - jumpbar) /
127 (jump[0] * (uRoe + cRoe) - jump[1] - cRoe * alpha[1]) / (2.0 * cRoe);
128 alpha[4] = jump[0] - (alpha[0] + alpha[1]);
129 alpha[2] = jump[2] - vRoe * jump[0];
130 alpha[3] = jump[3] - wRoe * jump[0];
133 rhof = 0.5 * (rhoL * uL + rhoR * uR);
134 rhouf = 0.5 * (pL + rhoL * uL * uL + pR + rhoR * uR * uR);
135 rhovf = 0.5 * (rhoL * uL * vL + rhoR * uR * vR);
136 rhowf = 0.5 * (rhoL * uL * wL + rhoR * uR * wR);
137 Ef = 0.5 * (uL * (EL + pL) + uR * (ER + pR));
143 T uRoeAbs =
abs(uRoe);
144 T lambda[5] = {
abs(uRoe - cRoe), uRoeAbs, uRoeAbs, uRoeAbs,
148 for (
size_t i = 0; i < 5; ++i)
150 uRoeAbs = 0.5 * alpha[i] * lambda[i];
152 rhof -= uRoeAbs * k[i][0];
153 rhouf -= uRoeAbs * k[i][1];
154 rhovf -= uRoeAbs * k[i][2];
155 rhowf -= uRoeAbs * k[i][3];
156 Ef -= uRoeAbs * k[i][4];
void v_PointSolve(ND rhoL, ND rhouL, ND rhovL, ND rhowL, ND EL, ND rhoR, ND rhouR, ND rhovR, ND rhowR, ND ER, ND &rhof, ND &rhouf, ND &rhovf, ND &rhowf, ND &Ef) final
Roe Riemann solver.
void v_ArraySolve(const Array< OneD, const Array< OneD, ND > > &Fwd, const Array< OneD, const Array< OneD, ND > > &Bwd, Array< OneD, Array< OneD, ND > > &flux) final
RoeSolver()
programmatic ctor
static RiemannSolverSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession)
static std::string solverName
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< RiemannSolver > RiemannSolverSharedPtr
A shared pointer to an EquationSystem object.
void RoeKernel(T &rhoL, T &rhouL, T &rhovL, T &rhowL, T &EL, T &rhoR, T &rhouR, T &rhovR, T &rhowR, T &ER, T &rhof, T &rhouf, T &rhovf, T &rhowf, T &Ef, NekDouble gamma)
scalarT< T > abs(scalarT< T > in)
scalarT< T > sqrt(scalarT< T > in)