OpenFOAM guide/H operator

From OpenFOAMWiki

The H operator is a form of shorthand notation that is not commonly used, but appears in OpenFOAM. It is comprised of a collection of terms from the momentum equation. A partially discretized form of the momentum equation is:

A_p \mathbf U_p = \mathbf {S_m}_{,p} - \sum\limits_r A_r \mathbf{U}_r - \boldsymbol \nabla p^*


  • subscript p is the cell index;
  • subscript r are related cells[1];
  • A are the matrix coefficients;
  • U is the uncorrected velocity;
  • S is the discretization source term; and
  • p* is the pressure from the previous timestep or initial guess.

The H operator is all terms on the right-hand side, excluding those involving pressure:

\mathbf H_p = \mathbf {S_m}_{,p} - \sum\limits_r A_r \mathbf{U}_r

Therefore the momentum equation becomes:

A_p \mathbf U_p = \mathbf H_p - \boldsymbol \nabla p

Due to its prevalence in solver algorithms, OpenFOAM implements the H operator directly in its matrix classes, including:


  1. What I'm calling related cells is conventionally called neighbours. But OpenFOAM has a different meaning for neighbours, so the term related cells is used.