46 "Exact Riemann solver");
78 cup = 0.25*(rhoL + rhoR)*(cL + cR);
79 ppv = 0.5 *(pL + pR) + 0.5*(uL - uR)*cup;
80 ppv = std::max(0.0, ppv);
81 pmin = std::min(pL, pR);
82 pmax = std::max(pL, pR);
85 if (qmax <= quser && pmin <= ppv && ppv <= pmax)
94 NekDouble um = (pq*uL/cL + uR/cR + g[4]*(pq - 1.0))/(pq/cL + 1.0/cR);
97 return 0.5*(pL*pow(ptL, g[3]) + pR*pow(ptR, g[3]));
102 NekDouble geL = sqrt((g[5]/rhoL)/(g[6]*pL + ppv));
103 NekDouble geR = sqrt((g[5]/rhoR)/(g[6]*pR + ppv));
104 return (geL*pL + geR*pR - (uR - uL))/(geL + geR);
127 f = g[4]*ck*(pow(prat, g[1])-1.0);
128 fd = pow(prat, -g[2])/(dk*ck);
137 fd = (1.0-0.5*(p-pk)/(bk+p))*qrt;
188 (EL - 0.5 * (rhouL*uL + rhovL*vL + rhowL*wL));
190 (ER - 0.5 * (rhouR*uR + rhovR*vR + rhowR*wR));
194 (gamma-1.0)/(2.0*gamma),
195 (gamma+1.0)/(2.0*gamma),
196 2.0*gamma/(gamma-1.0),
199 (gamma-1.0)/(gamma+1.0),
207 ASSERTL0(g[4]*(cL+cR) > (uR-uL),
"Vacuum is generated by given data.");
216 for (k = 0; k <
NRITER; ++k)
218 prefun(g, pOld, rhoL, pL, cL, fL, fLd);
219 prefun(g, pOld, rhoR, pR, cR, fR, fRd);
220 p = pOld - (fL+fR+uDiff) / (fLd+fRd);
221 change = 2 * fabs((p-pOld)/(p+pOld));
236 ASSERTL0(k < NRITER,
"Divergence in Newton-Raphson scheme");
249 NekDouble outRho, outU, outV, outW, outP;
274 outRho = rhoL*pow(p/pL, 1.0/gamma);
284 outRho = rhoL*pow(c/cL, g[4]);
285 outU = g[5]*(cL + g[7]*uL + S);
288 outP = pL*pow(c/cL, g[3]);
296 NekDouble SL = uL - cL*sqrt(g[2]*pmL + g[1]);
309 outRho = rhoL*(pmL + g[6])/(pmL*g[6] + 1.0);
323 NekDouble SR = uR + cR*sqrt(g[2]*pmR + g[1]);
336 outRho = rhoR*(pmR + g[6])/(pmR*g[6] + 1.0);
365 outRho = rhoR*pow(p/pR, 1.0/gamma);
375 outRho = rhoR*pow(c/cR, g[4]);
376 outU = g[5]*(-cR + g[7]*uR + S);
379 outP = pR*pow(c/cR, g[3]);
386 rhof = outRho * outU;
387 rhouf = outP + outRho*outU*outU;
388 rhovf = outRho * outU * outV;
389 rhowf = outRho * outU * outW;
390 Ef = outU*(outP/(gamma-1.0) + 0.5*outRho*
391 (outU*outU + outV*outV + outW*outW) + outP);
#define ASSERTL0(condition, msg)
virtual void v_PointSolve(NekDouble rhoL, NekDouble rhouL, NekDouble rhovL, NekDouble rhowL, NekDouble EL, NekDouble rhoR, NekDouble rhouR, NekDouble rhovR, NekDouble rhowR, NekDouble ER, NekDouble &rhof, NekDouble &rhouf, NekDouble &rhovf, NekDouble &rhowf, NekDouble &Ef)
Exact Riemann solver for the Euler equations.
RiemannSolverFactory & GetRiemannSolverFactory()
NekDouble guessp(NekDouble g[], NekDouble rhoL, NekDouble uL, NekDouble pL, NekDouble cL, NekDouble rhoR, NekDouble uR, NekDouble pR, NekDouble cR)
Use either PVRS, two-rarefaction or two-shock Riemann solvers to calculate an initial pressure for th...
ExactSolverToro(const LibUtilities::SessionReaderSharedPtr &pSession)
static RiemannSolverSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession)
std::map< std::string, RSParamFuncType > m_params
Map of parameter function types.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
void prefun(NekDouble *g, NekDouble p, NekDouble dk, NekDouble pk, NekDouble ck, NekDouble &f, NekDouble &fd)
Evaluate pressure functions fL and fR in Newton iteration of Riemann solver (see equation 4...
static std::string solverName