The open source CFD toolbox
Schemes

# Introduction

OpenFOAM codes are based on algorithms for unstructured meshes, offering up to second order accuracy, predominantly using collocated variable arrangements. Most focus on Finite Volume Method applications, for which the conservative form of the general scalar transport equation for the property $$\phi$$ takes the form:

$\underbrace{\ddt{\left(\rho \phi \right)}}_{\mathrm{unsteady}} + \underbrace{\div \left(\rho \phi \vec{U} \right)}_{\mathrm{convection}} = \underbrace{\div \left(\Gamma \grad \phi \right)}_{\mathrm{diffusion}} + \underbrace{S_\phi}_{\mathrm{source}}$

The Finite Volume Method requires the integration over a 3-D control volume, such that:

$\int_V \ddt{\left(\rho \phi \right)} dV + \int_V \div \left(\rho \phi \vec{U} \right) dV = \int_V \div \left(\Gamma \grad \phi \right) dV + \int_V S_\phi dV$

This equation is discretised to produce a system of algebraic equations of the form

$[A] \vec{x} = \vec{B}$

where

 $$[A]$$ = coefficient matrix $$\vec{x}$$ = vector of unknowns $$\vec B$$ = source vector

The discretisation process employs user selected schemes to contribute to the $$[A]$$ matrix and $$\vec B$$ vector, described in the following sections. Choice of schemes are set in the fvSchemes dictionary.

# Temporal schemes

OpenFOAM includes a variety of schemes to integrate fields with respect to time:

# Spatial schemes

At their core, spatial schemes rely heavily on interpolation schemes to transform cell-based quantities to cell faces, in combination with Gauss Theorem to convert volume integrals to surface integrals.

# Wall distance calculation method

Distance to the nearest wall is required, e.g. for a number of turbulence models. Several calculation methods are available: