41 double *uL, *uR, cL, cR;
42 static double **fL, **fR;
43 static double *pR, *pL, *a2L, *a2R, *hL, *hR;
44 static double *cminL, *cmaxL;
45 static double *cminR, *cmaxR;
71 Flux (state->
uL, state->
vL, a2L, fL, pL, beg, end);
72 Flux (state->
uR, state->
vR, a2R, fR, pR, beg, end);
77 for (i = beg; i <= end; i++) {
78 cL =
MAX(fabs(cminL[i]), fabs(cmaxL[i]));
79 cR =
MAX(fabs(cminR[i]), fabs(cmaxR[i]));
80 cmax[
i] =
MAX(cL, cR);
84 for (nv =
NFLX; nv--; ) {
85 state->
flux[
i][nv] = 0.5*(fL[
i][nv] + fR[
i][nv] - cmax[
i]*(uR[nv] - uL[nv]));
87 state->
press[
i] = 0.5*(pL[
i] + pR[
i]);
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)
void LF_Solver(const State_1D *state, int beg, int end, double *cmax, Grid *grid)
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.
double ** vL
Primitive variables to the left of the interface, .
double * press
Upwind pressure term computed with the Riemann solver.
void MaxSignalSpeed(double **v, double *cs2, double *cmin, double *cmax, int beg, int end)
#define ARRAY_2D(nx, ny, type)
double ** uL
same as vL, in conservative vars