HyPar
1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
|
Compute the gravitational source term for the 2D Navier Stokes system. More...
#include <stdlib.h>
#include <basic.h>
#include <arrayfunctions.h>
#include <arrayfunctions_gpu.h>
#include <physicalmodels/navierstokes2d.h>
#include <mpivars.h>
#include <hypar.h>
Go to the source code of this file.
Functions | |
static int | NavierStokes2DSourceFunction (double *, double *, double *, void *, void *, double, int) |
static int | NavierStokes2DSourceUpwind (double *, double *, double *, double *, int, void *, double) |
int | NavierStokes2DSource (double *source, double *u, void *s, void *m, double t) |
Compute the gravitational source term for the 2D Navier Stokes system.
Definition in file NavierStokes2DSource.c.
|
static |
Compute the source function in the well-balanced treatment of the source terms. The source function is:
\begin{equation} dir = x \rightarrow \left[\begin{array}{c}0 \\ \varphi\left(x,y\right) \\ 0 \\ \varphi\left(x,y\right) \end{array}\right], \ dir = y \rightarrow \left[\begin{array}{c}0 \\ 0 \\ \varphi\left(x,y\right) \\ \varphi\left(x,y\right) \end{array}\right] \end{equation}
where \(\varphi\) (NavierStokes2D::grav_field_g) is computed in NavierStokes2D::GravityField().
References:
f | Array to hold the computed source function |
u | Solution vector array |
x | Array of spatial coordinates (grid) |
s | Solver object of type HyPar |
m | MPI object of type MPIVariables |
t | Current simulation time |
dir | Spatial dimension (x or y) |
Definition at line 151 of file NavierStokes2DSource.c.
|
static |
Compute the "upwind" source function value at the interface: the upwinding is just the arithmetic average of the left and right biased interpolated values of the source function at the interface.
References:
fI | Array to hold the computed "upwind" interface source function |
fL | Interface source function value computed using left-biased interpolation |
fR | Interface source function value computed using right-biased interpolation |
u | Solution vector array |
dir | Spatial dimension (x or y) |
s | Solver object of type HyPar |
t | Current simulation time |
Definition at line 200 of file NavierStokes2DSource.c.
int NavierStokes2DSource | ( | double * | source, |
double * | u, | ||
void * | s, | ||
void * | m, | ||
double | t | ||
) |
Computes the gravitational source term using a well-balanced formulation: the source term is rewritten as follows:
\begin{equation} \left[\begin{array}{c} 0 \\ -\rho {\bf g}\cdot{\bf \hat{i}} \\ -\rho {\bf g}\cdot{\bf \hat{j}} \\ -\rho u {\bf g}\cdot{\bf \hat{i}} - \rho v {\bf g}\cdot{\bf \hat{j}} \end{array}\right] = \left[\begin{array}{cccc} 0 & p_0 \varrho^{-1} & 0 & p_0 u \varrho^{-1} \end{array}\right] \cdot \frac{\partial}{\partial x}\left[\begin{array}{c} 0 \\ \varphi \\ 0 \\ \varphi \end{array}\right] + \left[\begin{array}{cccc} 0 & 0 & p_0 \varrho^{-1} & p_0 v \varrho^{-1} \end{array}\right] \cdot \frac{\partial}{\partial y}\left[\begin{array}{c} 0 \\ 0 \\ \varphi \\ \varphi \end{array}\right] \end{equation}
where \(\varphi = \varphi\left(x,y\right)\) and \(\varrho = \varrho\left(x,y\right)\) are computed in NavierStokes2DGravityField(). The derivatives are computed in an exactly identical manner as the hyperbolic flux (i.e., using a conservative finite-difference formulation) (see HyperbolicFunction()).
References:
source | Array to hold the computed source |
u | Solution vector array |
s | Solver object of type HyPar |
m | MPI object of type MPIVariables |
t | Current simulation time |
Definition at line 37 of file NavierStokes2DSource.c.