HyPar
1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
|
Initialization of the physics-related variables and function pointers for the 2D Navier-Stokes system. More...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <basic.h>
#include <arrayfunctions.h>
#include <boundaryconditions.h>
#include <physicalmodels/navierstokes2d.h>
#include <mpivars.h>
#include <hypar.h>
Go to the source code of this file.
Functions | |
double | NavierStokes2DComputeCFL (void *, void *, double, double) |
int | NavierStokes2DFlux (double *, double *, int, void *, double) |
int | NavierStokes2DStiffFlux (double *, double *, int, void *, double) |
int | NavierStokes2DNonStiffFlux (double *, double *, int, void *, double) |
int | NavierStokes2DRoeAverage (double *, double *, double *, void *) |
int | NavierStokes2DParabolicFunction (double *, double *, void *, void *, double) |
int | NavierStokes2DSource (double *, double *, void *, void *, double) |
int | NavierStokes2DJacobian (double *, double *, void *, int, int, int) |
int | NavierStokes2DStiffJacobian (double *, double *, void *, int, int, int) |
int | NavierStokes2DLeftEigenvectors (double *, double *, void *, int) |
int | NavierStokes2DRightEigenvectors (double *, double *, void *, int) |
int | NavierStokes2DUpwindRoe (double *, double *, double *, double *, double *, double *, int, void *, double) |
int | NavierStokes2DUpwindRF (double *, double *, double *, double *, double *, double *, int, void *, double) |
int | NavierStokes2DUpwindLLF (double *, double *, double *, double *, double *, double *, int, void *, double) |
int | NavierStokes2DUpwindSWFS (double *, double *, double *, double *, double *, double *, int, void *, double) |
int | NavierStokes2DUpwindRusanov (double *, double *, double *, double *, double *, double *, int, void *, double) |
int | NavierStokes2DUpwinddFRoe (double *, double *, double *, double *, double *, double *, int, void *, double) |
int | NavierStokes2DUpwinddFRF (double *, double *, double *, double *, double *, double *, int, void *, double) |
int | NavierStokes2DUpwinddFLLF (double *, double *, double *, double *, double *, double *, int, void *, double) |
int | NavierStokes2DUpwinddFRusanov (double *, double *, double *, double *, double *, double *, int, void *, double) |
int | NavierStokes2DUpwindFdFRoe (double *, double *, double *, double *, double *, double *, int, void *, double) |
int | NavierStokes2DUpwindFdFRF (double *, double *, double *, double *, double *, double *, int, void *, double) |
int | NavierStokes2DUpwindFdFLLF (double *, double *, double *, double *, double *, double *, int, void *, double) |
int | NavierStokes2DUpwindFdFRusanov (double *, double *, double *, double *, double *, double *, int, void *, double) |
int | NavierStokes2DUpwindRusanovModified (double *, double *, double *, double *, double *, double *, int, void *, double) |
int | NavierStokes2DUpwinddFRusanovModified (double *, double *, double *, double *, double *, double *, int, void *, double) |
int | NavierStokes2DUpwindFdFRusanovModified (double *, double *, double *, double *, double *, double *, int, void *, double) |
int | NavierStokes2DGravityField (void *, void *) |
int | NavierStokes2DModifiedSolution (double *, double *, int, void *, void *, double) |
int | NavierStokes2DPreStep (double *, void *, void *, double) |
int | NavierStokes2DInitialize (void *s, void *m) |
Initialization of the physics-related variables and function pointers for the 2D Navier-Stokes system.
Definition in file NavierStokes2DInitialize.c.
double NavierStokes2DComputeCFL | ( | void * | s, |
void * | m, | ||
double | dt, | ||
double | t | ||
) |
Computes the maximum CFL number over the domain. Note that the CFL is computed over the local domain on this processor only.
s | Solver object of type HyPar |
m | MPI object of type MPIVariables |
dt | Time step size for which to compute the CFL |
t | Time |
Definition at line 16 of file NavierStokes2DComputeCFL.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.
int NavierStokes2DRoeAverage | ( | double * | uavg, |
double * | uL, | ||
double * | uR, | ||
void * | p | ||
) |
Compute the Roe-averaged state for the 2D Navier Stokes equations. This function just calls the macro _NavierStokes2DRoeAverage_ and is not used by any functions within the 2D Navier Stokes module. However, it's necessary to define it and provide it to the the solver object (HyPar) so that it can then send it to interpolation functions for a characteristic-based reconstruction.
uavg | The computed Roe-averaged state |
uL | Left state (conserved variables) |
uR | Right state (conserved variables) |
p | Object of type NavierStokes2D with physics-related variables |
Definition at line 15 of file NavierStokes2DFunctions.c.
int NavierStokes2DParabolicFunction | ( | double * | par, |
double * | u, | ||
void * | s, | ||
void * | m, | ||
double | t | ||
) |
Compute the viscous terms in the 2D Navier Stokes equations: this function computes the following:
\begin{equation} \frac {\partial} {\partial x} \left[\begin{array}{c} 0 \\ \tau_{xx} \\ \tau_{yx} \\ u \tau_{xx} + v \tau_{yx} - q_x \end{array}\right] + \frac {\partial} {\partial y} \left[\begin{array}{c} 0 \\ \tau_{xy} \\ \tau_{yy} \\ u \tau_{xy} + v \tau_{yy} - q_y \end{array}\right] \end{equation}
where
\begin{align} \tau_{xx} &= \frac{2}{3}\left(\frac{\mu}{Re}\right)\left(2\frac{\partial u}{\partial x} - \frac{\partial v}{\partial y}\right),\\ \tau_{xy} &= \left(\frac{\mu}{Re}\right)\left(\frac{\partial u}{\partial y} + \frac{\partial v}{\partial x}\right),\\ \tau_{yx} &= \left(\frac{\mu}{Re}\right)\left(\frac{\partial u}{\partial y} + \frac{\partial v}{\partial x}\right),\\ \tau_{yy} &= \frac{2}{3}\left(\frac{\mu}{Re}\right)\left(-\frac{\partial u}{\partial x} +2\frac{\partial v}{\partial y}\right),\\ q_x &= -\frac{mu}{\left(\gamma-1\right)Re Pr}\frac{\partial T}{\partial x}, \\ q_y &= -\frac{mu}{\left(\gamma-1\right)Re Pr}\frac{\partial T}{\partial y} \end{align}
and the temperature is \(T = \gamma p/\rho\). \(Re\) and \(Pr\) are the Reynolds and Prandtl numbers, respectively. Note that this function computes the entire parabolic term, and thus bypasses HyPar's parabolic function calculation interfaces. NavierStokes2DInitialize() assigns this function to HyPar::ParabolicFunction.
Reference:
par | Array to hold the computed viscous terms |
u | Solution vector array |
s | Solver object of type HyPar |
m | MPI object of type MPIVariables |
t | Current simulation time |
Definition at line 38 of file NavierStokes2DParabolicFunction.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.
int NavierStokes2DJacobian | ( | double * | Jac, |
double * | u, | ||
void * | p, | ||
int | dir, | ||
int | nvars, | ||
int | upw | ||
) |
Function to compute the flux Jacobian of the 2D Navier-Stokes equations, given the solution at a grid point. The Jacobian is square matrix of size nvar=4, and is returned as a 1D array (double) of 16 elements in row-major format.
Jac | Jacobian matrix: 1D array of size nvar^2 = 16 |
u | solution at a grid point (array of size nvar = 4) |
p | object containing the physics-related parameters |
dir | dimension (0 -> x, 1 -> y) |
nvars | number of vector components |
upw | 0 -> send back complete Jacobian, 1 -> send back Jacobian of right(+)-moving flux, -1 -> send back Jacobian of left(-)-moving flux |
Definition at line 14 of file NavierStokes2DJacobian.c.
int NavierStokes2DStiffJacobian | ( | double * | Jac, |
double * | u, | ||
void * | p, | ||
int | dir, | ||
int | nvars, | ||
int | upw | ||
) |
Function to compute the Jacobian of the fast flux (representing the acoustic waves) of the 2D Navier-Stokes equations, given the solution at a grid point. The Jacobian is square matrix of size nvar=4, and is returned as a 1D array (double) of 16 elements in row-major format.
Jac | Jacobian matrix: 1D array of size nvar^2 = 16 |
u | solution at a grid point (array of size nvar = 4) |
p | object containing the physics-related parameters |
dir | dimension (0 -> x, 1 -> y) |
nvars | number of vector components |
upw | 0 -> send back complete Jacobian, 1 -> send back Jacobian of right(+)-moving flux, -1 -> send back Jacobian of left(-)-moving flux |
Definition at line 51 of file NavierStokes2DJacobian.c.
int NavierStokes2DLeftEigenvectors | ( | double * | u, |
double * | L, | ||
void * | p, | ||
int | dir | ||
) |
Compute the left eigenvections for the 2D Navier Stokes equations. This function just calls the macro _NavierStokes2DLeftEigenvectors_ and is not used by any functions within the 2D Navier Stokes module. However, it's necessary to define it and provide it to the the solver object (HyPar) so that it can then send it to interpolation functions for a characteristic-based reconstruction.
u | Conserved solution at a grid point |
L | Array of size nvar^2 = 4^2 to save the matrix of left eigenvectors in (row-major format). |
p | Object of type NavierStokes2D with physics-related variables |
dir | Spatial dimension (x or y) |
Definition at line 19 of file NavierStokes2DEigen.c.
int NavierStokes2DRightEigenvectors | ( | double * | u, |
double * | R, | ||
void * | p, | ||
int | dir | ||
) |
Compute the right eigenvections for the 2D Navier Stokes equations. This function just calls the macro _NavierStokes2DRightEigenvectors_ and is not used by any functions within the 2D Navier Stokes module. However, it's necessary to define it and provide it to the the solver object (HyPar) so that it can then send it to interpolation functions for a characteristic-based reconstruction.
u | Conserved solution at a grid point |
R | Array of size nvar^2 = 4^2 to save the matrix of right eigenvectors in (row-major format). |
p | Object of type NavierStokes2D with physics-related variables |
dir | Spatial dimension (x or y) |
Definition at line 38 of file NavierStokes2DEigen.c.
int NavierStokes2DUpwindRoe | ( | double * | fI, |
double * | fL, | ||
double * | fR, | ||
double * | uL, | ||
double * | uR, | ||
double * | u, | ||
int | dir, | ||
void * | s, | ||
double | t | ||
) |
Roe's upwinding scheme.
\begin{equation} {\bf f}_{j+1/2} = \frac{1}{2}\left[ {\bf f}_{j+1/2}^L + {\bf f}_{j+1/2}^R - \left| A\left({\bf u}_{j+1/2}^L,{\bf u}_{j+1/2}^R\right) \right| \left( {\bf u}_{j+1/2}^R - {\bf u}_{j+1/2}^L \right)\right] \end{equation}
This upwinding scheme is modified for the balanced discretization of the 2D Navier Stokes equations when there is a non-zero gravitational force. See the reference below. For flows without any gravitational forces, it reduces to its original form.
fI | Computed upwind interface flux |
fL | Left-biased reconstructed interface flux |
fR | Right-biased reconstructed interface flux |
uL | Left-biased reconstructed interface solution |
uR | Right-biased reconstructed interface solution |
u | Cell-centered solution |
dir | Spatial dimension (x or y) |
s | Solver object of type HyPar |
t | Current solution time |
Definition at line 34 of file NavierStokes2DUpwind.c.
int NavierStokes2DUpwindRF | ( | double * | fI, |
double * | fL, | ||
double * | fR, | ||
double * | uL, | ||
double * | uR, | ||
double * | u, | ||
int | dir, | ||
void * | s, | ||
double | t | ||
) |
Characteristic-based Roe-fixed upwinding scheme.
\begin{align} \alpha_{j+1/2}^{k,L} &= \sum_{k=1}^3 {\bf l}_{j+1/2}^k \cdot {\bf f}_{j+1/2}^{k,L}, \\ \alpha_{j+1/2}^{k,R} &= \sum_{k=1}^3 {\bf l}_{j+1/2}^k \cdot {\bf f}_{j+1/2}^{k,R}, \\ v_{j+1/2}^{k,L} &= \sum_{k=1}^3 {\bf l}_{j+1/2}^k \cdot {\bf u}_{j+1/2}^{k,L}, \\ v_{j+1/2}^{k,R} &= \sum_{k=1}^3 {\bf l}_{j+1/2}^k \cdot {\bf u}_{j+1/2}^{k,R}, \\ \alpha_{j+1/2}^k &= \left\{ \begin{array}{cc} \alpha_{j+1/2}^{k,L} & {\rm if}\ \lambda_{j,j+1/2,j+1} > 0 \\ \alpha_{j+1/2}^{k,R} & {\rm if}\ \lambda_{j,j+1/2,j+1} < 0 \\ \frac{1}{2}\left[ \alpha_{j+1/2}^{k,L} + \alpha_{j+1/2}^{k,R} - \left(\max_{\left[j,j+1\right]} \lambda\right) \left( v_{j+1/2}^{k,R} - v_{j+1/2}^{k,L} \right) \right] & {\rm otherwise} \end{array}\right., \\ {\bf f}_{j+1/2} &= \sum_{k=1}^3 \alpha_{j+1/2}^k {\bf r}_{j+1/2}^k \end{align}
where \({\bf l}\), \({\bf r}\), and \(\lambda\) are the left-eigenvectors, right-eigenvectors and eigenvalues. The subscripts denote the grid locations.
Note that this upwinding scheme cannot be used for solving flows with non-zero gravitational forces.
fI | Computed upwind interface flux |
fL | Left-biased reconstructed interface flux |
fR | Right-biased reconstructed interface flux |
uL | Left-biased reconstructed interface solution |
uR | Right-biased reconstructed interface solution |
u | Cell-centered solution |
dir | Spatial dimension (x or y) |
s | Solver object of type HyPar |
t | Current solution time |
Definition at line 120 of file NavierStokes2DUpwind.c.
int NavierStokes2DUpwindLLF | ( | double * | fI, |
double * | fL, | ||
double * | fR, | ||
double * | uL, | ||
double * | uR, | ||
double * | u, | ||
int | dir, | ||
void * | s, | ||
double | t | ||
) |
Characteristic-based local Lax-Friedrich upwinding scheme.
\begin{align} \alpha_{j+1/2}^{k,L} &= \sum_{k=1}^3 {\bf l}_{j+1/2}^k \cdot {\bf f}_{j+1/2}^{k,L}, \\ \alpha_{j+1/2}^{k,R} &= \sum_{k=1}^3 {\bf l}_{j+1/2}^k \cdot {\bf f}_{j+1/2}^{k,R}, \\ v_{j+1/2}^{k,L} &= \sum_{k=1}^3 {\bf l}_{j+1/2}^k \cdot {\bf u}_{j+1/2}^{k,L}, \\ v_{j+1/2}^{k,R} &= \sum_{k=1}^3 {\bf l}_{j+1/2}^k \cdot {\bf u}_{j+1/2}^{k,R}, \\ \alpha_{j+1/2}^k &= \frac{1}{2}\left[ \alpha_{j+1/2}^{k,L} + \alpha_{j+1/2}^{k,R} - \left(\max_{\left[j,j+1\right]} \lambda\right) \left( v_{j+1/2}^{k,R} - v_{j+1/2}^{k,L} \right) \right], \\ {\bf f}_{j+1/2} &= \sum_{k=1}^3 \alpha_{j+1/2}^k {\bf r}_{j+1/2}^k \end{align}
where \({\bf l}\), \({\bf r}\), and \(\lambda\) are the left-eigenvectors, right-eigenvectors and eigenvalues. The subscripts denote the grid locations.
This upwinding scheme is modified for the balanced discretization of the 2D Navier Stokes equations when there is a non-zero gravitational force. See the reference below. For flows without any gravitational forces, it reduces to its original form.
fI | Computed upwind interface flux |
fL | Left-biased reconstructed interface flux |
fR | Right-biased reconstructed interface flux |
uL | Left-biased reconstructed interface solution |
uR | Right-biased reconstructed interface solution |
u | Cell-centered solution |
dir | Spatial dimension (x or y) |
s | Solver object of type HyPar |
t | Current solution time |
Definition at line 223 of file NavierStokes2DUpwind.c.
int NavierStokes2DUpwindSWFS | ( | double * | fI, |
double * | fL, | ||
double * | fR, | ||
double * | uL, | ||
double * | uR, | ||
double * | u, | ||
int | dir, | ||
void * | s, | ||
double | t | ||
) |
Steger-Warming Flux-Splitting scheme
Note that this method cannot be used for flows with non-zero gravitational forces.
fI | Computed upwind interface flux |
fL | Left-biased reconstructed interface flux |
fR | Right-biased reconstructed interface flux |
uL | Left-biased reconstructed interface solution |
uR | Right-biased reconstructed interface solution |
u | Cell-centered solution |
dir | Spatial dimension (x or y) |
s | Solver object of type HyPar |
t | Current solution time |
Definition at line 316 of file NavierStokes2DUpwind.c.
int NavierStokes2DUpwindRusanov | ( | double * | fI, |
double * | fL, | ||
double * | fR, | ||
double * | uL, | ||
double * | uR, | ||
double * | u, | ||
int | dir, | ||
void * | s, | ||
double | t | ||
) |
Rusanov's upwinding scheme.
\begin{equation} {\bf f}_{j+1/2} = \frac{1}{2}\left[ {\bf f}_{j+1/2}^L + {\bf f}_{j+1/2}^R - \max_{j,j+1} \nu_j \left( {\bf u}_{j+1/2}^R - {\bf u}_{j+1/2}^L \right)\right] \end{equation}
where \(\nu = c + \left|u\right|\).
This upwinding scheme is modified for the balanced discretization of the 2D Navier Stokes equations when there is a non-zero gravitational force. See the reference below. For flows without any gravitational forces, it reduces to its original form.
fI | Computed upwind interface flux |
fL | Left-biased reconstructed interface flux |
fR | Right-biased reconstructed interface flux |
uL | Left-biased reconstructed interface solution |
uR | Right-biased reconstructed interface solution |
u | Cell-centered solution |
dir | Spatial dimension (x or y) |
s | Solver object of type HyPar |
t | Current solution time |
Definition at line 428 of file NavierStokes2DUpwind.c.
int NavierStokes2DUpwinddFRoe | ( | double * | fI, |
double * | fL, | ||
double * | fR, | ||
double * | uL, | ||
double * | uR, | ||
double * | u, | ||
int | dir, | ||
void * | s, | ||
double | t | ||
) |
The Roe upwinding scheme (NavierStokes2DUpwindRoe) for the partitioned hyperbolic flux that comprises of the acoustic waves only (see NavierStokes2DStiffFlux, _NavierStokes2DSetStiffFlux_). Thus, only the characteristic fields / eigen-modes corresponding to \( u\pm a\) are used. Reference:
fI | Computed upwind interface flux |
fL | Left-biased reconstructed interface flux |
fR | Right-biased reconstructed interface flux |
uL | Left-biased reconstructed interface solution |
uR | Right-biased reconstructed interface solution |
u | Cell-centered solution |
dir | Spatial dimension (x or y) |
s | Solver object of type HyPar |
t | Current solution time |
Definition at line 589 of file NavierStokes2DUpwind.c.
int NavierStokes2DUpwinddFRF | ( | double * | fI, |
double * | fL, | ||
double * | fR, | ||
double * | uL, | ||
double * | uR, | ||
double * | u, | ||
int | dir, | ||
void * | s, | ||
double | t | ||
) |
The characteristic-based Roe-fixed upwinding scheme (NavierStokes2DUpwindRF) for the partitioned hyperbolic flux that comprises of the acoustic waves only (see NavierStokes2DStiffFlux, _NavierStokes2DSetStiffFlux_). Thus, only the characteristic fields / eigen-modes corresponding to \( u\pm a\) are used. Reference:
fI | Computed upwind interface flux |
fL | Left-biased reconstructed interface flux |
fR | Right-biased reconstructed interface flux |
uL | Left-biased reconstructed interface solution |
uR | Right-biased reconstructed interface solution |
u | Cell-centered solution |
dir | Spatial dimension (x or y) |
s | Solver object of type HyPar |
t | Current solution time |
Definition at line 670 of file NavierStokes2DUpwind.c.
int NavierStokes2DUpwinddFLLF | ( | double * | fI, |
double * | fL, | ||
double * | fR, | ||
double * | uL, | ||
double * | uR, | ||
double * | u, | ||
int | dir, | ||
void * | s, | ||
double | t | ||
) |
The characteristic-based local Lax-Friedrich upwinding scheme (NavierStokes2DUpwindLLF) for the partitioned hyperbolic flux that comprises of the acoustic waves only (see NavierStokes2DStiffFlux, _NavierStokes2DSetStiffFlux_). Thus, only the characteristic fields / eigen-modes corresponding to \( u\pm a\) are used. Reference:
fI | Computed upwind interface flux |
fL | Left-biased reconstructed interface flux |
fR | Right-biased reconstructed interface flux |
uL | Left-biased reconstructed interface solution |
uR | Right-biased reconstructed interface solution |
u | Cell-centered solution |
dir | Spatial dimension (x or y) |
s | Solver object of type HyPar |
t | Current solution time |
Definition at line 764 of file NavierStokes2DUpwind.c.
int NavierStokes2DUpwinddFRusanov | ( | double * | , |
double * | , | ||
double * | , | ||
double * | , | ||
double * | , | ||
double * | , | ||
int | , | ||
void * | , | ||
double | |||
) |
int NavierStokes2DUpwindFdFRoe | ( | double * | fI, |
double * | fL, | ||
double * | fR, | ||
double * | uL, | ||
double * | uR, | ||
double * | u, | ||
int | dir, | ||
void * | s, | ||
double | t | ||
) |
The Roe upwinding scheme (NavierStokes2DUpwindRoe) for the partitioned hyperbolic flux that comprises of the entropy waves only (see NavierStokes2DNonStiffFlux, _NavierStokes2DSetStiffFlux_). Thus, only the characteristic fields / eigen-modes corresponding to \(u\) are used. Reference:
fI | Computed upwind interface flux |
fL | Left-biased reconstructed interface flux |
fR | Right-biased reconstructed interface flux |
uL | Left-biased reconstructed interface solution |
uR | Right-biased reconstructed interface solution |
u | Cell-centered solution |
dir | Spatial dimension (x or y) |
s | Solver object of type HyPar |
t | Current solution time |
Definition at line 950 of file NavierStokes2DUpwind.c.
int NavierStokes2DUpwindFdFRF | ( | double * | fI, |
double * | fL, | ||
double * | fR, | ||
double * | uL, | ||
double * | uR, | ||
double * | u, | ||
int | dir, | ||
void * | s, | ||
double | t | ||
) |
The characteristic-based Roe-fixed upwinding scheme (NavierStokes2DUpwindRF) for the partitioned hyperbolic flux that comprises of the entropy waves only (see NavierStokes2DNonStiffFlux, _NavierStokes2DSetNonStiffFlux_). Thus, only the characteristic fields / eigen-modes corresponding to \(u\) are used. Reference:
fI | Computed upwind interface flux |
fL | Left-biased reconstructed interface flux |
fR | Right-biased reconstructed interface flux |
uL | Left-biased reconstructed interface solution |
uR | Right-biased reconstructed interface solution |
u | Cell-centered solution |
dir | Spatial dimension (x or y) |
s | Solver object of type HyPar |
t | Current solution time |
Definition at line 1046 of file NavierStokes2DUpwind.c.
int NavierStokes2DUpwindFdFLLF | ( | double * | fI, |
double * | fL, | ||
double * | fR, | ||
double * | uL, | ||
double * | uR, | ||
double * | u, | ||
int | dir, | ||
void * | s, | ||
double | t | ||
) |
The characteristic-based local Lax-Friedrich upwinding scheme (NavierStokes2DUpwindLLF) for the partitioned hyperbolic flux that comprises of the entropy waves only (see NavierStokes2DNonStiffFlux, _NavierStokes2DSetNonStiffFlux_). Thus, only the characteristic fields / eigen-modes corresponding to \(u\) are used. Reference:
fI | Computed upwind interface flux |
fL | Left-biased reconstructed interface flux |
fR | Right-biased reconstructed interface flux |
uL | Left-biased reconstructed interface solution |
uR | Right-biased reconstructed interface solution |
u | Cell-centered solution |
dir | Spatial dimension (x or y) |
s | Solver object of type HyPar |
t | Current solution time |
Definition at line 1140 of file NavierStokes2DUpwind.c.
int NavierStokes2DUpwindFdFRusanov | ( | double * | , |
double * | , | ||
double * | , | ||
double * | , | ||
double * | , | ||
double * | , | ||
int | , | ||
void * | , | ||
double | |||
) |
int NavierStokes2DUpwindRusanovModified | ( | double * | fI, |
double * | fL, | ||
double * | fR, | ||
double * | uL, | ||
double * | uR, | ||
double * | u, | ||
int | dir, | ||
void * | s, | ||
double | t | ||
) |
Modified Rusanov's upwinding scheme: NavierStokes2DUpwindRusanov() modified as described in the following paper (for consistent characteristic-based splitting):
fI | Computed upwind interface flux |
fL | Left-biased reconstructed interface flux |
fR | Right-biased reconstructed interface flux |
uL | Left-biased reconstructed interface solution |
uR | Right-biased reconstructed interface solution |
u | Cell-centered solution |
dir | Spatial dimension (x or y) |
s | Solver object of type HyPar |
t | Current solution time |
Definition at line 499 of file NavierStokes2DUpwind.c.
int NavierStokes2DUpwinddFRusanovModified | ( | double * | fI, |
double * | fL, | ||
double * | fR, | ||
double * | uL, | ||
double * | uR, | ||
double * | u, | ||
int | dir, | ||
void * | s, | ||
double | t | ||
) |
The modified Rusanov upwinding scheme (NavierStokes2DUpwindRusanovModified()) for the partitioned hyperbolic flux that comprises of the acoustic waves only (see NavierStokes2DStiffFlux, _NavierStokes2DSetStiffFlux_). Thus, only the characteristic fields / eigen-modes corresponding to \( u\pm a\) are used. Reference:
fI | Computed upwind interface flux |
fL | Left-biased reconstructed interface flux |
fR | Right-biased reconstructed interface flux |
uL | Left-biased reconstructed interface solution |
uR | Right-biased reconstructed interface solution |
u | Cell-centered solution |
dir | Spatial dimension (x or y) |
s | Solver object of type HyPar |
t | Current solution time |
Definition at line 859 of file NavierStokes2DUpwind.c.
int NavierStokes2DUpwindFdFRusanovModified | ( | double * | fI, |
double * | fL, | ||
double * | fR, | ||
double * | uL, | ||
double * | uR, | ||
double * | u, | ||
int | dir, | ||
void * | s, | ||
double | t | ||
) |
The modified Rusanov upwinding scheme (NavierStokes2DUpwindRusanovModified()) for the partitioned hyperbolic flux that comprises of the entropy waves only (see NavierStokes2DNonStiffFlux, _NavierStokes2DSetNonStiffFlux_). Thus, only the characteristic fields / eigen-modes corresponding to \(u\) are used. Reference:
fI | Computed upwind interface flux |
fL | Left-biased reconstructed interface flux |
fR | Right-biased reconstructed interface flux |
uL | Left-biased reconstructed interface solution |
uR | Right-biased reconstructed interface solution |
u | Cell-centered solution |
dir | Spatial dimension (x or y) |
s | Solver object of type HyPar |
t | Current solution time |
Definition at line 1235 of file NavierStokes2DUpwind.c.
int NavierStokes2DGravityField | ( | void * | s, |
void * | m | ||
) |
This function computes the pressure and density variation functions for the hydrostatic balance of the type specified by the user (NavierStokes2D:HB). The pressure and density in hydrostatic balance are given by
\begin{equation} \rho = \rho_0\varrho\left(x,y\right),\ p = p_0\varphi\left(x,y\right) \end{equation}
where \(\rho_0\) and \(p_0\) are the reference density (NavierStokes2D::rho0) and pressure (NavierStokes2D::p0). This function computes \(\varrho\) (NavierStokes2D::grav_field_f) and \(\varphi\) (NavierStokes2D::grav_field_g). For flows without gravity, \(\varrho = \varphi = 1\).
References:
s | Solver object of type HyPar |
m | MPI object of type MPIVariables |
Definition at line 33 of file NavierStokes2DGravityField.c.
int NavierStokes2DModifiedSolution | ( | double * | uC, |
double * | u, | ||
int | d, | ||
void * | s, | ||
void * | m, | ||
double | waqt | ||
) |
This function computes the modified solution for the well-balanced treatment of the gravitational source terms. The modified solution vector is given by
\begin{equation} {\bf u}^* = \left[\begin{array}{c} \rho \varrho^{-1}\left(x,y\right) \\ \rho u \varrho^{-1}\left(x,y\right) \\ \rho v \varrho^{-1}\left(x,y\right) \\ e^* \end{array}\right] \end{equation}
where
\begin{equation} e^* = \frac{p \varphi^{-1}\left(x,y\right)}{\gamma-1} + \frac{1}{2}\rho \varrho^{-1}\left(x,y\right) \left(u^2+v^2\right) \end{equation}
\(\varrho\) and \(\varphi\) are computed in NavierStokes2DGravityField(). For flows without gravity, \({\bf u}^* = {\bf u}\).
References:
uC | Array to hold the computed modified solution |
u | Solution vector array |
d | spatial dimension (not used) |
s | Solver object of type HyPar |
m | MPI object of time MPIVariables |
waqt | Current simulation time |
Definition at line 31 of file NavierStokes2DModifiedSolution.c.
int NavierStokes2DPreStep | ( | double * | u, |
void * | s, | ||
void * | m, | ||
double | waqt | ||
) |
Pre-step function for the 2D Navier Stokes equations: This function is called at the beginning of each time step.
\begin{equation} A_f\left({\bf u}\right) = R\left({\bf u}\right)\Lambda_f\left({\bf u}\right)L\left({\bf u}\right) \end{equation}
where \(R\) and \(L\) are the matrices of right and left eigenvectors, and,\begin{equation} \Lambda_f = diag\left[0,0,u+c,u-c \right] \end{equation}
with \(c\) being the speed of sound.u | Solution vector |
s | Solver object of type HyPar |
m | MPI object of type MPIVariables |
waqt | Current simulation time |
Definition at line 33 of file NavierStokes2DPreStep.c.
int NavierStokes2DInitialize | ( | void * | s, |
void * | m | ||
) |
Initialize the 2D Navier-Stokes (NavierStokes2D) module: Sets the default parameters, read in and set physics-related parameters, and set the physics-related function pointers in HyPar.
This file reads the file "physics.inp" that must have the following format:
begin <keyword> <value> <keyword> <value> <keyword> <value> ... <keyword> <value> end
where the list of keywords are:
Keyword name | Type | Variable | Default value |
---|---|---|---|
gamma | double | NavierStokes2D::gamma | 1.4 |
Pr | double | NavierStokes2D::Pr | 0.72 |
Re | double | NavierStokes2D::Re | -1 |
Minf | double | NavierStokes2D::Minf | 1.0 |
gravity | double,double | NavierStokes2D::grav_x,NavierStokes2D::grav_y | 0.0,0.0 |
rho_ref | double | NavierStokes2D::rho0 | 1.0 |
p_ref | double | NavierStokes2D::p0 | 1.0 |
HB | int | NavierStokes2D::HB | 1 |
R | double | NavierStokes2D::R | 1.0 |
upwinding | char[] | NavierStokes2D::upw_choice | "roe" (_ROE_) |
If "HB" (NavierStokes2D::HB) is specified as 3, it should be followed by the the Brunt-Vaisala frequency (NavierStokes2D::N_bv), i.e.
begin ... HB 3 0.01 ... end
Note: "physics.inp" is optional; if absent, default values will be used.
s | Solver object of type HyPar |
m | MPI object of type MPIVariables |
Definition at line 103 of file NavierStokes2DInitialize.c.