v2026.11.16174
Guide / Choosing… / Choosing boundary conditions

Choosing boundary conditions

Which boundary condition should each boundary of the mesh take?

Give every solid surface a wall, and choose its wall model separately. Close an external flow with a farfield on the compressible solver, and an internal flow with an inflow and an outflow; the incompressible solver always uses the latter pair. Put a symmetry condition on a plane of mirror symmetry. Where a boundary is not closed at all but joined to another part of the domain, whether an overlapping mesh, an abutting rotating mesh or its own periodic partner, make it an interface.

typeUse it forSelected by kindNames its flow state with
wallsolid surfaces; see Choosing a wall modelslip, no slip, wall function—
farfieldopen boundaries of an external flow, compressible solver onlyriemann, pressure, supersonic, preconditionedcondition
inflowinletspressure, massflow, default (incompressible)reference
outflowoutletspressure, massflow, radial pressure gradientreference
symmetryplanes of mirror symmetry——
interfaceoverset boundaries, sliding interfaces and periodic pairsoverset, sliding, periodic—

Declaring a boundary condition

Boundary conditions are a dictionary of named blocks under the mesh's model entry. Each block is keyed by a name of your choosing, conventionally BC_1, BC_2 and so on, and describes one boundary condition:

parameters = {
    "config_version": 2,
    "solver": {...},
    "model": {
        "naca0012": {
            "mesh": "naca0012.h5",
            "boundary_conditions": {
                "BC_1": {"zones": [2, 3], "type": "symmetry"},
                "BC_2": {"zones": [4], "type": "wall", "kind": "no slip"},
                "BC_3": {
                    "zones": [1],
                    "type": "farfield",
                    "condition": "IC_1",
                    "kind": "riemann",
                },
            },
        }
    },
}

Every block requires a type, which selects the boundary condition applied to its zones, and zones, which lists those zones. Most types also take a kind, which selects a variant of the type with its own further keys. A wall's kind, for example, chooses between slip, no slip and wall function, and the keys available below it change with the choice.

Zones

zones is a list of the zone identifiers of the mesh to which the boundary condition applies. The converters record which source zone name became which identifier; see Zone identifiers.

Wall

See Choosing a wall model.

Farfield

A farfield boundary closes an external flow, and switches between inflow and outflow face by face according to the local flow direction. It names its flow state through condition, a reference condition entry. The incompressible solver has no farfield boundary; close an incompressible domain with inflow and outflow boundaries instead.

The kind sets how each face is treated:

kindTreatment
riemannRiemann invariants for a non-reflecting inflow; a viscous outflow takes the pressure from outside.
pressurea pressure boundary for both inflow and outflow.
supersonicthe upstream state on inflow and outflow alike.
preconditionedthe reference state imposed as a supersonic inflow on every face.

A farfield's target turns its angle of attack until a lift or drag coefficient reaches a set value; see Trimming to a target.

Inflow

An inflow boundary takes one of three kinds, selected by kind:

kindThe inflow state is set from
defaultthe reference condition alone; this is the incompressible solver's velocity inlet
pressurea total pressure ratio and a total temperature ratio relative to the reference condition
massflowa mass flow rate or a mass flow ratio

The default kind is for the incompressible solver. A compressible deck uses pressure or massflow, and validation rejects default there.

All three name their flow state through reference, a reference condition entry. The key is reference, not condition, which belongs to the farfield. On the compressible solver, the pressure and massflow kinds take a direction for the flow to enter along; without one, the flow enters normal to the boundary. A pressure inflow also takes a mach, which fixes the inlet Mach number: the inlet static pressure then follows from the total pressure ratio rather than from the flow inside the domain.

Outflow

An outflow boundary is a pressure, mass flow or radial-pressure-gradient outlet, selected by kind as for an inflow. All three kinds name their flow state through reference. A radial-pressure-gradient outlet holds its static_pressure_ratio at the reference_radius; elsewhere the exit pressure follows radial equilibrium about the axis of the frame the outlet's cells are solved in: the model's rotating motion, whether a moving mesh or a frame, or the rotating fluid zone that holds those cells.

An outflow sets no temperature, so it takes no total temperature ratio; that belongs on a pressure or massflow inflow.

Demonstration: what kind does From the pipe case
Outlet mass flow against cycle in a turbulent pipe, for a mass-flow outlet and a static-pressure outlet, with the imposed mass flow marked

Both runs use the same mesh, Menter SST with wall functions and a total-pressure inlet; only the outlet changes. The pressure ratio is not tuned to the 10 kg/s target: a pressure outlet sets the pressure, and the flow follows.

setting kindvalues massflow, pressurecase pipe

Interface

An interface boundary, {"type": "interface"}, joins a boundary to another part of the domain rather than closing it: the solution on one side is supplied by the other. The kind selects how the two sides are joined:

kindUse it whereWhat crosses the join
oversetthis mesh overlaps anotherfringe values, taken from the mesh beneath
slidingtwo meshes meet on a shared surface of revolution with non-matching facesa conservative flux
periodictwo boundaries of the same mesh are one surface, related by a rotation or a translationthe flow leaving one boundary enters the other

Every interface names what it connects to in its connection block. What the connection holds depends on the kind, and is described under each heading below.

Overset

An overset interface goes on the outer boundaries of a mesh that is overset on one or more other meshes. Its connection names the model or models whose meshes provide donor data; without a connection, the solver maps against every preceding model. See Overset meshes for how an overset case is set up and solved.

"BC_2": {
    "zones": [10],
    "type": "interface",
    "kind": "overset",
    "connection": {"model": ["background"]},
},

Sliding

A sliding interface joins two models whose meshes abut without overlapping on a shared cylindrical, conical or annular surface, typically a rotating region and the stationary region around it. The faces on the two sides need not match. The two face sets are clipped against each other into a common set of intersection polygons, one numerical flux is computed for each polygon, and that flux is applied to the cell on each side. The interface is therefore conservative, not interpolated.

A sliding interface is declared on both models, and each names the other. The connection gives the model and the boundary on the other side; that boundary must itself be a sliding interface whose connection names this one back.

The interface must be a surface of revolution about the rotation axis of the side that rotates. That axis comes from the model's rotating motion, with "moving mesh": True for a turning rotor or "moving mesh": False for a frozen rotor; the interface itself takes no axis or origin. When neither side rotates, the two meshes are joined directly, and the axis is found from the shape of the interface itself.

The interface may be a cylinder, a cone, a flat annulus, a spherical band, a disc or spherical cap that reaches the axis, or a whole sphere centred on the axis. It must cover the full circle about the axis; a periodic sector is not supported. The summary printed at the start of the run names the shape the solver found, which is a quick check that the right zones were listed.

A closed or compound surface, such as the two faces and the side of a drum, can be declared either way:

  • as one sliding interface on each side that lists every zone. The solver groups the zones into single surfaces, a cylinder meshed as two zones counting as one, and pairs each surface with the matching one on the other side;
  • as one sliding interface per surface, each naming its partner, when the pairing should be stated explicitly.

A zone that matches no surface on the other side stops the run at setup, with the zone, the model and the shape it was found to have.

"outer": {"boundary_conditions": {
    "BC_2": {"zones": [10, 63, 62], "type": "interface", "kind": "sliding",
             "connection": {"model": "disc", "boundary": "BC_1"}}}},
"disc": {"boundary_conditions": {
    "BC_1": {"zones": [21, 22, 23], "type": "interface", "kind": "sliding",
             "connection": {"model": "outer", "boundary": "BC_2"}}}},

A rotor turning inside the stator around it, each connected to the other:

"model": {
    "rotor": {
        "mesh": "rotor.h5",
        "transforms": {
            "motion": {
                "type": "rotating",
                "axis": [0.0, 0.0, 1.0],
                "origin": [0.0, 0.0, 0.0],
                "omega": 100.0,
                "moving mesh": True,
            },
        },
        "boundary_conditions": {
            "BC_3": {
                "zones": [21],
                "type": "interface",
                "kind": "sliding",
                "connection": {"model": "stator", "boundary": "BC_2"},
            },
        },
    },
    "stator": {
        "mesh": "stator.h5",
        "boundary_conditions": {
            "BC_2": {
                "zones": [20],
                "type": "interface",
                "kind": "sliding",
                "connection": {"model": "rotor", "boundary": "BC_3"},
            },
        },
    },
},

Two settings trade conservation against other properties of the interface:

Settingconservative / segment (the defaults)free stream / parent
areaboth sides use the mean of the two parent area maps: conservative to round-off, closure error first order in cell widtheach side uses its own parent map: closure and free-stream preservation exact, conservation deficit second order
fluxone flux per intersection polygon, with a shared area vector, so the two sides cancel exactlyone flux per parent face, against the area-weighted average of its donors: quieter as cells pass, but not conservative

The two area settings are identical on a planar interface and for matching meshes. Under parent the flux does not change when the intersection pattern changes, so the noise a rotating interface makes as cells pass one another is lower; but each side fluxes its own faces and nothing cancels. segment is the default for that reason.

segment_capacity_factor, sliver_tolerance and closure_tolerance are rarely needed. The first sizes the segment storage reserved for each interface face; setup sweeps a full revolution, and stops with the factor actually needed if it is too small. The closure tolerance is the largest fraction of a face's area that may be left uncovered before setup stops, so that a real gap between the two sides, from mismatched radii, a partial annulus or a wrong axis, shows at setup rather than as a silent leak.

The rotor's motion turns its mesh every time step and requires an unsteady run. A frozen rotor, steady or unsteady, sets "moving mesh": False on the same motion, which solves the rotor in a rotating frame over every cell of its mesh. Both are described in Placing and moving a mesh.

Periodic

A periodic interface treats two boundaries of the same mesh as one surface: the flow leaving one boundary enters the other. It is declared in pairs. Each boundary's connection names the other boundary of the pair, and that boundary must name this one back.

Each side carries the transform that maps it onto the other, so the two transforms must be inverses of each other. A rotation of θ about an axis pairs with a rotation of −θ about the same axis line, or equivalently θ about the reversed axis; a translation by a vector pairs with the translation by its negative. Both sides of a pair use the same transform type, 'linear' or 'rotated'.

A linear periodic pair:

"BC_3": {
    "zones": [11],
    "type": "interface",
    "kind": "periodic",
    "connection": {"boundary": "BC_4"},
    "transform": {"type": "linear", "vector": [0.0, 0.0, 1.0]},
},
"BC_4": {
    "zones": [12],
    "type": "interface",
    "kind": "periodic",
    "connection": {"boundary": "BC_3"},
    "transform": {"type": "linear", "vector": [0.0, 0.0, -1.0]},
},

A rotated periodic pair for a 120° sector:

"BC_5": {
    "zones": [5],
    "type": "interface",
    "kind": "periodic",
    "connection": {"boundary": "BC_6"},
    "transform": {
        "type": "rotated",
        "theta": math.radians(120.0),
        "axis": [1.0, 0.0, 0.0],
        "origin": [0.0, 0.0, 0.0],
    },
},
"BC_6": {
    "zones": [6],
    "type": "interface",
    "kind": "periodic",
    "connection": {"boundary": "BC_5"},
    "transform": {
        "type": "rotated",
        "theta": math.radians(-120.0),
        "axis": [1.0, 0.0, 0.0],
        "origin": [0.0, 0.0, 0.0],
    },
},

Reference entries