Boundary condition types
Every patch type the application can assign, the parameters each one asks for, and the OpenFOAM entry it writes into every field.
A boundary condition here is one physical concept. The application fans it out
across the whole field set, so you choose “Velocity inlet” once and it writes
fixedValue into 0/U, zeroGradient into 0/p,
turbulentIntensityKineticEnergyInlet into 0/k and so on. You never name a
patch type per field.
The thirteen
Section titled “The thirteen”| Type | For | Mesh patch type |
|---|---|---|
| Velocity inlet | A known speed entering the domain | patch |
| Pressure inlet | A known total pressure entering; the speed follows | patch |
| Pressure outlet | A known static pressure leaving | patch |
| Outflow | Everything leaves, nothing is specified | patch |
| Wall | A solid surface | wall |
| Thermal wall | A solid surface with a temperature condition | wall |
| Symmetry | A mirror plane | symmetry |
| Periodic | The flow leaving one face arrives at another | cyclic |
| Far field | A boundary far enough away to be undisturbed | patch |
| Fan / screen | A pressure jump across a face | patch |
| Wave inlet | A generated wave train | patch |
| Empty (2D) | A direction that is not solved | empty |
| Wedge (axisymmetric) | One side of an axisymmetric wedge | wedge |
A patch with no type assigned is an error. OpenFOAM decides whether a wall
function may be constructed from the mesh patch type, not from the field
entry, so the mesh patch type in the third column is written into
blockMeshDict and applied to an existing mesh’s constant/polyMesh/boundary
as well.
Outflow, Symmetry, Periodic, Empty (2D) and Wedge (axisymmetric) take no parameters. They are geometric statements applied identically to every field.
Parameters
Section titled “Parameters”Which fields the patch editor shows, by type.
| Parameter | Shown for |
|---|---|
| Velocity | Velocity inlet, Far field (labelled “Freestream speed”) |
| Gauge pressure (Pa) | Pressure inlet, Pressure outlet, Far field |
| Turbulence intensity + length scale | Velocity inlet, Pressure inlet, Far field |
| Wall motion, roughness | Wall, Thermal wall |
| Temperature (K) | Velocity inlet, Pressure inlet, Thermal wall, Far field — only when the energy equation is on |
| Pressure rise (Pa) | Fan / screen |
| Phase fraction | Velocity inlet, Pressure inlet, Pressure outlet, Far field — only on a two-phase VoF case |
| Stream (oxidiser / fuel) | The same four — only on a reacting case |
Intensity and length scale are converted to k, omega and epsilon and the
derived values are shown live under the fields. You never type a turbulence
quantity.
The base fan-out
Section titled “The base fan-out”What each type writes into each field before any family-specific overlay. Fields the case does not carry are simply not written.
| Type | U |
p |
k |
omega |
epsilon |
nuTilda |
nut |
T |
|---|---|---|---|---|---|---|---|---|
| Velocity inlet | fixedValue |
zeroGradient |
turbulentIntensityKineticEnergyInlet |
turbulentMixingLengthFrequencyInlet |
turbulentMixingLengthDissipationRateInlet |
fixedValue |
calculated |
fixedValue |
| Pressure inlet | pressureInletVelocity |
totalPressure |
turbulentIntensityKineticEnergyInlet |
turbulentMixingLengthFrequencyInlet |
turbulentMixingLengthDissipationRateInlet |
fixedValue |
calculated |
inletOutletTotalTemperature |
| Pressure outlet | inletOutlet |
fixedValue |
inletOutlet |
inletOutlet |
inletOutlet |
inletOutlet |
calculated |
inletOutlet |
| Outflow | zeroGradient |
zeroGradient |
zeroGradient |
zeroGradient |
zeroGradient |
zeroGradient |
calculated |
zeroGradient |
| Wall | noSlip |
zeroGradient |
kqRWallFunction |
omegaWallFunction |
epsilonWallFunction |
fixedValue |
nutkWallFunction |
zeroGradient |
| Thermal wall | noSlip |
zeroGradient |
kqRWallFunction |
omegaWallFunction |
epsilonWallFunction |
fixedValue |
nutkWallFunction |
externalWallHeatFluxTemperature |
| Symmetry | symmetry |
symmetry |
symmetry |
symmetry |
symmetry |
symmetry |
symmetry |
symmetry |
| Periodic | cyclic |
cyclic |
cyclic |
cyclic |
cyclic |
cyclic |
cyclic |
cyclic |
| Far field | freestreamVelocity |
freestreamPressure |
freestream |
freestream |
freestream |
freestream |
calculated |
freestream |
| Fan / screen | pressureInletOutletVelocity |
fanPressure |
inletOutlet |
inletOutlet |
inletOutlet |
inletOutlet |
calculated |
inletOutlet |
| Wave inlet | waveVelocity |
fixedFluxPressure |
inletOutlet |
inletOutlet |
inletOutlet |
inletOutlet |
calculated |
inletOutlet |
| Empty (2D) | empty |
empty |
empty |
empty |
empty |
empty |
empty |
empty |
| Wedge (axisymmetric) | wedge |
wedge |
wedge |
wedge |
wedge |
wedge |
wedge |
wedge |
The This writes box on the patch pane shows this table for the case in front of you, one line per field actually present. That box, not this page, is the authority for a specific case.
Entries written alongside the type
Section titled “Entries written alongside the type”| Patch type | Entries |
|---|---|
fixedValue (inlet U) |
value uniform (…) from the velocity and flow direction |
totalPressure |
p0 |
fanPressure |
jumpTable constant <Δp>, direction in |
freestreamVelocity / freestreamPressure / freestream |
freestreamValue |
turbulentIntensityKineticEnergyInlet |
intensity (as a fraction, not a percentage) |
turbulentMixingLengthFrequencyInlet, turbulentMixingLengthDissipationRateInlet |
mixingLength |
inletOutlet |
inletValue |
inletOutletTotalTemperature |
inletValue, T0 |
externalWallHeatFluxTemperature |
mode fixedValue, Ta, kappaMethod fluidThermo |
nutkRoughWallFunction |
Ks, Cs 0.5 |
rotatingWallVelocity |
origin, axis, omega |
movingWallVelocity |
value from the wall speed and the flow direction |
fixedFluxPressure |
rho rhok on a Boussinesq case only |
alphatJayatillekeWallFunction, compressible::alphatWallFunction |
Prt |
prghTotalPressure |
p0 |
prghPressure |
p |
atmBoundaryLayerInlet* |
flowDir, zDir, Uref, Zref, z0, d 0, zGround |
atmEpsilonWallFunction, atmOmegaWallFunction |
z0, lowReCorrection false |
atmNutkWallFunction |
z0 |
What a wall writes
Section titled “What a wall writes”Wall motion and roughness change the patch type, not only a value.
| Wall motion | U becomes |
nut becomes |
|---|---|---|
| Stationary (no-slip) | noSlip |
as roughness below |
| Slip | slip |
calculated |
| Moving wall | movingWallVelocity |
as roughness below |
| Rotating wall | rotatingWallVelocity |
as roughness below |
| Roughness | nut |
|---|---|
| Smooth | nutkWallFunction |
| Sand-grain roughness | nutkRoughWallFunction, with the sand-grain height as Ks |
Roughness is not offered on a slip wall — there is no boundary layer for it to roughen.
Family overlays
Section titled “Family overlays”The base table is refined once the physics family is known. These are applied in order and each one only touches the fields it owns.
Two-phase VoF. p is derived from p_rgh and carries calculated rather
than a condition of its own. alpha is inletOutlet at every opening — a
fixedValue on an outlet would hold the free surface at a fixed height against
the flow. A pressure outlet, an outflow or a far field gets
p_rgh prghTotalPressure and U pressureInletOutletVelocity; a wall gets
p_rgh fixedFluxPressure and alpha zeroGradient. Symmetry and periodic
override everything and apply unchanged.
Euler-Euler. One U.<phase> per phase and an alpha.<phase> for the
dispersed phase only. At a wall the dispersed phase gets slip rather than
no-slip — holding it to no-slip puts a boundary layer on bubbles. p_rgh is
prghPressure at a pressure outlet and fixedFluxPressure elsewhere.
Species and passive scalars. Mass fractions (reacting, spray) and the
transported scalar behave identically: fixedValue at an inlet or far field,
inletOutlet at a pressure outlet or fan, zeroGradient everywhere else.
Conduction. There is no flow, so every condition that switches on flow
direction — inletOutlet, freestream — would look up a flux that does not
exist and fail. T is reduced to fixedValue at an inlet, pressure inlet, far
field or thermal wall and zeroGradient elsewhere. Nothing else is written.
Atmospheric. A velocity inlet or far field is replaced by the logarithmic
profile: atmBoundaryLayerInletVelocity, atmBoundaryLayerInletK,
atmBoundaryLayerInletEpsilon, atmBoundaryLayerInletOmega. A non-slip wall
gets atmEpsilonWallFunction, atmOmegaWallFunction and atmNutkWallFunction.
constant/turbulenceProperties is unchanged; only the boundary library differs,
and libatmosphericModels.so is added to controlDict’s libs.
Compressible. alphat is added: compressible::alphatWallFunction at a
wall, calculated elsewhere, and the geometric type on symmetry or periodic.
Buoyant. p becomes calculated and the pressure condition moves to
p_rgh — fixedFluxPressure where p would have been zeroGradient. alphat
is alphatJayatillekeWallFunction at a wall. A Boussinesq case registers no
thermo model, so externalWallHeatFluxTemperature is downgraded to fixedValue
— there is nothing for kappaMethod to look up.
Anything else. Any field none of the above names still gets a condition, or
the case is written with NOT ASSIGNED in it and stops on the first read:
fixedValue at an inlet, pressure inlet or far field; zeroGradient at a
pressure outlet, outflow or fan; and at a wall fixedValue for a vector field,
zeroGradient for a scalar.
Constraints
Section titled “Constraints”These are checked and reported on the Problems tab.
Patch names
Section titled “Patch names”A patch name becomes an OpenFOAM dictionary keyword, so:
| Rule | Message |
|---|---|
| Not empty | “A patch needs a name.” |
| Cannot start with a digit | “A patch name cannot start with a digit.” |
| Letters, digits and underscores only | “Letters, digits and underscores only — a patch name is an OpenFOAM dictionary keyword.” |
| Unique within the case | “There is already a patch called ‘…’.” |
Renaming a patch here does not rename it in an already generated mesh.
A new patch added by name is given a starting type guessed from the name: a name
containing inlet becomes a Velocity inlet, outlet a Pressure outlet,
farfield/freestream/external a Far field, and wall/body/ground a
Wall. Anything else is left unassigned.
Two-dimensional cases
Section titled “Two-dimensional cases”OpenFOAM has no two-dimensional solver. A 2-D case is a three-dimensional mesh
one cell thick whose side faces are declared empty, and the solver then drops
that direction entirely.
- A case marked two-dimensional needs at least one Empty (2D) patch. With none, the solver treats it as 3-D.
- One empty patch is enough and is the usual arrangement: the application’s own
blockMeshDictputs both thin faces into a single patch namedfrontAndBack, which is the standard OpenFOAM idiom. - Turning the two-dimensional switch on adds that patch; turning it off removes it.
- The thin direction cannot be the flow direction — that is the direction the answer is in.
Axisymmetric cases
Section titled “Axisymmetric cases”- Exactly two Wedge (axisymmetric) patches, one each side of the axis. Not one, not three. One of a pair is the common mistake and OpenFOAM’s own error for it names a field rather than the patch.
- A case cannot be both two-dimensional and axisymmetric. Empty and wedge are alternative ways of removing the same direction.
Everything else
Section titled “Everything else”- Every patch needs a condition, on every field, before the case can run.
- The patch list must match the mesh. When a mesh has been generated and the names disagree, the boundary list says which patches the mesh actually has and offers “Use the mesh’s patches”. Left alone, the solver stops on the first field it reads with an error that names a keyword rather than the problem.
- Something must fix the pressure level. With no Pressure outlet, Far field
or Outflow anywhere on the boundary, only pressure differences are
determined, and
pRefCell 0/pRefValue 0are written intofvSolutionto pin it. This is reported as information, not an error. - A Marine & Waves case needs a Wave inlet. Without one,
constant/wavePropertiesnames a patch that generates nothing.
Periodic
Section titled “Periodic”The application writes type cyclic; into every field and type cyclic; into
the mesh patch. It does not write a neighbourPatch entry, so the pairing
between the two halves of a cyclic patch has to already exist in the mesh — from
an imported mesh, or from a createPatch mesh operation.
Patch names on a generated mesh
Section titled “Patch names on a generated mesh”The background block gives its faces fixed names, which is what the boundary list starts from on a case with no imported mesh.
| Setting | Patches |
|---|---|
| Default | inlet, outlet, farfield |
| Split block faces | xMin, xMax, yMin, yMax, zMin, zMax |
| Two-dimensional | plus frontAndBack |
snappyHexMesh adds the body: one patch named body, or one patch per part when
the geometry has been split into parts.