|
HyPar
1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
|
Contains the functions to compute the source terms for the 2D shallow water equations. More...
#include <stdlib.h>#include <basic.h>#include <arrayfunctions.h>#include <physicalmodels/shallowwater2d.h>#include <mpivars.h>#include <hypar.h>Go to the source code of this file.
Functions | |
| static int | ShallowWater2DSourceFunction1 (double *, double *, double *, void *, void *, double, int) |
| static int | ShallowWater2DSourceFunction2 (double *, double *, double *, void *, void *, double, int) |
| int | ShallowWater2DSource (double *source, double *u, void *s, void *m, double t) |
Contains the functions to compute the source terms for the 2D shallow water equations.
Definition in file ShallowWater2DSource.c.
|
static |
Compute the first source function that is then "discretized" in a way similar to the hyperbolic flux function for the balanced formulation introduced in the reference below. The source term is reformulated and "discretized" in a similar fashion as the hyperbolic flux to ensure that the hydrostatic balance is maintained to machine precision.
\begin{equation} {\bf S}_2 = \left\{ \begin{array}{cc} \left[ \begin{array}{c} 0 \\ \frac{1}{2}gb^2 \\ 0 \end{array}\right] & {\rm dir} = x \\ \left[ \begin{array}{c} 0 \\ 0 \\ \frac{1}{2}gb^2 \end{array}\right] & {\rm dir} = y \end{array} \right. \end{equation}
| f | Computed source function (array size and layout same as u) |
| u | Solution (conserved variables) |
| x | Spatial coordinates |
| s | Solver object of type HyPar |
| m | MPI object of type MPIVariables |
| t | Current solution time |
| dir | Spatial dimension |
Definition at line 194 of file ShallowWater2DSource.c.
|
static |
Compute the second source function that is then "discretized" in a way similar to the hyperbolic flux function for the balanced formulation introduced in the reference below. The source term is reformulated and "discretized" in a similar fashion as the hyperbolic flux to ensure that the hydrostatic balance is maintained to machine precision.
\begin{equation} {\bf S}_2 = \left\{ \begin{array}{cc} \left[ \begin{array}{c} 0 \\ b \\ 0 \end{array}\right] & {\rm dir} = x \\ \left[ \begin{array}{c} 0 \\ 0 \\ b \end{array}\right] & {\rm dir} = y \end{array} \right. \end{equation}
| f | Computed source function (array size and layout same as u) |
| u | Solution (conserved variables) |
| x | Spatial coordinates |
| s | Solver object of type HyPar |
| m | MPI object of type MPIVariables |
| t | Current solution time |
| dir | Spatial dimension |
Definition at line 251 of file ShallowWater2DSource.c.
| int ShallowWater2DSource | ( | double * | source, |
| double * | u, | ||
| void * | s, | ||
| void * | m, | ||
| double | t | ||
| ) |
Compute the source terms for the 2D shallow water equations.
| source | Computed source terms (array size & layout same as u) |
| u | Solution (conserved variables) |
| s | Solver object of type HyPar |
| m | MPI object of type MPIVariables |
| t | Current solution time |
Definition at line 33 of file ShallowWater2DSource.c.