HyPar
1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
|
Functions to compute the hyperbolic flux for 3D Navier-Stokes equations. More...
#include <stdlib.h>
#include <basic.h>
#include <arrayfunctions.h>
#include <mathfunctions.h>
#include <matmult_native.h>
#include <physicalmodels/navierstokes3d.h>
#include <hypar.h>
Go to the source code of this file.
Functions | |
int | NavierStokes3DFlux (double *f, double *u, int dir, void *s, double t) |
int | NavierStokes3DStiffFlux (double *f, double *u, int dir, void *s, double t) |
int | NavierStokes3DNonStiffFlux (double *f, double *u, int dir, void *s, double t) |
Functions to compute the hyperbolic flux for 3D Navier-Stokes equations.
Definition in file NavierStokes3DFlux.c.
int NavierStokes3DFlux | ( | double * | f, |
double * | u, | ||
int | dir, | ||
void * | s, | ||
double | t | ||
) |
Compute the hyperbolic flux function for the 3D Navier-Stokes equations:
\begin{eqnarray} dir = x, & {\bf f}\left({\bf u}\right) = \left[\begin{array}{c} \rho u \\ \rho u^2 + p \\ \rho u v \\ \rho u w \\ (e+p)u \end{array}\right], \\ dir = y, & {\bf f}\left({\bf u}\right) = \left[\begin{array}{c} \rho v \\ \rho u v \\ \rho v^2 + p \\ \rho v w \\ (e+p)v \end{array}\right], \\ dir = z, & {\bf f}\left({\bf u}\right) = \left[\begin{array}{c} \rho w \\ \rho u w \\ \rho v w \\ \rho w^2 + p \\ (e+p)w \end{array}\right] \end{eqnarray}
Note: the flux function needs to be computed at the ghost points as well.
f | Array to hold the computed flux vector (same layout as u) |
u | Array with the solution vector |
dir | Spatial dimension (x, y, or z) for which to compute the flux |
s | Solver object of type HyPar |
t | Current simulation time |
Definition at line 23 of file NavierStokes3DFlux.c.
int NavierStokes3DStiffFlux | ( | double * | f, |
double * | u, | ||
int | dir, | ||
void * | s, | ||
double | t | ||
) |
Compute the stiff flux, given the solution vector. The stiff flux is the component of the total flux that represents the acoustic modes (see _NavierStokes3DSetStiffFlux_). Here, the linearized approximation to the stiff flux is computed as:
\begin{equation} {\bf f}\left({\bf u}\right) = A_f{\bf u} \end{equation}
where \(A_f = A_f\left({\bf u}_{ref}\right)\) is the fast Jacobian (NavierStokes3D::fast_jac) evaluated for the solution at the beginning of each time step ( \({\bf u}_{ref}\) is NavierStokes3D::solution). This is done in NavierStokes3DPreStep().
Note: the flux function needs to be computed at the ghost points as well.
f | Array to hold the computed flux vector (same layout as u) |
u | Array with the solution vector |
dir | Spatial dimension (x,y, or z) for which to compute the flux |
s | Solver object of type HyPar |
t | Current simulation time |
Definition at line 70 of file NavierStokes3DFlux.c.
int NavierStokes3DNonStiffFlux | ( | double * | f, |
double * | u, | ||
int | dir, | ||
void * | s, | ||
double | t | ||
) |
Compute the non-stiff flux, given the solution vector. The non-stiff flux is the component of the total flux that represents the entropy modes (see _NavierStokes3DSetNonStiffFlux_). Here, the linearized approximation to the non-stiff flux is computed as:
\begin{equation} {\bf f}\left({\bf u}\right) - A_f{\bf u} \end{equation}
where \({\bf f}\left({\bf u}\right)\) is the total flux computed in NavierStokes3DFlux(), and \(A_f{\bf u}\) is the linearized stiff flux computed in NavierStokes3DStiffFlux().
Note: the flux function needs to be computed at the ghost points as well.
f | Array to hold the computed flux vector (same layout as u) |
u | Array with the solution vector |
dir | Spatial dimension (x,y, or z) for which to compute the flux |
s | Solver object of type HyPar |
t | Current simulation time |
Definition at line 111 of file NavierStokes3DFlux.c.