Previous: Boundary types Up: Boundary conditions in OpenFOAM Next: Inlet Boundary Conditions

This is an automatically generated documentation by LaTeX2HTML utility. In case of any issue, please, contact us at info@cfdsupport.com.

Boundary conditions ​

  • Boundary conditions are set in solution directories (0/U, …)


  • The most typical case is the velocity is prescribed at the inlet and static pressure is prescribed at the outlet.
sketch general boundary conditions

Figure: Test case geometry

  • Boundary conditions in OpenFOAM are divided into two groups by – basic and derived.
  • Basic boundary conditions by OpenFOAM implementation:

Boundary conditionDescriptionVariables
fixedValueconstant value at boundaryvalue
fixedGradientconstant gradientgradient
zeroGradientzero gradient (extrapolation)
calculateddepending on other quantities
mixedmix from other boundary conditionsrefValue, refGradient,
  valueFraction, value
directionMixedanisotropic BC mixed,refValue, refGradient,
 valueFraction is tensorvalueFraction, value


  • OpenFOAM has many derived boundary conditions
  • Some examples follow
  • Derived boundary conditions are stored on the path:
    • $FOAM_SRC/finiteVolume/fields/fvPatchFields/derived
    • or can be found by following command:
      # find $FOAM_SRC -name "*derivedFvPatch*"
      # find $FOAM_SOLVERS -name "*derivedFvPatch*"


  • Derived boundary conditions based on fixedValue

totalPressuretotal pressure is constant,$ p_0$
 static pressure is computed 
pressureInletVelocityif known pressure at inletvalue
 velocity is computed from flux 
pressureDirectedInletVelocityif known pressure at inletvalue,
 velocity is computed from fluxinletDirection
 velocity direction is respected 
movingWallVelocitymoving wallvalue
surfaceNormalFixedValuevelocity magnitude is kept,value
 direction is perpendicular 
 to domain 
turbulentInletcalculates a fluctuatingreferenceField
 variable based on a scale offluctuationScale
 a mean value 



  • Derived boundary conditions based on fixedGradient/zeroGradient boundary condition

fluxCorrectedVelocityNormal component is computedvalue
wallBuoyantPressureSets pressure gradient valuevalue
 according to atmospheric pressure 



  • Derived boundary conditions based on mixed boundary condition

inletOutletswitching between fixedValueinletValue,
 and zeroGradientvalue
 depending on flow direction 
outletInletswitching between fixedValueoutletValue,
 and zeroGradientvalue
 depending on flow direction 
pressureInletOutletVelocitycombination of pressureInletVelocityvalue
 and inletOutlet 
pressureDirectedInletOutletVelocitycombination ofvalue,
 and inletOutlet 
pressureTransmissivetransmitting supersonic pressure wavespInf
supersonicFreeStreamtransmits shocks to surroundingspInf, TInf, UInf



  • Another derived boundary conditions

slipslipping wall
partialSlipcombines slip and zeroGradientvalueFraction
 depending on valueFraction 
 (0 = slip) 
noSlipfixes the velocity to zero
 at the walls