47 "Exact Riemann solver");
77 cup = 0.25*(rhoL + rhoR)*(cL + cR);
78 ppv = 0.5 *(pL + pR) + 0.5*(uL - uR)*cup;
79 ppv = std::max(0.0, ppv);
80 pmin = std::min(pL, pR);
81 pmax = std::max(pL, pR);
84 if (qmax <= quser && pmin <= ppv && ppv <= pmax)
93 NekDouble um = (pq*uL/cL + uR/cR + g[4]*(pq - 1.0))/(pq/cL + 1.0/cR);
96 return 0.5*(pL*pow(ptL, g[3]) + pR*pow(ptR, g[3]));
101 NekDouble geL = sqrt((g[5]/rhoL)/(g[6]*pL + ppv));
102 NekDouble geR = sqrt((g[5]/rhoR)/(g[6]*pR + ppv));
103 return (geL*pL + geR*pR - (uR - uL))/(geL + geR);
126 f = g[4]*ck*(pow(prat, g[1])-1.0);
127 fd = pow(prat, -g[2])/(dk*ck);
136 fd = (1.0-0.5*(p-pk)/(bk+p))*qrt;
187 (EL - 0.5 * (rhouL*uL + rhovL*vL + rhowL*wL));
189 (ER - 0.5 * (rhouR*uR + rhovR*vR + rhowR*wR));
193 (gamma-1.0)/(2.0*gamma),
194 (gamma+1.0)/(2.0*gamma),
195 2.0*gamma/(gamma-1.0),
198 (gamma-1.0)/(gamma+1.0),
206 ASSERTL0(g[4]*(cL+cR) > (uR-uL),
"Vacuum is generated by given data.");
215 for (k = 0; k <
NRITER; ++k)
217 prefun(g, pOld, rhoL, pL, cL, fL, fLd);
218 prefun(g, pOld, rhoR, pR, cR, fR, fRd);
219 p = pOld - (fL+fR+uDiff) / (fLd+fRd);
220 change = 2 * fabs((p-pOld)/(p+pOld));
235 ASSERTL0(k < NRITER,
"Divergence in Newton-Raphson scheme");
248 NekDouble outRho, outU, outV, outW, outP;
273 outRho = rhoL*pow(p/pL, 1.0/gamma);
283 outRho = rhoL*pow(c/cL, g[4]);
284 outU = g[5]*(cL + g[7]*uL + S);
287 outP = pL*pow(c/cL, g[3]);
295 NekDouble SL = uL - cL*sqrt(g[2]*pmL + g[1]);
308 outRho = rhoL*(pmL + g[6])/(pmL*g[6] + 1.0);
322 NekDouble SR = uR + cR*sqrt(g[2]*pmR + g[1]);
335 outRho = rhoR*(pmR + g[6])/(pmR*g[6] + 1.0);
364 outRho = rhoR*pow(p/pR, 1.0/gamma);
374 outRho = rhoR*pow(c/cR, g[4]);
375 outU = g[5]*(-cR + g[7]*uR + S);
378 outP = pR*pow(c/cR, g[3]);
385 rhof = outRho * outU;
386 rhouf = outP + outRho*outU*outU;
387 rhovf = outRho * outU * outV;
388 rhowf = outRho * outU * outW;
389 Ef = outU*(outP/(gamma-1.0) + 0.5*outRho*
390 (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...
static RiemannSolverSharedPtr create()
std::map< std::string, RSParamFuncType > m_params
Map of parameter function types.
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
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.