HyPar
1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
|
1D Shallow Water Equations More...
Go to the source code of this file.
Data Structures | |
struct | ShallowWater1D |
Structure containing variables and parameters specific to the 1D Shallow Water equations. This structure contains the physical parameters, variables, and function pointers specific to the 1D ShallowWater equations. More... | |
Macros | |
#define | _SHALLOW_WATER_1D_ "shallow-water-1d" |
#define | _MODEL_NDIMS_ 1 |
#define | _MODEL_NVARS_ 2 |
#define | _ROE_ "roe" |
#define | _LLF_ "llf-char" |
#define | _XDIR_ 0 |
#define | _ShallowWater1DGetFlowVar_(u, h, v) |
#define | _ShallowWater1DSetFlux_(f, h, v, g) |
#define | _ShallowWater1DRoeAverage_(uavg, uL, uR, p) |
#define | _ShallowWater1DEigenvalues_(u, D, p, dir) |
#define | _ShallowWater1DLeftEigenvectors_(u, L, p, dir) |
#define | _ShallowWater1DRightEigenvectors_(u, R, p, dir) |
Functions | |
int | ShallowWater1DInitialize (void *, void *) |
int | ShallowWater1DCleanup (void *) |
1D Shallow Water Equations
1D Shallow Water Equations
\begin{equation} \frac {\partial} {\partial t} \left[\begin{array}{c} h \\ hu \end{array} \right] + \frac {\partial} {\partial x} \left[\begin{array}{c} hu \\ hu^2 + \frac{1}{2}gh^2 \end{array} \right] = \left[\begin{array}{c} 0 \\ -ghb_x \end{array}\right] \end{equation}
where \(h\) is the height, \(u\) is the velocity, \(b(x)\) is the bottom topography, and \(g\) is the gravitational constant.
For the treatment of the source term (well-balanced formulation), refer to:
Definition in file shallowwater1d.h.
#define _SHALLOW_WATER_1D_ "shallow-water-1d" |
1D Shallow Water equations
Definition at line 29 of file shallowwater1d.h.
#define _MODEL_NDIMS_ 1 |
Number of spatial dimensions
Definition at line 35 of file shallowwater1d.h.
#define _MODEL_NVARS_ 2 |
Number of variables per grid point
Definition at line 37 of file shallowwater1d.h.
#define _ROE_ "roe" |
Roe upwinding scheme
Definition at line 41 of file shallowwater1d.h.
#define _LLF_ "llf-char" |
Local Lax-Friedrich upwinding scheme
Definition at line 43 of file shallowwater1d.h.
#define _XDIR_ 0 |
dimension corresponding to the x spatial dimension
Definition at line 48 of file shallowwater1d.h.
#define _ShallowWater1DGetFlowVar_ | ( | u, | |
h, | |||
v | |||
) |
Compute the flow variables (height, velocity) from the conserved solution vector.
Definition at line 54 of file shallowwater1d.h.
#define _ShallowWater1DSetFlux_ | ( | f, | |
h, | |||
v, | |||
g | |||
) |
Set the flux vector given the flow variables (height, velocity).
Definition at line 64 of file shallowwater1d.h.
#define _ShallowWater1DRoeAverage_ | ( | uavg, | |
uL, | |||
uR, | |||
p | |||
) |
Compute the Roe average of two conserved solution vectors.
Definition at line 74 of file shallowwater1d.h.
#define _ShallowWater1DEigenvalues_ | ( | 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.
Definition at line 93 of file shallowwater1d.h.
#define _ShallowWater1DLeftEigenvectors_ | ( | u, | |
L, | |||
p, | |||
dir | |||
) |
Compute the matrix that has the left-eigenvectors as its rows. Stored in row-major format.
Definition at line 106 of file shallowwater1d.h.
#define _ShallowWater1DRightEigenvectors_ | ( | u, | |
R, | |||
p, | |||
dir | |||
) |
Compute the matrix that has the right-eigenvectors as its columns. Stored in row-major format.
Definition at line 117 of file shallowwater1d.h.
int ShallowWater1DInitialize | ( | void * | s, |
void * | m | ||
) |
Function to initialize the 1D ShallowWater module
Function to initialize the 1D shallow water equations (ShallowWater1D) module: Sets the default parameters, read in and set physics-related parameters, and set the physics-related function pointers in HyPar.
s | Solver object of type HyPar |
m | Object of type MPIVariables containing MPI-related info |
Definition at line 37 of file ShallowWater1DInitialize.c.
int ShallowWater1DCleanup | ( | void * | s | ) |
Function to clean up the 1D ShallowWater module
Function to clean up all physics-related allocations for the 1D shallow water equations
s | Solver object of type HyPar |
Definition at line 10 of file ShallowWater1DCleanup.c.