39 double *cmax,
Grid *grid)
55 static double **fL, **fR, **vRL;
56 static double *pR, *pL, *cmin_RL, *cmax_RL, *a2L, *a2R;
57 static double **VL, **VR, **UL, **UR;
79 #if BACKGROUND_FIELD == YES
84 GLM_Solve (state, VL, VR, beg, end, grid);
88 VL = state->
vL; UL = state->
uL;
89 VR = state->
vR; UR = state->
uR;
99 Flux (UL, VL, a2L, bgf, fL, pL, beg, end);
100 Flux (UR, VR, a2R, bgf, fR, pR, beg, end);
106 for (i = beg; i <= end; i++) {
107 VAR_LOOP(nv) vRL[
i][nv] = 0.5*(VL[
i][nv] + VR[
i][nv]);
111 #elif EOS == BAROTROPIC
112 cRL = sqrt(
g_gamma*BAROTROPIC_PR(vRL[i][RHO])/vRL[i][RHO]);
114 #elif EOS == ISOTHERMAL
122 for (i = beg; i <= end; i++) {
123 cRL =
MAX(fabs(cmin_RL[i]), fabs(cmax_RL[i]));
129 for (nv =
NFLX; nv--; ) {
130 state->
flux[
i][nv] = 0.5*(fL[
i][nv] + fR[
i][nv] - cRL*(uR[nv] - uL[nv]));
132 state->
press[
i] = 0.5*(pL[
i] + pR[
i]);
139 #if DIVB_CONTROL == EIGHT_WAVES
void GLM_Solve(const State_1D *state, double **VL, double **VR, int beg, int end, Grid *grid)
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 * SR
Rightmost velocity in the Riemann fan at i+1/2.
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, .
double ** GetBackgroundField(int beg, int end, int where, Grid *grid)
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 * SL
Leftmost velocity in the Riemann fan at i+1/2.
void Roe_DivBSource(const State_1D *state, int is, int ie, 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 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.
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