0% found this document useful (0 votes)
8 views54 pages

wk10 Meshing TRM

The document outlines the Week 10 lecture for MECH3780, focusing on mesh generation and grid dependency in computational fluid dynamics (CFD). It covers the importance of mesh quality, types of meshes, and practical applications using ANSYS, emphasizing the need for proper discretization to accurately model fluid flow. Key topics include assessing mesh quality, understanding different mesh types, and the implications of mesh on simulation accuracy and computational resources.

Uploaded by

1765182439
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views54 pages

wk10 Meshing TRM

The document outlines the Week 10 lecture for MECH3780, focusing on mesh generation and grid dependency in computational fluid dynamics (CFD). It covers the importance of mesh quality, types of meshes, and practical applications using ANSYS, emphasizing the need for proper discretization to accurately model fluid flow. Key topics include assessing mesh quality, understanding different mesh types, and the implications of mesh on simulation accuracy and computational resources.

Uploaded by

1765182439
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 54

MECH3780 – Week 10

Mesh generation and grid dependency


Dr Travis Mitchell – [email protected]
Upcoming
Schedule
Week 10 Lecture: Mesh generation and grid-dependency 2 hours

Week 10 Contact: Turbulence and its Discontents - I 1 hour

Week 11 Lecture: Labour Day – no lecture 0 hour

Week 11 Contact: Turbulence and its Discontents - II 1 hour

Week 12 Lecture: Advanced Topics in CFD 2 hours

Week 12 Contact: Multiphase Flow Demonstration 1 hour

Y. Bazilevs et al. (2014) http://dx.doi.org/10.1007/978-3-319-06136-8_14


https://www.ifpenergiesnouvelles.com/waLBerla-wind
MECH3780 - wk10 - cfd meshing 2
Aim for Today
From today we should be able to answer questions like:

1. Why do we need a mesh (or grid – these will be used interchangeably)?

2. What kind of meshes do we have in our toolkit?

3. How do we assess the quality of our CFD mesh?

4. When do we need to refine our mesh?

5. Should I just use ANSYS automatic mesh generator with default


settings?

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.

Key take home message:

MESH QUALITY IS IMPORTANT AND DON’T FORGET TO VERIFY THE


FLOW PHYSICS

MECH3780 - wk10 - cfd meshing 3


Today’s
Outline
1 Why do we need a mesh?

2 Types of meshes

3 Boundary layers (briefly – more on this in turbulence lectures)

4 Mesh quality and design

5 Mesh Independence

6 Lets get practical – Meshing with ANSYS

7 Summary

MECH3780 - wk10 - cfd meshing 4


Background: Why do we need a mesh?
“Gridding in CFD is a first-order error.”1

(left) mesh over space shuttle main engine (right) F1 mesh example

1Unsureif exact quote, but general idea from a discussion


between Dr Gollan and Head of CFD Division at Boeing.
MECH3780 - wk10 - cfd meshing 5
Numerical Discretisation: What is Involved?
To model the flow of fluids, we have a (continuous) mathematical model (i.e., the Navier-Stokes
equations). CFD involves the process of reformulating and solving a discrete approximation to these
continuous models.

This DISCRETISATION is conducted in two parts:

1. Discretisation of equations → Numerical method

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.

What kind of errors do we need to be aware of during these processes?

MECH3780 - wk10 - cfd meshing 6


Numerical Discretisation: What is Involved?
To model the flow of fluids, we have a (continuous) mathematical model (i.e., the Navier-Stokes
equations). CFD involves the process of reformulating and solving a discrete approximation to these
continuous models.

This is conducted in two parts:

1. Discretisation of equations → Numerical method

2. Discretisation of domain → Mesh generations

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.

- Errors in the physical models we are using (either selected or derived).

- Errors in the numerics

– Round-off error and Truncation error

MECH3780 - wk10 - cfd meshing 7


Meshing in FEM vs CFD
In structural problems:

• 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:
𝜕
න 𝜌𝜙 𝑑𝑉 + ර 𝜌𝜙𝑢 ⋅ 𝑛 𝑑𝑆 = ර Γ𝜙 ∇𝜙 ⋅ 𝑛 𝑑𝑆 + න 𝑆𝜙 𝑑𝑉
𝜕𝑡 𝑉 𝑆 𝑆 𝑉

• Here, 𝜙 = 1 (continuity), 𝜙 = 𝑢 (conservation of momentum)


• The surface integrals lead us to propagate fluxes through the faces of our
control volumes.
• Key point: the time derivative of some property (𝜙) inside a finite volume,
primarily depends on the surface value of the fluxes!
To apply this in our solver, we compute one flux at the boundary and apply it
leaving one control volume but entering its neighbour (conservative!)
• Most accurate when the flow is normal to the face that it is entering/leaving.
• Oblique faces of the control volume must be handled by our FVM, the non-
orthogonal contributions which can induce additional errors. https://www.afs.enea.it/project/neptunius/docs/fluent/html/ug/node161.htm

– Non-orthogonal corrections exist to mitigate this → increased complexity

MECH3780 - wk10 - cfd meshing 9


What is a Mesh and What do we look for?
What is a mesh (or grid) and what is its purpose?

• Collection of cells (or elements/volumes) on which we resolve the flow.


• Discrete representation of the flow domain and the geometry of interest.
• Groups cells into various zones (e.g., boundary zones).
• Purpose: is simply to enable the discretisation of the geometry to ensure all relevant flow features
are captured uniquely in each cell.

How can we assess if our mesh is reasonable or expected to perform well (we will go into more detail):

• Density of cells (e.g., clustering).


• Discontinuity in cell sizing (smoothness).
• Skewness.
• Cell type (e.g., tet vs hexa vs poly).
• Static or dynamic mesh refinement (pre-defined or through adaptation).

MECH3780 - wk10 - cfd meshing 10


Impact of the Mesh and Generating a Mesh
How can the quality of your mesh impact your analysis?

• 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

Nodes (vertices) : set of points which support a cell.


Cell (surface 2d, volume 3d) : used to discretise the domain, our flow solution is computed as the
average quantity in a cell (ANSYS uses cell centred to store ‘fields’ in the domain).
Interfaces : the edges in 2D or faces in 3D of our cells.
Zones : groupings of cells, vertices and interfaces.
Domain : grouping of all the above (completely filled with cells).

MECH3780 - wk10 - cfd meshing 12


Types of Meshes
Structured Mesh (Cartesian, Curvilinear, Block)
Unstructured Mesh
Hybrid Mesh

MECH3780 - wk10 - cfd meshing 13


Structured Mesh
Consist of families of grid lines with the property that members of a single family do not cross each other
and cross each member of the other families only once.

• Enhances computational performance and accuracy.


• Time consuming to construct and often infeasible for complex geometries.

• We can group these into:


– Cartesian Grids
– Non-uniform Cartesian Grids
• Variable mesh size
– Body-fitted or Curvilinear grids
– Multi-block and Overset grids
Structured vs unstructured discretisations

MECH3780 - wk10 - cfd meshing 14


Structured Mesh - Cartesian
Ideal mesh is a Cartesian distribution, where all points are equidistant, and all cells are perfect cubes
• Highest possible accuracy of discretised formulas.
• FVM leads to the same formulas as FDM in this case.
– Δ𝑥 = Δ𝑦 = Δ𝑧
→ Evaluations of grid qualities conducted by comparing a select cell to ideal cubic cell.

Consider flow in a channel (fluid moving in the +ve y):


• In 2D nodes can be located by index (i, j).
• Neighbours can be immediately identified by
increasing/decreasing these indices by a value of one.

Although not common in many FVM applications today, still


observed in aero-acoustic computations where high-order
schemes are needed for accurate simulation of acoustic
pressure wave propagation.

MECH3780 - wk10 - cfd meshing 15


Structured Mesh – Non-uniform Cartesian

Variable mesh sizes


• Cell sized do not need to be consistent → clustering can be
an efficient way to capture viscous effects near solid
boundaries.

Primary restriction for Cartesian grids is complex geometries


and flow domains!

MECH3780 - wk10 - cfd meshing 16


Structured Mesh – Body-fitted (curvilinear)
These represent the great revolution of FVM for arbitrary geometries during the 1980s.

• 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.

Maliska, Fundamentals of Computational Fluid Dynamics (2023).

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

MECH3780 - wk10 - cfd meshing 18


Structured Mesh – Body-fitted (curvilinear)
• We don’t have time to go into the coordinate transforms explicitly, but take away points:

• It is possible to write conservation equations in a curvilinear system → solution to equations can be


obtained in the transformed domain (where the cells are very high quality!)
• The computer code can be written for a fixed geometry (independent of physical domain), where the
transformation is supplied prior to execution.
• Another common name for these grids is boundary-fitted grids and find application in niches of
engineering. General industry CFD codes employ unstructured grids for generality and flexibility.

MECH3780 - wk10 - cfd meshing 19


Structured Mesh – Multi-block Grids
• For more complex geometries, one can use multiple blocks to fit the mesh around solid objects. These
blocks can be ‘conformal’ or ‘non-conformal’ (i.e. matching or non-matching boundaries between blocks)
– Non-conformal requires sophisticated interpolation routines between independent surface grids
• Typically used to body-fit geometries with sharp protuberances (e.g., T-sections).
Example flow through a heat exchanger with geometry simplified to a single cell:

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

• Cells are arranged in an arbitrary fashion.


• Any cell type can be used (tri/tet, quad/hex, pyr/prism, poly).
• Can’t use simple (i, j) or (i, j, k) node indexing, as no constraint on
cell layout.
• Due to this → computational overhead exists for unstructured
referencing (both in required memory and algorithm complexity!)
• Can introduce additional numerical errors due to changing element
types and sizes as well as complexity in estimating face values
and gradients.
Outside of Ansys, there are designated mesh generation software
that provide export to various solvers. One example here is from
Pointwise. Gmsh is another popular tool.
MECH3780 - wk10 - cfd meshing 21
How the CFD solver uses the mesh
Often split algorithms into cell-center or cell-vertex methods.

• From the images below:

– 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.

• Has grid nodes on boundary, conservation


as such will not be obeyed for control volumes
at the boundary (unless a special scheme is
constructed).

• In these methods, we need to estimate the value


of interest at mid-points of flux faces. We also need
to estimate cell areas and CV volumes. This often
requires quite elaborate schemes and local coordinate
transforms (not directly covered in MECH3780).
MECH3780 - wk10 - cfd meshing 22
Hybrid (unstructured) Mesh
On the right is a simulation of flow over a heat exchanger tube
bank - taking advantage of periodicity in the design.

• Meshes are a mixture of triangular and quadrilaterals,


polygon and quadrilaterals, as well as unstructured
quadrilaterals.

• Quadrilateral elements have been used near solid


boundaries → better resolutions of viscous effects in
boundary layer (more on this in a minute).

• Can drastically reduce mesh generation time.

• ‘Relatively’ easy to apply automatic mesh adaptation to


improve quality/resolution.

MECH3780 - wk10 - cfd meshing 23


Some Extra Mesh Examples

Example of a non-conformal, adapted octree mesh using a ‘cut-cell’ technique and a triangular
unstructured mesh.

Why do we need such high refinement around the solid boundaries?


MECH3780 - wk10 - cfd meshing 24
Boundary layers
Considering conservation of momentum in 𝑥 for a 2D steady-state incompressible fluid system:
𝜌 𝑢𝜕𝑥 𝑢 + 𝑣𝜕𝑦 𝑢 = −𝜕𝑥 𝑝 + 𝜇 𝜕𝑥𝑥 𝑢 + 𝜕𝑦𝑦 𝑢

If we applied finite differences to the derivatives:


𝑢𝑖,𝑗+1 − 𝑢𝑖,𝑗 𝛿𝑦 𝛿2
𝜕𝑦 𝑢 = − 𝜕 𝑢 − 𝜕𝑦𝑦𝑦 𝑢 − ⋯
𝛿𝑦 2 𝑦𝑦 6

• Truncation errors increase in regions of steep gradients!

• Need to resolve the mesh to capture the viscous-effects


resulting from the no-slip wall boundary.

• This is very important in both laminar and turbulent flows


→ more on turbulence in the next lecture!

MECH3780 - wk10 - cfd meshing 25


Why is quads and hexs are best for BL?
• These cells work as they connect orthogonally to each other – i.e. the vector connecting their centroids
is orthogonal to the connecting face.

• 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.

MECH3780 - wk10 - cfd meshing 26


Why are quads and hexs are best for BL?
• We can get this same benefit with elongated cells iff we know the direction of flow and the flow
gradients (i.e. normal to wall boundaries).

• 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.

MECH3780 - wk10 - cfd meshing 27


Cell sizing near the wall
• This is important in both laminar and turbulent boundaries.

• 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!

MECH3780 - wk10 - cfd meshing 28


Guidelines for Mesh Quality and Design

MECH3780 - wk10 - cfd meshing 29


Measures of Mesh Quality
Some of the commonly used metrics are listed below but we should also try to:

• Align our mesh density and cell orientation to capture desired flow features.

• Design wall adjacent mesh to resolve boundary layers.

• 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.

MECH3780 - wk10 - cfd meshing 30


Skewness
Common techniques for quantifying skewness:

1. Default for tri and tet cells (equilateral volume):


𝑜𝑝𝑡𝑖𝑚𝑎𝑙 𝑐𝑒𝑙𝑙 𝑠𝑖𝑧𝑒 − 𝑎𝑐𝑡𝑢𝑎𝑙 𝑐𝑒𝑙𝑙 𝑠𝑖𝑧𝑒
𝑠𝑘𝑒𝑤𝑛𝑒𝑠𝑠 =
𝑜𝑝𝑡𝑖𝑚𝑎𝑙 𝑐𝑒𝑙𝑙 𝑠𝑖𝑧𝑒

2. For prisms & pyramids and applies to all types of


faces/cells (normalised equilateral angle):
𝜃max − 90 90 − 𝜃m𝑖𝑛
𝑠𝑘𝑒𝑤𝑛𝑒𝑠𝑠 = max ,
90 90

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%.

MECH3780 - wk10 - cfd meshing 32


Aspect Ratio
• Measured as the ratio of the longest edge length to the shortest for a given cell.

• 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.

Where are you likely to want high aspect ratio cells?

MECH3780 - wk10 - cfd meshing 33


Additional Considerations
• Cell Connectivity: • Impact of skewness:

• Impact of cell type: • Impact of flow alignment:

• 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.

MECH3780 - wk10 - cfd meshing 34


https://www.azorecfd.com/blog/azores-built-in-tools-for-evaluating-mesh-quality
Best Practice Tips and Rules of Thumb
With poor mesh quality it is possible that a simulation may converge to inaccurate results or diverge. In
practice when creating your initial mesh, aim to:

• 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).

• Maintain aspect ratio near one when flow is multi-directional.

• 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!

MECH3780 - wk10 - cfd meshing 36


Christopher Roy, Virginia Tech, “Discretization Error”
Mesh Adaptation
Often initial simulations have low resolution but provide the CFD practitioner with an understanding of
the flow and where interesting features manifest in the domain.
• Mesh adaptation is the process (often automated these days) of adapting the mesh to add more
cells where the flow needs to be further resolved.
• Fluent does this using registers that can be based on:
– Gradients, isovalues, boundaries, cell volumes, ….

MECH3780 - wk10 - cfd meshing 37


Case Study: Influence of mesh type
GridPro conducted a case study which highlights the importance of mesh design (cell type, structure,
clustering, …).
– Six grids were generated with similar cell count, boundary buffer layers, size of boundary-adjacent
cell, etc.:

MECH3780 - wk10 - cfd meshing 38


Case Study: Influence of mesh type
In these simulations the unstructured grids resulted in faster wake dissipation than the structured grids.
Additionally, variation is observed in lift and drag - and this is for a relatively simple 2D airfoil.

MECH3780 - wk10 - cfd meshing 39


Case Study: Influence of mesh type
In these simulations the unstructured grids resulted in faster wake dissipation than the structured grids.
Additionally, variation is observed in lift and drag - and this is for a relatively simple 2D airfoil.

MECH3780 - wk10 - cfd meshing 40


Mesh Independence: How do we know our mesh
is good enough and our solution methodology is
correct?
Remember that all models are wrong; the practical question is how wrong do they have to be to not be
useful.
- George P.E. Box

MECH3780 - wk10 - cfd meshing 41


Mesh Independence
Often we are trying to model a physical system that depends on:
• Geometry, density, viscosity, temperature, pressure, velocity, …
The physical system is not dependent on an underlying discrete numerical grid.
→ Ideally your results should not be either!

Mesh Independence Study:


• Optimisation problem: what is the minimum
number of cells we need to obtain a solution that
will not change with further refinement?
• This is a systematic refinement of every aspect of
the computational mesh – not just refining areas of
interest for the flow (this should be done already).
• In practice, this is necessary to do when facing a
new flow problem, configuration, or introducing
additional equations into a solver (part of
verification).
MECH3780 - wk10 - cfd meshing 42
Mesh Independence
Often we are trying to model a physical system that depends on:
• Geometry, density, viscosity, temperature, pressure, velocity, …
The physical system is not dependent on an underlying discrete numerical grid.
→ Ideally your results should not be either!

Mesh Independence Study:


• Optimisation problem: what is the minimum
number of cells we need to obtain a solution that
will not change with further refinement?
• This is a systematic refinement of every aspect of
the computational mesh – not just refining areas of
interest for the flow (this should be done already).
• In practice, this is necessary to do when facing a
new flow problem, configuration, or introducing
additional equations into a solver (part of
verification).
MECH3780 - wk10 - cfd meshing 43
Verification vs Validation
According to NASA: Reality
• Verification: determines if the programming and Conceptualisation

computer implementation of the conceptual model is


Physical Model
correct.
• Validation: determines if the computer simulation (i.e., Formalisation

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

Timm Kruger’s: The art of (numerical) modelling

MECH3780 - wk10 - cfd meshing 44


Meshing with ANSYS: Lets get practical!

MECH3780 - wk10 - cfd meshing 45


The Modelling Process
1. Problem Identification – What is the goal of your simulation, what are your constraints?
2. Pre-processing:
a) Geometry
b) Mesh design
c) Selection of relevant physics
3. Solution
• What numerical algorithms to apply?
• What settings are appropriate for these algorithms?
• What is your estimated computational cost?
• Solve
4. Post-processing
a) Mesh independence analysis?
b) Assessment of flow features (check for any anomalies or unexpected behaviour)
c) Extraction of parameters relevant to simulation goal
5. Review and presentation of results
MECH3780 - wk10 - cfd meshing 46
Pre-Process: Geometry Creation & Simplification
Ansys is working hard to improve their geometry engine (i.e., SpaceClaim, Discovery) but perhaps still
lacks the power of CAD focused programs – Inventor, NX, Solidworks, Catia, Creo, etc.

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:

MECH3780 - wk10 - cfd meshing 47


Pre-Process: Prep geometry for meshing
More often than not, CAD geometries will be designed for manufacture – not for CFD.
→ As such they can cause issues for mesh generation algorithms due to e.g., small faces, additional
edges, small edges, etc.

• 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

We can also inspect the quality of the mesh with


contours and other post-processing tools:

MECH3780 - wk10 - cfd meshing


So what is Fluent’s method of calculating these?? 49
Mesh Quality in Fluent
Once you have generated the mesh, it is important to: 𝑨𝒊 ⋅ 𝒇𝒊 𝑨𝒊 ⋅ 𝒄𝒊
𝑸𝟏 = & 𝑸𝟐 =
• Mesh Check |𝑨𝒊 | |𝒇𝒊 | |𝑨𝒊 | |𝒄𝒊 |

• 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

MECH3780 - wk10 - cfd meshing 50


Pre-Process: Meshing
• SpaceClaim can be used to deal with fixing (and in some cases generating) more complex CAD
geometries. For simple geometries where we want more user control, DesignModeller (as we will
see in the tute this week) provides a ‘light(er)’ alternative.
• Once we have fixed the geometry, we can apply the theory discussed today to design a suitable
mesh!

In the tutorial this week:


• How to generate a geometry for a 2D internal flow problem (DesignModeller);
• How to generate a simple mesh for this geometry;
• How to apply sizing and inflations (clustering);
• How to set up a simulation using a User Defined Function for the inflow condition;
• How to compare our results with experimental data.

MECH3780 - wk10 - cfd meshing 51


Summary

MECH3780 - wk10 - cfd meshing 52


Key Take Away Points
1. Design and generation of your computational grid is crucial for the success of your CFD study.
2. Mesh generation for CFD can be considerably more time consuming then FEA and harder to inspect
for problem areas.
3. Structured grids (if easily generated) will offer the highest guarantee for optimal accuracy.
4. Unstructured grids will give you more flexibility for automatic grid generation with complex geometries.
5. Give significant care to the quality of the grid, avoid grid discontinuities and stretched distorted grids
(especially in regions where the flow is expected to vary significantly!)
6. Use tools to check mesh quality but be aware of the flow physics!
7. Mesh independence studies are very useful for building confidence and reliability when addressing
new configurations, geometries, or implementing new algorithms.
8. When choosing a mesh type and designing the structure consider:
a) Geometric complexity of the problem – can this be simplified?
b) The computational resources required and the accuracy needed to achieve the goal.
c) The expected flow features and whether the flow fields predicted by the simulation ‘make sense’ →
engineering judgement!
MECH3780 - wk10 - cfd meshing 53
Questions?
Dr Travis Mitchell
Lecturer
t.,[email protected]

CRICOS 00025B • TEQSA PRV12080

You might also like