CFD Boundary Conditions: The Physics, Mathematics and Numerical Implementation
Understand the physical principles, mathematical foundations and numerical implementation of CFD boundary conditions, including Dirichlet, Neumann and Robin conditions, inlet and outlet treatments, wall conditions, symmetry, periodicity, thermal boundaries, turbulence inputs, and practical OpenFOAM examples.
CFD Boundary Conditions: The Physics, Mathematics and Numerical Implementation
1. Introduction: Why Boundary Conditions Matter in CFD
Imagine that you want to simulate water flowing through a pipe.
You know the pipe diameter, its length, the fluid properties and perhaps the average inlet velocity. You create a computational mesh, select a turbulence model and choose a numerical solver.
But one important question remains:
How does the fluid enter the pipe, what happens when it leaves, and how does it interact with the pipe walls?
These questions describe the boundary conditions of the problem.
Boundary conditions (BCs) specify how the physical quantities being solved behave at the boundaries of a computational domain. They tell the numerical solver what information is known at the boundaries and how the solution should interact with the surrounding physical environment.
In Computational Fluid Dynamics (CFD), the governing equations describe the behaviour of fluid inside the computational domain. However, those equations alone are generally insufficient to obtain a unique solution.
The mathematical problem also requires appropriate initial conditions, boundary conditions and, in some cases, reference conditions.
Consider a simple pipe-flow simulation:
- At the inlet, fluid enters with a known velocity.
- At the outlet, the fluid discharges into an environment with a known pressure.
- At the pipe walls, the fluid cannot penetrate the solid surface.
- At the walls, viscosity causes the fluid velocity to match the wall velocity under the conventional no-slip assumption.
Each of these physical observations must be translated into mathematical and numerical instructions.
A CFD simulation can have an excellent mesh, a suitable turbulence model and a well-converged numerical solution, yet still predict the wrong physical behaviour if its boundary conditions are inappropriate.
This is why boundary-condition selection is not simply a software configuration task. It is an essential part of physical modelling.
Learning objectives
After reading this article, you should be able to:
- Understand why boundary conditions are necessary in mathematical and numerical modelling.
- Distinguish between Dirichlet, Neumann and Robin boundary conditions.
- Understand the physical meaning of inlet, outlet, wall, symmetry and periodic conditions.
- Select appropriate boundary conditions for velocity, pressure, temperature and turbulence variables.
- Understand the relationship between boundary conditions and numerical stability.
- Identify common boundary-condition mistakes.
- Implement basic boundary conditions in OpenFOAM.
- Develop a systematic approach to defining and checking boundary conditions in CFD.
2. What Is a Computational Domain?
Before discussing boundary conditions, it is useful to understand the computational domain.
A computational domain is the region of physical space in which the governing equations are solved numerically.
For example, consider fluid flowing through a straight pipe.
The actual physical pipe may be several metres long. However, the CFD model only needs to represent the region relevant to the engineering question.
The computational domain might contain:
- An inlet section.
- A straight pipe section.
- An outlet section.
- The pipe walls.
The boundaries of this domain are divided into different patches.
Each patch represents a physical or mathematical boundary where specific information must be supplied.
Example: Flow through a pipe

Laminar pipe-flow velocity profile by Ryan Toomey, University of South Florida, licensed under CC BY-SA 4.0 via Wikimedia Commons.
For a simplified pipe-flow model, we can identify three important boundary types:
| Boundary | Physical meaning | Typical information |
|---|---|---|
| Inlet | Fluid enters the domain | Velocity or mass flow rate |
| Outlet | Fluid leaves the domain | Static pressure or another suitable outflow condition |
| Wall | Fluid interacts with the solid pipe | Wall velocity and thermal condition |
The boundary conditions are applied to the corresponding patches of the computational mesh.
An important distinction is that the boundary of the computational domain does not always correspond to a physical wall.
An inlet and an outlet are often artificial boundaries introduced because the actual physical system extends beyond the region being simulated.
This distinction becomes important when choosing boundary conditions.
For example, a pipe wall is a physical surface. A computational outlet, on the other hand, is often an artificial surface placed somewhere downstream of the region of interest.
The artificial outlet should be located where its imposed condition does not significantly distort the physical flow being investigated.
3. The Mathematical Foundations of Boundary Conditions
Most CFD problems involve partial differential equations (PDEs).
A PDE describes how a physical quantity changes with respect to multiple independent variables, such as spatial coordinates and time.
For example, temperature may vary with position and time:
Here:
- is temperature.
- are spatial coordinates.
- is time.
A governing equation describes how this temperature field evolves inside the computational domain.
However, we also need to specify what happens at the boundaries.
Three fundamental mathematical categories are particularly important:
- Dirichlet boundary conditions.
- Neumann boundary conditions.
- Robin boundary conditions.
Understanding these three types provides a foundation for interpreting many practical CFD boundary conditions.
3.1 Dirichlet boundary condition: Specify the value
A Dirichlet boundary condition specifies the value of a variable directly at a boundary.
Mathematically:
where:
- is the physical variable being solved.
- is its prescribed boundary value.
For example, consider water entering a pipe at a uniform velocity of .
At the inlet:
This is a Dirichlet condition for the velocity field.
Similarly, if a metal surface is maintained at a constant temperature of , its temperature boundary condition is:
Physical interpretation:
You are telling the solver exactly what value the variable must have at that boundary.
Examples include:
- Specified inlet velocity.
- Specified inlet temperature.
- Fixed wall temperature.
- Prescribed pressure at an outlet.
- Specified concentration at an inlet.
In OpenFOAM, a common implementation is:
type fixedValue;
value uniform 2;
The actual value must have the correct dimensions and match the field being solved.
3.2 Neumann boundary condition: Specify the gradient
A Neumann boundary condition specifies the spatial derivative of a variable normal to the boundary.
Mathematically:
Here, is the prescribed normal gradient.
To understand this equation, we need to understand the mathematical operator involved.
What does the gradient operator mean?
The gradient of a scalar quantity is represented by:
The symbol , called the del or nabla operator, describes how a scalar field changes in space.
For example, if temperature increases rapidly along the x-direction, then the x-component of its gradient is large.
The gradient points in the direction of the greatest increase of the scalar field.
The normal derivative is obtained by taking the dot product of the gradient with the outward unit normal vector:
Here:
- describes the spatial variation of the field.
- is a unit vector perpendicular to the boundary.
- The dot product extracts the component of the gradient normal to the boundary.
This means that a Neumann condition controls how a variable changes as we move across the boundary.
Example: Insulated wall
Consider heat transfer through a solid wall.
If the wall is perfectly insulated, no heat can pass through it.
Fourier’s law gives the conductive heat flux:
where:
- is heat flux in .
- is thermal conductivity in .
- is the temperature gradient.
The heat flux normal to a surface is:
For a perfectly insulated wall:
Therefore:
This is a zero-gradient Neumann boundary condition.
Physical interpretation:
The temperature is not necessarily constant along the wall. Instead, it does not change in the direction normal to the insulated surface.
For example, the temperature may vary from one location to another along the wall while no heat passes through the wall.
In OpenFOAM, a common zero-gradient condition is:
type zeroGradient;
3.3 Robin boundary condition: Combine value and gradient
A Robin boundary condition combines the value of a variable and its normal gradient.
A general mathematical form is:
where , and are specified coefficients or functions.
A familiar physical example is convective heat transfer between a solid surface and a surrounding fluid.
Newton’s law of cooling gives:
where:
- is the heat flux from the surface.
- is the convective heat-transfer coefficient.
- is the surface temperature.
- is the ambient fluid temperature.
Combining this with Fourier’s law gives:
The precise sign depends on the direction chosen for the surface normal and heat flux.
This is a Robin-type thermal boundary condition.
Physical interpretation:
The heat transfer depends on both the surface temperature and the temperature difference between the surface and its surroundings.
This is more realistic than simply fixing the wall temperature when the wall exchanges heat with an environment through convection.
3.4 Comparing the three fundamental types
| Type | What is specified? | Physical example |
|---|---|---|
| Dirichlet | Variable value | Fixed inlet velocity |
| Neumann | Normal gradient | Insulated wall |
| Robin | Combination of value and gradient | Convective heat transfer |
These three mathematical types form the foundation of many practical boundary conditions used in CFD software.
However, a software boundary condition such as a pressure outlet or a symmetry plane may combine several mathematical requirements and solver-specific treatments.
It is therefore important not to assume that every practical CFD boundary condition is simply a direct one-to-one equivalent of one mathematical type.
4. Understanding Mathematical Operators Used in CFD Boundary Conditions
Boundary-condition equations frequently use mathematical operators. Understanding their physical meaning helps prevent the equations from becoming just symbolic expressions.
Consider the following operators.
4.1 Gradient operator:
As discussed earlier, the gradient describes the spatial rate and direction of change of a scalar field.
For temperature:
Physical meaning:
It tells us how quickly temperature changes in each spatial direction.
4.2 Divergence operator:
The divergence measures the net outward flow of a vector field per unit volume.
For velocity:
where , and are the velocity components.
For incompressible flow:
Physical meaning:
For a small fluid volume, the amount of fluid entering must balance the amount leaving.
There is no local accumulation of mass for constant-density incompressible flow.
The divergence operator is particularly important when defining velocity and mass conservation at boundaries.
4.3 Laplacian operator:
The Laplacian is the divergence of the gradient:
For a three-dimensional scalar field:
Physical meaning:
It describes how the gradient itself changes in space.
The Laplacian appears in diffusion processes, including heat conduction and viscous momentum transport.
For example, the heat-conduction equation contains:
because temperature differences drive heat diffusion.
4.4 Dot product:
The dot product extracts the component of one vector along another.
For a boundary normal vector:
This represents the velocity component normal to the boundary.
It is important because fluid can cross a boundary only through its normal velocity component.
The tangential velocity describes motion along the boundary.
4.5 Boundary-normal derivative
The derivative normal to a surface is:
This is particularly important for walls.
For example, at an impermeable wall, the normal velocity must satisfy:
At an insulated thermal wall:
The first condition restricts fluid movement through the wall. The second restricts conductive heat transfer through the wall.
They describe two different physical phenomena.
5. Boundary Conditions for Fluid Flow
The Navier-Stokes equations describe the conservation of mass and momentum in fluid flow.
For incompressible Newtonian flow with constant properties, the continuity equation is:
The momentum equation can be written as:
where:
- is the velocity vector.
- is time.
- is fluid density.
- is pressure.
- is kinematic viscosity.
- represents body forces per unit mass.
Let’s interpret the important terms.
Local acceleration:
This describes how velocity changes with time at a fixed location.
Convective acceleration:
This describes velocity changes experienced by a moving fluid particle as it travels through spatially varying velocity fields.
Pressure-gradient force:
This represents the acceleration caused by spatial pressure differences.
Viscous diffusion:
This represents the diffusion of momentum due to viscosity.
Boundary conditions must be specified so that these governing equations can be solved for the velocity and pressure fields.
The appropriate conditions depend on the physical situation and the numerical formulation.
6. Inlet Boundary Conditions
An inlet boundary represents a location where fluid enters the computational domain.
The inlet condition should describe the incoming flow as realistically as possible.
Depending on the problem, the available information may include:
- Uniform velocity.
- Fully developed velocity profile.
- Mass flow rate.
- Volumetric flow rate.
- Total pressure.
- Temperature.
- Turbulence intensity and length scale.
- Species concentrations.
6.1 Uniform velocity inlet
This is one of the simplest inlet conditions.
Consider water entering a straight pipe with an average velocity of:
A uniform inlet condition assumes that velocity is constant across the inlet surface.
For flow along the x-direction:
This can be appropriate when:
- The inlet flow is approximately uniform.
- The upstream flow is not being modelled.
- The inlet is sufficiently far from the region of interest.
- A simple initial simulation is being developed.
However, real pipe flow is not always uniform across its cross-section.
For example, fully developed laminar pipe flow has a parabolic velocity profile.
A uniform inlet may therefore introduce an artificial development region.
6.2 Fully developed laminar pipe-flow inlet
For fully developed laminar flow in a circular pipe, the velocity distribution is:
where:
- is the axial velocity at radial position .
- is the average velocity.
- is the pipe radius.
At the pipe centreline:
At the wall:
The profile is parabolic because of viscous momentum transport and the no-slip wall condition.
Using this profile at the inlet can avoid simulating the entire hydrodynamic development region when fully developed laminar flow is already known to exist upstream.
6.3 Mass-flow inlet
Sometimes the flow rate is known more accurately than the velocity profile.
The mass flow rate is:
where:
- is mass flow rate in .
- is density.
- is inlet area.
- is average normal velocity.
Therefore:
Practical example
Consider water entering a pipe with:
- Diameter:
- Mass flow rate:
- Density:
The pipe area is:
The average inlet velocity is:
This is a useful example of how physical operating information can be converted into a CFD boundary condition.
6.4 Turbulent inlet profiles
For turbulent flow, the inlet velocity distribution may be more complicated.
A fully developed turbulent pipe flow has a relatively flatter velocity profile than fully developed laminar flow, with a steep velocity gradient near the wall.
Depending on the engineering application, the inlet can be specified using:
- A measured velocity profile.
- A synthetic turbulent velocity field.
- A prescribed mean velocity profile with turbulence quantities.
- A precursor simulation.
- A suitable turbulence-development section.
The choice depends on the required accuracy and the distance between the inlet and the region of interest.
For a turbulence-modelled simulation, specifying only the mean velocity may not be sufficient. Turbulence quantities must also be initialized or prescribed consistently with the selected model.
7. Outlet Boundary Conditions
An outlet represents the location where fluid leaves the computational domain.
This boundary is often more difficult to define than it first appears.
A common mistake is to assume that every outlet can simply be assigned zero pressure and zero velocity gradient.
The correct treatment depends on the physical problem, the flow regime and the location of the outlet.
7.1 Pressure outlet
A common condition for incompressible flow is a specified static pressure at the outlet.
For example:
This value often represents gauge pressure relative to an arbitrary reference.
It does not necessarily mean that the absolute pressure is zero.
For an incompressible solver, the pressure field often acts as a kinematic pressure or a pressure relative to a reference state, depending on the formulation.
The exact dimensions and interpretation must be checked for the solver being used.
7.2 Zero-gradient velocity at an outlet
A common velocity outlet condition is:
This means that the normal gradient of the velocity components is set to zero at the boundary.
In simple terms, the solver extrapolates the velocity field from the nearby internal cells rather than imposing an independent velocity value.
This is often appropriate when the flow is predominantly leaving the domain and the outlet is located sufficiently far downstream.
7.3 Why outlet location matters
Consider a cylinder placed in a uniform flow.
The flow separates behind the cylinder, creating a wake with vortices and recirculation.
If the computational outlet is placed immediately behind the cylinder, the outlet boundary may interfere with the wake development.
This can distort:
- Vortex shedding.
- Pressure distribution.
- Drag coefficient.
- Velocity fluctuations.
- Wake recovery.
Moving the outlet farther downstream can reduce these artificial influences.
However, the required distance is problem-dependent. It should be checked through domain-size sensitivity studies.
7.4 Backflow at the outlet
An outlet boundary is often assumed to have flow leaving everywhere.
But in separated or unsteady flows, local reverse flow may occur.
For example, a large recirculation region may extend to the outlet boundary.
In that case, fluid may enter the computational domain through part of the outlet.
This creates a problem if the boundary condition does not define the incoming properties appropriately.
The solver may require values for incoming:
- Velocity.
- Temperature.
- Turbulence quantities.
- Species concentration.
- Other transported scalars.
Some CFD solvers provide inlet-outlet or opening-type conditions that switch behaviour depending on the direction of local flow.
However, these conditions do not eliminate the need to understand the physical origin of backflow.
If backflow is persistent, the outlet may be too close to the region of interest or the computational domain may need to be redesigned.
The OECD Nuclear Energy Agency’s guidance discusses outlet backflow and recommends careful treatment of the incoming properties when reverse flow occurs.
Reference: https://www.oecd-nea.org/nsd/docs/2020/csni-r2020-3.pdf
7.5 Pressure outlet versus mass-flow outlet
These two conditions represent different physical information.
A pressure outlet specifies the pressure environment into which the fluid discharges.
A mass-flow outlet specifies the amount of fluid leaving the domain.
For example:
- A pipe discharging into a large reservoir may be modelled using a suitable pressure condition.
- A system with a prescribed downstream pump or flow-control requirement may need a flow-rate condition.
They should not be selected interchangeably without considering the actual physical system.
8. Wall Boundary Conditions
Walls represent solid surfaces in contact with the fluid.
For conventional viscous fluid-flow simulations, the most common wall assumption is the no-slip condition.
8.1 No-slip wall condition
The no-slip condition states that the fluid velocity at the wall equals the wall velocity:
For a stationary wall:
This means that the fluid velocity at the wall is zero relative to the stationary wall.
Why does this happen?
Viscosity causes momentum exchange between adjacent fluid layers. At a conventional solid-fluid interface, the fluid is assumed to move with the solid surface.
The velocity changes from the wall value to the velocity of the outer flow over a finite distance.

Idealized Blasius boundary-layer profile. Source: Olivier Cleynen via Wikimedia Commons (CC0 1.0).
This creates a velocity gradient and wall shear stress.
For a Newtonian fluid:
where:
- is wall shear stress.
- is dynamic viscosity.
- is the tangential velocity component.
- is the wall-normal direction.
The exact sign depends on the orientation of the normal and the definition of shear stress.
Physical interpretation:
The velocity gradient near the wall determines the viscous force exerted by the fluid on the wall.
This is important for:
- Pressure losses in pipes.
- Aerodynamic drag.
- Skin friction.
- Heat transfer.
- Boundary-layer development.
- Turbomachinery performance.
8.2 Slip wall condition
A slip wall allows the fluid to move tangentially along the surface while preventing penetration through it.
The impermeability condition is:
The tangential shear stress is generally constrained to vanish for an ideal free-slip boundary.
This is different from a no-slip wall.
A slip condition can be useful when modelling:
- Idealized inviscid flow.
- Symmetry-like surfaces.
- Certain far-field or simplified boundaries.
It should not normally be used to represent an ordinary viscous solid wall when wall friction is important.
8.3 Moving wall condition
Consider a conveyor belt moving at .
The fluid touching the belt moves with the belt under the no-slip assumption.
Therefore:
This is a moving-wall boundary condition.
Applications include:
- Rotating machinery.
- Moving belts.
- Sliding surfaces.
- Lubrication systems.
- Rotating cylinders.
- Wind-tunnel moving-ground simulations.
8.4 Rough wall condition
Real engineering surfaces are not perfectly smooth.
Pipe roughness, surface coatings, manufacturing tolerances and erosion can influence the near-wall velocity distribution and friction losses.
In turbulent CFD, roughness is often represented through wall functions or specialized rough-wall models.
The correct approach depends on:
- Physical roughness height.
- Roughness distribution.
- Flow Reynolds number.
- Selected turbulence model.
- Near-wall mesh strategy.
It is important to distinguish between explicitly resolved surface geometry and a modelled roughness correction.
They are not equivalent approaches.
9. Symmetry Boundary Conditions
Symmetry allows us to reduce the size of a computational domain when the physical problem and its solution are symmetric.
Consider flow through a straight pipe with symmetric geometry and symmetric inlet conditions.
Instead of modelling the entire domain, we may be able to simulate only half of it.
The cut surface becomes a symmetry plane.
For velocity, the normal component must vanish:
The normal gradients of scalar variables are generally zero:
The tangential velocity components are not forced to zero.
This is an important difference between symmetry and a no-slip wall.
Physical interpretation
Imagine looking at a mirror.
The flow on one side of the symmetry plane should be a mirror image of the flow on the other side.
There should be no net flow through the symmetry plane.
For a symmetry condition to be valid, the geometry, boundary conditions and expected solution must all support the assumed symmetry.
It should not be used merely to reduce computational cost if the real flow can develop asymmetric structures.
For example, a nominally symmetric geometry may develop asymmetric vortex shedding or other unstable flow structures.
In such cases, a symmetry restriction may prevent the physically relevant behaviour from developing.
10. Periodic Boundary Conditions
Periodic boundary conditions are used when the flow repeats spatially.
Instead of modelling the entire physical system, a smaller representative section can be simulated.
Consider fully developed flow in a long straight pipe.
If the geometry and flow conditions repeat along the pipe, a periodic computational section may be sufficient.
For a pair of corresponding periodic boundaries:
where is the translation vector connecting the periodic boundaries.
For velocity:
In a pressure-driven periodic pipe-flow calculation, the mean pressure gradient or an equivalent driving force may need to be specified separately.
A periodic pressure field does not automatically provide the pressure drop needed to drive the flow.
Applications
- Fully developed pipe flow.
- Repeating heat-exchanger passages.
- Turbine blade passages.
- Periodic channel flow.
- Repeating lattice structures.
- Representative sections of repeated geometries.
Important distinction
A symmetry boundary mirrors the solution.
A periodic boundary connects one boundary to another through a specified spatial transformation.
They represent different physical assumptions.
11. Boundary Conditions for Heat Transfer
Boundary conditions are equally important in thermal CFD.
The energy equation describes how temperature changes due to convection, conduction and potentially other physical processes.
For a simplified constant-property incompressible fluid:
where:
- is temperature.
- is velocity.
- is thermal diffusivity.
- represents thermal sources per unit temperature per unit time in this simplified formulation.
The left-hand side represents local and convective temperature transport.
The right-hand side contains thermal diffusion and sources.
Different thermal boundary conditions describe different physical heating and cooling situations.
11.1 Fixed temperature boundary
A fixed-temperature boundary prescribes the wall temperature.
For example:
This may represent:
- A surface maintained by a temperature-control system.
- A heated plate with nearly constant surface temperature.
- An idealized thermal reservoir.
In OpenFOAM:
type fixedValue;
value uniform 350;
11.2 Fixed heat-flux boundary
Sometimes the heat supplied to a surface is known, rather than its temperature.
The conductive heat flux is:
For a specified heat flux:
For example, an electrical heater may supply:
This represents a specified thermal input.
The resulting wall temperature is calculated by the simulation.
11.3 Adiabatic wall
An adiabatic wall does not exchange heat with its surroundings.
Therefore:
For conduction:
This is a zero-gradient temperature condition for a stationary, non-conducting boundary in the idealized model.
11.4 Convective heat-transfer boundary
A real surface may exchange heat with surrounding air.
For example, a hot electronic component is cooled by air moving over its surface.

Schematic of natural-convection cells. Diagram by Eyrian and Con-struct via Wikimedia Commons, licensed under CC BY-SA 3.0.
Newton’s law of cooling gives:
where:
- is the heat-transfer coefficient.
- is surface temperature.
- is ambient temperature.
The surface temperature is not known in advance.
Instead, it depends on the balance between conduction inside the solid and convection at the external surface.
This is a Robin-type boundary condition.
11.5 Conjugate heat transfer
Conjugate heat transfer (CHT) involves solving heat transfer in both a solid and a fluid.
For example, consider a hot metal plate cooled by flowing air.
The simulation must represent:
- Heat conduction inside the solid.
- Heat transfer at the solid-fluid interface.
- Heat transport by the fluid.
- The temperature field in both regions.
At an ideal solid-fluid interface, temperature continuity is:
Heat-flux continuity is:
when the normals and sign conventions are chosen consistently.
Here:
- is solid thermal conductivity.
- is fluid thermal conductivity.
- is solid temperature.
- is fluid temperature.
Physical interpretation:
Heat leaving one side of the interface must enter the other side, assuming there is no interfacial heat generation or contact resistance.
This is a central principle in conjugate heat-transfer modelling.
Applications include:
- Data-centre cooling.
- Electronics cooling.
- Heat exchangers.
- Battery thermal management.
- Turbine blade cooling.
- Engine thermal analysis.
12. Boundary Conditions for Turbulence Models
Turbulence modelling introduces additional transported variables.
For example, the standard - model solves equations for:
- Turbulent kinetic energy, .
- Turbulent dissipation rate, .
The - family solves equations for:
- Turbulent kinetic energy, .
- Specific dissipation rate, .
These quantities also require appropriate boundary conditions.
12.1 Turbulence intensity
Turbulence intensity is commonly defined as:
where:
- is the root-mean-square velocity fluctuation.
- is a representative mean velocity.
For approximately isotropic turbulence:
where is the representative mean velocity magnitude.
This relationship is often used to estimate inlet turbulent kinetic energy from turbulence intensity.
Example
Suppose the inlet mean velocity is:
and the estimated turbulence intensity is:
Then:
This gives an approximate inlet value for turbulent kinetic energy.
It is an estimate based on the isotropic-fluctuation assumption, not a universal relationship for every turbulent flow.
12.2 Turbulence length scale
The turbulence length scale, , represents a characteristic size of energy-containing turbulent structures.
A common engineering estimate is:
where:
- is a model coefficient.
- is turbulent kinetic energy.
- is turbulent dissipation rate.
Rearranging:
This allows an approximate inlet dissipation rate to be estimated when the turbulence length scale is known.
For internal flows, a length scale related to the hydraulic diameter is sometimes used as an engineering approximation.
However, the appropriate turbulence length scale depends on the physical inlet and the turbulence model.
12.3 Estimating specific dissipation rate
For a common - formulation, an approximate inlet estimate is:
This is a common engineering conversion, but exact relationships depend on the selected model and its coefficient definitions.
Always consult the turbulence-model documentation.
12.4 Wall treatment and turbulence conditions
Turbulence quantities near walls require special attention.
Depending on the turbulence model and wall treatment, the solver may use:
- Wall functions.
- Low-Reynolds-number near-wall modelling.
- Blended wall treatment.
- Model-specific wall conditions.
The mesh resolution must be consistent with the selected treatment.
For example, a wall-resolved - SST simulation may require a first-cell-centre location corresponding to approximately:
A wall-function approach may instead target a different near-wall range, depending on the model and implementation.
The exact requirement must be checked in the relevant solver documentation.
A turbulence inlet condition should also be physically reasonable.
Arbitrarily selecting turbulence intensity and length scale can influence pressure drop, separation, heat transfer and downstream turbulence development.
13. Initial Conditions Versus Boundary Conditions
Initial conditions and boundary conditions are related, but they describe different things.
Initial conditions
Initial conditions specify the starting state of the computational domain.
For example:
This means that the fluid initially has zero velocity everywhere in the domain.
Similarly:
means that the initial temperature is uniformly 300 K.
Boundary conditions
Boundary conditions specify how variables behave at the boundaries during the simulation.
For example:
and:
These conditions continue to influence the solution as the simulation progresses.
Physical example
Imagine starting a simulation of water flowing through an initially stationary pipe.
At time zero:
- Velocity inside the pipe is zero.
- Temperature is initially 300 K.
During the simulation:
- Water enters through the inlet.
- Pressure is controlled at the outlet.
- The pipe wall remains stationary.
The initial conditions describe the starting state.
The boundary conditions describe the continuing interaction with the environment.
A simulation can converge to the wrong physical solution even when the initial conditions are reasonable if the boundary conditions are incorrect.
14. Boundary Conditions and Well-Posedness
A mathematical problem should be sufficiently constrained to obtain a meaningful solution.
This is often discussed through the concept of a well-posed problem.
In a simplified sense, a well-posed problem should have:
- A solution.
- A unique solution.
- A solution that changes continuously when the input data change slightly.
Boundary conditions are essential to achieving this.
14.1 Under-specified problems
Imagine a one-dimensional heat-conduction problem:
Its general solution is:
There are two unknown constants.
Therefore, two independent boundary constraints are required to determine the solution uniquely.
For example:
These two conditions determine the temperature distribution.
If only one condition is provided, the solution is not uniquely determined.
14.2 Over-constrained problems
The opposite problem occurs when too much or conflicting information is imposed.
For example, consider a simple incompressible pipe-flow problem.
Suppose the inlet velocity and outlet pressure are prescribed.
If additional independent velocity constraints are imposed at the outlet without a physical reason, the problem may become over-constrained or numerically inconsistent.
The exact compatibility depends on the governing equations and solver formulation.
14.3 Pressure reference in incompressible flow
In many incompressible-flow formulations, pressure is determined through a pressure-Poisson equation or a pressure-correction procedure.
Only pressure differences may affect the velocity solution.
Consequently, the absolute pressure level may be undetermined.
A reference pressure is then needed to remove this mathematical ambiguity.
This is why an outlet pressure of zero gauge pressure is common in many incompressible simulations.
It establishes a reference level; it does not imply that the physical fluid has zero absolute pressure.
14.4 A practical principle
Specify the physical information that is known, rather than imposing arbitrary values simply because the software requests them.
The NAFEMS guidance on CFD convergence identifies inappropriate and conflicting boundary conditions as common causes of convergence problems and incorrect predictions.
Reference:
https://www.nafems.org/publications/guidelines-for-good-convergence-in-cfd/boundary-conditions/
15. Boundary Conditions and the Direction of Information Propagation
Boundary-condition requirements are also influenced by the flow regime.
This is especially important in compressible flow.
For example, the number and type of conditions required at an inlet or outlet depend on whether the flow is subsonic or supersonic.
The Mach number is:
where:
- is flow speed.
- is the local speed of sound.
Subsonic flow
For subsonic flow:
Pressure disturbances can propagate upstream and downstream.
Therefore, downstream pressure information can influence the upstream flow.
Supersonic flow
For supersonic flow:
Disturbances cannot propagate upstream through the flow in the same way.
At a supersonic inlet, more flow properties generally need to be specified than at a subsonic inlet.
At a supersonic outlet, imposing a downstream static pressure may be inappropriate because the flow is not able to communicate that information upstream through the supersonic region.
This is why compressible CFD requires special attention to characteristic-based boundary conditions.
The general lesson is that boundary conditions are linked to the mathematical nature of the governing equations and the direction in which information can propagate.
16. Practical Boundary-Condition Selection for Common CFD Problems
The following table provides conceptual starting points. These are not universal prescriptions; the exact settings depend on the solver, flow regime and physical problem.
| Application | Inlet | Outlet | Walls |
|---|---|---|---|
| Internal pipe flow | Velocity or mass flow | Static pressure | No-slip |
| External aerodynamics | Freestream velocity | Pressure/far-field | No-slip |
| Natural convection | Suitable thermal and flow conditions | Open/far-field | Thermal wall condition |
| Heat exchanger | Mass flow or velocity, temperature | Pressure | Thermal/CHT interface |
| Turbomachinery | Total pressure/temperature or flow specification | Suitable pressure/flow condition | Moving or rotating walls |
| Periodic channel flow | Periodic driving condition | Periodic | No-slip |
| Fully developed pipe section | Periodic | Periodic | No-slip |
A useful habit is to write down the physical meaning of each boundary before opening the CFD software.
For example:
| Patch | Physical description | Information known |
|---|---|---|
| Inlet | Water enters the pipe | Mass flow rate |
| Outlet | Pipe discharges to a reservoir | Reservoir pressure |
| Wall | Stationary pipe wall | No-slip and heat-flux condition |
This physical description can then be translated into the mathematical and software conditions.
17. Implementing Boundary Conditions in OpenFOAM
OpenFOAM represents boundary conditions through patch-field dictionaries in the field files.
These files are generally located in the initial time directory, commonly named 0.
For example:
0/
├── U
├── p
├── T
├── k
├── epsilon
└── omega
The mesh boundary names must match the patch names used in these files.
A typical field file contains:
boundaryField
{
inlet
{
type fixedValue;
value uniform (2 0 0);
}
outlet
{
type zeroGradient;
}
walls
{
type noSlip;
}
}
The exact boundary-condition names and their availability depend on the OpenFOAM version, solver and field type.
17.1 Velocity field: U
For a simple incompressible pipe-flow case:
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (2 0 0);
}
outlet
{
type zeroGradient;
}
walls
{
type noSlip;
}
}
Interpretation:
- The internal velocity is initially zero.
- The inlet velocity is fixed at 2 m/s in the x-direction.
- The outlet velocity is extrapolated using a zero-gradient condition.
- The stationary walls use the no-slip condition.
The dimensions entry represents the physical dimensions of velocity.
17.2 Pressure field: p
For a typical incompressible pressure-velocity formulation:
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 0;
}
walls
{
type zeroGradient;
}
}
This is a common conceptual pairing for an incompressible velocity-inlet and pressure-outlet problem.
However, pressure conditions in OpenFOAM are solver-dependent.
For example, some solvers and configurations require fixedFluxPressure or other specialized conditions to ensure consistency between pressure gradients and the prescribed flux.
Do not blindly copy this configuration into every solver.
17.3 Temperature field: T
For a heated pipe with a prescribed wall temperature:
dimensions [0 0 0 1 0 0 0];
internalField uniform 300;
boundaryField
{
inlet
{
type fixedValue;
value uniform 300;
}
outlet
{
type zeroGradient;
}
walls
{
type fixedValue;
value uniform 350;
}
}
Interpretation:
- Fluid enters at 300 K.
- Temperature is allowed to develop naturally at the outlet.
- The pipe wall is maintained at 350 K.
This is a simplified thermal-flow example.
A real CHT simulation would instead solve the temperature field in the fluid and solid regions and couple their interface conditions.
17.4 Turbulence field: k
A simplified example is:
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0.375;
boundaryField
{
inlet
{
type fixedValue;
value uniform 0.375;
}
outlet
{
type zeroGradient;
}
walls
{
type kqRWallFunction;
value uniform 0.375;
}
}
This example illustrates the structure of a turbulence-field dictionary.
It should not be treated as a universally valid wall setup. The correct wall condition depends on the turbulence model, near-wall treatment and OpenFOAM implementation.
17.5 Understanding fixedValue, zeroGradient and noSlip
| OpenFOAM condition | General meaning |
|---|---|
fixedValue | Prescribes a field value |
zeroGradient | Prescribes zero normal gradient |
fixedGradient | Prescribes a normal gradient |
noSlip | Sets velocity equal to stationary wall velocity |
slip | Enforces an ideal slip condition |
symmetryPlane | Applies symmetry constraints |
cyclic | Couples periodic patches |
inletOutlet | Handles outflow and reverse-flow behaviour using specified inlet values |
OpenFOAM has many specialized conditions beyond these basic examples.
The official documentation provides a categorized list and explains the implementation details.
References:
- https://doc.openfoam.com/2306/tools/processing/boundary-conditions/
- https://www.openfoam.com/documentation/user-guide/5-models-and-physical-properties/5.1-boundary-conditions
- https://www.openfoam.com/documentation/user-guide/a-reference/a.4-standard-boundary-conditions
18. Practical Case Study: Turbulent Flow Through a Circular Pipe
Let’s combine the concepts into a practical CFD problem.
Problem description
Consider turbulent water flow through a straight circular pipe.
Assume:
| Parameter | Value |
|---|---|
| Pipe diameter | 0.1 m |
| Pipe length | 5 m |
| Mean inlet velocity | 2 m/s |
| Fluid density | 1000 kg/m³ |
| Dynamic viscosity | 0.001 Pa·s |
| Kinematic viscosity | |
| Inlet temperature | 300 K |
| Wall temperature | 350 K |
The purpose is to study the velocity, pressure and temperature distributions.
Step 1: Calculate the Reynolds number
The Reynolds number is:
Substituting:
This indicates turbulent flow in a conventional straight-pipe context.
Step 2: Define the physical boundaries
We identify three primary boundaries:
- Inlet.
- Outlet.
- Pipe wall.
Step 3: Select boundary conditions
| Variable | Inlet | Outlet | Wall |
|---|---|---|---|
| Velocity | Prescribed inlet profile | Suitable outflow condition | No-slip |
| Pressure | Consistent with velocity/flux specification | Reference static pressure | Suitable wall pressure condition |
| Temperature | 300 K | Suitable outflow condition | 350 K |
| Turbulence | Estimated from inlet turbulence data | Suitable outflow condition | Model-specific wall treatment |
Step 4: Estimate the inlet turbulence kinetic energy
Assume an inlet turbulence intensity of 5%.
This gives an approximate inlet turbulence kinetic energy.
The turbulence length scale and corresponding dissipation variables should be estimated using a physically justified model-specific approach.
Step 5: Consider the outlet position
The outlet should be placed far enough downstream that the velocity and pressure fields near the region of interest are not artificially influenced by the outlet boundary.
A domain-length sensitivity study can be used to check whether the predicted pressure drop and velocity profile change when the outlet is moved farther away.
Step 6: Verify the mass flow rate
The mass flow rate at the inlet is:
For the pipe:
Therefore:
The mass flow entering and leaving the domain should be consistent for a steady incompressible calculation.
For a transient calculation, temporary mass accumulation within the domain must also be considered.
Step 7: Check physical and numerical consistency
Before accepting the simulation, check:
- Does the inlet velocity correspond to the intended mass flow rate?
- Are the pressure and velocity boundary conditions compatible with the solver?
- Is the outlet sufficiently far from the region of interest?
- Are the turbulence inputs physically justified?
- Is the near-wall mesh compatible with the wall treatment?
- Is the temperature boundary condition representative of the physical heating arrangement?
- Is mass conservation satisfied?
The simulation should not be considered credible merely because the residuals have decreased.
19. Common Boundary-Condition Mistakes in CFD
Boundary-condition errors can produce incorrect results even when the numerical solver converges.
The following mistakes are particularly common.
Mistake 1: Using a uniform inlet profile for every problem
A uniform inlet may be suitable for a simple external-flow case, but it may not represent a fully developed internal flow.
An unrealistic inlet profile can create artificial flow development and influence the region being investigated.
Better approach: Use measured, calculated or appropriately developed inlet profiles when the upstream flow structure matters.
Mistake 2: Placing the outlet too close to the region of interest
A nearby outlet may interfere with recirculation, vortex shedding, pressure recovery or other flow structures.
Better approach: Extend the domain downstream and perform an outlet-location sensitivity study.
Mistake 3: Ignoring reverse flow
If flow enters through a boundary that was intended only for outflow, incoming properties may be undefined or unrealistic.
Better approach: Investigate why reverse flow occurs. Move the boundary if appropriate, or use a suitable inflow/outflow condition with physically justified incoming values.
Mistake 4: Assigning arbitrary turbulence quantities
Turbulence intensity and length scale strongly influence the inlet turbulence fields.
Better approach: Use experimental information, upstream calculations, physical estimates or sensitivity studies.
Mistake 5: Confusing zero pressure with zero absolute pressure
A zero pressure condition in an incompressible solver often represents a gauge or reference pressure.
Better approach: Understand the pressure variable and its reference convention.
Mistake 6: Using slip walls for ordinary viscous solid surfaces
A slip condition removes the conventional wall shear constraint.
This can significantly change drag and pressure-loss predictions.
Better approach: Use no-slip walls when modelling ordinary viscous fluid-solid interfaces unless the physics supports another assumption.
Mistake 7: Using symmetry without verifying physical symmetry
A symmetry condition prevents certain asymmetric behaviours from developing.
Better approach: Confirm that the geometry, forcing and expected flow structures support symmetry.
Mistake 8: Applying a fixed temperature when the physical condition is a heat flux
A prescribed wall temperature and prescribed wall heat flux represent different physical problems.
Better approach: Use the available experimental or engineering information to select the thermal condition.
Mistake 9: Ignoring dimensional consistency
Boundary values must have the correct physical dimensions.
For example:
- Velocity: .
- Pressure: , or the solver’s specified pressure convention.
- Temperature: .
- Heat flux: .
- Turbulent kinetic energy: .
Better approach: Check the dimensions of every prescribed field and the conventions of the selected solver.
Mistake 10: Treating convergence as proof of correctness
A numerically converged simulation can still represent the wrong physical problem.
Better approach: Check conservation, physical plausibility, boundary sensitivity and validation data.
20. How to Develop a Systematic Boundary-Condition Strategy
A good CFD workflow should begin with physical reasoning, not software menus.
The following process is useful for most engineering simulations.
Step 1: Understand the physical system
Ask:
- What is entering the domain?
- What is leaving the domain?
- What solid surfaces are present?
- Is the system open or closed?
- Is the flow steady or transient?
- Is heat transfer important?
- Are chemical species or multiple phases involved?
Step 2: Identify the available information
Determine which quantities are known from:
- Experimental measurements.
- Design specifications.
- Operating conditions.
- Analytical solutions.
- Upstream simulations.
- Manufacturer data.
Do not prescribe values that have no physical basis without clearly identifying them as modelling assumptions.
Step 3: Identify the mathematical requirements
For every solved variable, determine whether the physical information is best represented through:
- A prescribed value.
- A prescribed gradient or flux.
- A mixed condition.
- A coupled condition.
- A specialized inflow/outflow treatment.
Step 4: Check compatibility with the governing equations
Consider:
- Mass conservation.
- Momentum conservation.
- Energy conservation.
- Compressibility.
- Pressure-velocity coupling.
- Turbulence-model requirements.
Step 5: Select the numerical implementation
Only after the physical and mathematical conditions are understood should you select the corresponding software boundary conditions.
Step 6: Perform sensitivity studies
Change uncertain inputs and boundary locations to determine whether the main results are sensitive to them.
For example:
- Increase the downstream domain length.
- Change the assumed inlet turbulence intensity.
- Compare uniform and developed inlet profiles.
- Compare plausible outlet treatments.
- Investigate the influence of wall roughness.
Step 7: Verify the final solution
Check:
- Mass conservation.
- Momentum and energy balances.
- Pressure distribution.
- Velocity profiles.
- Wall shear stress.
- Heat transfer.
- Sensitivity to boundary assumptions.
A well-defined boundary-condition strategy makes the entire CFD simulation more physically meaningful.
21. Further Learning and Recommended References
The following resources provide useful explanations of mathematical boundary conditions, practical CFD implementation and engineering best practices.
1. OpenFOAM Official Documentation – Boundary Conditions
https://doc.openfoam.com/2306/tools/processing/boundary-conditions/
A useful reference for understanding how OpenFOAM organizes boundary conditions and applies them to field patches.
2. OpenFOAM User Guide – Boundary Conditions
Explains common boundary conditions, including fixed-value, gradient, symmetry, inlet, outlet and wall treatments.
3. OpenFOAM Standard Boundary Conditions
https://www.openfoam.com/documentation/user-guide/a-reference/a.4-standard-boundary-conditions
A useful technical reference when translating physical requirements into OpenFOAM dictionary settings.
4. NAFEMS – Boundary Conditions
https://www.nafems.org/publications/guidelines-for-good-convergence-in-cfd/boundary-conditions/
Discusses the influence of boundary-condition selection on convergence and physical accuracy.
5. CFD University – How to Implement Boundary Conditions in CFD
Provides an educational explanation of mathematical boundary-condition types and their practical implementation in CFD.
6. OECD Nuclear Energy Agency – CFD-Grade Experiments for Nuclear Reactor Thermal Hydraulics
https://www.oecd-nea.org/nsd/docs/2020/csni-r2020-3.pdf
A more advanced reference discussing experimental requirements, boundary-condition uncertainties and outlet treatment in thermal-hydraulic CFD.
22. Suggested Practical Learning Exercises
The best way to understand boundary conditions is to change them in a controlled numerical experiment and observe how the solution responds.
Here are five exercises suitable for students and new CFD researchers.
Exercise 1: Uniform versus developed inlet profile
Simulate laminar flow through a circular pipe.
Compare:
- Uniform velocity at the inlet.
- Fully developed parabolic velocity at the inlet.
Observe:
- Velocity development.
- Pressure drop.
- Wall shear stress.
- Length required for the flow to become fully developed.
Learning objective: Understand how inlet conditions influence the development of an internal flow.
Exercise 2: Outlet location sensitivity
Simulate flow past a circular cylinder.
Create several computational domains with different downstream lengths.
Compare:
- Drag coefficient.
- Lift coefficient.
- Vortex shedding frequency.
- Wake velocity distribution.
Learning objective: Understand how an artificial outlet can influence the predicted physical flow.
Exercise 3: No-slip versus slip wall
Simulate flow in a simple channel.
Compare a no-slip wall with a slip wall.
Observe:
- Velocity distribution.
- Wall shear stress.
- Pressure drop.
Learning objective: Understand the physical significance of wall momentum transfer.
Exercise 4: Fixed temperature versus fixed heat flux
Simulate a heated channel.
Perform two separate calculations:
- Prescribe a fixed wall temperature.
- Prescribe a fixed wall heat flux.
Compare:
- Wall temperature.
- Fluid temperature.
- Total heat transferred.
- Temperature distribution along the channel.
Learning objective: Understand the difference between prescribing a thermal state and prescribing a thermal input.
Exercise 5: Turbulence inlet sensitivity
Simulate turbulent pipe flow using different inlet turbulence intensities.
For example:
- 1%.
- 3%.
- 5%.
- 10%.
Keep the other modelling assumptions consistent.
Compare:
- Turbulent kinetic energy.
- Velocity development.
- Pressure drop.
- Wall shear stress.
Learning objective: Understand why turbulence boundary conditions are an important source of modelling uncertainty.
23. Final Thoughts
Boundary conditions are among the most fundamental aspects of Computational Fluid Dynamics.
They connect the mathematical equations inside a computational domain to the physical world outside it.
A velocity inlet represents incoming momentum. A pressure outlet represents the pressure environment. A no-slip wall represents momentum exchange between fluid and solid. A fixed-temperature or heat-flux condition represents a particular thermal interaction.
These are not simply settings selected from a software interface. Each one represents a physical assumption that can influence the entire numerical solution.
One of the most important habits for a CFD researcher is to ask three questions before defining any boundary condition:
- What is happening physically at this boundary?
- What mathematical information does the governing equation require here?
- How does the selected numerical condition represent that physical information?
When these three questions are answered carefully, CFD simulations become more than numerical calculations. They become meaningful representations of real engineering systems.
Remember: A converged simulation is not necessarily a correct simulation. The quality of the physical assumptions, including the boundary conditions, determines how meaningful the results can be.
Article prepared as a standalone educational resource for students, early-career researchers and engineers learning Computational Fluid Dynamics.