Surface Mesh
Introduction
Now that we have a geometry, we can start meshing it. We are using Pointwise to generate the surface mesh. This is not a full blown tutorial, more a walk through. If you want to learn more about it, their Youtube channel is highly recommended. You do not have to use Pointwise to generate an overset mesh. ICEM or an other meshing software would work as well.
Files
Navigate to the directory overset/mesh
in your tutorial folder. Either use the previously generated .igs
file or copy it from the tutorial folder.
cp ../../../tutorial/overset/geo/onera_m6.igs .
It is possible to script Pointwise. In order to use it, we have to download the script first. You can either download it here or copy it from the tutorial folder.
cp ../../../tutorial/overset/mesh/Semicircle.glf .
Meshing strategy
Before we start meshing, we have to know how many meshes we create and where they overlap. For this tutorial,
3 different meshes are proposed: near_wing
, near_tip
and far
. The following picture should give an overview:
Now we should estimate the cell count of the mesh. For the purpose of a grid convergence study (GCS) and debugging it makes sense to have differently refined meshes. To limit the amount of work, we will create the finest mesh and coarsen it multiple times.
Usually, the finest mesh is called L0
(level 0) and should have approx 60M cells for this geometry. If every 2 cells
are combined in each direction, we get a coarser mesh called L1
. This usually goes to L2
for production and L3
for
debugging purposes. Additionally, there could be an intermediate level starting at L0.5
. It requires a different
surface mesh that is sqrt(2) coarser than L0
. In this tutorial, we will start at L1
(~8M cells) and end at L3
(~0.125M cells).
Mesh Generation
Pointwise overview
If you start Pointwise, it should look something like in the next picture.
Object, Layer and Default control
Solver information
Selection control
View control
Fast meshing controls
You can control the main view with the following key- and mouse combinations:
- zoom
Rotate your
mouse wheel
. The zoom centers around yourmouse pointer
.- rotate
Press
ctrl
and yourright mouse button
while moving your mouse.- move
Press
shift
and yourright mouse button
while moving your mouse.
Setup Pointwise
Before we actually begin meshing, we have to set some standard values and import our geometry. At first, we set some tolerances for Pointwise
Click on
File
->Properties
Set
Model Size
to1
. (It is enough, if the order of magnitude is similar)Set
Node
to1e-6
. The value ofConnector
should automatically jump to1e-6
as wellOK
Now we have to choose the proper solver. In my case it is CGNS
with adf
support. If you have compiled the
MACH-Framework with hdf5
support, you can skip the last step.
Click
CAE
->Select Solver
Make Sure
CGNS
is selected.Click
OK
.Click
CAE
->Set Dimension
->2D
(That’s how surface meshes are called here)Click
CAE
->Set Solver Attributes
(If you havehdf5
support, you can stop here)Select
adf
forCGNS File Type
Click
Close
Now we can import the .iges
file we created in the previous tutorial.
Click
File
->Import
->Database
Select your
.iges
File ->open
Make sure nothing but
Units
andFrom File
is selectedClick
OK
You will receive a warning that some entities could not be converted. Just ignore it and click
YES
After those steps, the window should look like this (you should probably save at this point):
Few important Pointwise labels:
- Block
This is a 3 dimensional Mesh
- Domain
This is a 2 dimensional Mesh
- Connector
A line constraining the extend of a
Block
orDomain
- Database
An imported geometry
- Spacing Constraint
This controls how the
nodes
lay on aConnector
. Further down the line, theConnector
controls how thenodes
lay in aDomain
orBlock
Prepare the Database
To make our live a bit easier in the coming mesh work, we first prepare the database a bit (take a look at the next picture to help guide you).
Select the whole
database
. Just draw a rectangle around it while yourleft mouse button
is pressedClick
Wireframe
->Shaded
Click on
Layers
Double click on
Description
and enterGeo
Because we have two overlapping meshes (near_wing
and near_tip
), we have to cut the database at an appropriate place.
This will indicate where the near_tip
mesh will start. The near_wing
mesh will go right to the tip of the wing. But
because ADflow uses an Implicit Hole Cutting Scheme
we only have to make sure, that the near_tip
mesh is slightly smaller
than the near_wing
mesh. This will ensure, that the overlapping region is approximately where we cut the database. In this
way we are certain, the solver does not have to interpolate in a critical region (like the wing tip).
Click on
Create
->Planes
Choose
Constant X, Y or Z
Select
Y
and enter a value of0.9
Click
OK
(Your view should now look like detailA
in the following picture)Select only the
upper
,lower
andtrailing edge
surface by drawing a rectangle with yourleft mouse button
Click
Edit
->Trim by Surfaces
Select your freshly created plane (detail
A
)Make sure
Tolerance
andAdvanced
is unselectedClick
Imprint
(Your geometry should now have a different color towards the tip)Click
OK
Now we are doing some cleaning up and delete some unneeded surfaces.
Rotate your view with pressing
ctrl
and yourright mouse button
while moving your mouse until you have a good view on the root surfaces.Select the first
root surface
Press
ctrl
while selecting the secondroot surface
Press
del
on your keyboard to delete them
Create the near_wing
surface mesh
We create the mesh near_wing
in a new layer to keep everything orderly.
Click
Layers
Select
Show Empty Layers
Click with your
right mouse button
on layer10
->Set Current
Double click with your
left mouse button
on theDescription
of layer10
and enternear_wing
Unselect
Show Empty Layers
Because we want to coarsen our mesh multiple times, it is important to think about how many nodes we should have on a connector (Apart from that, it is always good to be multi-grid-friendly). To calculate the number of nodes (\(N\)) per connector, we use this formula:
Where \(n\) is the number of refinements + 1
and \(m\) is an integer
. For our chord-wise direction, we will
use ‘’145’’ Nodes. To save some work, we will set it as default.
Click
Defaults
Make sure
Connector
is checkedSelect
Dimension
and enter145
Select the
upper
andlower
surface of the wingClick
Connectors on Database Entities
Click on
Layers
and uncheck theGeo
layerSelect the
two connectors
in the middle of the wing (Detail A) and delete them. They showed up because we split the databaseSelect the
6 spanwise connectors
(Detail B)Click
Edit
->Join
When creating the connectors, we left out the TE. We did this because there were 2 surfaces from OpenVSP. It is less work for us, if we manually create two connectors.
Click
Defaults
Select
Dimension
and enter17
Click
2 Point Curves
Close the
root trailing edge
(make sure your pointer becomes a cross-hair before you click. This way you are sure the new connector lies on the closest point)Close the
tip trailing edge
Press
OK
Now we initialize the surface mesh.
Select
everything
Click
Assemble Domains
Select
everything
Click on the
small arrow pointing down
next toWireframe
Click on
Hidden Line
Now we size
the LE (Leading Edge) and TE (Trailing Edge) connectors.
Click on
All Masks On/Off
Click on
`Connectors
Select the
LE
andTE
Connectors
by drawing a rectangle like it is shownClick on the input field next to
Dimension
, enter73
and hitenter
The surface mesh is now almost complete. We only have to distribute the nodes on it properly by changing the spacing
.
Usually all Points are distributed according to Tanh
. But because we split up the database in the previous steps,
we have to remove so called break point
at that location.
Note
Break Points
give you even more control to distribute your nodes on a connector.
Select the
LE
andTE
connectors again.Click on
Grid
->Distribute
Click on
Break Points
Click on
Delete all Break Points
Click on
OK
Click on
All Masks On/Off
Click on
Spacing Constraints
Select the 2 spacing constraints at the
LE
of theroot
(A)Click the field next to
Spacing
and enter0.0003
. Then hitenter
Select the 2 spacing constraints at the
TE root
(B)Apply
7.15e-5
for spacingSelect the 2 spacing constraints at the
LE tip
(C)Apply
0.00016
for spacingSelect the 2 spacing constraints at the
TE tip
(D)Apply
4e-5
for spacingSelect the 3 spacing constraints at the
tip
(E)Apply
0.0025
for spacingSelect the 3 spacing constraints at the
root
(F)Apply
0.04
as spacing
The mesh near_wing
is now complete. We will export it later.
Create the near_tip
surface mesh
Now we will create the near_tip
mesh. Let’s start with creating a new layer and hide everything unnecessary.
Click on
Layers
Check
Show Empty Layers
Right click on Layer
20
->Set Current
Double click the
Description
Field and enternear_tip
Uncheck
Show Empty Layers
Check Layer
0
to make the database visibleHide the mesh
near_wing
by un-checking layer10
Now we will create the connectors.
Click on
Defaults
-> enter201
forDimension
Select everything from the tip to the cut we made earlier
Click
Connectors on Database Entities
Click on
Layers
-> uncheck layer0
. Now, you should only see the connectors we created
Let’s clean up the generated connectors at the tip TE.
Zoom into the
tip TE
Select the
5
shownconnectors
(A)Delete them
Select and delete the remaining
pole
(the point with a circle around) (B)Select the
2
connectors
that define the outer tip (C)Click
Edit
->Join
Select the
newly joined
connector (C)Enter
65
ForDimension
and hitenter
Click on
Defaults
and enter65
forDimension
Click on
2 Point Curves
Close the
TE
again (D)
Next we clean up the root TE.
Select the
2
connectors
that define the TE (A)Delete them
Click on
2 Point Curves
Close the Tip again (B)
The last thing to clean up is the tip LE
.
Select the
3
shownconnectors
(A)Click on the
arrow pointing down
next toshow
Click
Hide
Select and delete the remaining
pole
(B)Click on
View
->Show Hidden
Select the
3
connectors
(A)Click on the
arrow pointing down
next toHide
Click on
Show
Now we will dimension the remaining connectors and space the nodes properly.
Select the
3
shown connectors (A)Enter
97
forDimension
and hitenter
Click
All Masks On/Off
Click
Spacing Constraints
Select the
2
spacing constraints at theroot LE
(B)Apply
0.0008
for spacingSelect the
2
spacing constraints at thetip LE
(C)Apply
0.0008
for spacingSelect the
2
spacing constraints at theroot TE
(D)Apply
1.3e-5
as spacingSelect the
2
spacing constraints at thetip TE
(E)Apply
1.3e-5
as spacingSelect the
3
spacing constraints at theroot
(F)Apply
0.01
as spacingSelect the
1
spacing constraint at thetip LE
(G)Apply
0.0005
as spacingSelect the
2
spacing constraints at thetip TE
(H)Apply
1.56e-5
as spacing
Next, we split the connectors at the tip to allow a topology where we can achieve a decent quality mesh.
Select the
tip top
connector (A)Click
Edit
->Split
Make sure
Advanced
is checkedEnter
17
forIJK
and hitenter
Click
OK
Select the
tip bottom
connector (B)Click
Edit
->Split`
Enter
185
forIJK
and hitenter
Click
OK
Click on
2 Point Curves
Connect the
2
newpoints
(A) to (B)
Since our tip is rounded, we have to project
the newly created connector on to our database.
Select the
newly
createdconnector
(A)Click on
Edit
->Project
Click on
Layers
Check layer
0
(Geo
)Click on
Project
Make sure
Target Database Selection
is checkedClick
Begin
Select the
upper
andlower
tip surface (hold downctrl
) (B)Click
End
Click
Project
Click
OK
Now we actually start meshing.
Click on
Layers
Uncheck layer
0
(Geo
)Select the
newly
createdconnector
(A)Click on the
arrow pointing down
next toTanh Distribution
Click on
Equal
Click
Edit
->Split
Enter
17
forIJK
and hitenter
Enter
49
forIJK
and hitenter
Click
OK
Click on
Create
->Assemble Special
->Domain
Select
1
connector
(B)Click
Next Edge
Select
2
connectors
(C)Click
Next Edge
Click
OK
Next, we mesh the rest.
Select the
2
connectors that form the semi-circle (A)Click
Script
->Execute
Look for the
script
you just downloaded andopen
it.Select
all
connectorsClick
Assemble Domains
The last step is to make sure, that the skewed elements at the tip are smoothed. As Assemble Domains
didn’t work
for the most outer mesh, we will delete this domain first, and create it manually again.
Select
all
domainsClick
Hidden Line
Select the
outer most
domain and delete it (A)Select all
9
connectors, that define the last remaining domainClick
Assemble Domain
Select the
newly
createddomain
and clickHidden Line
Select the
2
domains that define thetip
(A & B)Click
Grid
->Solve
Click on
Edge Attributes
Make sure
Boundary Conditions
is checked and set theType
toFloating
Click on
Attributes
Make sure
Surface Shape
is checked and setShape
toDatabase
Click on
Begin
and make sure, the tip is selected (it should be)Click on
End
Make sure
Solution Algorithm
is checked and setSolver Engine
toSuccessive Over Relaxation
Set
Relaxation Factor
toNominal
Click on
Solve
Enter
50
forIterations
and hitRun
Click
OK
Lets check the quality of the created mesh. The most important metrics are Area Ratio
and Equiangle Skewness
.
Select
all
domainsClick
Examine
->Area Ratio
Click on the
Magnification Glass
next tomax
You see, the biggest
Area Ratio
is~2.24
Click on
Advanced
Make sure
Histogram
andShow Histogram
are checkedAs you see, the vast majority of cells has an
Area Ratio
of less than1.25
. This should be fineClick on
Examine
Choose
Skewness Equiangle
forType
As you can see, the most skewed cell has a
Skewness Equiangle
of~0.4
. This is also fineClick
Close
Note
The lower max Area Ratio
is, the easier it is to extrude a mesh with pyHyp. If it is more than 2
,
it can get tricky. Skewness Equiangle
describes how skewed a cell is. It should be below 0.8
Export all meshes for use in pyhyp
The last step is to export the mesh. For pyHyp it is important, that the normals
look in the outwards direction.
We will set the boundaries manually in pyHyp.
Note
As there has not been found an easy way to figure out which domain in Pointwise corresponds to which domain in pyHyp, it is recommended to orient them all the same way. Then apply the BC for all domains and run the pyHyp script. If an error pops up for one domain, the corresponding BC can be removed. This gets repeated until there are no errors left (This information is repeated on the next page where it probably makes more sense).
Lets start with orienting the near_tip
mesh first.
Make sure only the layer
near_tip
is visibleSelect
all
domainsClick
Edit
->Orient
Select
one
domain (It does not matter which one)Click
I-J
a few times until you are sure, theorange arrow
is pointing outwardsClick
Set Master
Select
all
domainsClick
Align
Click
OK
Now we can export it.
Select
all
domainsClick
File
->Export
->CAE
Set
near_tip
as Filename and save it somewhereMake sure
Data Precision
anddouble
is checkedYou can uncheck
the rest
(It doesn’t really matter. But the files will be bigger if you leave it on)Press
OK
Now lets do the same for the near_wing
mesh. As we have a symmetry boundary condition, the orientation
procedure is slightly more complicated.
Make sure only the layer
near_wing
is visibleSelect
all
domainsClick
Edit
->Orient
Select
one
domain (It doesn’t matter which one)Click
I-J
until theorange arrow
is pointing outwardsIf the
red arrow
is not pointing towards the tip, clickI
andI-J
until both conditions are satisfiedClick
Set Master
Select
all
domainsClick
Align
Make sure all
red arrows
point towards the tip (if this is not the case, select this domain and repeat step 6)Click
OK
Now you can export the mesh near_wing
like you did in the previous step.
Congratulations, you managed to create the surface mesh. On the next page, we will extrude it into a volume mesh.