3.24 Example of building a matrix equation

The previous sections describe methods to discretise derivative and other terms in order to build a matrix equation for a given physical equation. Let us demonstrate the construction of a matrix equation, using the momentum conservation equation from Sec. 3.23 as an example. It is a vector equation, so produces 3 matrix equations for eqn, eqn and eqn.

The first term, the time derivative eqn, might be discretised with the Euler scheme Eq. (3.21 ). Matrix equations are constructed in extensive form as discussed in Sec. 3.6 . Hence, the contributions from Eq. (3.21 ) to matrix coefficients eqn and source vector eqn are scaled by cell volume eqn, i.e. eqn and eqn, respectively, as illustrated below.

PIC
The second term, the advective derivative eqn, is discretised by Eq. (3.8 ). It pre-calculates the volumetric flux eqn, using eqn interpolated by Eq. (3.3 ) with linear weights Eq. (3.4 ).

The transported eqn might be discretised using the linear upwind scheme described in Sec. 3.14 . The scheme first applies upwind discretisation, which contributes outgoing positive fluxes eqn to diagonal coefficients and negative fluxes eqn to off-diagonals. It then adds an explicit contribution based on an extrapolated gradient eqn (see Sec. 3.14 ). The gradient eqn is usually calculated by Eq. (3.18 ) with gradient limiting from Sec. 3.16 .

PIC
The third term, the Laplacian derivative eqn, is discretised by Eq. (3.2 ). It requires eqn, which is linearly interpolated from the cell centres. If the surface normal gradient eqn includes a non-orthogonal correction eqn, see Sec. 3.8 , then the term contributes to eqn and eqn, as shown below.

PIC
The final term, eqn is calculated using Eq. (3.18 ). Like all the other terms described here, it is implemented in extensive form, scaling by eqn, so is calculated for each cell by the vector eqn. The relevant component (eqn, eqn, eqn) of this vector is then applied to the respective equation for eqn, eqn and eqn.

PIC
Notes on CFD: General Principles - 3.24 Example of building a matrix equation