Post · 3 min read· pp. 142–143

4.8 Numerical framework

4.8 Numerical framework

The fixed value and fixed gradient conditions described in Sec. 4.2 can be combined to form a general numerical framework for boundary conditions.

PIC

The contributions from the boundary conditions to the matrix equation eqn, by discretisation of advection and Laplacian terms, can be generalised as:

  • “internal” contributions to eqn, from terms including the cell value eqn;
  • “boundary” contributions to eqn, from terms without eqn.

The example above shows Eq. (4.2) for the face value, required at a boundary for advection discretisation, in the case of a fixed gradient boundary condition. The internal “factor” on eqn is 1, which is multiplied by eqn for the contribution to the respective diagonal coefficient in eqn, as in the example in Sec. 3.24.

The boundary factor is eqn, which is similarly multiplied by eqn for the contribution to eqn.

For the fixed value condition eqn with advection, the boundary factor is eqn and an internal factor is 0.

Laplacian discretisation requires the surface normal gradient on the faces. A fixed gradient condition delivers an equivalent boundary factor of eqn to eqn and an internal factor of 0.

PIC

With a fixed value eqn, the face normal gradient Eq. (4.3) gives an internal factor of eqn and a boundary factor of eqn. Both are multiplied by eqn in their contributions to eqn and the diagonal coefficient of eqn in eqn, as shown in the Laplacian discretisation in Sec. 3.24.

The table below summarises: the “value” internal and boundary factors, contributing to the respective matrix coefficients with advection discretisation; and equivalent “gradient” factors relating to Laplacian discretisation. This provides a framework which can be extended to more complex conditions.

termfactorfixed valuefixed gradient
------------
advectionvalue internal01
advectionvalue boundaryeqneqn
Laplaciangradient internaleqn0
Laplaciangradient boundaryeqneqn
------------