The Ultimate Computational Fluid Dynamics Cheatsheet: Simulating Flow Physics

Introduction to Computational Fluid Dynamics (CFD)

Computational Fluid Dynamics is a branch of fluid mechanics that uses numerical methods and algorithms to solve and analyze problems involving fluid flows. CFD enables engineers and scientists to perform “virtual experiments” within a computational environment to predict fluid behavior, heat transfer, mass transfer, chemical reactions, and related phenomena.

Why CFD Matters:

  • Reduces the need for costly physical prototypes and experiments
  • Provides detailed visualization of flow fields difficult to measure experimentally
  • Enables analysis of systems under hazardous conditions or extreme environments
  • Allows parametric studies to optimize designs efficiently
  • Complements theoretical and experimental approaches to fluid dynamics
  • Provides insights into complex flow phenomena across scales (from microfluidics to atmospheric flows)

Core Equations and Principles

Governing Equations

EquationDescriptionConservation Principle
Continuity Equation∂ρ/∂t + ∇·(ρu) = 0Mass conservation
Momentum Equation (Navier-Stokes)ρ(∂u/∂t + u·∇u) = -∇p + ∇·τ + ρgMomentum conservation
Energy Equationρ(∂e/∂t + u·∇e) = -p∇·u + ∇·(k∇T) + ΦEnergy conservation
Species Transport∂(ρYᵢ)/∂t + ∇·(ρuYᵢ) = ∇·(ρD∇Yᵢ) + SᵢSpecies conservation

Where:

  • ρ: density
  • u: velocity vector
  • p: pressure
  • τ: stress tensor
  • g: gravitational acceleration
  • e: internal energy
  • k: thermal conductivity
  • T: temperature
  • Φ: viscous dissipation function
  • Yᵢ: mass fraction of species i
  • D: diffusion coefficient
  • Sᵢ: source term for species i

Fundamental Dimensionless Numbers

NumberFormulaPhysical MeaningSignificance
Reynolds (Re)ρUL/μInertial forces / Viscous forcesFlow regime (laminar vs turbulent)
Mach (Ma)U/cFlow velocity / Speed of soundCompressibility effects
Froude (Fr)U/√(gL)Inertial forces / Gravitational forcesFree surface flows
Weber (We)ρU²L/σInertial forces / Surface tensionMultiphase flows
Prandtl (Pr)ν/αMomentum diffusivity / Thermal diffusivityHeat transfer characteristics
Nusselt (Nu)hL/kConvective / Conductive heat transferHeat transfer effectiveness
Courant (CFL)U∆t/∆xDistance flow travels in timestep / Grid spacingNumerical stability criterion

Discretization Methods

Finite Difference Method (FDM)

  1. Divide domain into grid points
  2. Approximate derivatives using Taylor series expansions
  3. Replace derivatives in governing equations with difference approximations
  4. Solve resulting algebraic system

Advantages: Simple implementation, structured grids Disadvantages: Complex geometries difficult, conservation not guaranteed

Finite Volume Method (FVM)

  1. Divide domain into control volumes
  2. Integrate governing equations over control volumes
  3. Apply Gauss divergence theorem to convert volume integrals to surface integrals
  4. Approximate fluxes at surfaces
  5. Solve resulting algebraic system

Advantages: Conservative, handles complex geometries, physically intuitive Disadvantages: Higher-order accuracy more difficult to achieve

Finite Element Method (FEM)

  1. Divide domain into elements
  2. Define shape functions within elements
  3. Apply weighted residual method
  4. Assemble global system of equations
  5. Solve resulting algebraic system

Advantages: Handles complex geometries, higher-order accuracy Disadvantages: More complex implementation, may require special treatment for advection

Spectral Methods

  1. Represent solution as series of basis functions (e.g., Fourier series)
  2. Substitute into governing equations
  3. Solve for coefficients

Advantages: High accuracy for smooth solutions, efficient for periodic problems Disadvantages: Limited to simple geometries, sensitive to discontinuities

Solution Algorithms

Pressure-Velocity Coupling Schemes

AlgorithmDescriptionCharacteristics
SIMPLESemi-Implicit Method for Pressure-Linked EquationsStandard method, robust but slow convergence
SIMPLECSIMPLE-ConsistentBetter convergence for simple flows
PISOPressure Implicit with Splitting of OperatorsGood for transient problems, no iterations within timestep
PIMPLECombined PISO-SIMPLEHybrid suitable for both steady and transient flows
CoupledDirect coupling of pressure and velocityFaster convergence, higher memory usage

Time Advancement Schemes

SchemeOrderFormulationProperties
Explicit EulerFirstu^(n+1) = u^n + Δt·f(u^n)Simple, conditionally stable (CFL < 1)
Implicit EulerFirstu^(n+1) = u^n + Δt·f(u^(n+1))Unconditionally stable, dissipative
Crank-NicolsonSecondu^(n+1) = u^n + Δt/2·[f(u^n) + f(u^(n+1))]Unconditionally stable, less dissipative
Runge-KuttaSecond-FourthMulti-stage approachHigher accuracy, explicit variants
BDFSecond-SixthBackward Differentiation FormulasGood for stiff problems

Turbulence Modeling

Approaches to Turbulence

ApproachResolutionComputational CostApplicability
DNS (Direct Numerical Simulation)All scales resolvedExtremely high (Re³)Fundamental research, low Re flows
LES (Large Eddy Simulation)Large scales resolved, small scales modeledHighComplex flows where RANS inadequate
RANS (Reynolds-Averaged Navier-Stokes)All scales modeledModerateIndustrial applications, high Re flows
DES (Detached Eddy Simulation)Hybrid LES/RANSIntermediateExternal aerodynamics, separated flows

Common RANS Turbulence Models

ModelEquationsStrengthsWeaknesses
Spalart-Allmaras1 equationEfficient, good for attached boundary layersLimited for complex flows
k-ε Standard2 equationsRobust, widely usedPoor for adverse pressure gradients
k-ε RNG2 equationsImproved for swirling flowsStill struggles with strong separation
k-ω Standard2 equationsGood near-wall treatmentFree-stream sensitivity
k-ω SST2 equationsGood for adverse pressure gradientsMore complex implementation
Reynolds Stress Model7 equationsCaptures anisotropic turbulenceComputationally expensive, stability issues

Boundary Conditions

Inlet Conditions

  • Velocity Inlet: Specify velocity components
  • Mass Flow Inlet: Specify mass flow rate
  • Pressure Inlet: Specify total pressure and temperature
  • Turbulence Specification: k-ε values, turbulence intensity, length scale

Outlet Conditions

  • Pressure Outlet: Specify static pressure
  • Outflow: Zero gradient for all variables (fully developed)
  • Mass Flow Outlet: Specify mass flow rate

Wall Conditions

  • No-Slip: Zero velocity at wall (u = 0)
  • Slip: Zero shear stress at wall (∂u/∂n = 0)
  • Wall Functions: Bridge solution between wall and fully turbulent region
  • Thermal: Adiabatic, constant temperature, or heat flux

Special Conditions

  • Symmetry: Zero normal velocity, zero normal gradients
  • Periodic/Cyclic: Values repeat across matching boundaries
  • Fan/Porous Media: Momentum source terms
  • Interface: Information transfer between non-conformal meshes

Mesh Generation and Quality

Mesh Types

  • Structured: Regular arrangement of cells, implicit connectivity
  • Unstructured: Irregular arrangement, explicit connectivity
  • Hybrid: Combination of structured and unstructured regions
  • Adaptive: Refines automatically based on solution gradients

Mesh Quality Metrics

MetricDefinitionAcceptable Range
Aspect RatioRatio of longest to shortest edge< 100 (lower is better)
SkewnessDeviation from equilateral element< 0.9 (lower is better)
OrthogonalityAngle between face normal and cell center vector> 0.15 (higher is better)
Expansion RatioSize ratio between adjacent cells< 1.2 (closer to 1 is better)
y+Dimensionless wall distance≈ 1 (resolving), 30-300 (wall functions)

Best Practices for Meshing

  • Refine in regions of high gradients (boundary layers, wakes, shocks)
  • Ensure smooth size transitions (growth ratio < 1.2)
  • Align mesh with expected flow direction when possible
  • Use boundary layer meshing near walls
  • Perform mesh sensitivity studies

Common CFD Software

Commercial Packages

  • ANSYS Fluent: Comprehensive general-purpose CFD software
  • ANSYS CFX: Strong in turbomachinery applications
  • Siemens Star-CCM+: Automated meshing and comprehensive physics
  • COMSOL Multiphysics: Coupled physics simulation
  • SolidWorks Flow Simulation: CAD-integrated CFD

Open-Source Solutions

  • OpenFOAM: Extensive library of solvers and utilities
  • SU2: Aerospace-focused CFD and optimization
  • Code_Saturne: General-purpose CFD from EDF
  • FEniCS: Finite element solver with high-level Python interface
  • Palabos: Lattice Boltzmann method framework

Verification and Validation

Verification Techniques

  • Grid Convergence Study: Systematic refinement to estimate discretization error
  • Richardson Extrapolation: Estimates exact solution from multiple grid solutions
  • Method of Manufactured Solutions: Creates exact solutions for code verification
  • Consistency Checks: Conservation of mass, energy, etc.
  • Convergence Monitoring: Residual reduction, solution monitoring

Validation Approaches

  • Comparison with Experiments: Direct comparison with physical tests
  • Comparison with Benchmark Solutions: Validated test cases
  • Uncertainty Quantification: Assess confidence in simulation results
  • Sensitivity Analysis: Effect of input parameters on outputs

Common Challenges and Solutions

Convergence Issues

  • Challenge: Solution divergence or stalled convergence
  • Solutions:
    • Start with lower-order discretization schemes
    • Use relaxation factors to dampen solution changes
    • Improve mesh quality in problematic regions
    • Initialize with better solution approximation
    • Step down from simpler physics models

High Computing Requirements

  • Challenge: Excessive computational demands
  • Solutions:
    • Use appropriate turbulence modeling for application
    • Apply local mesh refinement only where needed
    • Consider steady-state approximation when applicable
    • Implement parallel computing strategies
    • Use symmetry and periodicity to reduce domain size

Capturing Complex Physics

  • Challenge: Multiphysics coupling (combustion, multiphase, etc.)
  • Solutions:
    • Validate individual physics models separately
    • Use adaptive timestepping for stiff problems
    • Apply appropriate submodels for specific phenomena
    • Start simple and incrementally add complexity
    • Consider scale-resolved simulations for critical regions

Best Practices

Pre-Processing

  • Define clear simulation objectives and required accuracy
  • Simplify geometry to essential features
  • Ensure CAD cleanup (remove small features, fix gaps)
  • Perform mesh sensitivity studies
  • Apply appropriate boundary conditions
  • Initialize with physically realistic values

Solving

  • Monitor both residuals and physical quantities
  • Use steady-state formulation when appropriate
  • Start with robust, lower-order schemes
  • Progress to higher-order methods after initial convergence
  • Document all solver settings and assumptions

Post-Processing

  • Verify conservation principles
  • Compare with analytical solutions where possible
  • Visualize results using multiple techniques
  • Extract quantitative data at key locations
  • Perform uncertainty analysis
  • Document workflow for reproducibility

Resources for Further Learning

Textbooks

  • “An Introduction to Computational Fluid Dynamics: The Finite Volume Method” by Versteeg and Malalasekera
  • “Computational Fluid Dynamics: Principles and Applications” by Blazek
  • “Computational Methods for Fluid Dynamics” by Ferziger and Perić
  • “Turbulence Modeling for CFD” by Wilcox
  • “Computational Fluid Mechanics and Heat Transfer” by Tannehill, Anderson, and Pletcher

Online Courses

  • edX: “Computational Fluid Dynamics” by TU Delft
  • Coursera: “Intro to CFD” by University of Colorado Boulder
  • LearnCAx: “Applied Computational Fluid Dynamics”
  • NASA CFD Online Resources

Communities and Forums

  • CFD Online (cfd-online.com)
  • SimScale Community
  • OpenFOAM Community
  • ANSYS Customer Portal
  • Stack Exchange Computational Science

Journals

  • Journal of Computational Physics
  • Computers & Fluids
  • International Journal for Numerical Methods in Fluids
  • Flow, Turbulence and Combustion
  • Physics of Fluids

This cheatsheet provides a foundation for understanding and applying Computational Fluid Dynamics. The field continues to evolve with advances in high-performance computing, machine learning integration, and multiphysics coupling capabilities.

Scroll to Top