CFD Fundamentals — Governing Equations, Numerical Methods & Key Parameters
The three governing equations of fluid flow, finite volume method, dimensionless numbers, meshing fundamentals, and how to choose the right solver — the bedrock every CFD engineer needs.
By NovaSolver Contributors (Anonymous Engineers & AI) | CFD / Fluid Analysis | 日本語版 →
1. What is CFD?
I know CFD stands for Computational Fluid Dynamics, but what exactly is it computing? Like, what problem is it actually solving?
CFD numerically solves three coupled conservation laws that govern every fluid flow. Think of a river: mass can't appear or disappear (continuity), momentum changes only when forces act on the water (Navier-Stokes), and if the water warms near a hot rock, energy has to balance too (energy equation). These three laws together describe everything from the airflow over a racing car wing to coolant flow through a data center.
The governing equations in compact form:
Continuity (mass conservation): $\dfrac{\partial \rho}{\partial t} + \nabla \cdot (\rho \mathbf{u}) = 0$
Momentum (Navier-Stokes): $\rho\dfrac{D\mathbf{u}}{Dt} = -\nabla p + \nabla \cdot \boldsymbol{\tau} + \rho \mathbf{g}$
Energy: $\rho c_p \dfrac{DT}{Dt} = \nabla \cdot (k \nabla T) + \Phi$
where $\boldsymbol{\tau}$ is the viscous stress tensor and $\Phi$ is viscous dissipation. These are nonlinear partial differential equations — no closed-form solution exists for general geometries and flow conditions. That's why numerical methods are essential.
So we can't solve them analytically. But why do we need a computer specifically? Can't we just use pen and paper approximations?
Analytical solutions exist only for highly idealized cases — Poiseuille pipe flow, Stokes flow around a sphere, Couette flow between parallel plates. The moment you have a real geometry — a centrifugal pump impeller, a car door mirror, an aircraft engine inlet — boundary conditions become impossible to express analytically. A modern CFD mesh discretizes the domain into millions of small control volumes and solves a system of algebraic equations at every cell, iterating until convergence. That's essentially what OpenFOAM, Fluent, and Star-CCM+ do under the hood.
2. The Three Pillars of CFD
Pre-processing (Meshing)
Define geometry, generate the computational mesh, set boundary conditions and material properties. Mesh quality — cell skewness, aspect ratio, y+ — determines solution accuracy and stability. Typically 40–60% of total project time.
Solving (Numerics)
Discretize the governing equations over the mesh using FVM, FEM, or FDM. Solve the resulting sparse linear system iteratively (SIMPLE, PISO, PIMPLE algorithms). Monitor residuals for convergence.
Post-processing (Visualization)
Extract pressure distributions, velocity streamlines, temperature contours, force coefficients. Tools: ParaView (open-source), Tecplot, EnSight. Validate against experimental data or analytical benchmarks.
I've heard FVM, FEM, and FDM — they all discretize the equations but differently. Which one do most CFD codes use and why?
The vast majority of industrial CFD codes — OpenFOAM, Fluent, Star-CCM+ — use the Finite Volume Method (FVM). Here's why: FVM integrates the conservation equations over each control volume, so mass, momentum, and energy are conserved exactly at the cell level regardless of mesh quality. FDM approximates derivatives at grid points — simple to implement but requires structured meshes. FEM uses weighted residuals over elements and is dominant in structural mechanics, but less natural for convection-dominated flows. FVM hits the sweet spot: conservative, flexible on unstructured meshes, and well-proven over 40 years of industrial use.
3. Key Dimensionless Parameters in CFD
What are Reynolds number, Mach number, and Courant number? I see them constantly but I'm fuzzy on what each one is physically telling me.
Three completely different quantities, but each is diagnostic for a different aspect of the flow or the numerics:
Reynolds number — ratio of inertial to viscous forces:
$$Re = \frac{\rho U L}{\mu} = \frac{UL}{\nu}$$
Low Re (say, Re < 2000 for a pipe): laminar, smooth flow. High Re (Re > 4000 for pipe): turbulent, chaotic. Re tells you whether you need a turbulence model. A 1 mm micro-channel at Re = 0.01 needs no turbulence model; a wind turbine blade at Re = 10⁷ definitely does.
Mach number — ratio of flow speed to local speed of sound:
$$Ma = \frac{U}{a}, \qquad a = \sqrt{\gamma R T}$$
Ma < 0.3: incompressible assumption valid (density changes < 5%). Ma > 0.3: compressible effects become important; use density-based solvers. Ma > 1: supersonic — shocks appear. This number decides whether you solve incompressible Navier-Stokes or the full compressible Euler/N-S equations.
Courant number (CFL) — governs time-step stability in transient simulations:
$$Co = \frac{U \Delta t}{\Delta x}$$
For explicit time integration, Co < 1 is required for stability — it means a fluid parcel moves less than one cell per time step. Implicit schemes tolerate Co > 1, but accuracy degrades. In OpenFOAM's controlDict, setting maxCo 0.5 keeps transient simulations stable with auto time-stepping.
| Parameter | Formula | Physical Meaning | Design Threshold |
|---|---|---|---|
| Reynolds number (Re) | $UL/\nu$ | Inertia vs. viscosity; laminar/turbulent regime | Re < 2300 laminar; Re > 4000 turbulent (pipe) |
| Mach number (Ma) | $U/a$ | Compressibility effects | Ma < 0.3 incompressible; Ma > 1 supersonic |
| Courant number (Co) | $U\Delta t / \Delta x$ | Numerical stability of time integration | Co < 1 for explicit; Co ~ 5–20 acceptable implicit |
| Prandtl number (Pr) | $\nu / \alpha$ | Momentum vs. thermal diffusivity | Air ≈ 0.71; water ≈ 7; liquid metals < 0.1 |
| Strouhal number (St) | $fL/U$ | Ratio of oscillation frequency to flow frequency | Vortex shedding: St ≈ 0.2 (cylinder) |
4. Sub-Articles in This Section
5. Choosing the Right Solver for Your Problem
When I open OpenFOAM there are dozens of solvers — simpleFoam, pimpleFoam, rhoCentralFoam, interFoam. How do I know which one to use?
Start with three diagnostic questions: Is the flow incompressible or compressible (Ma)? Is it steady or transient? Is it single-phase or multiphase? Those three answers narrow it down fast. For most industrial problems — subsonic aerodynamics, HVAC, pipe flow — simpleFoam (steady, incompressible RANS) is the workhorse. Add a heat equation and you need buoyantSimpleFoam. If you have free surfaces, interFoam (VOF method). If Ma > 0.3, switch to rhoCentralFoam or sonicFoam.
| Flow Type | Compressibility | Time | Recommended Solver (OpenFOAM) | Commercial Equivalent |
|---|---|---|---|---|
| General internal / external flow | Incompressible (Ma < 0.3) | Steady | simpleFoam |
Fluent: steady pressure-based; Star: Segregated |
| Transient with large time steps | Incompressible | Transient | pimpleFoam |
Fluent: PISO transient; Star: Implicit Unsteady |
| Subsonic with buoyancy / heat | Incompressible + energy | Steady/Transient | buoyantSimpleFoam |
Fluent: Buoyancy-Driven; Star: CHT |
| Free surface (e.g., sloshing) | Incompressible | Transient | interFoam (VOF) |
Fluent: Multiphase VOF; Star: VOF |
| Transonic / supersonic | Compressible (Ma > 0.3) | Steady/Transient | rhoCentralFoam |
Fluent: Density-based; Star: Density-based |
| Combustion / reacting flow | Compressible + chemistry | Transient | reactingFoam |
Fluent: Species transport; Star: Combustion |
| Large Eddy Simulation | Incompressible | Transient | pimpleFoam + LES turb model |
Fluent: LES; Star: LES |
6. CFD Software Comparison
So besides OpenFOAM, there's Ansys Fluent, Siemens Star-CCM+, and others. What makes each one different? Is there a reason big companies pay for Fluent when OpenFOAM is free?
Each tool has a distinct character. OpenFOAM is free but text-based — you learn a lot by configuring case files manually, and it's highly customizable. Fluent has a polished GUI and excellent documentation — good for teams that need validated workflows fast. Star-CCM+ has the best integrated mesher (polyhedral auto-meshing) and is very strong in automotive and turbomachinery. SU2 is open-source and focused on aerospace shape optimization. The "free vs. paid" question in a company context is really "engineer time vs. license cost" — a $50,000/year Fluent license pays for itself if it saves a senior engineer two weeks per project.
| Software | License | Discretization | Strengths | Typical Users |
|---|---|---|---|---|
| OpenFOAM | Free (GPL) | FVM (unstructured) | Fully customizable, large community, HPC-ready | Research, startups, universities |
| Ansys Fluent | Commercial | FVM (unstructured) | Validated physics, excellent GUI, rich model library | Automotive, aerospace, energy |
| Siemens Star-CCM+ | Commercial | FVM (polyhedral) | Best-in-class auto-mesher, design exploration tools | Automotive OEM, marine, turbomachinery |
| ANSYS CFX | Commercial | FEM-based FVM | Rotating machinery, strong coupled solver | Turbomachinery, power generation |
| SU2 | Free (LGPL) | FVM (unstructured) | Adjoint-based shape optimization, aero design | Aerospace research, academic |
| COMSOL CFD | Commercial | FEM | Multiphysics coupling (electromagnetics, FSI) | MEMS, microfluidics, coupled physics |
7. Learning Path — CFD Fundamentals to Practice
- Navier-Stokes equation — physical meaning and incompressible form
- Finite volume method — how equations become algebraic systems
- Boundary conditions — inlet/outlet/wall/symmetry and their mathematical form
- Turbulence modeling — RANS overview, then k-ω SST specifically
- Meshing strategy — boundary layer inflation, y+ targeting
- Your first OpenFOAM case — cavity or pipe flow tutorial
- Validation — compare against analytical solution or experiment