25 real ML, Mp1L, Mp2L, Mm2L, Mp4L, Pp5L;
26 real MR, Mm1R, Mp2R, Mm2R, Mm4R, Pm5R;
28 real Ku, Kp, sigma, fa, Mm2, Mo2, Mo, M,
scrh;
29 real *vL, *vR, *uL, *uR;
31 static real **fl, **fr, **ul, **ur;
47 Ku = 0.75; Kp = 0.25; sigma = 1.0;
49 for (i = beg; i <= end; i++) {
58 EXPAND(phiL[
MX1] = vL[
VX1]; ,
61 phiL[ENG] = (uL[ENG] - vL[PRS])/vL[
RHO];
64 EXPAND(phiR[
MX1] = vR[
VX1]; ,
67 phiR[ENG] = (uR[ENG] - vR[PRS])/vR[
RHO];
74 asL2 = aL*aL/(
g_gamma - 1.0) + 0.5*asL2;
78 asR2 = aR*aR/(
g_gamma - 1.0) + 0.5*asR2;
84 atL = asL2/
MAX(asL, fabs(vL[
VXn]));
85 atR = asR2/
MAX(asR, fabs(vR[
VXn]));
103 alpha = 3.0/16.0*(-4.0 + 5.0*fa*fa);
114 Mp1L = 0.5*(ML + fabs(ML));
115 Mm1R = 0.5*(MR - fabs(MR));
117 Mp2L = 0.25*(ML + 1.0)*(ML + 1.0);
118 Mm2L = - 0.25*(ML - 1.0)*(ML - 1.0);
120 Mp2R = 0.25*(MR + 1.0)*(MR + 1.0);
121 Mm2R = - 0.25*(MR - 1.0)*(MR - 1.0);
123 if (fabs(ML) >= 1.0){
127 Mp4L = Mp2L*(1.0 - 16.0*beta*Mm2L);
128 Pp5L = Mp2L*((2.0 - ML) - 16.0*alpha*ML*Mm2L);
131 if (fabs(MR) >= 1.0){
135 Mm4R = Mm2R*(1.0 + 16.0*beta*Mp2R);
136 Pm5R = Mm2R*(( - 2.0 - MR) + 16.0*alpha*MR*Mp2R);
139 scrh =
MAX(1.0 - sigma*Mm2, 0.0);
141 M = Mp4L + Mm4R - Kp/fa*scrh*(vR[PRS] - vL[PRS])/(vL[
RHO] + vR[
RHO])/a/a*2.0;
144 m *= M > 0.0 ? vL[
RHO]: vR[
RHO];
150 state->
press[
i] = Pp5L*vL[PRS] + Pm5R*vR[PRS];
154 for (nv =
NFLX; nv--; ) state->
flux[i][nv] = m*phiL[nv];
156 for (nv =
NFLX; nv--; ) state->
flux[i][nv] = m*phiR[nv];
161 *cmax =
MAX(*cmax, fabs(vL[
VXn]) + aL);
162 *cmax =
MAX(*cmax, fabs(vR[
VXn]) + aR);
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.
double ** vR
Primitive variables to the right of the interface, .
double g_maxMach
The maximum Mach number computed during integration.
int g_dir
Specifies the current sweep or direction of integration.
double ** array_2D(int nx, int ny)
long int NMAX_POINT
Maximum number of points among the three directions, boundaries excluded.
void PrimToCons(double **uprim, double **ucons, int ibeg, int iend)
double ** vL
Primitive variables to the left of the interface, .
double * press
Upwind pressure term computed with the Riemann solver.