Fluid Mechanics & Hydraulic Machines

Chapter 13
Computational Fluid Dynamics and Digital Engineering

Bachelors Program in Mechnical Engineering
Fluid Mechanics & Hydraulic Machines   •   Bachelor

Computational Fluid Dynamics and Digital Engineering

Introduction and context

Computational fluid dynamics (CFD) is the numerical solution of the governing equations of fluid motion, heat transfer, and, where relevant, mass transfer and chemical reaction. It is not a replacement for fluid mechanics; it is a method for evaluating approximate solutions to fluid-mechanics models. Digital engineering extends this idea by connecting simulation, experiments, operational data, design tools, and lifecycle decisions. A digital twin is a continuously updated digital representation of a physical asset or process, supported by data and a defined purpose.

CFD is valuable when experiments are expensive, hazardous, slow, or unable to reveal internal flow details. It is used in pumps, turbines, compressors, hydraulic systems, pipelines, vehicles, buildings, combustion devices, and biomedical equipment. However, a visually attractive contour plot is not evidence of accuracy. Geometry, boundary conditions, physical assumptions, mesh quality, numerical schemes, convergence, validation data, and uncertainty all determine whether a result is fit for purpose.

Learning objectives

After studying this chapter, a student should be able to:

  1. Explain why governing equations must be discretized for computation.
  2. Describe mesh generation and important finite-volume concepts.
  3. Select and interpret basic turbulence models.
  4. Distinguish iterative convergence, verification, validation, and uncertainty quantification.
  5. Plan a credible CFD study and communicate its limitations.
  6. Explain appropriate uses of digital twins and AI-assisted prediction.
  7. Recognize data-quality, cybersecurity, ethical, and governance requirements.

1. Governing equations and the modeling hierarchy

For a Newtonian fluid, the conservation of mass is expressed by the continuity equation:

∂ρ/∂t + ∇·(ρu) = 0

Here ρ is density (kg m⁻³), t is time (s), and u is the velocity vector (m s⁻¹). For an incompressible fluid of constant density, this reduces to ∇·u = 0.

The momentum equation for a Newtonian fluid may be written as:

∂(ρu)/∂t + ∇·(ρu⊗u) = −∇p + ∇·τ + ρg + f

where p is pressure (Pa), g is gravitational acceleration (m s⁻²), f represents other body-force density (N m⁻³), and τ is the viscous stress tensor (Pa). For a constant-viscosity incompressible fluid, τ = μ(∇u + ∇uT), where μ is dynamic viscosity (Pa s). The equation assumes a continuum description and Newtonian constitutive behavior.

An energy equation is required when temperature, compressibility, buoyancy, or heat transfer is important. Additional transport equations may describe species concentration, turbulence quantities, or reaction progress. Thus, a CFD problem consists of:

  • conservation laws;
  • constitutive models, such as viscosity or an equation of state;
  • initial conditions for transient problems;
  • boundary conditions at inlets, outlets, walls, symmetry planes, and interfaces; and
  • numerical choices for representing and solving the equations.

A useful modeling hierarchy is:

  1. Physical reality: the actual pump, pipe, or atmosphere.
  2. Mathematical model: conservation laws plus assumptions.
  3. Discrete model: algebraic equations on a finite mesh.
  4. Computer implementation: algorithms, solvers, and software.
  5. Engineering interpretation: decisions based on predictions and uncertainty.

An error introduced at an earlier level cannot generally be corrected by using a finer mesh at a later level.

2. Discretization: from differential equations to algebra

Differential equations define behavior continuously in space and time. A computer stores values at a finite number of locations or control volumes. Discretization replaces derivatives and integrals by algebraic approximations. Common approaches are:

  • Finite difference: derivatives are approximated at grid points. It is efficient on structured grids but less flexible for complex geometry.
  • Finite element: the governing equations are expressed in a weighted-residual form using interpolation or shape functions. It is powerful for complex domains and multiphysics.
  • Finite volume: integral conservation laws are applied to finite control volumes. Fluxes through faces are balanced, giving strong local conservation and making the method especially common in industrial CFD.

For a general transported scalar φ, a conservation equation can be written:

∂(ρφ)/∂t + ∇·(ρuφ) = ∇·(Γ∇φ) + Sφ

where Γ is the diffusion coefficient and Sφ is a source term. Integrating over a control volume V and applying the divergence theorem gives:

d/dt ∫V ρφ dV + ∮A ρφu·n dA = ∮A Γ∇φ·n dA + ∫V Sφ dV

A is the control-volume boundary and n is the outward unit normal. The first surface integral is convective transport; the second is diffusive transport. In a finite-volume method, each face flux is approximated and the contributions are assembled into an algebraic equation:

aP φP = ΣN aN φN + b

P denotes the current cell, N denotes neighboring cells, aP and aN are coefficients, and b contains sources, boundary contributions, and known terms. The exact coefficients depend on the time discretization, convection scheme, diffusion approximation, and linearization.

For a one-dimensional steady diffusion problem with constant Γ and uniform spacing Δx, the central-difference approximation is second-order accurate in space:

(d²φ/dx²)i ≈ (φi+1 − 2φi + φi−1)/(Δx)²

The approximation is appropriate when the solution is sufficiently smooth and the grid is regular. Near sharp gradients, discontinuities, or highly distorted cells, accuracy may deteriorate.

Convection schemes and boundedness

Convection-dominated flows can produce oscillations when a high-order central scheme is used on an insufficient mesh. First-order upwind schemes are generally robust but numerically diffusive: they smear gradients. Higher-order bounded schemes reduce false diffusion but may be more sensitive to mesh quality and nonlinear convergence. Scheme selection should be based on a mesh and sensitivity study, not on the desire for a visually sharp image.

The Courant number is important in transient calculations:

Co = |u|Δt/Δx

where Δt is the time step and Δx is a representative cell length. Its acceptable value depends on the time-integration scheme, spatial discretization, and flow problem. An implicit scheme can remain numerically stable at larger Co than an explicit scheme, but stability does not guarantee temporal accuracy.

3. Meshing and geometric representation

A mesh divides the fluid domain into cells. Structured meshes use an orderly connectivity pattern; unstructured meshes accommodate complex geometry; hybrid meshes combine approaches. Common cell types include hexahedra, tetrahedra, prisms, pyramids, and polyhedra.

Important mesh-quality measures include:

  • skewness: displacement of a cell center or face center from an ideal configuration;
  • non-orthogonality: deviation between the face-normal direction and the line joining neighboring cell centers;
  • aspect ratio: ratio of the longest to shortest characteristic dimension;
  • smoothness: rate at which neighboring cell sizes change; and
  • y⁺: nondimensional wall distance used to assess near-wall resolution.

For wall-bounded flow, the friction velocity is:

uτ = √(τw/ρ)

where τw is wall shear stress (Pa). The nondimensional wall distance is:

y⁺ = ρuτ y/μ = uτ y/ν

where y is the distance from the wall to the first cell-center point (m), and ν = μ/ρ is kinematic viscosity (m² s⁻¹). Wall-resolved models generally require the first computational point to be very close to the wall, often with y⁺ of order unity. Wall-function approaches place the first point in an empirically modeled logarithmic region, commonly with y⁺ in a higher range; the appropriate range depends on the wall function and solver. These are modeling requirements, not universal constants.

A credible mesh workflow is to:

  1. simplify geometry only when the removed detail is physically insignificant;
  2. refine at walls, separation regions, wakes, jets, interfaces, and strong curvature;
  3. maintain acceptable quality and gradual size transitions;
  4. document cell count, quality statistics, and near-wall treatment; and
  5. perform a mesh-sensitivity study using engineering outputs such as pressure drop, force, flow rate, or efficiency.
Finite-volume control volume and face fluxes P: control volume N N face flux face flux
Finite-volume control volume showing neighboring cells and face fluxes
Figure: Finite-volume control volume showing neighboring cells and face fluxes

Figure: A finite-volume cell balances convective and diffusive fluxes through its faces.

4. Turbulence modeling

The instantaneous velocity is often decomposed into mean and fluctuating parts: u = ū + u′. Substitution into the Navier–Stokes equations and averaging produces the Reynolds-averaged Navier–Stokes (RANS) equations. The averaging introduces the Reynolds-stress tensor −ρ overline(u′⊗u′), creating a closure problem.

Common engineering approaches are:

ModelMain ideaTypical strengthsMain cautions
RANSSolves time-averaged flow with modeled turbulence effectsLow computational cost; suitable for many steady engineering flowsCan poorly predict separation, unsteadiness, and anisotropy
k–εSolves turbulent kinetic energy k and dissipation εRobust for free-shear and fully turbulent flowsOften weaker near walls and in adverse pressure gradients without modifications
k–ω SSTBlends k–ω near walls with k–ε behavior away from wallsOften effective for adverse pressure gradients and turbomachinerySensitive to inlet turbulence and wall treatment
LESResolves large eddies and models smaller scalesCaptures unsteady coherent structuresExpensive; requires fine spatial and temporal resolution
DNSResolves all relevant scalesReference-quality fundamental dataUsually impractical for engineering Reynolds numbers

The Reynolds number indicates the relative importance of inertia and viscosity:

Re = ρUL/μ = UL/ν

U is a characteristic velocity (m s⁻¹), L a characteristic length (m), and ν kinematic viscosity (m² s⁻¹). Reynolds number alone does not select a turbulence model; geometry, transition, separation, buoyancy, rotation, compressibility, and required outputs also matter.

A turbulence model is a closure hypothesis. It does not make a coarse mesh equivalent to a resolved turbulent simulation. Model sensitivity should be examined when separation, mixing, fatigue loading, or efficiency is important.

5. Solvers, convergence, and numerical quality

CFD solvers commonly use segregated or coupled algorithms. Pressure–velocity coupling is required because pressure enforces mass conservation in incompressible flow. Iterative algorithms may include SIMPLE-type methods for steady problems and pressure-correction or coupled methods for transient problems.

A residual measures the imbalance of a discretized equation. A normalized residual may be expressed conceptually as:

R = ||r||/||r₀||

where r is the current algebraic residual vector and r₀ is a reference residual vector. Residual reduction is useful, but it is not the same as physical accuracy.

A calculation should be considered converged only after checking several indicators:

  • residuals have decreased sufficiently and stabilized;
  • global mass imbalance is acceptably small;
  • monitored forces, pressure drop, torque, or flow rate have become stable;
  • relevant integral balances close; and
  • further iterations do not materially change the engineering conclusion.

For a steady incompressible domain, the mass imbalance can be reported as:

εm = |ṁin − ṁout|/ṁref

where ṁ is mass flow rate (kg s⁻¹) and ṁref is a selected reference flow rate. The tolerance is application-dependent and should be stated, not assumed.

A transient flow may never reach a steady field. In that case, periodic statistics, time-averaged quantities, and time-step sensitivity are more meaningful than forcing residuals toward a steady-state solution.

6. Verification, validation, and uncertainty

Verification asks, “Is the mathematical model solved correctly?” It includes code verification, checking implementation against known solutions, and solution verification through mesh and time-step refinement. Validation asks, “Is the chosen model an adequate representation of the real system for this purpose?” It requires comparison with independent experimental or field data under comparable conditions.

These questions are distinct. Agreement with an experiment may result from compensating errors, while a correctly solved model may still omit an important physical mechanism.

For a scalar quantity Q, a relative comparison with experiment may be written:

Erel = |QCFD − Qexp|/|Qexp| × 100%

This metric is meaningful only when Qexp is nonzero and measurement uncertainty, operating conditions, and definitions of Q are compatible.

A grid-convergence study uses systematically refined meshes. If results Q₁, Q₂, and Q₃ are obtained on successively refined grids, a formal observed order can be estimated under restrictive assumptions of monotonic convergence and known refinement ratio. In practice, engineers should report the mesh levels, refinement ratios, output changes, and whether the solution is in an asymptotic convergence range. A small change in one output does not prove that every local feature is grid independent.

Uncertainty has several sources:

  • aleatory variability: natural or operational variation, such as fluctuating inlet flow;
  • epistemic uncertainty: lack of knowledge, such as uncertain roughness or turbulence closure;
  • measurement uncertainty in validation data;
  • numerical uncertainty from discretization and iterative error; and
  • model-form uncertainty caused by simplifying physics.

If independent input uncertainties are small and a response Q depends on inputs xᵢ, first-order propagation may be approximated by:

uQ² ≈ Σi (∂Q/∂xi)² uxi²

where uQ and uxi are standard uncertainties. The approximation assumes local linearity and negligible covariance. If inputs are correlated, covariance terms must be included; if the model is strongly nonlinear, Monte Carlo or other sampling methods may be more appropriate.

7. A disciplined CFD workflow

A professional study begins with the decision to be supported: for example, whether a pump meets a head requirement, whether a valve produces unacceptable cavitation risk, or whether a heat exchanger has sufficient capacity. The workflow is:

  1. define the question, output quantities, acceptance criteria, and operating envelope;
  2. identify relevant physics and justify simplifications;
  3. create and inspect geometry;
  4. choose boundary and initial conditions from measured or defensible data;
  5. generate a quality mesh and document y⁺ strategy;
  6. select numerical schemes, solver settings, and turbulence treatment;
  7. run a coarse diagnostic case before expensive refinement;
  8. monitor residuals, conservation, and engineering outputs;
  9. perform mesh, time-step, model, and boundary-condition sensitivity studies;
  10. compare with analytical, benchmark, experimental, or field evidence;
  11. quantify uncertainty and report limitations; and
  12. archive geometry, mesh, inputs, software version, scripts, results, and post-processing definitions.

Post-processing should emphasize decision-relevant quantities. A colored velocity contour can conceal recirculation, interpolation artifacts, or a misleading scale. Pressure drop, hydraulic efficiency, wall shear, cavitation indicators, and forces should be calculated with clear reference areas and sign conventions.

8. Digital twins and data-enabled engineering

A digital twin is more than a three-dimensional CAD model or a one-time CFD simulation. It has a physical asset, a digital representation, a data connection, and a purpose such as monitoring, prediction, optimization, or maintenance. A hydraulic-machine twin may combine CFD-derived performance maps, sensor measurements of pressure and vibration, control-system data, and reduced-order models.

A practical architecture contains:

  • sensors and data acquisition;
  • data validation, time synchronization, and storage;
  • physics-based and/or data-driven models;
  • state estimation and uncertainty tracking;
  • visualization and decision support; and
  • controlled feedback to operators or automated systems.

Digital twins can support anomaly detection, remaining-useful-life estimation, commissioning, virtual sensing, and what-if analysis. They can also fail when sensors drift, tags are misidentified, operating regimes change, or training data exclude rare events. A twin should therefore expose confidence levels and permit human review.

Reduced-order models, surrogate models, and machine-learning regressors can approximate expensive CFD. They are useful for rapid design exploration when trained and tested over a defined domain. Extrapolation beyond that domain is unsafe unless supported by new evidence. Physics-informed or hybrid models can enforce conservation laws, but they still depend on correct data, boundary conditions, and numerical implementation.

Responsible AI-assisted prediction requires:

  • traceable training and validation data;
  • separation of training, validation, and test cases;
  • physically meaningful input and output definitions;
  • uncertainty or confidence estimates;
  • detection of distribution shift;
  • independent engineering checks; and
  • explicit human accountability for decisions.

An AI system must not be allowed to conceal uncertainty or replace mandatory safety analysis.

9. Data governance, cybersecurity, and professional responsibility

CFD and digital-twin data may contain proprietary geometry, operating information, or safety-critical control logic. Good practice includes access control, encryption in transit and at rest, authenticated devices, patch management, network segmentation, secure backups, audit logs, and tested recovery procedures. Sensor data should have timestamps, calibration status, units, quality flags, and provenance.

Model governance should record who created a model, which assumptions it uses, its validation range, software dependencies, known failure modes, and approval status. Results used in safety-related design require review by competent engineers and compliance with applicable codes, standards, and organizational procedures.

Ethically, engineers must not present unvalidated contours as facts, omit unfavorable sensitivity results, or claim accuracy unsupported by evidence. Reproducibility and transparent limitations are professional obligations, not optional academic refinements.

10. Illustrative case: CFD-supported diagnosis of a centrifugal pump

Background. An industrial centrifugal pump delivered less head than its acceptance specification at the rated flow. Vibration was also elevated. The manufacturer had a CAD model, but no complete internal pressure survey.

Problem. The team needed to distinguish between hydraulic loss, recirculation, inadequate inlet conditions, and an instrumentation error without immediately redesigning the impeller.

Analysis. Engineers first calibrated flow, pressure, speed, and temperature measurements and checked that pressure-tap elevations were correctly included in the head calculation. They created a rotating-domain CFD model including the impeller and volute. A baseline RANS model with a near-wall strategy consistent with the mesh was solved at several flow rates. Mass imbalance, torque, head, and efficiency were monitored. Two meshes and two turbulence treatments were compared.

The simulations showed a separated region near the impeller suction side at the measured inlet condition and strong nonuniformity entering the impeller. However, the predicted head differed substantially between turbulence models, indicating model-form uncertainty. A separate inlet-pipe model and a physical pressure survey were then used to test the inlet-flow hypothesis.

Approach and solution. The pressure survey confirmed a distorted inlet profile caused by an upstream elbow placed too close to the pump. The remedial design lengthened and reconfigured the inlet section. CFD was used to compare alternatives, but the final decision also required a model-scale test and vibration checks. The selected geometry improved the inlet profile and reduced the predicted separation zone.

Outcome. The tested configuration recovered most of the specified head and reduced vibration. The team retained the original CFD model and validation data in a digital engineering record, including the operating range over which the conclusions were supported.

Learning points. The case demonstrates that CFD should diagnose mechanisms, not merely generate images; inlet boundary conditions can dominate predictions; turbulence-model sensitivity is evidence of uncertainty; and simulation should be combined with measurement before a safety-critical or costly decision.

Challenges and limitations

CFD remains limited by imperfect geometry, uncertain boundary conditions, unresolved scales, turbulence closure, multiphase complexity, cavitation models, numerical diffusion, and computational cost. Real systems may include roughness, leakage, manufacturing tolerances, wear, thermal deformation, and transient events absent from the model. Digital twins add risks of sensor failure, software obsolescence, cyberattack, and false confidence from automated dashboards.

The correct response is not to abandon simulation but to define the model’s purpose, validate it at relevant conditions, quantify sensitivity, and communicate the range of trustworthy use. A model is a decision instrument whose credibility must be earned by evidence.

Chapter Summary

CFD converts conservation laws and constitutive models into algebraic equations through discretization. The finite-volume method integrates conservation equations over control volumes and balances fluxes through their faces. Mesh quality, near-wall resolution, convection schemes, time step, and solver settings affect numerical accuracy and robustness. RANS, LES, and DNS represent different compromises between modeled and resolved turbulence.

Convergence requires more than declining residuals: conservation, monitored outputs, and physical behavior must also stabilize. Verification tests the correctness of the numerical solution, whereas validation tests the adequacy of the physical model against independent evidence. Mesh sensitivity, model sensitivity, measurement uncertainty, and uncertainty propagation are essential to responsible interpretation.

Digital twins connect models and operational data throughout an asset’s lifecycle. They can improve monitoring and design decisions, but data quality, cybersecurity, model drift, extrapolation, and human accountability must be managed. AI-assisted surrogates are useful within a demonstrated domain and must not obscure uncertainty or replace engineering judgment.

Key Terms

Discretization: Replacement of continuous governing equations by finite algebraic equations.

Finite volume: A method that applies integral conservation laws to control volumes.

Control volume: A finite region over which conservation is enforced.

Flux: Rate of transport through a surface.

Mesh: Partition of a computational domain into cells or elements.

Skewness: Geometric deviation from an ideal cell arrangement.

Non-orthogonality: Misalignment between a face normal and the line joining cell centers.

y⁺: Nondimensional wall distance used to assess near-wall resolution.

RANS: Reynolds-averaged Navier–Stokes approach.

LES: Large-eddy simulation, resolving large turbulent structures and modeling smaller ones.

DNS: Direct numerical simulation resolving all relevant turbulent scales.

Turbulence closure: Model used to represent effects of unresolved turbulent motion.

Residual: Algebraic equation imbalance during an iterative solution.

Convergence: Stabilization of numerical and engineering indicators to acceptable levels.

Verification: Assessment of whether equations are solved correctly.

Validation: Assessment of whether the model represents reality adequately for its purpose.

Uncertainty quantification: Characterization of doubt in inputs, numerics, data, and model form.

Digital twin: Data-connected digital representation of a physical asset or process.

Surrogate model: Computationally inexpensive approximation of a more expensive model.

Model-form uncertainty: Uncertainty caused by incomplete or approximate physical representation.

Review Questions

Short Answer Questions

  1. Why is CFD described as an approximate solution method rather than a direct observation of fluid reality?
  2. State the incompressible continuity equation and explain its physical meaning.
  3. What is the role of a control volume in the finite-volume method?
  4. Distinguish verification from validation.
  5. Why can declining residuals alone be insufficient evidence of convergence?

Long Answer Questions

  1. Explain the finite-volume discretization of a general transport equation, including convective, diffusive, transient, and source terms.
  2. Compare RANS, LES, and DNS with respect to resolved physics, computational cost, and engineering use.
  3. Describe a professional mesh-generation and mesh-sensitivity workflow for a hydraulic machine.
  4. Explain the meaning of y⁺ and compare wall-resolved and wall-function approaches.
  5. Discuss how a digital twin can support pump maintenance while remaining subject to data, model, and cybersecurity limitations.

Analytical / Application Questions

  1. A CFD model predicts a pump head of 46 m while a carefully corrected test gives 48 m. Calculate the relative difference using the test as the reference, and identify two reasons why this comparison alone does not establish model validity.
  2. A transient simulation uses a local velocity of 12 m s⁻¹, time step 0.0005 s, and cell length 0.003 m. Calculate the local Courant number and discuss what additional information is needed to judge temporal accuracy.
  3. A design decision depends on pressure drop, but two turbulence models give materially different pressure-drop predictions while mesh refinement changes each result only slightly. Explain what this indicates and propose a validation and uncertainty plan.

Multiple Choice Questions with Answers

Question 1

Which statement best describes the finite-volume method?

A. It enforces conservation over finite control volumes by balancing face fluxes.

B. It represents every turbulent eddy explicitly in all engineering flows.

C. It can be used only on rectangular structured grids.

D. It eliminates the need for boundary conditions.

Correct Answer: A. It enforces conservation over finite control volumes by balancing face fluxes.

Question 2

For an incompressible constant-density flow, which continuity condition applies?

A. ∇·u = ρ

B. ∇·u = 0

C. ∇·u = μ

D. ∇·u = p

Correct Answer: B. ∇·u = 0

Question 3

A flow has velocity 12 m s⁻¹, time step 0.0005 s, and cell length 0.003 m. What is its local Courant number?

A. 0.2

B. 1.0

C. 2.0

D. 20

Correct Answer: C. 2.0

Question 4

What does y⁺ primarily help determine?

A. The fluid density

B. The appropriate near-wall resolution and wall treatment

C. The total number of fluid species

D. The pump shaft power directly

Correct Answer: B. The appropriate near-wall resolution and wall treatment

Question 5

Which turbulence approach resolves large eddies and models smaller scales?

A. DNS

B. LES

C. Steady laminar modeling

D. First-order upwind discretization

Correct Answer: B. LES

Question 6

Which is the best definition of validation?

A. Checking whether residuals decrease

B. Checking whether the mesh contains enough cells

C. Comparing model predictions with independent evidence from the real system

D. Changing a turbulence model until a preferred answer appears

Correct Answer: C. Comparing model predictions with independent evidence from the real system

Question 7

A residual is best interpreted as a measure of:

A. The algebraic imbalance of a discretized equation

B. The exact experimental error in a pressure sensor

C. The Reynolds number of the flow

D. The physical size of a mesh cell

Correct Answer: A. The algebraic imbalance of a discretized equation

Question 8

Which statement about a digital twin is most accurate?

A. It is always identical to a CAD drawing.

B. It is a data-connected digital representation with a defined engineering purpose.

C. It requires no sensor-quality information.

D. It guarantees accurate prediction outside its training and validation range.

Correct Answer: B. It is a data-connected digital representation with a defined engineering purpose.

Question 9

A CFD head prediction is 46 m and the experimental value is 48 m. What is the relative difference using the experiment as reference?

A. 2.0%

B. 4.17%

C. 4.35%

D. 96%

Correct Answer: B. 4.17%

Question 10

Which practice is most responsible when deploying an AI-assisted CFD surrogate?

A. Use it confidently for all operating conditions after fitting one dataset.

B. Hide uncertainty estimates to simplify operator decisions.

C. Test its domain of validity, monitor distribution shift, and retain human engineering review.

D. Replace all experimental validation with model-generated data.

Correct Answer: C. Test its domain of validity, monitor distribution shift, and retain human engineering review.

Fluid Mechanics & Hydraulic Machines
Chapter 13 of 14