Solve Riemann problem for the adiabatic/isothermal MHD equations using the HLL Riemann solver.
46 double *uL, *uR, *SL, *SR;
47 static double **fL, **fR;
48 static double *pL, *pR, *a2L, *a2R, *hL, *hR;
50 static double **VL, **VR, **UL, **UR;
77 GLM_Solve (state, VL, VR, beg, end, grid);
81 VL = state->
vL; UL = state->
uL;
82 VR = state->
vR; UR = state->
uR;
92 Flux (UL, VL, hL, fL, pL, beg, end);
93 Flux (UR, VR, hR, fR, pR, beg, end);
99 SL = state->
SL; SR = state->
SR;
100 HLL_Speed (VL, VR, a2L, a2R, hL, hR, SL, SR, beg, end);
102 for (i = beg; i <= end; i++) {
104 scrh =
MAX(fabs(SL[i]), fabs(SR[i]));
107 uL = UL[
i]; uR = UR[
i];
111 bmin =
MIN(0.0, SL[i]);
112 bmax =
MAX(0.0, SR[i]);
113 scrh = 1.0/(bmax - bmin);
114 for (nv =
NFLX; nv--; ){
115 state->
flux[
i][nv] = bmin*bmax*(uR[nv] - uL[nv])
116 + bmax*fL[i][nv] - bmin*fR[i][nv];
119 state->
press[
i] = (bmax*pL[
i] - bmin*pR[
i])*scrh;
126 #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.
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)
void HLL_DIVB_SOURCE(const State_1D *, double **, int, int, 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