50% OFF - Ends Soon!

Lesson 6 of 13 20 min

Boundary Conditions

A CFD problem is not just the governing equations — it's the equations plus boundary conditions. The solution inside the domain is entirely determined by what happens at the boundaries. Wrong boundary conditions guarantee wrong answers, regardless of mesh quality or solver settings.

The Mathematical Necessity

The Navier-Stokes equations are a system of PDEs. For a well-posed problem, we need:

  • Existence: A solution exists
  • Uniqueness: Only one solution exists
  • Stability: Small changes in BCs → small changes in solution

This requires specifying the right number and type of boundary conditions:

Sponsored

Srinithin now works at Xitadel as Design Engineer

Mechanical engineering graduate turned automotive designer

See His Journey
EquationTypeRequired BCs
Continuity1st order in $p$1 condition somewhere
Momentum2nd order in $\mathbf{u}$2 conditions per direction
Energy2nd order in $T$2 conditions

Types of Boundary Conditions

Click each boundary type to see how it's implemented and when to use it.

1. Inlet Conditions

Purpose: Specify fluid entering the domain. Common specifications:
TypeVariables SpecifiedUse Case
Velocity inlet$u, v, w, k, \epsilon$Known velocity profile
Mass flow inlet$\dot{m}$, directionFixed mass flow rate
Pressure inlet$p_0, T_0$Compressible/HVAC
Turbulence$k, \epsilon$ or $I, L$Turbulent flows
Implementation (velocity inlet):

At inlet face $f$:

  • $u_f = u_{specified}$
  • $\phi_f = \phi_{specified}$ for all transported scalars
Turbulence specification:

If turbulence intensity $I$ and length scale $L$ are given:

$$k = \frac{3}{2}(U_{avg} \cdot I)^2$$

Sponsored

Get an IIT Jammu PG certification

Recognized by Mahindra, Bosch, TATA ELXSI & 500+ companies

See Program Details

$$\epsilon = C_\mu^{3/4} \frac{k^{3/2}}{L}$$

2. Outlet Conditions

Purpose: Allow fluid to leave the domain without reflecting back. Types:
TypeSpecificationPhysics
Pressure outlet$p = p_{specified}$Subsonic exit to atmosphere
Outflow$\frac{\partial \phi}{\partial n} = 0$Fully developed flow
Mass flow outlet$\dot{m} = \dot{m}_{specified}$Fixed extraction
Implementation (pressure outlet):
  • Pressure: $p_f = p_{specified}$
  • Velocity: Extrapolated from interior
  • Scalars: Zero gradient $\frac{\partial \phi}{\partial n} = 0$
Warning: Place outlets far from regions of interest. Flow should be nearly uniform at the outlet.

3. Wall Conditions

Purpose: Model the fluid-solid interface. No-slip condition:

$$\mathbf{u}_{wall} = \mathbf{0}$$ (for stationary walls)

For thermal:
  • Fixed temperature: $T_{wall} = T_{specified}$
  • Heat flux: $q''_{wall} = q''_{specified}$
  • Convection: $q'' = h(T_{wall} - T_\infty)$
Implementation:

The no-slip condition is a Dirichlet condition — velocity at the wall cell face is set directly. For the momentum equation:

Sponsored

Master CATIA, NX, LS-DYNA, HyperMesh, ANSYS

The exact tools used by Mahindra, Bosch & TATA ELXSI

🎯 3,000+ Engineers Placed
Sponsored
Harshal Sukenkar

Harshal

Fiat Chrysler

Abhishek

Abhishek

TATA ELXSI

Srinithin

Srinithin

Xitadel

Ranjith

Ranjith

Core Automotive

Gaurav Jadhav

Gaurav

Automotive Company

Bino K Biju

Bino

Design Firm

Aseem Shrivastava

Aseem

EV Company

Puneet

Puneet

Automotive Company

Vishal Kumar

Vishal

EV Startup

See All Tools

$$a_P u_P = \sum a_{nb} u_{nb} + S + a_{wall} \cdot 0$$

Where $a_{wall}$ includes the wall shear stress contribution.

4. Symmetry/Slip Conditions

Purpose: Reduce domain size using physical or geometric symmetry. Conditions: Use cases: Warning: Only use symmetry if the flow is truly symmetric. Unsteady flows with vortex shedding are NOT symmetric.

5. Periodic Conditions

Purpose: Model repeating geometries. Types: Implementation: Values on one periodic boundary are copied to the matching boundary, treating them as neighbors.

Wall Functions

Visualize the law of the wall and how wall functions bridge the near-wall region.

The Near-Wall Challenge

Turbulent boundary layers have extreme gradients near the wall. Resolving them requires:

Solution: Wall functions — empirical formulas that bridge the viscous sublayer.

The Law of the Wall

In the logarithmic region ($30 < y^+ < 300$):

$$u^+ = \frac{1}{\kappa} \ln(y^+) + B$$

Where:

How Wall Functions Work

$$\tau_w = \frac{\rho u_P u_\tau}{u^+}$$ $$k_P = \frac{u_\tau^2}{\sqrt{C_\mu}}$$

$$\epsilon_P = \frac{u_\tau^3}{\kappa y_P}$$

Standard vs Enhanced Wall Functions

Approachy+ RangeAccuracyCost
Standard wall function30-300ModerateLow
Enhanced (blended)1-300HigherModerate
Low-Re (resolve)~1HighestHigh
Guidelines:

Numerical Implementation

Ghost Cell Method

For FVM, boundary conditions are often implemented using ghost cells:

Interior cells:    [ P ] [ E ]
                     |
Boundary face:  =====|=====
                     |
Ghost cell:        [ G ]

The ghost cell value $\phi_G$ is set based on the BC type:

Coefficient Modification

Alternatively, modify the discretization coefficients:

For a Dirichlet condition $\phi_{wall} = \phi_0$:

For a Neumann condition $\frac{\partial \phi}{\partial n} = q$:

Common Boundary Condition Mistakes

MistakeSymptomSolution
Outlet too closeReversed flow at outletExtend domain
Wrong outlet BCNon-physical pressureUse pressure outlet
Missing turbulence at inletLaminar-like resultsSpecify $k, \epsilon$
Symmetry on asymmetric flowWrong flow patternsUse full domain
Wall function with $y^+ < 30$Incorrect wall shearAdjust mesh or model

Compressible Flow BCs

For compressible flows, boundary conditions are based on characteristic analysis:

Subsonic Inlet

Subsonic Outlet

Supersonic Inlet

Supersonic Outlet

Practical Guidelines

Inlet Placement

Outlet Placement

Domain Size (External Flows)

Checking BCs

Always verify:

Key Takeaways

What's Next

With boundaries specified, we need to discretize the convection terms. The next lesson covers Convection Schemes — how different interpolation methods (upwind, central, QUICK) affect accuracy and stability.

3,000+ Engineers Placed in Top Companies
Career Growth

3,000+ Engineers Placed in Top Companies

Join the ranks of successful engineers at Bosch, Tata, L&T, and 500+ hiring partners.

Mesh Generation & Quality