HyPar
1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
|
Functions to compute the hyperbolic flux for 2D Navier-Stokes equations. More...
#include <stdlib.h>
#include <arrayfunctions.h>
#include <mathfunctions.h>
#include <matmult_native.h>
#include <physicalmodels/navierstokes2d.h>
#include <hypar.h>
Go to the source code of this file.
Functions | |
int | NavierStokes2DFlux (double *f, double *u, int dir, void *s, double t) |
int | NavierStokes2DStiffFlux (double *f, double *u, int dir, void *s, double t) |
int | NavierStokes2DNonStiffFlux (double *f, double *u, int dir, void *s, double t) |
Functions to compute the hyperbolic flux for 2D Navier-Stokes equations.
Definition in file NavierStokes2DFlux.c.
int NavierStokes2DFlux | ( | double * | f, |
double * | u, | ||
int | dir, | ||
void * | s, | ||
double | t | ||
) |
Compute the hyperbolic flux function for the 2D 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 \\ (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 \\ (e+p)v \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 or y) for which to compute the flux |
s | Solver object of type HyPar |
t | Current simulation time |
Definition at line 21 of file NavierStokes2DFlux.c.
int NavierStokes2DStiffFlux | ( | 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 _NavierStokes2DSetStiffFlux_). 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 (NavierStokes2D::fast_jac) evaluated for the solution at the beginning of each time step ( \({\bf u}_{ref}\) is NavierStokes2D::solution). This is done in NavierStokes2DPreStep().
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 or y) for which to compute the flux |
s | Solver object of type HyPar |
t | Current simulation time |
Definition at line 63 of file NavierStokes2DFlux.c.
int NavierStokes2DNonStiffFlux | ( | 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 _NavierStokes2DSetNonStiffFlux_). 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 NavierStokes2DFlux(), and \(A_f{\bf u}\) is the linearized stiff flux computed in NavierStokes2DStiffFlux().
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 or y) for which to compute the flux |
s | Solver object of type HyPar |
t | Current simulation time |
Definition at line 104 of file NavierStokes2DFlux.c.