29 int nv,
k,
i, beg, end;
30 real pstar, ustar, dp,
fp, dfp;
33 real fL, dfL, SL, STL, csL;
34 real fR, dfR, SR, STR, csR;
35 static real *
s, **vs, **us, *cmax_loc;
53 for (i = beg; i <= end; i++){
61 pstar = 0.5*(vL[PRS] + vR[PRS]);
65 PFUN (pstar, vL, vR, &fp, &dfp);
69 if (fabs(dp) < 1.e-7*pstar)
break;
70 if (k == (MAX_ITER-5)){
71 print (
"! Too many iterations in Rieman\n");
79 FUN_LR (pstar, vL, &fL, &dfL);
80 FUN_LR (pstar, vR, &fR, &dfR);
82 ustar = 0.5*(vL[
VXn] + vR[
VXn] + fR - fL);
95 for (nv =
NVAR; nv--; ) vs[i][nv] = vL[nv];
97 vs[
i][
RHO] = vL[
RHO]*(q + gmmp)/(gmmp*q + 1.0);
107 for (nv =
NVAR; nv--; ) vs[i][nv] = vL[nv];
114 scrh = 2.0 + gm1/csL*(vL[
VXn] - s[
i]);
115 vs[
i][
RHO] = vL[
RHO]*pow(scrh/gp1, 2.0/gm1);
116 vs[
i][PRS] = vL[PRS]*pow(scrh/gp1, 2.0*
g_gamma/gm1);
117 vs[
i][
VXn] = 2.0/gp1*(csL + 0.5*gm1*vL[
VXn] + s[
i]);
132 for (nv =
NVAR; nv--; ) vs[i][nv] = vR[nv];
134 vs[
i][
RHO] = vR[
RHO]*(q + gmmp)/(gmmp*q + 1.0);
144 for (nv =
NVAR; nv--; ) vs[i][nv] = vR[nv];
151 scrh = 2.0 - gm1/csR*(vR[
VXn] - s[
i]);
152 vs[
i][
RHO] = vR[
RHO]*pow(scrh/gp1, 2.0/gm1);
153 vs[
i][PRS] = vR[PRS]*pow(scrh/gp1, 2.0*
g_gamma/gm1);
154 vs[
i][
VXn] = 2.0/gp1*(-csR + 0.5*gm1*vR[
VXn] + s[
i]);
174 MAX_CH_SPEED (vs, cmax_loc, grid, beg, end);
175 for (i = beg; i <= end; i++) {
176 *cmax =
MAX(cmax_loc[i], *cmax);
178 FLUX(us, vs, state->
flux, state->
press, beg, end);
double ** flux
upwind flux computed with the Riemann solver
int lend
Local end index for the local array.
int lbeg
Local start index for the local array.
static void FUN_LR(real p, real *v, real *fLR, real *dfLR)
double ** vR
Primitive variables to the right of the interface, .
int g_dir
Specifies the current sweep or direction of integration.
void print(const char *fmt,...)
double ** array_2D(int nx, int ny)
void Show(double **, int)
long int NMAX_POINT
Maximum number of points among the three directions, boundaries excluded.
double ** vL
Primitive variables to the left of the interface, .
double * press
Upwind pressure term computed with the Riemann solver.
#define QUIT_PLUTO(e_code)
static void PFUN(real p, real *vL, real *vR, real *f, real *df)