Skip to main content

adjust_phi

Function adjust_phi 

Source
pub fn adjust_phi(phi: &mut SurfaceScalarField, u: &VolVectorField) -> bool
Expand description

Adjust face fluxes to satisfy global mass balance.

Sums all boundary fluxes. Any imbalance (net outflow ≠ 0 in a closed domain) is distributed uniformly over adjustable boundary faces — those whose corresponding velocity BC is ZeroGradient (i.e. free-stream / outlet faces where the flux is not prescribed). Fixed-value faces are left untouched.

This matches adjustPhi(phi, U, p) in OpenFOAM (src/finiteVolume/cfdTools/general/adjustPhi/adjustPhi.C).

§Returns

true if any adjustment was made, false if already balanced.