wk10 Meshing TRM
wk10 Meshing TRM
As well as this, by the end of the week you should feel comfortable to build a
geometry and mesh in ANSYS, understanding the different meshing options,
and what mesh types are available.
2 Types of meshes
5 Mesh Independence
7 Summary
(left) mesh over space shuttle main engine (right) F1 mesh example
2. Discretisation of domain → Mesh generations (as the finite numerical methods we are using
require a mesh/grid)
Generally, in numerical methods in CFD we transform our differential (or integral) equations to an
algebraic system of equations → unknowns (fields of interest) are stored at the discrete locations on the
mesh.
Generally, in numerical methods in CFD we transform our differential (or integro) mathematical model to
an algebraic system of equations → unknowns (fields of interest) are stored at the locations on the mesh.
• Typically, we have ‘fields’ (e.g. displacement) that vary smoothly across our geometry.
• Can create higher-order polynomial elements to capture the field accurately with fewer elements.
• When starting a problem, we must create a mesh on the geometry surface and interior.
In CFD problems:
• Do not necessarily have smooth fields (e.g., turbulence, multiphase, unsteady/transient behaviour).
• Finite Volume Method uses lots of ‘simple’ elements and relies on the ‘flux’ between these.
• Often have to mesh the ‘negative’ of the solid body – can be much harder to inspect.
https://www.learncax.com/knowled
ge-base/blog/by-
category/cfd/good-looking-
mesh-may-not-always-be-
MECH3780 - wk10 - cfd meshing good-for-the-simulation 8
Element Types
In FVM, we apply our conversation equations over small finite volumes:
𝜕
න 𝜌𝜙 𝑑𝑉 + ර 𝜌𝜙𝑢 ⋅ 𝑛 𝑑𝑆 = ර Γ𝜙 ∇𝜙 ⋅ 𝑛 𝑑𝑆 + න 𝑆𝜙 𝑑𝑉
𝜕𝑡 𝑉 𝑆 𝑆 𝑉
How can we assess if our mesh is reasonable or expected to perform well (we will go into more detail):
• Rate of convergence (both for a solution and with reducing mesh size).
• Accuracy of solution.
• Amount of computational resources required.
•….
Pre-running first simulation on a given domain Post-running first simulation on a given domain
• Mesh quality rules of thumb (we will discuss). • Are there any obvious numerical artifacts?
• Mesh aligns with expected flow physics (e.g., – Do the flow features align with changes in
boundary layers). the grid?
• Mesh will generate in feasible time. – Are there any unresolved eddies forming?
• Will the simulation time be reasonable to get a – ….
‘first’ view at if assumptions and discretisation is • Conduct systematic grid dependence study.
appropriate.
– Is our mesh fine enough for our parameter of
interest to be independent of the mesh.
MECH3780 - wk10 - cfd meshing 11
Spatial Discretisation into Finite Volumes
Common terminology when talking about the computational mesh
• Define a global curvilinear coordinate system where one can write the differential equations and
integrate them in this curvilinear system rather than the Cartesian coordinate system.
• Transform from (𝑥, 𝑦, 𝑧) to a new system (𝜉, 𝜂, 𝛾) globally across the domain.
MECH3780 - wk10 - cfd meshing Oberkampf and Roy, Verification and Validation in Scientific Computing (2010). 17
Structured Mesh – Body-fitted (curvilinear)
• This was very popular for aerofoils (incl. turbomachinery).
• Depending on orientation of the grid lines, various configurations exist:
– H-, C-, O-, I-type and their various combinations
Another technique (not addressed in MECH3780) to be aware of is overset grids also called chimera
technique → grids are generated around a fixed or moving body that overlap a background fixed grid 20
Unstructured Mesh
Any grid not holding the property of a structured mesh = unstructured.
Provides significantly more flexibility and automation.
→ Industry standard essentially driven by the requirement for
automatic grid generation tools
– Cell-center: uses the ‘cell’ as the control volume with faces defined from this to balance fluxes.
– Cell-vertex: builds control volume using sections of cells which creates more faces to balance the
fluxes.
Example of a non-conformal, adapted octree mesh using a ‘cut-cell’ technique and a triangular
unstructured mesh.
• In this case we do not need a non-orthogonal correction (you will likely have seen this option in
Fluent) and our convergence is often improved.
• Often when you set these up in Fluent for a boundary layer you will also see options around buffer
layers if using a hexcore or poly-hexcore mesh – this smooths connections between layers moving
away from the boundary.
• Laminar:
• BL resolution impacts accuracy of computed wall shear stress and heat transfer coefficient.
• Sizing adjacent to the wall should ideally obey:
𝑢∞
𝑦𝑝 ≤1
𝜈𝑥
• 𝑦𝑝 : distance to the wall from adjacent cell centroid. 𝑢∞ : free-stream velocity. 𝜈: kinematic viscosity.
𝑥: distance along the wall from starting point of the boundary layer.
• This equation comes from the Blasius solution for laminar flow over a flat plate at zero incidence.
• Turbulent:
• The resolution here depends on the numerical model and the applied ‘law-of-the-wall’.
• We will touch more on this in the turbulence lectures!
• Align our mesh density and cell orientation to capture desired flow features.
• Although triangles make for easy to generate meshes, they generally introduce more errors than
quad/hex or poly meshes.
Regardless of the cell type → addressing these errors is the main goal of mesh quality analysis.
3. Equiangle skewness:
𝜃𝑒𝑞 ∶ 𝑎𝑛𝑔𝑙𝑒 𝑓𝑜𝑟 𝑒𝑞𝑢𝑖𝑎𝑛𝑔𝑢𝑙𝑎𝑟 𝑐𝑒𝑙𝑙
𝜃max − 𝜃𝑒𝑞 𝜃𝑒𝑞 − 𝜃m𝑖𝑛
𝑠𝑘𝑒𝑤𝑛𝑒𝑠𝑠 = max ,
180 − 𝜃𝑒𝑞 𝜃𝑒𝑞
MECH3780 - wk10 - cfd meshing For these definitions skewness = 0 is best and =1 is worst 31
Smoothness and Growth Ratios
• During mesh generation (and refinement), it is necessary for change in cell size to be smooth
• Sudden jump in cell size introduces larger truncation errors (i.e. difference between continuous partial
derivatives and their discrete approximations).
• Rule of thumb is to aim for a maximum grid spacing change of less than 20%.
• Sometimes these can be acceptable, e.g., if flow is ‘not changing’ significantly in the elongated direction.
However, generally high aspect ratio cells can be detrimental for simulation accuracy where flow is multi-
dimensional.
• To compute gradients, cell faces provide information • Lack of alignments contributes to larger numerical
about neighbours → better the variation of known diffusion.
data around the cell = better compute accuracy.
• Minimise equiangle skewness (note the values often vary on who you speak with):
• Quad/hex cells – should not exceed 0.89.
• Triangular cells – should not exceed 0.89.
• Tetrahedral cells – should not exceed 0.9.
Mesh Quality Excellent Good Acceptable Poor Bad Degenerate
Skewness 0-0.25 0.25-0.5 0.5-0.8 0.8-0.95 0.95-0.97 0.97-1
• Minimise local cell size variation with adjacent cells size ratio no greater than 20%.
• Increase mesh density as required to adequately resolve flow features (e.g., boundary layer).
• Compute feasibility → tools like clustering and solution adaptation allow refinement in ‘interesting’ areas.
MECH3780 - wk10 - cfd meshing 35
Be Careful with Reliance on Mesh Quality Metrics
“One researcher was able to show a complete lack of correlation between mesh quality and solution
quality”
“Use as many grid points as possible.. In many cases, resolution trumps quality.”
• The example below shows an error measure on two meshes - the ‘perfect’ mesh performs much
worse than the ‘bad’ mesh from a priori metrics. BUT these quotes and the case below indicate CFD
practitioners not always accounting for the flow physics when they design their mesh!
the conceptual model) agrees with physical reality. Validation Mathematical Model
Discretisation
One way to consider this, verification is building the
system right and validation is building the right system. Numerical Model Verification
Programming
Simulation
Once geometry is made (or provided) a CFD practitioner can look to reduce required compute time by
taking advantage of various aspects including symmetry and/or removing aspects not relevant/critical to
the goal of the simulation study:
• As such it is often beneficial to remove unnecessary features that won’t impact the flow, and smooth
areas of geometry that could cause mesh generation and or quality issues.
MECH3780 - wk10 - cfd meshing 48
Mesh Quality in Fluent
• Checks the mesh connectivity orientation Where 𝐴𝑖 is the area vector of a face, 𝑓𝑖 is a vector from
• Domain extents and statistics for volume and face area the centroid of the cell to the centroid of the face, and 𝑐𝑖
• Topological information (i.e. number of nodes/faces per cell) is a vector from the centroid of the cell to the centroid of
• … the adjacent cell that shares that face.
𝑂𝑟𝑡ℎ𝑜𝑔𝑜𝑛𝑎𝑙𝑖𝑡𝑦 = min 𝑄1 , 𝑄2
• Quality Check
Worst cells have an orthogonality closer to 0.
• Orthogonal quality
– Calculates two quantities
– Depends on cell type
• Tet, prism, pyramid = min(orthogonality,1-cell skewness)
• Hex and Poly = orthogonality
• Fluent aspect ratio
• Cell squish and skewness