5 CFD Week06 - Domain Defintion

March 26, 2018 | Author: adilnaseem | Category: Computational Fluid Dynamics, Mathematical Analysis, Geometry, Mathematics, Science


Comments



Description

27-Mar-1527-Mar-1527-Mar15 Computational Fluid Dynamics 34 GEOMETRY GENERATION USING OPEN SOURCE TOOLS Computational Fluid Dynamics 35 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. So always do your best when creating the geometry. 1 27-Mar-1527-Mar-1 27-Mar-1527-Mar-15 Computational Fluid Dynamics 3 6 Potential geometry issues • Missing faces. • Cracks. • Small faces. • Misaligned faces. • Overlapping faces. • Sliver faces (high aspect-ratio). • Repeated faces. • Several surfaces connected to a single surface. • Gaps. • Free faces, edges, nodes. • Hard edges. • Small edges. • Sharp angles. • Repeated edges. • High curvature NURBS. Computational Fluid Dynamics 37 NURBS • • 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 Dynamics 38 Potential geometry issues • In 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 Dynamics 39 Preparing 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-1 Computational Fluid Dynamics 41 Preparing Geometry for Meshing • Missing face Computational Fluid Dynamics 42 Preparing Geometry for Meshing • NURBS . split the single surface into two surfaces .To improve quality. 27-Mar-1527-Mar-1 Computational Fluid Dynamics 43 Preparing Geometry for Meshing Computational Fluid Dynamics Preparing Geometry for Meshing 44 . 27-Mar-1527-Mar-1 Computational Fluid Dynamics 45 Preparing Geometry for Meshing Too many surfaces connected to a single surface \ High aspect ratio face/Sliver face Computational Fluid Dynamics Preparing Geometry for Meshing 46 . 27-Mar-1527-Ma Computational Fluid Dynamics 47 Preparing 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 Dynamics 48 . hexahedras or any kind of polyhedral element (or a mix of all of them). In our discussion. • The meshes can be unstructured or structured. prisms. • Meshes used for the FVM method can consist of tetrahedras.27-Mar-1527-Mar Computational Fluid Dynamics 49 MESHING Computational Fluid Dynamics 50 Meshing Preliminaries • Mesh generation consist in dividing the physical domain into a finite number of discrete regions. . pyramids. called control volumes or cells in which the solution is sought. 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-15 Computational Fluid Dynamics 51 Meshing Preliminaries • The data structure of the meshes used in the FVM is represented by the points and faces that make up each control volume. this is highly memory efficient as we do not need to store all the connectivity information of the faces and cells. • The connectivity information of the meshes used in the FDM is expressed as a two or three dimensional array. • Meshes used for the FDM method are made of hexahedra and they are known as single and/or multi-block structured meshes. Computational Fluid Dynamics Meshing Examples • Single-block C-type structured grid around a NACA 4412 airfoil 53 . 27-Mar-1527-Mar-1 Computational Fluid Dynamics 54 Meshing Examples • Multi-block structured grid around a NLR 7301 airfoil with flap Computational Fluid Dynamics 55 Meshing Examples • Unstructured triangular mesh around a NHLP-2D three element airfoil . 27-Mar-1527-Mar-1 Computational Fluid Dynamics 56 Meshing Examples • Overlapping structured grid around a NLR 7301 airfoil with flap Computational Fluid Dynamics Meshing Examples • Cartesian mesh around a Drela DAE11 low Reynolds airfoil 57 . and improve code performance is to throw away the block structure and replace indices with node numbers and a connectivity table. k space (3D).j).k structure.j. j. for simplicity: - • • Every node in a 2D structured mesh has a corresponding integer i and j index value which is unique. The neigbours of node (ij) are (i-1. (ij-1). Although it is also possible to have wedges (3D).27-Mar-1527-Mar-1 Computational Fluid Dynamics 58 Meshing Comparison STRUCTURED UNSTRUCTURED CARTESIAN OVERLAPPING Geometric Flexibility/ Adaptation Grid Adaptation/ Local Refinement Viscous Computation Moving/Deforming Meshes Quality Interpolation/ Conservation Grid generation easiness V Good V Good Average Bad V Good V Good V Good Good Good Average V Good V Good V Good Good Bad V Good V Good Bad V Good Bad V Good V Good Bad V Good V Goo d V Goo V Bad Memory Requirements CPU Requirements V Goo d V Goo d V Goo V Goo d Goo d Computational Fluid Dynamics 59 Structured Vs. (i-1. A structured mesh has many coding advantages.j). . The physical locations of the nodes are stored in a table or are functionally related to the mesh space (ie (x. A structured mesh makes it very easy to loop through neighbours and can be efficient with memory. (i+1. Looking at a 2D example. because it lacks the i.j+1). This is known as an unstructured mesh. (ij+1).y)= f(i. j space (2D) or i.j)). and (i+1. Unstructured Mesh • A single block structured mesh may comprise of square elements (2D) or hexahedral elements (3D) which are orthogonal in i.j-1). Another way to make the mesh generation simpler. but this can make the internal memory strucutres more inefficient. Code developers have got around this by allowing multiple blocks (multiblock unstructured). but it may be difficult to conform a single block to a complicated shape. triangles (2D) and pyramids (3D) in a structured mesh. prisms and hexs) • Cell count: approx. 5 000 000 • Structured Mesh (hexahedrals) • Cell count: approx. 5 000 000 61 . • Unstructured meshes. Computational Fluid Dynamics Structured Vs. Unstructured Mesh • A structured mesh requires the blocking as input. Unstructured Mesh • Unstructured Hybrid Mesh (tetras. only requires the element size on the lines and surfaces that define the geometry as input.27-Mar-1527-Mar-1 Computational Fluid Dynamics 60 Structured Vs. • At the end of the day. Unstructured Mesh • Each mesh type has its advantages and disadvantages. . the mesh you use must has a good overall quality and must be smooth.27-Mar-1527-Mar-1 Computational Fluid Dynamics 62 Structured Vs. • The mesh density should be high enough to capture all relevant flow features. Unstructured Mesh Computational Fluid Dynamics 63 Structured Vs. • Rule of thumb: ‘the elements shape and distribution should be pleasing to the eye’. • • The user can rely on grid dependency studies. Computational Fluid Dynamics Mesh Quality • The most common mesh quality metrics are: - Orthogonality. but they are time consuming and expensive. Smoothness. Skewness. 66 .27-Mar-1527-Mar-1 Computational Fluid Dynamics 65 Mesh Quality • There is no written theory when it comes to mesh generation and the whole process depends on user experience. but you can rely on suggested best practices. • No single standard benchmark or metric exists that can effectively assess the quality of a mesh. Aspect Ratio. It affects the interpolation of the cell centered quantities to the face center f. The deviation vector is represented with A and the point where the vector d intersects .Skewness is the deviation of the vector d that connects the two cells P and N. f ) from the vector d It affects the gradient of the face center f. Computational Fluid Dynamics 68 Mesh Quality • Mesh skewness .27-Mar-1527-Mar-1 Computational Fluid Dynamics 67 Mesh Quality • Mesh orthogonality - - It is the angular deviation of the vector S (located at the face center connecting the two cell centers P and N. the face f is f-. from the face center f. . It adds diffusion to the solution. 70 . Computational Fluid Dynamics Mesh Quality • Smoothness Smoothness.27-Mar-1527-Mar-1 Computational Fluid Dynamics 69 Mesh Quality • Mesh aspect ratio AR - Mesh aspect ratio AR is the ratio between the longest side Ax and the shortest side Ay . also known as expansion rate. Large AR are fine if gradients in the long direction are small. High AR smear gradients. growth factor or uniformity. defines the transition in size between contiguous cells. Large transition ratios between cells add diffusion to the solution. • If you are not using wall functions (turbulence modeling). • • In boundary layers.C you will find the quality metrics used in OpenFOAM. Computational Fluid Dynamics 72 Mesh Quality • In . • For the same cell count. Use local refinements and solution adaption to further refine only on selected areas. you can use larger elements.0e-6.WM_PROJ ECT_DIR/src/OpenFOAM/meshes/primitive Mesh/primitiveMeshCheck/primitiveMeshCheck. or pyramids. hexahedral meshes will give more accurate solutions. . the mesh adjacent to the walls should be fine enough to resolve the boundary layer flow. and prism/wedge cells are preferred over triangles. To keep cell count down. use non-uniform meshes to cluster cells only where they are needed. Foam::scalar Foam::primitiveMesh::nonOrthThreshold_ = 70. // deg Foam::scalar Foam::primitiveMesh::skewThreshold_ = 4. In areas where the solution change slowly. tetrahedras.0e-6. Foam::scalar Foam::primitiveMesh::aspectThreshold_ = 1000. • Their maximum (or minimum) values are defined as follows: Foam::scalar Foam::primitiveMesh::closedThreshold_ = 1. especially if the grid lines are aligned with the flow. Foam::scalar Foam::primitiveMesh::planarCosAngle_ = 1. This will rocket the cell count. hex.27-Mar-1527-Mar-1 Computational Fluid Dynamics 71 Mesh Quality • • The mesh density should be high enough to capture all relevant flow features. quad. cell volumes. aspect ratio) • If for any reason checkMesh finds errors. and non-orthogonality. it will give you a message and it will tell you what check failed. skewness. These sets are saved in the directory constant/polyMesh/sets/ Computational Fluid Dynamics 74 Mesh Quality • Mesh topology and patch topology errors must be repaired. points. Check topology (boundary conditions definitions).27-Mar-1527-Mar-15 Computational Fluid Dynamics 73 Mesh Quality • OpenFOAM comes with the utility checkMesh which checks the validity of the mesh. they will severely tamper the solution accuracy and eventually can make the solver blow-up. • checkMesh will look for/check for: - Mesh stats and overall number of cells of each type. faces. But remember. • It will also write a set with the faulty cells. minimum face area. orthogonality. Check geometry and mesh quality (bounding box. You will . • You will be able to run with mesh quality errors such as skewness. • checkMesh does not repair these errors. aspect ratio. node and . ideasUnvToFoam: I-Deas unv format mesh conversion.ele and . mirrorMesh: mirrors a mesh around a given plane. refineMesh: utility to refine cells in multiple directions. reading and renumbering all fields from all the time directories transformPoints: transforms the mesh points in the polyMesh directory according to the translate. tetgenToFoam: Converts . cfx4ToFoam: converts a CFX 4 mesh to OpenFOAM format. renumberMesh: renumbers the cell list in order to reduce the bandwidth. Computational Fluid Dynamics 75 Mesh Conversion • It is also possible to export a mesh generated with a third party software and use it in OpenFOAM. • Some of them are listed below: - checkMesh: checks validity of a mesh. setSet: manipulate a cell/face/point/ set or zone refineWallLayer: utility to refine cells next to patches. fluent3DMeshToFoam: converts a Fluent mesh to OpenFOAM format. gambitToFoam: converts a GAMBIT mesh to OpenFOAM format. Some of the utilities available formesh conversion are listed below: - ansysToFoam: converts an ANSYS input mesh file OpenFOAM format. plot3dToFoam: plot3d mesh (ascii/formatted format) converter. written by tetgen. Computational Fluid Dynamics 76 Mesh Conversion • OpenFOAM also comes with many mesh manipulation utilities. .27-Mar-1527-Mar-15 need to check the geometry for possible errors and generate a new mesh.face files. rotate and scale options. gmshToFoam: reads .msh file as written by Gmsh. star4ToFoam: converts a STAR-CD (v4) PROSTAR mesh into OpenFOAM format. The mesh is generated from a dictionary file named blockMeshDict located in the constant/polyMesh directory. • blockMesh • snappyHexMesh - For complex geometries. . The snappyHexMesh utility generates 3D meshes containing hexahedra and split-hexahedra from a triangulated surface geometry in Stereolithography (STL) format. The blockMesh utility creates multiblock meshes.27-Mar-1527-Mar-15 Computational Fluid Dynamics 77 Mesh Conversion - For simple geometries. can be used. 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 Dynamics 78 Meshing Examples • Working with lid driven cavity blocks ( hex (0 1 2 3 4 5 6 7) (20 20 1) simpleGrading (1 1 1) ). the mesh generation utility snappyHexMesh (supplied with OpenFOAM). can be used. the mesh generation utility blockMesh (supplied with OpenFOAM). Computational Fluid Dynamics 80 Meshed Cavity .0001. Maximum face area = 9.16694e. Max skewness = 2. • Coupled point location match (average 0) OK. Max volume = 2.58347e-07. Max volume = 4. Face area magnitudes OK. Cell volumes OK. - Minumum face area = 2.5e-07. Total volume = 0. • Mesh non-orthogonality Max: 0 average: 0 Non-orthogonality check OK. Face pyramids OK. • Min volume = 1. - Coupled point location match (average 0) OK.18175e-08 OK. .27-Mar-1527-Mar-15 Computational Fluid Dynamics 79 Meshed Cavity . Total volume = 0. Min volume = 2. Cell volumes OK. • Max skewness = 1e-08 OK. Maximum face area = 5e-05.5e-05.18175 OK.05.Grading 1 1 1 • Max aspect ratio = 1 OK.14587e5.Grading 4 1 1 • • • • Max aspect ratio = 2. Face area magnitudes OK. • Minumum face area = 1.5e-07.0001.14587e-07. Face pyramids OK. • Mesh non-orthogonality Max: 0 average: 0 - Non-orthogonality check OK. Face area magnitudes OK. • Min volume = 1. • Coupled point location match (average 0) OK. Maximum face area = 9.27-Mar-1527-Mar-15 Computational Fluid Dynamics 81 Meshed Cavity. • Max skewness = 2.18175 OK. Maximum face area = 9.40328e-07.Grading 4 4 1 • Max aspect ratio = 4 OK. Cell volumes OK.0001.14587e-07.05. Total volume = 0.05.05. Max volume = 8. • Minumum face area = 5. • Face pyramids OK.14587e. Computational Fluid Dynamics Meshed Cavity . • Mesh non-orthogonality Max: 0 average: 0 • Non-orthogonality check OK. Cell volumes OK.16694e. • Max skewness = 4.58347e-07.41922e-08 OK.18175e-08 OK. Total volume = 0. 82 .25205e-08. Face area magnitudes OK.0001. • Minumum face area = 1.Grading 0.25205e6.25 1 1 • Max aspect ratio = 2. • Face pyramids OK. Max volume = 4. • Mesh non-orthogonality Max: 0 average: 0 • Non-orthogonality check OK. • Coupled point location match (average 0) OK. • Min volume = 5.16694e. Face area magnitudes OK. Max volume = 8.25 1 • Max aspect ratio = 4 OK. • Max skewness = 4. Maximum face area = 9. Maximum face area = 3. • Min volume = 5.06. Face area magnitudes OK. . • • Max skewness = 4.25 0.06423e05. • Mesh non-orthogonality Max: 0 average: 0 • Non-orthogonality check OK.25 4 1) // bottom right quadrant hex (3 4 7 6 12 13 16 15) (30 30 1) simpleGrading (4 0.27-Mar-1527-Mar-15 Computational Fluid Dynamics 83 Meshed Cavity .25205e. Cell volumes OK.25 1) // top left quadrant hex (4 5 8 7 13 14 17 16) (30 30 1) simpleGrading (0. Total volume = 0. • Minumum face area = 5.86845e7. • Coupled point location match (average 0) OK. • Face pyramids OK.05.25763e-07 OK. Computational Fluid Dynamics Dense Cavity 84 Max aspect ratio = 4 OK.25205e-08.16694e. Minumum face area = 5. hex ( 0 1 4 3 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.Grading 0.0001.25 1) // top right quadrant ).75371e-08 OK. Coupled point location match (average 0) OK.25 0.40328e-07. 4 0) arc 1617 (0. .1) ). Computational Fluid Dynamics 86 Arched Curved Cavity • • • Max aspect ratio = 294. Maximum face area = 4. Max skewness = 1.1) arc 4 5(0.4 0. Non-orthogonality check OK.57064 OK. Cell volumes OK.73 OK.8 0. Minumum face area = 1.1) arc 7 8(0.73 OK. <<Writing 1309 non-orthogonal faces to set nonOrthoFaces Face pyramids OK.47263e-07. I\/lin \/nli imp — 1 1 DQ1 Qp-1 D IV/IPV edges ( arc 12 (0.4 0.4 0) arc 1011(0.81143e-05.81143e-05.8 0.0001.10919e-10. Max volume = 1.8 0. Max skewness = 1.9 0) arc 13 14 (0. Coupled point location match (average 0) OK. Maximum face area = 4. Face area magnitudes OK. Mesh non-orthogonality Max: 89.10919e-08.3784 *Number of severely non-orthogonal faces: 1309. Coupled point location match (average 0) OK.8 0. Total volume = 0.8 1.3105 average: 52. Face area magnitudes OK. Min volume = 1. Face pyramids OK.81. Minumum face area = 1.10919e-08.27-Mar-1527-Mar-15 Computational Fluid Dynamics 85 Arched Cavity • • • • • • • • • • Max aspect ratio = 294.57064 OK.9 0. 27-Mar-1527-Mar-15 Computational Fluid Dynamics 89 Problem • You are required to simulate 2D circular domain. • Draw a figure highlighting the vertices that will be used in the blockMeshDict to create the geometry in OF. of radius R = 2 m. . 0) (2.27-Mar-1527-Mar-15 Computational Fluid Dynamics 90 Partial Solution (0.2.0) Computational Fluid Dynamics 91 .0. Examples of 3D Shapes using BlockMesh . 27-Mar-1527-Mar-15 Computational Fluid Dynamics 92 Examples of 3D Shapes using BlockMesh Computational Fluid Dynamics 3D Cylinder using blockMesh: Step1 93 . 27-Mar-1527-Mar-15 Computational Fluid Dynamics 94 3D Cylinder using blockMesh: Step2 Computational Fluid Dynamics 3D Cylinder using blockMesh: Step3 95 . 27-Mar-1527-Mar-15 Computational Fluid Dynamics 96 Dome using blockMesh: Stepl Computational Fluid Dynamics Dome using blockMesh: Step2 97 . 100 . • Draw a figure highlighting the vertices that will be used in the blockMeshDict to create the geometry in OF.27-Mar-1527-Mar-15 Computational Fluid Dynamics 99 QUIZ Computational Fluid Dynamics Problem • You are required to simulate a 2D domain shown. Computational Fluid Dynamics Partial Solution 27 M ar15 102 .
Copyright © 2024 DOKUMEN.SITE Inc.