fvSchemes

foamSearch $FOAM_TUTORIALS fvSchemes ddtSchemes.default
foamSearch $FOAM_TUTORIALS fvSchemes gradSchemes
foamSearch $FOAM_TUTORIALS fvSchemes "divSchemes.div(phi,U)"
foamSearch $FOAM_TUTORIALS fvSchemes laplacianSchemes.default
foamSearch $FOAM_TUTORIALS fvSchemes interpolationSchemes.default
foamSearch $FOAM_TUTORIALS fvSchemes snGradSchemes

tree $FOAM_SRC/finiteVolume/finiteVolume/ddtSchemes -L 1
tree $FOAM_SRC/finiteVolume/finiteVolume/gradSchemes -L 1
tree $FOAM_SRC/finiteVolume/finiteVolume/divSchemes -L 1
tree $FOAM_SRC/finiteVolume/finiteVolume/laplacianSchemes -L 1
tree $FOAM_SRC/finiteVolume/finiteVolume/snGradSchemes -L 1

Time schemes example

Time schemes define how a property is integrated as a function of time

ddtSchemes
{
    default         backward;
    default         Crank-Nicolson 0.9; //for most condition [0 ~ 1]
    default         Euler;
    default         CoEuler phi rho 0.5;;
    default         SLTS phi rho 0.5;;
    default         Local Euler;
    default         steadyState;
    ddt(phi)        <time scheme>;
}
// if divSchemes using "bounded"
// ddtSchemes should define "bounded"
// default         bounded Euler;

Backward time scheme

  • Implicit
  • Second order
  • Transient
  • Boundedness not guaranteed
  • Conditionally stable

Crank-Nicolson time scheme

  • Second order
  • Transient
  • Bounded
ddtSchemes
{
    default         CrankNicolson <coeff>
    ddt(phi)        CrankNicolson <coeff>;
}
// 0: Euler
// 1: Crank-Nicolson
// A value of 0.9 is a good compromise between accuracy and robustness
// CrankNicolson ocCoeff { type scale ; scale linearRamp ; duration 1 ; value 0.9 ; };

Euler implicit time scheme

  • Implicit
  • First order
  • Transient

Local Euler implicit/explicit time scheme

  • First order
  • Pseudo transient, designed for steady cases
  • Spatially varying, cell-based time scale set by specific Local Time Stepping (LTS) solvers

Steady state time scheme

  • Steady state
  • Sets temporal derivative contributions to zero

Interpolation schemes

Interpolation schemes are used to transform cell-centre quantities to face centres. The operation is used in many of the finite volume calculations, e.g. for the calculation of gradient, divergence, and Laplacian terms.

interpolationSchemes
{
    default         none;
    <equation term> <interpolation scheme>;
}

Linear divergence scheme

  • Second order
  • Unbounded
  • Good choice for LES calculations due to low dissipation
  • For isotropic meshes

divSchemes
{
    default         none;
    div(phi,U)      Gauss linear;
    div(phi,U)      cubic;    // DNS case
}

Gradient schemes example

The gradient of a scalar property is represented using the notation:

gradSchemes
{
    default         none;
    grad(p)         <optional limiter> <gradient scheme> <interpolation scheme>;
}
// <limiters> cellLimited cellMDLimited faceLimited faceMDLimited clippedLinear
// <gradient scheme> fourth gauss leastSquares 
// <interpolation scheme> linear pointLinear leastSquares

Laplacian schemes

Taking the Laplacian of a property is represented using the notation:

or as a combination of divergence and gradient operators

where is a diffusion coefficient.

laplacianSchemes
{
    default         none;
    default         Gauss linear;
    default         Gauss linear corrected;
    default         Gauss linear corrected;
    default         Gauss linear corrected;
    laplacian(gamma,phi) Gauss <interpolation scheme> <snGrad scheme>
}

Divergence schemes example

The divergence of a property Q describes the net rate at which it changes as a function of space, represented using the notation:

wallDist
{
    method meshWave;

    // Optional entry enabling the calculation
    // of the normal-to-wall field
    nRequired false;

    // Optional entry delaying wall distance update to every n steps
    // Default is 1 (update every step)
    updateInterval 5;
}