Please enable JavaScript.
Coggle requires JavaScript to display documents.
Mesh generation and conversion, Mesh conversion, Mapping fields between…
Mesh generation and conversion
Mesh description
Mesh is an integral part of the numerical solution and must satisfy certain criteria to ensure a valid, and accurate solution.
a mesh in OpenFOAM is known as a
polyMesh
offers great freedom in mesh generation and manipulation in particular when the geometry of the domain is complex or changes over time.
Mesh specification and validity constraints
conditions
Points
: location in #-D space, defined by a vector in m
Faces
: an ordered list of points, where a point is referred by its label.
Ordering
: each two neighbouring points are connected by an edge
Cells
: a list of faces in arbitrary order.
properties
Contiguous
: cells completely cover the computational domain (must not overlap)
Convex
: cell must be convex and its cell centre inside the cell
Closed
: cell must be closed, geometrically and topologically
Orthogonality
: requires each internal face, the angle between the face area vector, oriented and the centre-to-centre vector must < 90 degree
Boundary
: a list of patches associated with a bpundary condition (patch is a list of face labels, must contain only boundary faces and no internal faces). Required to be closed
types
Internal faces
: connect two cells (never be more than two).
Ordering
: the face normal points into the cell with larger label
Boundary faces
: addressed by one cell (only) and a boundary patch.
Ordering
: the face normal points outside of the computational domain
The polyMesh description
based around faces, and internal cells connect 2 cells and boundary faces address a cell and a boundary patch
each face is assigned an 'owner' cell and 'neighbour' cell
startFace
: index into the face list of the first face in the patch
nFaces
: the number of faces in the patch
I/O specification
points
: a list of vectors describing the cell vertices
faces
: a list of faces
owner
: a list of owner cell labels
neighbour
: a list of neighbour cell labels
boundary
: a list of patches
The cellShape tools
a mesh in terms of a limited set of 3D cell geometries
the shape is defined by the ordering of point labels in accordance with the numbering scheme contained in the shape model
cell description consists of the name of a cell model and the ordered list of labels
1- and 2-dimensional and axi-symmetric problems
simulated by generating a mesh in 3-D and applying special boundary conditions on any patch in the plane(s) normal to the direction(s) of interest
1- and 2-D problems use
empty
patch type. Axi-symmetric problems use the
wedge
type.
cell type: hexahedron, wedge, prism, pyramid, tetrahedron, tet-wedge
Boundaries
generally broken up into a set of
patches
Specification of patch types in OpenFOAM
Base types
patch
: generic path
symmetryPlane
: plane of symmetry
empty
: front and back planes of a 2D geometry
wedge
: wedge front and back for an axi-symmetric geometry
cyclic
: cyclic plane
wall
: used for wall functions in turbulent flows
1 more item...
Mesh generation with the blockMesh utility
Multiple block
connection between blocks
the consequences: the original geometry of the slave patch will not necessarily be completely preserved during merging
possibilties:
face matching
: set of faces that comprise a patch from 1 block are formed from
the same set of vertices
, ignored from the
patches
list
face merging
: a group of faces are connected to another group of faces (different blocks), defined in the
patches
list
rules for merging
the faces of the master patch remain as originally defined
the faces of the salve patch are projected onto the master patch (separate)
the location of any vertex of a salve face might be adjusted by
blockMesh
to eliminate any face edge that is shorter than a minimum tolerance
if patches overlap, each face that does not merge remains as an external face of the original patch (applied boundary conditions)
if all faces are merged, then the patch itself will contain no faces and removed
Writing a
blockMesh
file
keyword:
scale
- specifies a scaling factor by which all vertex coordinates in mesh description are multiplied
The vertices
: vertices of the blocks of the mesh
The edges
: any edge may be specified to be curved by entries
keyword:
arc, simpleSpline, polyLine, polySpline, line
The blocks
: compound entry consisting of a list of vertex labels based on the orders
Orders
:
Vertex numbering
: shape identifier of the block
Number of cells
: number of cells in each x1, x2 and x3 directions
Cell expansion ratios
: enables the mesh to be grade or refined in specified directions.
1 more item...
The boundary
: broken into patches (regions), each patch has its name as keyword (user's choice or recommendations)
patch alongside with
type
: patch type
faces
: make up the patch
Creating blocks with fewer than 8 vertices
collapsing one or more pair(s) of vertices onto each other
example: creating a 6-sided wedge shaped block for 2-D axi-symmetric cases, use
wedge
patch
hex (0 1 2 3 4 5 6 7) to hex (0 1 2 3 4 5 5 4)
Mesh generation with the snappyHexMesh utility
generates 3D meshes containing hex and split-hex automatically from triangulated surface geometries in Stereolithography (STL) format
The mesh generation process of snappyHexMesh
objective: to mesh a rectangular shaped region (shaded grey in the figure) surrounding an object described by and STL surface
Creating the background hex mesh
criteria
the cell aspect ratio should be approximately 1
at least 1 intersection of a cell edge with STL surface
the mesh must consist purely of hexes
Cell splitting at feature edges and surfaces
begins with cells being selected according to specified edge features first within the domain
minimum level: applied generally across the surface, maximum level: applied to cells that can see intersections that form an angle
Cell removal
requires one or more regions enclosed entirely by a bounding surface within the domain
Cell splitting in specified regions
cells that lie within 1 or more specified volume regions can be further split
refinement
mode
outside
distance
inside
Snapping to surfaces
remove the jagged castellated surface from the mesh
Mesh layers
can produce some irregular cells along boundary surfaces
1 more item...
Mesh quality controls
Mesh conversion
generate meshes using other packages and convert them into the fomat used by OpenFOAM
fluentMeshToFoam
: writes mesh data to a single file with
.msh
extension
star4ToFoam
: convert a mesh generated on the
STAR-CD/PROSTAR
files
gambitToFoam
: writes mesh data to a single file with
.neu
extension.
cfx4ToFoam
: writes mesh data to a single file with
.geo
extension
Mapping fields between different geometries
maps one or more fields relating to a given geometry onto the corresponding fields for another geometry
terms:
data is mapped from source to target
fields are deemed
consistent
if geometry and boundary types (source & target) are identical
time directory specified by
startFrom/startTime
in
controlDict
of target case
Mapping consistent fields
: performed by executing
mapFields
on target case using
-consistent
command line option
Mapping inconsistent fields
:
mapFields
requires a
mapFieldsDict
dictionary in the
system
directory. lists:
patchMap
(contains each pair of names of source and target patch),
cuttingPatches
(contains names of target patches)
the field data is mapped from source to target wherever possible
the patch field data is left unaltered unless specified otherwise in
mapFieldsDict
dictionary
Mapping parallel cases
: either or both source and target cases are decomposed for running in parallel
-parallelSource
: source case is decomposed for parallel running
-parallelTarget
: target case is decomposed for parallel running
creates parametric meshes with grading and crurved edges
principle
: decompose the domain geometry into a set of 1 or more 3D, hexahedral blocks