PLUTO
|
Set labels, indexes and prototypes for the RHD module. More...
Go to the source code of this file.
Classes | |
struct | MAP_PARAM |
Macros | |
#define | RHO 0 |
#define | MX1 1 |
#define | MX2 (COMPONENTS >= 2 ? 2: 255) |
#define | MX3 (COMPONENTS == 3 ? 3: 255) |
#define | VX1 MX1 |
#define | VX2 MX2 |
#define | VX3 MX3 |
#define | NFLX (2 + COMPONENTS) |
#define | iVR VX1 |
#define | iVZ VX2 |
#define | iVPHI VX3 |
#define | iMR MX1 |
#define | iMZ MX2 |
#define | iMPHI MX3 |
#define | iVR VX1 |
#define | iVPHI VX2 |
#define | iVZ VX3 |
#define | iMR MX1 |
#define | iMPHI MX2 |
#define | iMZ MX3 |
#define | iVR VX1 |
#define | iVTH VX2 |
#define | iVPHI VX3 |
#define | iMR MX1 |
#define | iMTH MX2 |
#define | iMPHI MX3 |
Typedefs | |
typedef struct MAP_PARAM | Map_param |
Functions | |
int | ConsToPrim (double **, double **, int, int, unsigned char *) |
void | PrimEigenvectors (double *, double, double, double *, double **, double **) |
int | EnergySolve (Map_param *) |
int | EntropySolve (Map_param *) |
int | PressureFix (Map_param *) |
void | Flux (double **, double **, double *, double **, double *, int, int) |
void | HLL_Speed (double **, double **, double *, double *, double *, double *, int, int) |
void | MaxSignalSpeed (double **, double *, double *, double *, int, int) |
void | PrimToCons (double **, double **, int, int) |
void | PrimRHS (double *, double *, double, double, double *) |
void | PrimSource (const State_1D *, int, int, double *, double *, double **, Grid *) |
void | VelocityLimiter (double *, double *, double *) |
void | ConvertTo4vel (double **, int, int) |
void | ConvertTo3vel (double **, int, int) |
Variables | |
Riemann_Solver | TwoShock_Solver |
Riemann_Solver | LF_Solver |
Riemann_Solver | HLL_Solver |
Riemann_Solver | HLLC_Solver |
Set labels, indexes and prototypes for the RHD module.
Contains variable names and prototypes for the RHD module
Definition in file mod_defs.h.
#define iMPHI MX3 |
Definition at line 71 of file mod_defs.h.
#define iMPHI MX2 |
Definition at line 71 of file mod_defs.h.
#define iMPHI MX3 |
Definition at line 71 of file mod_defs.h.
#define iMR MX1 |
Definition at line 69 of file mod_defs.h.
#define iMR MX1 |
Definition at line 69 of file mod_defs.h.
#define iMR MX1 |
Definition at line 69 of file mod_defs.h.
#define iMTH MX2 |
Definition at line 70 of file mod_defs.h.
#define iMZ MX2 |
Definition at line 59 of file mod_defs.h.
#define iMZ MX3 |
Definition at line 59 of file mod_defs.h.
#define iVPHI VX3 |
Definition at line 67 of file mod_defs.h.
#define iVPHI VX2 |
Definition at line 67 of file mod_defs.h.
#define iVPHI VX3 |
Definition at line 67 of file mod_defs.h.
#define iVR VX1 |
Definition at line 65 of file mod_defs.h.
#define iVR VX1 |
Definition at line 65 of file mod_defs.h.
#define iVR VX1 |
Definition at line 65 of file mod_defs.h.
#define iVTH VX2 |
Definition at line 66 of file mod_defs.h.
#define iVZ VX2 |
Definition at line 55 of file mod_defs.h.
#define iVZ VX3 |
Definition at line 55 of file mod_defs.h.
#define MX1 1 |
Definition at line 20 of file mod_defs.h.
#define MX2 (COMPONENTS >= 2 ? 2: 255) |
Definition at line 21 of file mod_defs.h.
#define MX3 (COMPONENTS == 3 ? 3: 255) |
Definition at line 22 of file mod_defs.h.
#define NFLX (2 + COMPONENTS) |
Definition at line 32 of file mod_defs.h.
#define RHO 0 |
Definition at line 19 of file mod_defs.h.
#define VX1 MX1 |
Definition at line 28 of file mod_defs.h.
#define VX2 MX2 |
Definition at line 29 of file mod_defs.h.
#define VX3 MX3 |
Definition at line 30 of file mod_defs.h.
The Map_param structure is used to pass input/output arguments during the conversion from conservative to primitive variables operated by the ConsToPrim() function. The output parameter, rho, W, lor and p, must be set at the end of every root-finder routine (EnergySolve(), EntropySolve() and PressureFix()). Additionally, some of the input parameters must be re-computed in EntropySolve() and PressureFix().
int ConsToPrim | ( | double ** | ucons, |
double ** | uprim, | ||
int | beg, | ||
int | end, | ||
unsigned char * | flag | ||
) |
Convert from conservative to primitive variables.
[in] | ucons | array of conservative variables |
[out] | uprim | array of primitive variables |
[in] | beg | starting index of computation |
[in] | end | final index of computation |
[in,out] | flag | array of flags tagging, in input, zones where entropy must be used to recover pressure and, on output, zones where conversion was not successful. |
Definition at line 89 of file mappers.c.
void ConvertTo3vel | ( | double ** | , |
int | , | ||
int | |||
) |
void ConvertTo4vel | ( | double ** | , |
int | , | ||
int | |||
) |
int EnergySolve | ( | Map_param * | par | ) |
Use Newton algorithm to recover pressure p0 from conservative quantities D, m and E
Solve f(W) = 0, where f(W) is Equation (A4) or (A6).
Definition at line 23 of file energy_solve.c.
int EntropySolve | ( | Map_param * | par | ) |
Convert the conservative variables {D, m, sigma_c} (where sigma_c = D*sigma is the conserved entropy) to primitive variable using a Newton-Raphson/Bisection scheme.
LAST MODIFIED
February 5th (2012) by C. Zanni & A. Mignone (zanni, @oat o.ina f.itmigno) ne@o ato.i naf. it
Definition at line 21 of file entropy_solve.c.
void Flux | ( | double ** | ucons, |
double ** | uprim, | ||
double * | h, | ||
double ** | fx, | ||
real * | pr, | ||
int | beg, | ||
int | end | ||
) |
[in] | u | 1D array of conserved quantities |
[in] | w | 1D array of primitive quantities |
[in] | a2 | 1D array of sound speeds |
[out] | fx | 1D array of fluxes (total pressure excluded) |
[out] | p | 1D array of pressure values |
[in] | beg | initial index of computation |
[in] | end | final index of computation |
Definition at line 23 of file fluxes.c.
void HLL_Speed | ( | double ** | vL, |
double ** | vR, | ||
double * | a2L, | ||
double * | a2R, | ||
double * | SL, | ||
double * | SR, | ||
int | beg, | ||
int | end | ||
) |
Compute leftmost (SL) and rightmost (SR) speed for the Riemann fan.
[in] | vL | left state for the Riemann solver |
[in] | vR | right state for the Riemann solver |
[in] | a2L | 1-D array containing the square of the sound speed for the left state |
[in] | a2R | 1-D array containing the square of the sound speed for the right state |
[out] | SL | the (estimated) leftmost speed of the Riemann fan |
[out] | SR | the (estimated) rightmost speed of the Riemann fan |
[in] | beg | starting index of computation |
[in] | end | final index of computation |
Switches:
ROE_ESTIMATE (YES/NO), DAVIS_ESTIMATE (YES/NO). TVD_ESTIMATE (YES/NO) JAN_HLL (YES/NO)
These switches set how the wave speed estimates are going to be computed. Only one can be set to 'YES', and the rest of them must be set to 'NO'
ROE_ESTIMATE: b_m = (0, (u_R - c_R, u_L - c_L, u_{roe} - c_{roe})) b_m = (0, (u_R + c_R, u_L + c_L, u_{roe} + c_{roe}))
where u_{roe} and c_{roe} are computed using Roe averages.
DAVIS_ESTIMATE: b_m = (0, (u_R - c_R, u_L - c_L)) b_m = (0, (u_R + c_R, u_L + c_L))
Compute leftmost (SL) and rightmost (SR) speed for the Riemann fan.
[in] | vL | left state for the Riemann solver |
[in] | vR | right state for the Riemann solver |
[in] | a2L | 1-D array containing the square of the sound speed for the left state |
[in] | a2R | 1-D array containing the square of the sound speed for the right state |
[out] | SL | the (estimated) leftmost speed of the Riemann fan |
[out] | SR | the (estimated) rightmost speed of the Riemann fan |
[in] | beg | starting index of computation |
[in] | end | final index of computation |
Definition at line 24 of file hll_speed.c.
void MaxSignalSpeed | ( | double ** | v, |
double * | cs2, | ||
double * | cmin, | ||
double * | cmax, | ||
int | beg, | ||
int | end | ||
) |
Compute the maximum and minimum characteristic velocities for the HD equation from the vector of primitive variables v.
[in] | v | 1-D array of primitive variables |
[in] | cs2 | 1-D array containing the square of the sound speed |
[out] | cmin | 1-D array containing the leftmost characteristic |
[out] | cmin | 1-D array containing the rightmost characteristic |
[in] | beg | starting index of computation |
[in] | end | final index of computation |
Definition at line 34 of file eigenv.c.
int PressureFix | ( | Map_param * | par | ) |
Fix p to a small value, solve for the square of velocity by using secant algorithm applied to Eq (9) of Mignone, Plewa & Bodo (2005). This step involved re-computing W at each step of the iteration. Once the root has been found, we recompute total energy E. Return 0 if succesful, 1 otherwise.
Definition at line 22 of file pressure_fix.c.
void PrimEigenvectors | ( | double * | q, |
double | a2, | ||
double | h, | ||
double * | lambda, | ||
double ** | LL, | ||
double ** | RR | ||
) |
Provide left and right eigenvectors and corresponding eigenvalues for the primitive form of the HD equations (adiabatic, pvte & isothermal cases).
[in] | q | vector of primitive variables |
[in] | cs2 | sound speed squared |
[in] | h | enthalpy |
[out] | lambda | eigenvalues |
[out] | LL | matrix containing left primitive eigenvectors (rows) |
[out] | RR | matrix containing right primitive eigenvectors (columns) |
Wave names and their order are defined as enumeration constants in mod_defs.h.
Advection modes associated with passive scalars are simple cases for which lambda = u (entropy mode) and l = r = (0, ... , 1, 0, ...). For this reason they are NOT defined here and must be treated seperately.
References:
Provide left and right eigenvectors and corresponding eigenvalues for the PRIMITIVE form of the MHD equations (adiabatic & isothermal cases).
[in] | q | vector of primitive variables |
[in] | a2 | sound speed squared |
[in] | h | enthalpy |
[out] | lambda | eigenvalues |
[out] | LL | left primitive eigenvectors |
[out] | RR | right primitive eigenvectors |
Wave names and their order are defined as enumeration constants in mod_defs.h. Notice that, the characteristic decomposition may differ depending on the way div.B is treated.
Advection modes associated with passive scalars are simple cases for which lambda = u (entropy mode) and l = r = (0, ... , 1, 0, ...). For this reason they are NOT defined here and must be treated seperately.
References:
The derivation of the isothermal eigenvectors follows the consideration given in roe.c
Definition at line 91 of file eigenv.c.
void PrimRHS | ( | double * | w, |
double * | dw, | ||
double | cs2, | ||
double | h, | ||
double * | Adw | ||
) |
Compute the matrix-vector multiplication where A is the matrix of the quasi-linear form of the HD equations.
[in] | w | vector of primitive variables; |
[in] | dw | limited (linear) slopes; |
[in] | cs2 | local sound speed; |
[in] | h | local enthalpy; |
[out] | Adw | matrix-vector product. |
Compute the matrix-vector multiplication where A is the matrix of the quasi-linear form of the MHD equations.
References
[in] | v | vector of primitive variables |
[in] | dv | limited (linear) slopes |
[in] | cs2 | local sound speed |
[in] | h | local enthalpy |
[out] | AdV | matrix-vector product |
Compute the matrix-vector multiplication where
A
is the matrix of the quasi-linear form of the RHD equations.
[in] | w | vector of primitive variables; |
[in] | dw | limited (linear) slopes; |
[in] | cs2 | local sound speed; |
[in] | h | local enthalpy; |
[out] | Adw | matrix-vector product. |
Definition at line 31 of file prim_eqn.c.
void PrimSource | ( | const State_1D * | state, |
int | beg, | ||
int | end, | ||
double * | a2, | ||
double * | h, | ||
double ** | src, | ||
Grid * | grid | ||
) |
Compute source terms of the HD equations in primitive variables.
The rationale for choosing during which sweep a particular source term has to be incorporated should match the same criterion used during the conservative update. For instance, in polar or cylindrical coordinates, curvilinear source terms are included during the radial sweep only.
[in] | state | pointer to a State_1D structure; |
[in] | beg | initial index of computation; |
[in] | end | final index of computation; |
[in] | a2 | array of sound speed; |
[in] | h | array of enthalpies (not needed in MHD); |
[out] | src | array of source terms; |
[in] | grid | pointer to a Grid structure. |
Compute source terms of the MHD equations in primitive variables. These include:
The rationale for choosing during which sweep a particular source term has to be incorporated should match the same criterion used during the conservative update. For instance, in polar or cylindrical coordinates, curvilinear source terms are included during the radial sweep only.
[in] | state | pointer to a State_1D structure |
[in] | beg | initial index of computation |
[in] | end | final index of computation |
[in] | a2 | array of sound speed |
[in] | h | array of enthalpies (not needed in MHD) |
[out] | src | array of source terms |
[in] | grid | pointer to a Grid structure |
where
Compute source terms of the RHD equations in primitive variables.
The rationale for choosing during which sweep a particular source term has to be incorporated should match the same criterion used during the conservative update. For instance, in polar or cylindrical coordinates, curvilinear source terms are included during the radial sweep only.
[in] | state | pointer to a State_1D structure; |
[in] | beg | initial index of computation; |
[in] | end | final index of computation; |
[in] | a2 | array of sound speed; |
[in] | h | array of enthalpies (not needed in MHD); |
[out] | src | array of source terms; |
[in] | grid | pointer to a Grid structure. |
Definition at line 71 of file prim_eqn.c.
void PrimToCons | ( | double ** | uprim, |
double ** | ucons, | ||
int | beg, | ||
int | end | ||
) |
Convert primitive variables to conservative variables.
[in] | uprim | array of primitive variables |
[out] | ucons | array of conservative variables |
[in] | beg | starting index of computation |
[in] | end | final index of computation |
Convert primitive variables in conservative variables.
[in] | uprim | array of primitive variables |
[out] | ucons | array of conservative variables |
[in] | beg | starting index of computation |
[in] | end | final index of computation |
Definition at line 26 of file mappers.c.
void VelocityLimiter | ( | double * | v, |
double * | vp, | ||
double * | vm | ||
) |
Check whether the total reconstructed velocity is > 1 If a superluminal value occurs, flatten distribution.
Definition at line 16 of file vel_limiter.c.
Riemann_Solver HLL_Solver |
Definition at line 119 of file mod_defs.h.
Riemann_Solver HLLC_Solver |
Definition at line 119 of file mod_defs.h.
Riemann_Solver LF_Solver |
Definition at line 119 of file mod_defs.h.
Riemann_Solver TwoShock_Solver |
Definition at line 119 of file mod_defs.h.