periodic_dimension flag in CartesianGeometry and, for non-periodic directions, by registering RobinBcCoefStrategy objects in C++ code.
Only periodic and Dirichlet conditions are currently implemented for the velocity fields. Neumann (pure flux) conditions on velocity are not supported.
Periodic boundary conditions
Periodic BCs are the simplest option and require no extra C++ code. Setperiodic_dimension = 1 for each direction you want to be periodic inside the CartesianGeometry block:
0 in any entry disables periodicity in that direction and requires explicit BCs to be registered for both velocity and (optionally) volume fraction.
Dirichlet boundary conditions via RobinBcCoefStrategy
For non-periodic directions, you must provide oneRobinBcCoefStrategy object per velocity component per phase, and register them with the integrator before calling initializePatchHierarchy.
The Robin BC formula is:
a = 1 and b = 0; then g is the prescribed velocity value.
Registering BCs in C++
muParserRobinBcCoefs input format
muParserRobinBcCoefs reads its coefficients from a named sub-block in the input file. Each boundary face in 2D has an index 0–3 (left, right, bottom, top), so four entries are needed for each of acoef, bcoef, and gcoef.
muParserRobinBcCoefs constructor (un_bcs_0 above). The subscript on the block name corresponds to the velocity component direction (0 = x-component, 1 = y-component).
Expression strings follow the same muParser syntax as initial condition blocks: X_0, X_1 for coordinates and t for time.
Channel flow example
A channel flow with parabolic inflow in the x-direction (X_1 * (1 - X_1)) and no-slip walls at top and bottom:
us_bcs_0 and us_bcs_1 for the solvent-phase velocity.
Volume fraction boundary conditions
When the volume fraction is not advected by anAdvDiffHierarchyIntegrator, you can optionally register Dirichlet BCs for thn via registerVolumeFractionBoundaryConditions:
thn is advected with an AdvDiffIntegrator, register the BC with the advection–diffusion integrator instead:
acoef/bcoef/gcoef structure as velocity BCs:
Volume fraction BCs are ignored at periodic boundaries regardless of how they are registered. Only non-periodic boundaries use the
thn_bc values.BC face index reference
In 2D, the four boundary faces have the following index assignments:
In 3D, indices 4 (front, −z) and 5 (back, +z) are added and all six faces must be specified.
MultigridCartesianGeometry block
For non-periodic simulations, a secondMultigridCartesianGeometry block with periodic_dimension = 1, 1 is sometimes used to configure the multigrid preconditioner on a periodic auxiliary problem. This is an advanced option and is only required when the physical domain is non-periodic but you want the preconditioner to use periodic coarse-grid solves: