31 static real **fL, **fR;
32 static real *SL, *SR, *pL, *pR;
33 static double *a2L, *a2R, *hL, *hR;
57 Flux (state->
uL, state->
vL, a2L, fL, pL, beg, end);
58 Flux (state->
uR, state->
vR, a2R, fR, pR, beg, end);
62 for (i = beg; i <= end; i++) {
64 scrh =
MAX(fabs(SL[i]), fabs(SR[i]));
73 for (nv =
NFLX; nv--; ) state->
flux[i][nv] = fL[i][nv];
74 state->
press[i] = pL[i];
76 }
else if (SR[i] <= 0.0){
78 for (nv =
NFLX; nv--; ) state->
flux[i][nv] = fR[i][nv];
79 state->
press[i] = pR[i];
86 scrh = 1.0/(SR[
i] - SL[
i]);
87 for (nv =
NFLX; nv--; ){
88 state->
flux[
i][nv] = SL[
i]*SR[
i]*(uR[nv] - uL[nv])
89 + SR[i]*fL[i][nv] - SL[i]*fR[i][nv];
92 state->
press[
i] = (SR[
i]*pL[
i] - SL[
i]*pR[
i])*scrh;
double ** flux
upwind flux computed with the Riemann solver
void Flux(double **u, double **w, double *a2, double **fx, double *p, int beg, int end)
double ** vR
Primitive variables to the right of the interface, .
void SoundSpeed2(double **v, double *cs2, double *h, int beg, int end, int pos, Grid *grid)
double ** uR
same as vR, in conservative vars
#define ARRAY_1D(nx, type)
long int NMAX_POINT
Maximum number of points among the three directions, boundaries excluded.
void HLL_Speed(double **vL, double **vR, double *a2L, double *a2R, double *SL, double *SR, int beg, int end)
double ** vL
Primitive variables to the left of the interface, .
double * press
Upwind pressure term computed with the Riemann solver.
#define ARRAY_2D(nx, ny, type)
double ** uL
same as vL, in conservative vars