grokkingstuff Home Blog Projects Wiki Calculators About

Boundary conditions -- types, well-posedness, practical setup

date2026-07-26tags:cfd: :boundary: :conditions: :setup: :inlet: :outlet: :wall:

Well-posedness of the boundary value problem

The Navier-Stokes equations are mixed-type. The pressure equation is elliptic. The convective terms are hyperbolic. Mixed-type equations have consequences for boundary conditions:

Well-posedness means three things: the correct BCs give a unique solution, and the solution changes continuously with the input data. An ill-posed BC set causes:

1. Instant divergence (usually over-specified with too many fixed values) 2. Non-convergence of residuals (often under-specified or conflicting) 3. Unphysical steady-state (usually wrong BC type for the flow regime) 4. Backflow at the outlet causes divergence (the characteristic direction has reversed)

Inlet boundary conditions

Velocity inlet / fixed-velocity

U equals U_inlet. Fixed inlet velocity is most common for external aerodynamics and internal pipe flows. The velocity profile at the inlet matters:

ProfileWhen to useKey effect
----------------------------------
Uniform (top-hat)Inlet far from any shearArtificially thin shear layer, slow natural development
Parabolic (Poiseuille)Pipe inlet, fully developed flowRealistic initial profile, correct initial shear
Log-lawPipe-duct inlet near turbulenceBest for LES, matching experiments
Power-law (boundary layer)Airfoil-flat-plate inletApproximate BL development, fast startup

Turbulence quantities at the inlet use these formulas:

Standard values for I: pipe flow is 1 to 5%. External aerodynamics is 0.1 to 2%. Indoor ventilation is 0.05 to 0.5%.

Pressure inlet

p = p_inlet + p_inlet_fluctuation(t). Pressure-inlet BCs are common for compressible flows. A nozzle inlet uses total pressure and temperature as the key inputs. These determine the static properties at the inlet. Low-Mach-number solvers treat a fixed total pressure as equivalent to a fixed static pressure at subsonic inlet.

Mass-flow inlet

Mass flow rate m-dot equals the integral of rho U dot n dA over A_inlet. A fixed flow rate (pump or motor simulations) requires fixing the mass flux instead of velocity. The solver adjusts the inlet velocity profile to deliver the target mass flow. In OpenFOAM, the BC name is massFlowInletVelocity.

Outlet boundary conditions

Fixed pressure / pressure-outlet

p = p_atm. velocity and all other variables use zero gradient. Fixed static pressure at the outlet is the standard choice for most low-Mach incompressible simulations. The zero-gradient for velocity works well for convectively-outflowing variables.

The danger is backflow. Backflow happens when the pressure gradient reverses. Flow enters the domain at the outlet. Recirculation zones cause this. The zero-gradient BC becomes wrong for incoming flow. OpenFOAM fixedValue outlet for velocity is not recommended if recirculation is possible. Use inletOutlet (with fixed inflow and zero-gradient outflow) or the zeroGradient option.

Outflow / zero-gradient

Zero gradient for all variables is the simplest outlet BC. This BC is consistent with physics only when far-downstream flow is sufficiently developed. Streamwise gradients must be negligible. Do not use it for:

Pressure far-field

p equals p_infinity and U equals U_infinity. Compressible external flows use a Riemann-invariant far-field BC. One characteristic enters the domain (supersonic inflow or subsonic inflow). One leaves (supersonic outflow or subsonic outflow). The Riemann invariant allows the solver to handle the combination of incoming and outgoing characteristics correctly. In OpenFOAM, fanPressureFvPatchVectorField handles inlet. waveTransmissive handles outlets. compressible TurbulentInlet handles far-field turbulence.

Wave-transmissive / non-reflecting

p + rho c u' = 0 defines the condition. A non-reflecting outlet minimizes spurious pressure-wave reflections. This BC is critical for:

Wall boundary conditions

No-slip wall

U = 0 defines the standard viscous wall BC. To resolve the viscous sublayer for accurate wall shear stress, the mesh must resolve it too. Wall functions bypass this requirement by integrating the governing equations from the wall to the first off-wall node.

Resolutiony_1+Wall treatment
----------------------------------
Wall-resolved (DNS-LES-low-Re RANS)y_1+ less than or equal to 1No wall functions. Viscous sublayer resolved.
Wall-function RANS (standard)30 less than y_1+ less than 300Log-law integration
Wall-function RANS (enhanced)5 less than y_1+ less than 300Enhanced wall treatment (viscous sublayer plus buffer layer plus log-law)

Slip wall / symmetry

U dot n = 0 and U dot t = 0 defines no-slip symmetry. U dot n = 0 and partial(U dot t)/partial n = 0 defines slip symmetry. Symmetry and slip walls carry no viscous shear stress and block all mass flux.

Adiabatic wall / zero heat flux

partial T / partial n = 0 handles perfectly insulated walls.

Fixed temperature wall

T equals T_wall is common in heat transfer simulations. T_wall can be constant or a function of time. Transient heating and cooling use time-varying T_wall.

Periodic boundary conditions

phi(x, y, z) = phi(x + L_x, y + L_y, z + L_z) defines periodicity. Periodic BCs let you simulate a representative elementary volume (REV). The REV stands in for a much larger domain. Common uses:

In OpenFOAM, cyclic patches handle simple periodic BCs. cyclicAMI handles non-conformal periodic interfaces between meshes that do not align.

Interface and coupling boundary conditions

AMI (Arbitrary Mesh Interface)

AMI connects two non-conformal meshes. The interface is conservative. Mass, momentum, and energy are conserved across the interface. AMI uses surface interpolation (nearest-neighbor or weighted-least-squares) to map values from one patch to the other. m-dot_A plus m-dot_B equals 0 and p_A equals p_B.

AMI typeConservative?InterpolationUse case
--------------------------------------------------
AMIYes (default)Weighted interpolationRotating machinery, sliding mesh
nearestPatchFaceAMINoNearest-neighborFast, approximate
faceAreaWeightAMIYesFace-area weightedModerate accuracy

Coupled patches (internal faces)

phi_f = phi_plus and [n dot nabla phi] = 0. Internal faces between adjacent cells are coupled. The discretisation uses values from both cells to compute the flux. OpenFOAM uses the coupled BC type for internal faces. This is the default, so you do not need to specify it.

Common mistakes and debugging

MistakeSymptomFix
-----------------------
Fixed pressure plus fixed velocity at outletInstant divergence (over-specified)Remove pressure fix, use zeroGradient on velocity
Backflow at zeroGradient outletDivergence when Re or delta p highUse inletOutlet or totalPressure
Wall function with y_1+ less than 1Unphysical wall shear stressUse y_1+ greater than or equal to 30 or switch to low-y+ wall functions
Uniform inlet with shear layerSlow BL development (unphysical)Use parabolic or log-law profile
Slip wall where no-slip is neededZero drag, no boundary layerSwitch to noSlip

Cross-references