PLUTO
4.4-patch2
|
Set labels, indexes and prototypes for the HD module. More...
Go to the source code of this file.
Functions | |
int | ConsToPrim (double **, double **, int, int, uint16_t *) |
void | Eigenvalues (double **, double *, double **, int, int) |
void | PrimEigenvectors (const State *, int, int) |
void | ConsEigenvectors (double *, double *, double, double **, double **, double *) |
void | Flux (const State *, int, int) |
void | HLL_Speed (const State *, const State *, double *, double *, int, int) |
void | MaxSignalSpeed (const State *, double *, double *, int, int) |
void | PrimToCons (double **, double **, int, int) |
void | PrimRHS (double *, double *, double, double, double *) |
void | PrimSource (const State *, double **, int, int, Grid *) |
Contains variable names and prototypes for the HD module
void ConsEigenvectors | ( | double * | u, |
double * | v, | ||
double | a2, | ||
double ** | Lc, | ||
double ** | Rc, | ||
double * | lambda | ||
) |
Provide conservative eigenvectors for HD equations.
[in] | u | array of conservative variables |
[in] | v | array of primitive variables |
[in] | a2 | square of sound speed |
[out] | LL | left conservative eigenvectors |
[out] | RR | right conservative eigenvectors |
[out] | lambda | eigenvalues |
References:
Provide conservative eigenvectors for MHD equations.
[in] | u | array of conservative variables |
[in] | v | array of primitive variables |
[in] | a2 | square of sound speed |
[out] | Lc | left conservative eigenvectors |
[out] | Rc | right conservative eigenvectors |
[out] | lambda | eigenvalues |
Reference
With the following corrections:
The components (By, Bz) of L_{1,7} page 571 should be +{rho}a instead of -. Also, since Bx is not considered as a parameter, one must also add a component in the fast and slow waves. This can be seen by forming the conservative eigenvectors from the primitive ones, see the paper from Powell, Roe Linde.
The Lc_{1,3,5,7}[Bx] components, according to Serna 09 are -(1-g_gamma)*a_{f,s}*Bx and not (1-g_gamma)*a_{f,s}*Bx. Both are orthonormal though. She is WRONG! -Petros-
int ConsToPrim | ( | double ** | ucons, |
double ** | uprim, | ||
int | beg, | ||
int | end, | ||
uint16_t * | 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. |
void Eigenvalues | ( | double ** | v, |
double * | cs2, | ||
double ** | lambda, | ||
int | beg, | ||
int | end | ||
) |
Compute eigenvalues for the HD equations
[in] | v | 1-D array of primitive variables |
[out] | csound2 | 1-D array containing the square of sound speed |
[out] | lambda | 1-D array [i][nv] containing the eigenvalues |
[in] | beg | starting index of computation |
[in] | end | final index of computation |
Compute eigenvalues for the MHD equations
[in] | v | 1-D array of primitive variables |
[out] | csound2 | 1-D array containing the square of sound speed |
[out] | lambda | 1-D array [i][nv] containing the eigenvalues |
[in] | beg | starting index of computation |
[in] | end | final index of computation |
Provide eigenvalues for the MHD equations
void Flux | ( | const State * | state, |
int | beg, | ||
int | end | ||
) |
[in,out] | state | Pointer to a state structure |
[in] | beg | initial index of computation |
[in] | end | final index of computation |
Compute the component of the flux tensor normal to the direction of integration.
[in,out] | state | Pointer to a state structure |
[in] | beg | initial index of computation |
[in] | end | final index of computation |
void HLL_Speed | ( | const State * | stateL, |
const State * | stateR, | ||
double * | SL, | ||
double * | SR, | ||
int | beg, | ||
int | end | ||
) |
Compute leftmost (SL) and rightmost (SR) speeds for the Riemann fan.
[in] | stateL | pointer to a state structure for the left state |
[in] | stateR | pointer to a state structure 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) speeds for the Riemann fan.
[in] | stateL | pointer to a state structure for the left state |
[in] | stateR | pointer to a state structure 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)
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) speeds for the Riemann fan.
[in] | stateL | pointer to a state structure for the left state |
[in] | stateR | pointer to a state structure 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 |
void MaxSignalSpeed | ( | const State * | state, |
double * | cmin, | ||
double * | cmax, | ||
int | beg, | ||
int | end | ||
) |
Compute the maximum and minimum characteristic velocities for the HD equations from the vector of primitive variables state->v.
[in] | state | pointer to a State structure |
[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 |
Compute the maximum and minimum characteristic velocities for the MHD equations, cmin= v - cf, cmax = v + cf
[in] | state | pointer to a State structure |
[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 |
Return the rightmost (cmax) and leftmost (cmin) wave propagation speed in the Riemann fan
Compute the maximum and minimum propagation speeds for the RHD equations.
[in] | state | pointer to a State structure |
[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 |
void PrimEigenvectors | ( | const State * | state, |
int | beg, | ||
int | end | ||
) |
Provide left and right eigenvectors and corresponding eigenvalues for the primitive form of the HD equations (adiabatic, pvte & isothermal cases).
[in] | state | pointer to a State structure |
[in] | beg | starting index of computation |
[in] | end | final index of computation |
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,out] | state | Pointer to State structure |
[in] | beg | starting grid index |
[in] | end | final grid index |
state->Lp
and state->Rp
must be initialized to zero before since only non-zero entries are treated here.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
Provide eigenvectors eigenvalues of the relativistic equations in primitive form.
[in,out] | state | Pointer to State structure |
[in] | beg | starting grid index |
[in] | end | final grid index |
Only non-zero components of LL and RR are computed; RR and LL must be initialized to zero outside.
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 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. |
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] | gas | pointer to a Sweep structure |
[out] | src | array of source terms |
[in] | beg | initial index of computation |
[in] | end | final index of computation |
[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.
void PrimToCons | ( | double ** | uprim, |
double ** | ucons, | ||
int | ibeg, | ||
int | iend | ||
) |
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 |
Convert a vector of primitive quantities to conservative