making your own mesh - national institute of aerospace

35
Making Your Own Mesh Hiroaki Nishikawa National Institute of Aerospace JOINT NATIONAL INSTITUTE OF AEROSPACE (NIA) & SU2 FOUNDATION USER WORKSHOP, August 9, 2019 Updated on 08-05-19

Upload: others

Post on 08-Feb-2022

0 views

Category:

Documents


0 download

TRANSCRIPT

Making Your Own Mesh

Hiroaki NishikawaNational Institute of Aerospace

JOINT NATIONAL INSTITUTE OF AEROSPACE (NIA) & SU2 FOUNDATION USER WORKSHOP, August 9, 2019

Updated on 08-05-19

Grid format

- Native format (.su2) h"ps://su2code.github.io/docs/Mesh-File/

- CGNS (.cgns)

SU2 accepts the following grid formats:

Any software that can produce a grid file in either .su2 or .cgns format serves as a grid generator for SU2.

https://cgns.github.io

Grid Generation Software

- Gmsh h"p://gmsh.info

- ICEM CFD- CENTAUR Grid Generator

h"ps://en.wikibooks.org/wiki/ICEM_CFD

- Pointwise h"ps://www.pointwise.com

h"ps://www.centaursoB.com/grid-generator

- Custom grid generation codes

Open-source software:

- Salome h"ps://www.salome-plaCorm.org

This talk focuses on custom codes (written by Hiro Nishikawa) that generate .su2 files.

- SC/Tetra (available in MSC ONE) h"ps://www.cradle-cfd.com/products/sctetra/

scFLOW (also in MSC ONE) in 2021 or later, https://www.cradle-cfd.com/products/scflow/

which generate .su2 and/or .cgns files.

- refine h"ps://github.com/nasa/refine (3D mixed-element grid adaptation framework)

Grid generation codeswritten by Hiroaki Nishikawa

Find them in “Free CFD Codes” at cfdbooks.comAugust, 2019

.su2, .vtk, .ugrid/.mapbc, .grid/.bcmap, .dat (Tecplot)

Special grid generation codesCustom grid generation: 3D

NASA TMR (HC) NASA TMR (OM6)

Hemisphere-Cylinder Wing

Code packages are available NASA Turbulence Model Resource website (click “NASA TMR” above).

Special grid generation codes:Custom grid generation: 3D

- Generate a family of regularly-coarsened gridssuitable for grid convergence studies.

- Structured/unstructured gridswith the same (or very similar) point distributions.

- Grid generation code, not grid fileseasy to share large-size grids, which can be difficult

- Other special featuresInter-grid operators, line information, removed points (to construct high-order grids, natural partitions.

Failed to download…

Dra

Mesh

Grid

Hemisphere-Cylinderhc_release_072319.tar.gzGrid generation code package:

Custom grid generation: 3D

See “readme_release.txt” included in the package.

(Updated)

3D Wing (e.g., NACA00XX, ONERA M6)

3D Grid Custom grid generation: 3D

wing_release_072319.tar.gzGrid generation code package:

See “readme_release.txt” included in the package.(Updated)

3D Grid Custom grid generation: 3D

- Generate a 2D grid (symmetry plane) (NEW).

- Blunt tip (NEW).

This option is available only for the finest grid.

New Features: 3D Wing

Sample input file: input.nml

Read the source file for details onthe input parameters.

c

c

Add “generate_2d_grid = T” to input file.

Sample input file: input.nml

2D grid file is written in .su2 while generating a 3D grid.

NOTE: It can be very slow. A more efficient implementation will be considered in future.

3D Grid Custom grid generation: 3D

For further details, see AIAA2018-1101:

Hiroaki Nishikawa and Boris Diskin, "Customized Grid Generation Codes for Benchmark Three-Dimensional Flows", AIAA Paper 2018-1101, 56th AIAA Aerospace Sciences Meeting, 8 - 12 January 2018, Kissimmee, Florida. [ Paper | ]Presentation file

There are no documentations for the rest of the codes,

Please read the source codes:- Source codes contain detailed descriptions including references and explanations of all input parameters.- Codes are written for my own research needs and also for an educational purpose: read the code, understand the algorithm, and then write your own.

Feel free also to modify them for your purposes.

Feel free to ask me questions ([email protected]).

To run a code: e.g., at a Linux prompt,%gfortran xxx.f90%./a.out

All codes are written in Fortran (.f90).

HCH: Hemisphere-Cylinder-Hemisphere

3D Grid Custom grid generation: 3D

hch_v2p0_release.tar.gzPackage can be downloaded at cfdbooks.comor directly at

- Structured/unstructured, regular coarsening, etc.- Users can specify the shape.

- Adjustable mesh parameters

Sphere3D Grid Custom grid generation: 3D

Code: sphere_grid_v06.f90Input: parameters are specified inside the code.

Output: .su2, .vtk, Tecplot files, .ugrid, .mapbc.

- Adjustable mesh parameters

Features:

- No polar singularity

- Grid line information (optional)

- Nodal perturbation (optional)

- Structured indices (optional)

c

Hemisphere3D Grid Custom grid generation: 3D

Code: hemisphere_grid_v10.f90Input: parameters are specified inside the code.

Output: .su2, .vtk, Tecplot files, .ugrid, .mapbc.

- Adjustable mesh parameters

Features:

- No polar singularity

- Two configurations

- Grid line information (optional)

- Structured indices (optional)

c

Bump (circular/sine bump)3D Grid Custom grid generation: 3D

Code: edu3d_bump_v3Input: input.nml

Output: .su2, .vtk, Tecplot files, .ugrid, .mapbc.

- Adjustable mesh parametersFeatures:

- Circular or smooth sine^4 bump

- Tetra/prism/mixed grid.- Bump on top or bottom.

- Stretching in z-direction.- 6 or 8 boundary parts.

c chttps://turbmodels.larc.nasa.gov/bump.htmlxle=0.3, xte=1.2, sine_bump_zmax=0.05 givesthe sine^4 bump described at

separate_bump = T-> Split the boundary into 3 parts: sym, bump, sym which results in 8 boundary parts in total.

Cube: Hex3D Grid Custom grid generation: 3D

Code: hexgrid_cube_v4.f90Input: parameters are specified inside the code.

Output: .su2, .vtk, Tecplot files, .ugrid, .mapbc.

- Adjustable mesh parameters

Features:

- 4 boundary parts

Cube: Prism3D Grid Custom grid generation: 3D

Code: przgrid_cube_v4.f90Input: parameters are specified inside the code.

Output: .su2, .vtk, Tecplot files, .ugrid, .mapbc.

- Adjustable mesh parameters

Features:

- 4 boundary parts

Cube: Tetra3D Grid Custom grid generation: 3D

Code: edu3d_tetgrid_cube_v4.f90 edu3d_tetgrid_cube_ptb_v7.f90

Input: parameters are specified inside the code.

Output: .su2, .vtk, Tecplot files, .ugrid, .mapbc.

cc

c

Cube: Mixed (Prism-Tetra)3D Grid Custom grid generation: 3D

Code: mixgrid_cube_v5.f90Input: parameters are specified inside the code.

Output: .su2, .vtk, Tecplot files, .ugrid, .mapbc.

- Adjustable mesh parameters

Features:

- 4 boundary parts

2D grid -> 3D grid

This code reads a 2D grid (in .grid format) and extends it to 3D.

2D Grid Custom grid generation: 2D to 3D

Code: edu2d_twod2threed.zip (package)Input: input_twod2threed.nml and a 2D grid (.grid and .bcmap)

Output: .su2, .vtk, Tecplot files, .ugrid, .mapbc.

See edu2d_twod2threed_v3_readme.txt included in the zip.

.grid

.bcmap

c

c c

.ugrid

.mapbc

.su2

.vtkTecplot

Updated on 08/03/19

2D grid -> 3D grid2D Grid Custom grid generation: 2D to 3D

c

Can also add variation in the z-coordinate.Updated on 08/03/19

It can also generate a pure tetrahedral grid by subdivision.

This code can generate a 3D grid alsoby rotating a 2D grid:

Following 2D grid generation codes will generate 2D grids (in .grid, .su2, .vtk), which can then be extended to 3D by the “edu2d_twod2threed” code.

c

2D Grid Generation Codes

Rectangular domain (Flat Plate)

2D Grid Custom grid generation: 2D

Code: edu2d_fp_grid_v1.f90Input: input.nml

Output: .su2, .vtk, Tecplot files, .grid, .bcmap.

Features:

- Quad/tria/mixed grids- Mixed grid = quad in BL, tria outside

Reynolds # is used to determine the BL thickness.

- 5 boundary parts- Exponential stretching- Adjustable mesh parameters

Rectangular E.g., for a flow over a flat plate

2D Grid Custom grid generation: 2D

Code: edu2d_rectangular_grid_v1.f90Input: parameters are specified inside the code.

Output: .su2, .vtk, Tecplot files, .grid, .bcmap.

Features: - Quad/tria grids

4 boundary partsn_boundary=4

- Adjustable mesh parameters

5 boundary partsn_boundary=51

2

3

4

1

3

4

5

2

E.g., for shock diffraction, forward-facing stepRectangular

Rectangular domain (viscous walls)

2D Grid Custom grid generation: 2D

Code: edu2d_viscous_box_grid_v0.f90Input: parameters are specified inside the code.

Output: .su2, .vtk, Tecplot files, .grid, .bcmap.

Features: - Adjustable mesh parameters- Adjustable stretching parameter (tanh function).

c

c

c

E.g., for buoyancy-flow, natural convection

- Quad/tria grids with 4 viscous walls

Rectangular

Rectangular domain (bump)

2D Grid Custom grid generation: 2D

Code: edu2d_bump_irregular_grid_v1.f90Input: parameters are specified inside the code.

Output: .su2, .vtk, Tecplot files, .grid, .bcmap.

Features:

- Irregular triangular grid (can be made regular)- Adjustable mesh parameters - 4 boundary parts

c

- Bump is described in https://turbmodels.larc.nasa.gov/bump.html

E.g., for a flow over a bumpRectangular

Half Cylinder 2D Grid Custom grid generation: 2D

Code: edu2d_half_cylinder_grid_v0.f90Input: parameters are specified inside the code.

Output: .su2, .vtk, Tecplot files, .grid, .bcmap.

Features:

- Quad/tria grids.

- Adjustable mesh parameters

c c

c

c

- Adjustable angle of outflow

Sector, Disk, Annulus (Cylinder)

2D Grid2D Grid Custom grid generation: 2D

Code: edu2d_50yen_tria_grids_v2.f90Input: parameters are input on screen

Output: .su2, .vtk, Tecplot files, .grid, .bcmap.

Features: - Various grids are constructed in turn from a triangular sector,

- Only triangular grids will be generated.

as illustrated in the next slide.

- Highly irregular triangular grid can be generated.- More points on the inner circle than the outer circle.

- Adjustable mesh parameters

2D Grid2D Grid Custom grid generation: 2D

6 of them Remove Invert

Rescale/stretching

Perturb Diagonalswapping

Sector, Disk, Annulus (Cylinder)

2D Grid2D Grid Custom grid generation: 2D

Code: edu2d_cylinder_wake_v4.f90Input: input.nml

Output: .su2, .vtk, Tecplot files, .grid, .bcmap.

Features:

- Extra resolution in the wake region.- Quad/tria/mixed grids

Cylinder flow with a wake

- Adjustable mesh parametersc

c

Karmann-Trefftz Airfoil2D Grid with Exact Solution

includes the Joukowsky airfoil as a special case.

2D GridCustom grid generation: 2D and Exact Solution

Code: edu2d_vkt_airfoil_v4.f90Input: parameters are specified inside the code.

Output: .su2, .vtk, Tecplot files, .grid, .bcmap.

Features:

- Exact potential-flow solution is computed.- Quadrilateral/triangular grids.

- Joukowsky airfoil is a special case.

- Adjustable mesh parameters.

- Circular cylinder is a special case.

Exact solution data included in Tecplot files.

Rankine's Half Body2D Grid with Exact Solution2D Grid with Exact Solution2D GridCustom grid generation: 2D and Exact Solution

Code: edu2d_rankine_half_body_grid_v1.f90Input: parameters are specified inside the code.

Output: .su2, .vtk, Tecplot files, .grid, .bcmap.

Features:

- Quadrilateral/triangular grids

- Exact potential-flow solution is computed.

- Adjustable mesh parameters

- Nodal perturbation (irregular)

Exact solution data included in Tecplot files.

Ringleb’s Flow2D Grid with Exact Solution2D Grid with Exact Solution2D GridCustom grid generation: 2D and Exact Solution

Features:

- Quadrilateral/triangular grids- Exact Euler-solution computed.

Code: edu2d_ringleb_v2.f90Input: parameters are specified inside the code.

Output: .su2, .vtk, Tecplot files, .grid, .bcmap.

- Adjustable mesh parameters

- Smooth transition from subsonic to supersonic flows.

Exact solution data included in Tecplot files.

More codes

3D grid generation codes for- Supersonic viscous flow through a duct

2D grid generation codes for

- Supersonic flow over a triangular bump/wedge- Delaunay triangulation of arbitrary domains

(Not yet released or .su2 not yet implemented, as of August 9, 2019)

Let me know if you want to use any of these codes for SU2. I may be able to find time to implement .su2.

https://turbmodels.larc.nasa.gov/3dsqduct_mod_numerics_val.htmlto appear at NASA TMR

- Subsonic/supersonic flow through a nozzle