HyPar
1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
|
1D Euler Equations (inviscid, compressible flows) More...
Go to the source code of this file.
Data Structures | |
struct | Euler1D |
Structure containing variables and parameters specific to the 1D Euler equations. This structure contains the physical parameters, variables, and function pointers specific to the 1D Euler equations. More... | |
Macros | |
#define | _EULER_1D_ "euler1d" |
#define | _MODEL_NDIMS_ 1 |
#define | _MODEL_NVARS_ 3 |
#define | _ROE_ "roe" |
#define | _RF_ "rf-char" |
#define | _LLF_ "llf-char" |
#define | _SWFS_ "steger-warming" |
#define | _RUSANOV_ "rusanov" |
#define | _XDIR_ 0 |
#define | _Euler1DGetFlowVar_(u, rho, v, e, P, p) |
#define | _Euler1DSetFlux_(f, rho, v, e, P) |
#define | _Euler1DSetStiffFlux_(f, rho, v, e, P, gamma) |
#define | _Euler1DSetLinearizedStiffFlux_(f, u, J) |
#define | _Euler1DSetStiffJac_(J, rho, v, e, P, gamma) |
#define | _Euler1DRoeAverage_(uavg, uL, uR, p) |
#define | _Euler1DEigenvalues_(u, D, p, dir) |
#define | _Euler1DLeftEigenvectors_(u, L, p, dir) |
#define | _Euler1DRightEigenvectors_(u, R, p, dir) |
Functions | |
int | Euler1DInitialize (void *, void *) |
int | Euler1DCleanup (void *) |
1D Euler Equations (inviscid, compressible flows)
1D Euler Equations for Inviscid, Compressible Flows (includes gravitational force terms)
\begin{equation} \frac {\partial} {\partial t} \left[\begin{array}{c} \rho \\ \rho u \\ e \end{array}\right] + \frac {\partial} {\partial x} \left[\begin{array}{c} \rho u \\ \rho u^2 + p \\ (e+p) u\end{array}\right] = \left[\begin{array}{c} 0 \\ -\rho g \\ -\rho u g \end{array}\right] \end{equation}
where
\begin{equation} e = \frac {p} {\gamma-1} + \frac{1}{2} \rho u^2 \end{equation}
Reference for the governing equations:
For the partitioning of the flux into its stiff (acoustic) and non-stiff (convective) components, refer to:
For the treatment of gravitational source terms, refer to:
Definition in file euler1d.h.
#define _RF_ "rf-char" |
#define _LLF_ "llf-char" |
#define _SWFS_ "steger-warming" |
#define _XDIR_ 0 |
#define _Euler1DGetFlowVar_ | ( | u, | |
rho, | |||
v, | |||
e, | |||
P, | |||
p | |||
) |
#define _Euler1DSetFlux_ | ( | f, | |
rho, | |||
v, | |||
e, | |||
P | |||
) |
#define _Euler1DSetStiffFlux_ | ( | f, | |
rho, | |||
v, | |||
e, | |||
P, | |||
gamma | |||
) |
Set the stiff flux vector given the flow variables (density, velocity, pressure). The stiff flux vector is defines as the part of the total flux that represents the two acoustic waves. This is used in a characteristic-based split-flux method for implicit-explicit time-integration. The stiff flux is integrated in time implicitly.
Reference:
#define _Euler1DSetLinearizedStiffFlux_ | ( | f, | |
u, | |||
J | |||
) |
Linearized version of _Euler1DSetStiffFlux_, where the Jacobian of the stiff flux is evaluated at the beginning of each time step.
Reference:
#define _Euler1DSetStiffJac_ | ( | J, | |
rho, | |||
v, | |||
e, | |||
P, | |||
gamma | |||
) |
Compute the Jacobian of the stiff flux defined in _Euler1DSetStiffFlux_. The Jacobian is stored in the row-major format.
Reference:
#define _Euler1DRoeAverage_ | ( | uavg, | |
uL, | |||
uR, | |||
p | |||
) |
Compute the Roe average of two conserved solution vectors.
#define _Euler1DEigenvalues_ | ( | u, | |
D, | |||
p, | |||
dir | |||
) |
Compute the eigenvalues, given the conserved solution vector. The eigenvalues are returned as a 3x3 matrix stored in row-major format. It is a diagonal matrix with the eigenvalues as diagonal elements. Admittedly, it is a wasteful way of storing the eigenvalues.
#define _Euler1DLeftEigenvectors_ | ( | u, | |
L, | |||
p, | |||
dir | |||
) |
Compute the matrix that has the left-eigenvectors as its rows. Stored in row-major format.
#define _Euler1DRightEigenvectors_ | ( | u, | |
R, | |||
p, | |||
dir | |||
) |
Compute the matrix that has the right-eigenvectors as its columns. Stored in row-major format.
int Euler1DInitialize | ( | void * | s, |
void * | m | ||
) |
Function to initialize the 1D Euler module
Function to initialize the 1D inviscid Euler equations (Euler1D) module: Sets the default parameters, read in and set physics-related parameters, and set the physics-related function pointers in HyPar.
This file reads the file "physics.inp" that must have the following format:
begin <keyword> <value> <keyword> <value> <keyword> <value> ... <keyword> <value> end
where the list of keywords are:
Keyword name | Type | Variable | Default value |
---|---|---|---|
gamma | double | Euler1D::gamma | 1.4 |
gravity | double | Euler1D::grav | 0.0 |
grav_type | int | Euler1D::grav_type | 0 |
upwinding | char[] | Euler1D::upw_choice | "roe" (_ROE_) |
Note: "physics.inp" is optional; if absent, default values will be used.
s | Solver object of type HyPar |
m | Object of type MPIVariables containing MPI-related info |
Definition at line 71 of file Euler1DInitialize.c.
int Euler1DCleanup | ( | void * | s | ) |
Function to clean up the 1D Euler module
Function to clean up all physics-related allocations for the 1D Euler equations
s | Solver object of type HyPar |
Definition at line 10 of file Euler1DCleanup.c.