11.9 Imposing a constant flowrate

In some simulations, it may be desirable to drive the flow by fixing a value of the volumetric flux through a boundary surface. A common use case for this is a channel flow, where the inflow and outflow are treated using periodic boundary conditions, requiring a use of either a body force or a flowrate condition to drive the flow. Often, the use of a body force is sufficient, but in some cases (e.g. transitional or turbulent simulations), it may be difficult to determine the correct body force to use in order to attain a specific Reynolds number. The incompressible solver supports the use of an alternative forcing whereby the volumetric flux,

             ∫
Q (u) = --1--   u⋅ds,
        μ(R)  R

through a user-defined surface R of area μ(R) is kept constant. This is supported for standard two- and three-dimensional simulations, where R is a boundary region, as well as three-dimensional homogeneous simulations. In the latter case, the forcing can be imposed either in the homogeneous direction (in the x - y plane) or perpendicular to it (in the z direction).

The flowrate correction works by taking each timestep’s velocity field un, and computing a scalar α so that the corrected flow

˜un = un + αus

has the desired flowrate. Here, us is a linear Stokes solution that is calculated once at the start of the simulation, so that the condition is not expensive to implement.

To enable flowrate corrections, three things must be defined in the session file:

Importantly, note that in homogeneous simulations where the forcing is in the z-direction only the Flowrate parameter should be specified, and the reference area R is taken to be the homogeneous plane.

Optionally, the IO_FlowSteps parameter can be defined. If set to a non-zero integer, this produces a file session.prs which records the value of α used in the flowrate correction, every IO_FlowSteps steps.