20 static double **fL, **fR, **vRL;
21 static double *cRL_min, *cRL_max, *pL, *pR, *a2L, *a2R;
22 double *uR, *uL, *flux;
24 double num, den, lambda, dU, dF, vn;
45 Flux (state->
uL, state->
vL, a2L, fL, pL, beg, end);
46 Flux (state->
uR, state->
vR, a2R, fR, pR, beg, end);
56 for (i = beg; i <= end; i++) {
57 for (nv =
NFLX; nv--; ) {
58 vRL[
i][nv] = 0.5*(state->
vL[
i][nv] + state->
vR[
i][nv]);
60 vRL[
i][
VXn] = 0.5*(fabs(state->
vL[i][
VXn]) + fabs(state->
vR[i][
VXn]));
70 for (i = beg; i <= end; i++) {
73 flux = state->
flux[
i];
77 cmax[
i] =
MAX(fabs(cRL_max[i]), fabs(cRL_min[i]));
82 for (nv = 0; nv <
NFLX; nv++) {
84 dF = fR[
i][nv] - fL[
i][nv] + (nv ==
MXn ? (pR[
i] - pL[
i]):0.0);
89 lambda = fabs(num)/(fabs(den) + 1.e-12);
91 if (lambda > cmax[i]) lambda = cmax[
i];
93 vn = 0.5*( fabs(state->
vR[i][VXn]) + fabs(state->
vL[i][VXn]) );
94 vn =
MAX( fabs(state->
vR[i][VXn]), fabs(state->
vL[i][VXn]) );
95 if (lambda < vn) lambda = vn;
102 for (nv =
NFLX; nv--; ) {
103 flux[nv] = 0.5*(fL[
i][nv] + fR[
i][nv] - lambda*(uR[nv] - uL[nv]));
105 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)
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 g_maxMach
The maximum Mach number computed during integration.
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