+ All Categories
Home > Documents > 5 CFD Week06 - Domain Defintion

5 CFD Week06 - Domain Defintion

Date post: 09-Nov-2015
Category:
Upload: adilnaseem
View: 234 times
Download: 7 times
Share this document with a friend
Description:
CFD Week06 - Domain Defintion
Popular Tags:
39
27- Mar-15 1 27-Mar-1527-Mar-15 Computational Fluid Dynamics 34 GEOMETRY GENERATION USING OPEN SOURCE TOOLS There many ways to creating a geometry, this gives you the freedom to work in a way that is comfortable to you. There is no wrong or right way to generate a geometry. The only rule you should keep in mind is that by the end of the day you should get a unique clean and watertight geometry. The quality of the mesh and hence of Computational Fluid Dynamics 35 Domain Definition
Transcript

Computational Fluid Dynamics

27-Mar-1527-Mar-15Computational Fluid Dynamics34GEOMETRY GENERATION USING OPEN SOURCE TOOLSComputational Fluid Dynamics35

Domain Definition

There many ways to creating a geometry, this gives you the freedom to work in a way that is comfortable to you. There is no wrong or right way to generate a geometry. The only rule you should keep in mind is that by the end of the day you should get a unique clean and watertight geometry. The quality of the mesh and hence of the solution, greatly depends on the geometry.

27-Mar-15So always do your best when creating the geometry.

#

27-Mar-1527-Mar-15Computational Fluid Dynamics36Potential geometry issues Missing faces. Cracks. Small faces. Gaps. Misaligned faces. Free faces, edges, Overlapping faces.nodes. Sliver faces (high Hard edges.aspect-ratio). Small edges. Repeated faces. Sharp angles. Several surfaces Repeated edges.connected to a single surface. High curvature NURBS.Computational Fluid Dynamics37NURBS

Non-uniform rational basis spline (NURBS) is a mathematical model commonly used in computer graphics for generating and representing curves and surfaces. It is a mathematically precise representation of freeform surfaces which could be exactly reproduced whenever technically needed, like those used for ship hulls, aerospace exterior surfaces, and car bodies,Computational Fluid Dynamics38

Potential geometry issues

27-Mar-1527-Mar-15In general, when generating the geometry and by using good geometry generation practices, we should not experience these geometry issues. At the end, we should get a smooth, clean, watertight body. Usually, we find these issues when importing or exporting the geometry from/to different formats.Computational Fluid Dynamics39Preparing Geometry for Meshing Delete hard edges. Delete small edges/faces. Fill holes. Split surfaces with high curvature. Sew faces. Remove sliver faces. Connect/disconnected edges/faces. Delete sharp edges. Remove unnecessary details (defeaturing). This includes points, edges and faces. Decompose geometry into meshable sections.

27-Mar-1527-Mar-15Computational Fluid Dynamics41Preparing Geometry for Meshing Missing face

Computational Fluid Dynamics42Preparing Geometry for Meshing NURBS- To improve quality, split the single surface into two surfaces

27-Mar-1527-Mar-15Computational Fluid Dynamics43Preparing Geometry for Meshing

Computational Fluid Dynamics44Preparing Geometry for Meshing

27-Mar-1527-Mar-1545Computational Fluid DynamicsPreparing Geometry for Meshing

Too many surfaces connected to a single surface\High aspect ratio face/Sliver face

Computational Fluid Dynamics46Preparing Geometry for Meshing

Computational Fluid Dynamics47

27-Mar-1527-Mar-15Preparing Geometry for Meshing Many times, it is not necessary to model all the details of the geometry. In these cases you should consider simplifying the geometry (geometry defeaturing) it can save a lot of time when generating the mesh.

Computational Fluid Dynamics48

Computational Fluid Dynamics49

27-Mar-1527-Mar-15MESHINGComputational Fluid Dynamics50

Meshing Preliminaries

Mesh generation consist in dividing the physical domain into a finite number of discrete regions, called control volumes or cells in which the solution is sought. Meshes used for the FVM method can consist of tetrahedras, pyramids, prisms, hexahedras or any kind of polyhedral element (or a mix of all of them). The meshes can be unstructured or structured. In our discussion, when we talk about unstructured or structured meshes we refer specifically to the method used to generate them.

The connectivity information of each cell (how faces and cells are connected) and cell/face neighbor information is also needed for FVM unstructured meshes. 27-Mar-1527-Mar-15Computational Fluid Dynamics51Meshing Preliminaries The data structure of the meshes used in the FVM is represented by the points and faces that make up each control volume.Meshes used for the FDM method are made of hexahedra and they are known as single and/or multi-block structured meshes. The connectivity information of the meshes used in the FDM is expressed as a two or three dimensional array, this is highly memory efficient as we do not need to store all the connectivity information of the faces and cells.Computational Fluid Dynamics53

Meshing Examples

Single-block C-type structured grid around a NACA 4412 airfoil

27-Mar-1527-Mar-15Computational Fluid Dynamics54Meshing Examples Multi-block structured grid around a NLR 7301 airfoil with flap

Computational Fluid Dynamics55

Meshing Examples

Unstructured triangular mesh around a NHLP-2D three element airfoil

27-Mar-1527-Mar-15Computational Fluid Dynamics56Meshing Examples

Overlapping structured grid around a NLR 7301 airfoil with flap

Computational Fluid Dynamics

57 Cartesian mesh around a Drela DAE11 low Reynolds airfoilMeshing Examples

27-Mar-1527-Mar-15Computational Fluid Dynamics58Meshing ComparisonSTRUCTURED UNSTRUCTURED CARTESIAN OVERLAPPINGGeometric Flexibility/ AdaptationV GoodV GoodAverageV Good

Grid Adaptation/ Local RefinementBadV GoodV GoodV Good

Viscous ComputationV GoodGoodV BadV Good

Moving/Deforming Meshes QualityGoodAverageV GoodV Good

Interpolation/ConservationV GoodV GoodGoodGood

Grid generation easinessBadV GoodV GoodBad

MemoryRequirementsV GoodBadV GoodV Good

CPU RequirementsV GoodBadV GoodV Good

Computational Fluid Dynamics59Structured Vs. Unstructured Mesh A single block structured mesh may comprise of square elements (2D) or hexahedral elements (3D) which are orthogonal in i, j space (2D) or i, j, k space (3D). Although it is also possible to have wedges (3D), triangles (2D) and pyramids (3D) in a structured mesh. Looking at a 2D example, for simplicity: Every node in a 2D structured mesh has a corresponding integer i and j index value which is unique. The physical locations of the nodes are stored in a table or are functionally related to the mesh space (ie(x,y)= f(i,j)). The neigbours of node (ij) are (i-1,j), (i+1,j), (ij-1), (ij+1), (i-1,j-1), and (i+1,j+1). A structured mesh makes it very easy to loop through neighbours and can be efficient with memory. A structured mesh has many coding advantages, but it may be difficult to conform a single block to a complicated shape. Code developers have got around this by allowing multiple blocks (multiblock unstructured), but this can make the internal memory strucutres more inefficient. Another way to make the mesh generation simpler, and improve code performance is to throw away the block structure and replace indices with node numbers and a connectivity table. This is known as an unstructured mesh, because it lacks the i,j,k structure.

27-Mar-1527-Mar-15Computational Fluid Dynamics60Structured Vs. Unstructured Mesh A structured mesh requires the blocking as input. Unstructured meshes, only requires the element size on the lines and surfaces that define the geometry as input.Computational Fluid Dynamics61Structured Vs. Unstructured Mesh Unstructured Hybrid Mesh (tetras, prisms and hexs) Cell count: approx. 5 000 000 Structured Mesh (hexahedrals) Cell count: approx. 5 000 000

27-Mar-1527-Mar-1562Computational Fluid DynamicsStructured Vs. Unstructured MeshComputational Fluid Dynamics63Structured Vs. Unstructured Mesh Each mesh type has its advantages and disadvantages. At the end of the day, the mesh you use must has a good overall quality and must be smooth. The mesh density should be high enough to capture all relevant flow features.

Computational Fluid Dynamics65

Mesh Quality

Rule of thumb: the elements shape and distribution should be pleasing to the eye.

27-Mar-1527-Mar-15There is no written theory when it comes to mesh generation and the whole process depends on user experience. The user can rely on grid dependency studies, but they are time consuming and expensive. No single standard benchmark or metric exists that can effectively assess the quality of a mesh, but you can rely on suggested best practices.Computational Fluid Dynamics66

Mesh Quality

The most common mesh quality metrics are:

Orthogonality. Skewness. Aspect Ratio. Smoothness.

27-Mar-1527-Mar-15Computational Fluid Dynamics67Mesh Quality Mesh orthogonality It is the angular deviation of the vector S (located at the face center f ) from the vector d connecting the two cell centers P and N. It affects the gradient of the face center f. It adds diffusion to the solution.

Computational Fluid Dynamics68

Mesh Quality

Mesh skewness

- It affects the interpolation of the cell centered quantities to the face center f.- Skewness is the deviation of the vector d that connects the two cells P and N, from the face center f. The deviation vector is represented with A and the point where the vector d intersects the face f is f-.

27-Mar-1527-Mar-15Computational Fluid Dynamics69Mesh Quality Mesh aspect ratio AR Mesh aspect ratio AR is the ratio between the longest side Ax and the shortest side Ay . Large AR are fine if gradients in the long direction are small. High AR smear gradients.

Computational Fluid Dynamics70

Mesh Quality

Smoothness, also known as expansion rate, growth factor or uniformity, defines the transition in size between contiguous cells.Large transition ratios between cells add diffusion to the solution. Smoothness

Computational Fluid Dynamics71

Mesh Quality

For the same cell count, hexahedral meshes will give more accurate solutions, especially if the grid lines are aligned with the flow.

27-Mar-1527-Mar-15The mesh density should be high enough to capture all relevant flow features. In areas where the solution change slowly, you can use larger elements. To keep cell count down, use non-uniform meshes to cluster cells only where they are needed. Use local refinements and solution adaption to further refine only on selected areas. In boundary layers, quad, hex, and prism/wedge cells are preferred over triangles, tetrahedras, or pyramids. If you are not using wall functions (turbulence modeling), the mesh adjacent to the walls should be fine enough to resolve the boundary layer flow. This will rocket the cell count.Computational Fluid Dynamics72

Mesh Quality

In- WM_PROJ ECT_DIR/src/OpenFOAM/meshes/primitive Mesh/primitiveMeshCheck/primitiveMeshCheck.C you will find the quality metrics used in OpenFOAM. Their maximum (or minimum) values are defined as follows:Foam::scalar Foam::primitiveMesh::closedThreshold_ = 1.0e-6; Foam::scalar Foam::primitiveMesh::aspectThreshold_ = 1000; Foam::scalar Foam::primitiveMesh::nonOrthThreshold_ = 70; // deg Foam::scalar Foam::primitiveMesh::skewThreshold_ = 4; Foam::scalar Foam::primitiveMesh::planarCosAngle_ = 1.0e-6;

27-Mar-1527-Mar-15Computational Fluid Dynamics73Mesh Quality OpenFOAM comes with the utility checkMesh which checks the validity of the mesh.checkMesh will look for/check for:Mesh stats and overall number of cells of each type.Check topology (boundary conditions definitions).Check geometry and mesh quality (bounding box, cell volumes, skewness, orthogonality, aspect ratio)If for any reason checkMesh finds errors, it will give you a message and it will tell you what check failed.It will also write a set with the faulty cells, faces, points. These sets are saved in the directoryconstant/polyMesh/sets/Computational Fluid Dynamics74Mesh Quality Mesh topology and patch topology errors must be repaired. You will be able to run with mesh quality errors such as skewness, aspect ratio, minimum face area, and non-orthogonality. But remember, they will severely tamper the solution accuracy and eventually can make the solver blow-up. checkMesh does not repair these errors. You will need to check the geometry for possible errors and generate a new mesh.

Computational Fluid Dynamics75

Mesh Conversion

27-Mar-1527-Mar-15 It is also possible to export a mesh generated with a third party software and use it in OpenFOAM. Some of the utilities available formesh conversion are listed below: ansysToFoam: converts an ANSYS input mesh file OpenFOAM format. cfx4ToFoam: converts a CFX 4 mesh to OpenFOAM format. fluent3DMeshToFoam: converts a Fluent mesh to OpenFOAM format. gambitToFoam: converts a GAMBIT mesh to OpenFOAM format. gmshToFoam: reads .msh file as written by Gmsh. ideasUnvToFoam: I-Deas unv format mesh conversion. plot3dToFoam: plot3d mesh (ascii/formatted format) converter. star4ToFoam: converts a STAR-CD (v4) PROSTAR mesh into OpenFOAM format. tetgenToFoam: Converts .ele and .node and .face files, written by tetgen.Computational Fluid Dynamics76

Mesh Conversion

OpenFOAM also comes with many mesh manipulation utilities. Some of them are listed below: checkMesh: checks validity of a mesh. refineMesh: utility to refine cells in multiple directions. renumberMesh: renumbers the cell list in order to reduce the bandwidth, reading and renumbering all fields from all the time directories transformPoints: transforms the mesh points in the polyMesh directory according to the translate, rotate and scale options. mirrorMesh: mirrors a mesh around a given plane. setSet: manipulate a cell/face/point/ set or zone refineWallLayer: utility to refine cells next to patches.

Computational Fluid Dynamics77

Mesh Conversion

blockMesh

27-Mar-1527-Mar-15For simple geometries, the mesh generation utility blockMesh (supplied with OpenFOAM), can be used. The blockMesh utility creates multiblock meshes. The mesh is generated from a dictionary file named blockMeshDict located in the constant/polyMesh directory. snappyHexMesh For complex geometries, the mesh generation utility snappyHexMesh (supplied with OpenFOAM), can be used. The snappyHexMesh utility generates 3D meshes containing hexahedra and split-hexahedra from a triangulated surface geometry in Stereolithography (STL) format. The mesh is generated from a dictionary file named snappyHexMeshDict located in the system directory and a triangulated surface geometry file located in the directory constant/triSurface.Computational Fluid Dynamics78

Meshing Examples

Working with lid driven cavityblocks(hex (0 1 2 3 4 5 6 7) (20 20 1) simpleGrading (1 1 1));

27-Mar-1527-Mar-15Computational Fluid Dynamics79Meshed Cavity - Grading 1 1 1 Max aspect ratio = 1 OK. Minumum face area = 2.5e-05. Maximum face area = 5e-05. Face area magnitudes OK. Min volume = 2.5e-07. Max volume = 2.5e-07. Total volume = 0.0001. Cell volumes OK. Mesh non-orthogonality Max: 0 average: 0 Non-orthogonality check OK. Face pyramids OK. Max skewness = 1e-08 OK. Coupled point location match (average 0) OK.Computational Fluid Dynamics80Meshed Cavity - Grading 4 1 1 Max aspect ratio = 2.18175 OK. Minumum face area = 1.14587e-5. Maximum face area = 9.16694e- 05. Face area magnitudes OK. Min volume = 1.14587e-07. Max volume = 4.58347e-07. Total volume = 0.0001. Cell volumes OK. Mesh non-orthogonality Max: 0 average: 0 Non-orthogonality check OK. Face pyramids OK. Max skewness = 2.18175e-08 OK. Coupled point location match (average 0) OK.

27-Mar-1527-Mar-15Computational Fluid Dynamics81Meshed Cavity- Grading 4 4 1 Max aspect ratio = 4 OK. Minumum face area = 5.25205e-6. Maximum face area = 9.16694e- 05. Face area magnitudes OK. Min volume = 5.25205e-08. Max volume = 8.40328e-07. Total volume = 0.0001. Cell volumes OK. Mesh non-orthogonality Max: 0 average: 0 Non-orthogonality check OK. Face pyramids OK. Max skewness = 4.41922e-08 OK. Coupled point location match (average 0) OK.Computational Fluid Dynamics82Meshed Cavity - Grading 0.25 1 1 Max aspect ratio = 2.18175 OK. Minumum face area = 1.14587e- 05. Maximum face area = 9.16694e- 05. Face area magnitudes OK. Min volume = 1.14587e-07. Max volume = 4.58347e-07. Total volume = 0.0001. Cell volumes OK. Mesh non-orthogonality Max: 0 average: 0 Non-orthogonality check OK. Face pyramids OK. Max skewness = 2.18175e-08 OK. Coupled point location match (average 0) OK.

27-Mar-1527-Mar-1584Computational Fluid Dynamics83Meshed Cavity - Grading 0.25 0.25 1 Max aspect ratio = 4 OK. Minumum face area = 5.25205e- 06. Maximum face area = 9.16694e- 05. Face area magnitudes OK. Min volume = 5.25205e-08. Max volume = 8.40328e-07. Total volume = 0.0001. Cell volumes OK. Mesh non-orthogonality Max: 0 average: 0 Non-orthogonality check OK. Face pyramids OK. Max skewness = 4.75371e-08 OK. Coupled point location match (average 0) OK.Computational Fluid DynamicsDense CavityMax aspect ratio = 4 OK.Minumum face area = 5.86845e-7. Maximum face area = 3.06423e- 05. Face area magnitudes OK.hex (0143 910 13 12) (30 30 1) simpleGrading (4 4 1) // bottom left quadrant hex (1 2 5 4 1011 14 13) (30 30 1) simpleGrading (0.25 4 1) // bottom right quadrant hex (3 4 7 6 12 13 16 15) (30 30 1) simpleGrading (4 0.25 1) // top left quadrant hex (4 5 8 7 13 14 17 16) (30 30 1) simpleGrading (0.25 0.25 1) // top right quadrant); Max skewness = 4.25763e-07 OK. Coupled point location match (average 0) OK.

27-Mar-1527-Mar-15Computational Fluid Dynamics85Arched Cavity Max aspect ratio = 294.73 OK. Minumum face area = 1.10919e-08. Maximum face area = 4.81143e-05.Face area magnitudes OK. Min volume = 1.10919e-10. Max volume = 1.47263e-07. Total volume = 0.0001. Cell volumes OK. Mesh non-orthogonality Max: 89.3105 average: 52.3784 *Number of severely non-orthogonal faces: 1309. Non-orthogonality check OK.


Recommended