Solve Riemann problem for the adiabatic/isothermal MHD equations using the HLL Riemann solver.
46 double *vL, *vR, *uL, *uR, *SR, *SL;
47 static double **fL, **fR, **Uhll;
48 static double **VL, **VR, **UL, **UR;
49 static double *pL, *pR, *a2L, *a2R;
70 #if BACKGROUND_FIELD == YES
79 GLM_Solve (state, VL, VR, beg, end, grid);
83 VL = state->
vL; UL = state->
uL;
84 VR = state->
vR; UR = state->
uR;
94 Flux (UL, VL, a2L, bgf, fL, pL, beg, end);
95 Flux (UR, VR, a2R, bgf, fR, pR, beg, end);
101 SL = state->
SL; SR = state->
SR;
102 HLL_Speed (VL, VR, a2L, a2R, bgf, SL, SR, beg, end);
108 for (i = beg; i <= end; i++) {
110 scrh =
MAX(fabs(SL[i]), fabs(SR[i]));
115 for (nv = 0; nv <
NFLX; nv++) {
116 state->
flux[
i][nv] = fL[
i][nv];
120 }
else if (SR[i] < 0.0){
122 for (nv = 0; nv <
NFLX; nv++) {
123 state->
flux[
i][nv] = fR[
i][nv];
129 uL = UL[
i]; uR = UR[
i];
131 scrh = 1.0 / (SR[
i] - SL[
i]);
133 for (nv = 0; nv <
NFLX; nv++) {
134 state->
flux[
i][nv] = SL[
i]*SR[
i]*(uR[nv] - uL[nv]) +
135 SR[i]*fL[i][nv] - SL[i]*fR[i][nv];
138 state->
press[
i] = (SR[
i]*pL[
i] - SL[
i]*pR[
i])*scrh;
148 #if DIVB_CONTROL == EIGHT_WAVES
void GLM_Solve(const State_1D *state, double **VL, double **VR, int beg, int end, Grid *grid)
void HLL_DivBSource(const State_1D *state, double **Uhll, 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.
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 * SL
Leftmost velocity in the Riemann fan at i+1/2.
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)
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