UCFD_SPARSE  v1.0
Documentation
Loading...
Searching...
No Matches
flux.c File Reference

Computes numerical flux from conservative variables. More...

#include "flux.h"
Include dependency graph for flux.c:

Go to the source code of this file.

Macros

#define gamma   1.4
 
#define pmin   1e-15
 
#define max(a, b)   (((a) > (b)) ? (a) : (b))
 

Functions

void ns_flux_container (int nfvars, int ndims, double *u, double *nf, double *f)
 Computes flux for Navier-Stokes equations. More...
 
void rans_flux_container (int nfvars, int ndims, int nturbvars, double *u, double *nf, double *f)
 Computes flux for RANS equations. More...
 
int rans_source_jacobian (int nvars, int ntvars, double betast, double *uf, double *tmat, double *dsrc)
 Computes source term Jacobian matrix for RANS equations. More...
 

Detailed Description

Computes numerical flux from conservative variables.

======================================================================================================================

Non-physical value correction included.

Author
Date
July 2024
Version
1.0
Copyright
Copyright (c) 2024, Namhyoung Kim and Jin Seok Park, Inha University, All rights reserved.
License
This project is release under the terms of the MIT License (see LICENSE file).

Definition in file flux.c.

Macro Definition Documentation

◆ gamma

#define gamma   1.4

Specific heat ratio

Definition at line 24 of file flux.c.

◆ max

#define max (   a,
 
)    (((a) > (b)) ? (a) : (b))

Definition at line 29 of file flux.c.

◆ pmin

#define pmin   1e-15

Minimum pressure value

Definition at line 26 of file flux.c.

Function Documentation

◆ ns_flux_container()

void ns_flux_container ( int  nfvars,
int  ndims,
double *  u,
double *  nf,
double *  f 
)

Computes flux for Navier-Stokes equations.

Computes Euler/Navier-Stokes flux vector.
Jacobian matrix is replaced by first-order flux function, typically Rusanov flux is implemented.
Therefore, only convective flux is used.

Variable description :
rho : Density
et : Total Energy
temp : \(\rho^2 \times (u^2 + v^2)\)
contrav : Contravariant velocity

Definition at line 37 of file flux.c.

Here is the caller graph for this function:

◆ rans_flux_container()

void rans_flux_container ( int  nfvars,
int  ndims,
int  nturbvars,
double *  u,
double *  nf,
double *  f 
)

Computes flux for RANS equations.

Computes convective flux for RANS one- or two-equations.
Similar to the Navier-Stokes equations, RANS equations can be reformulated into the finite-volume framework.
It contains conservative variables, convective/viscous flux, and source term. Convective flux in RANS equations is computed simply by multiplying conservative variables and contravariant velocity.

Definition at line 85 of file flux.c.

Here is the caller graph for this function:

◆ rans_source_jacobian()

int rans_source_jacobian ( int  nvars,
int  ntvars,
double  betast,
double *  uf,
double *  tmat,
double *  dsrc 
)

Computes source term Jacobian matrix for RANS equations.

Parameters
nvarsNumber of conservative variables
ntvars

Definition at line 101 of file flux.c.

Here is the caller graph for this function: