Chapter 4 · 9 hours
Mesh Generation and Solver Setup
Practice questions
Practice questions and answers
6 exam-style questions on this chapter, written for this site from the official syllabus. We haven’t found past IOE papers for this subject yet; if you have some, share them in the community.
- Practice · 6 marks
Differentiate between structured, unstructured and hybrid meshes. Give the advantages, disadvantages and typical applications of each.
Answer
A mesh (grid) divides the flow domain into small cells on which the equations are solved. Its type affects accuracy, memory and effort.
Structured Unstructured Hybrid
+--+--+--+ /\ /\ /\ |||||||| prism
+--+--+--+ /__\/__\/__\ |||||||| layers
+--+--+--+ \ /\ /\ / /\/\/\/\ tetra
+--+--+--+ \/__\/__\/ core
- Structured: cells are arranged in a regular pattern; each interior node has the same number of neighbours and is addressed by indices . Cells are quadrilaterals (2D) or hexahedra (3D).
- Unstructured: cells (triangles/tetrahedra, or any polyhedra) have arbitrary connectivity, stored in a table; the number of neighbours varies.
- Hybrid: a combination, e.g. thin prism or hexahedral layers next to walls and tetrahedral cells in the core, or structured blocks joined by unstructured regions.
| Point | Structured | Unstructured | Hybrid |
|---|---|---|---|
| Geometry fit | Simple shapes; complex shapes need multi-block | Any complex shape | Complex shapes with good wall treatment |
| Meshing effort | High manual effort | Mostly automatic | Moderate |
| Accuracy per cell | High; aligned with flow | Lower; may need more cells | Good near walls |
| Memory/solver | Low memory, fast solvers (ADI, line-SOR) | More memory, indirect addressing | Medium |
| Local refinement | Hard, propagates through the block | Easy | Easy |
| Numerical diffusion | Low if aligned with flow | Higher | Low in boundary layer |
| Applications | Pipes, ducts, turbomachinery blades, finite difference codes | Car body, engine bay, buildings, electronics | Aircraft wings, vehicle aerodynamics, boundary-layer flows |
- Practice · 5 marks
Describe the common 2D and 3D mesh element types used in CFD. What are prism (inflation) layers and why are they used?
Answer
2D elements
- Triangle: three nodes; fits any boundary, fully automatic generation, but needs more cells and gives more numerical diffusion if not aligned with flow.
- Quadrilateral: four nodes; good accuracy when aligned with the flow, fewer cells, preferred in boundary layers and simple shapes.
3D elements
| Element | Faces | Features |
|---|---|---|
| Tetrahedron | 4 triangles | Easy automatic meshing of any CAD; large cell count; poor in thin boundary layers |
| Hexahedron | 6 quads | Highest accuracy and lowest cell count; hard to generate for complex shapes |
| Prism (wedge) | 2 triangles + 3 quads | Used for boundary layers; extruded from a surface triangle mesh |
| Pyramid | 1 quad + 4 triangles | Transition between hexa and tetra regions |
| Polyhedron | Any number of faces | Created by merging tetra cells (e.g. in Fluent); fewer cells, more neighbours, good gradients |
tetra hexa prism pyramid
/\ +----+ /|--|\ /\
/__\ | | / | | \ / \
\ / +----+ \_|__|_/ +---+
Prism (inflation) layers
Prism layers are several thin layers of prismatic (or hexahedral) cells stacked from a wall, with the first-layer height small and each layer thicker than the previous by a growth ratio (usually 1.1 to 1.3).
Reasons for use:
- Velocity and temperature gradients are steepest normal to the wall, so many cells are needed in that direction only; stretched cells save cell count.
- The first cell height can be set to meet the required for the turbulence model (about 1 for wall-resolved, 30 to 300 for wall functions).
- Cells aligned with the wall reduce numerical diffusion and improve wall shear stress and heat flux prediction.
- Total layer thickness should be about the boundary layer thickness, with smooth transition to the core cells.
- Practice · 6 marks
Explain the mesh quality measures skewness, aspect ratio and orthogonality. State the acceptable ranges and the effect of poor quality on the solution.
Answer
Mesh quality strongly affects accuracy, stability and convergence.
Skewness
It measures how far a cell is from an ideal shape (equilateral triangle, rectangle).
- Equiangular skewness:
where for triangles/tetrahedra and for quads/hexahedra.
- Range 0 (perfect) to 1 (degenerate). Typical guide: 0 to 0.25 excellent, 0.25 to 0.5 good, 0.5 to 0.8 acceptable, 0.8 to 0.95 poor, above 0.95 unacceptable. Aim for maximum below 0.85 (below 0.9 in 3D tetra).
Aspect ratio
Ratio of the longest to the shortest edge (or dimension) of a cell:
- Ideal value is 1. High values (10 to 1000) are acceptable only inside boundary layers where gradients are in one direction and the flow is aligned with the long side.
- Elsewhere keep ; avoid sudden changes in cell size (size change ratio below about 1.2 to 1.3).
Orthogonality
Measures the angle between the face normal vector and the vector joining the centres of the two adjacent cells (and between the face normal and the vector to the face centre).
- Orthogonal quality where is that angle; range 0 (bad) to 1 (best). Acceptable above about 0.1 (best above 0.2), and non-orthogonality (the angle itself) should be below about 70 to 75°.
- A perfect Cartesian cell has orthogonality 1.
Effects of poor quality
- Large truncation error and numerical diffusion, as the central gradient assumption fails.
- Slow convergence, divergence or negative cell volumes.
- Wrong pressure gradients and forces, even when residuals look small.
- Need for extra non-orthogonal correction loops.
Quality should be checked before solving, and bad cells fixed by re-meshing, smoothing or local refinement.
- Practice · 6 marks
A triangular cell has vertices at (0, 0), (2, 0) and (0.5, 1.2) (units in mm). A quadrilateral cell has vertices at (0, 0), (4, 0), (4.6, 0.5) and (0.6, 0.5) (mm). For each cell find the interior angles, the equiangular skewness and the edge-based aspect ratio, and comment on the quality.
Answer
Equiangular skewness: , with (triangle) and (quad). Aspect ratio = longest edge / shortest edge.
Triangle
Edge lengths:
- A(0,0)-B(2,0): mm
- B(2,0)-C(0.5,1.2): mm
- C-A: mm
Angles from the dot product:
- At A: vectors AB=(2,0), AC=(0.5,1.2): ,
- At B: BA=(-2,0), BC=(-1.5,1.2): ,
- At C:
Skewness 0.36 falls in the "good" range (0.25 to 0.5), and AR is small, so the triangle is acceptable.
Quadrilateral (a leaning parallelogram)
Edges: bottom mm, right side mm, top mm, left side mm.
Angles: at (0,0) between (4,0) and (0.6,0.5): , . The adjacent angle is .
Comment
| Cell | Skewness | AR | Quality |
|---|---|---|---|
| Triangle | 0.36 | 1.54 | Good |
| Quad | 0.56 | 5.12 | Acceptable only; skewed (39.8° angle) and elongated |
The quadrilateral is both strongly skewed and stretched. A stretched cell is fine in a boundary layer if aligned with the wall, but the sheared shape (not rectangular) reduces orthogonality and accuracy; it should be improved by reducing the shear (making the angles closer to 90°).
Answer: Triangle , (good); quad , (fair).
- Practice · 8 marks
Air ( kg/m³, Pa·s) flows at 30 m/s over a flat plate 1.5 m long. A wall-resolved turbulence model requires at the first cell centre. Estimate (a) the plate Reynolds number, (b) the skin friction coefficient using , (c) the wall shear stress and friction velocity, (d) the first cell height, and (e) the number of prism layers with growth ratio 1.2 needed to cover the boundary layer thickness estimated from .
Answer
Definition: with . The estimate is done before meshing using flat-plate correlations.
(a) Reynolds number
(turbulent over most of the plate).
(b) Skin friction coefficient
(c) Wall shear stress and friction velocity
(d) First cell height
Kinematic viscosity m²/s. For the cell centre is at
The first cell has its centre at half its height, so the first cell height is
(e) Number of layers
Boundary layer thickness:
For layers with growth ratio , total thickness is :
Check: with 30 layers the total is m, which is above .
Answer: ; ; Pa; m/s; first cell height m; about 30 prism layers.
- Practice · 5 marks
Describe the main steps in setting up a CFD solver for a steady incompressible flow. Explain how convergence is judged and how a grid independence study is carried out.
Answer
Solver setup
- Select the solver type: pressure-based (incompressible and low Mach) or density-based (high-speed compressible); steady or transient.
- Choose the physics: laminar or turbulence model (e.g. k-, k- SST), energy equation on/off, gravity, other models.
- Materials: density, viscosity, specific heat, conductivity.
- Boundary conditions: velocity inlet (with turbulence intensity and length scale), pressure outlet, no-slip wall, symmetry, periodic.
- Discretisation schemes: first-order upwind to start, then second-order upwind or QUICK for accuracy; gradients by least squares or Green-Gauss; pressure scheme (PRESTO or second order).
- Pressure-velocity coupling: SIMPLE, SIMPLEC or PISO (transient); set under-relaxation factors (e.g. 0.3 for pressure and 0.7 for momentum).
- Initialise the field (from inlet values or hybrid initialisation) and run.
Convergence criteria
- Residuals (imbalance of each discretised equation) normalised; typically fall by three to four orders of magnitude ( continuity/momentum, energy).
- Monitors of quantities of interest (drag, pressure drop, outlet temperature) become steady.
- Global balances: mass flow in equals mass flow out (error below 0.1 to 1%); energy balance closes. Low residuals alone are not proof, so the monitored values must be checked.
Grid independence study
- Create at least three meshes (coarse, medium, fine) with a uniform refinement ratio .
- Solve each with identical settings and compare a key output (e.g. pressure drop or ).
- When the change between the last two meshes is small (say below 1 to 2%), the solution is considered grid independent; use the coarser of these two.
- Optionally apply Richardson extrapolation and the Grid Convergence Index (GCI) to estimate the discretisation error.
Finally, validate the results against experimental or analytical data.
Written from the official syllabus. Questions and answers are written for this site; check them against your class notes.
Chapter titles and hours from the IOE syllabus ↗