3d grid generation - tu dortmund · coarse grid triac1 comment line 4 cubes comment line 4 18 1 8...
TRANSCRIPT
3D Grid Generation
Sven H.M. Buijssen
Institut fur Angewandte Mathematik und Numerik, LS3,
Universitat Dortmund,
Germany
– p.1/17
Talk Topic
How to create the geometry and the mesh needed for a 3D simulationwith FEATFLOW?
Two main possibilities:
semi-automatic
manually
Each possibility will be described in detail.
Interfaces to professional CAD and grid generation software are notavailable yet, unfortunately.
– p.2/17
Talk Topic
How to create the geometry and the mesh needed for a 3D simulationwith FEATFLOW?
Two main possibilities:
semi-automatic
manually
Each possibility will be described in detail.
Interfaces to professional CAD and grid generation software are notavailable yet, unfortunately.
– p.2/17
Talk Topic
How to create the geometry and the mesh needed for a 3D simulationwith FEATFLOW?
Two main possibilities:
semi-automatic
manually
Each possibility will be described in detail.
Interfaces to professional CAD and grid generation software are notavailable yet, unfortunately.
– p.2/17
Semi-automatic grid generation
Symmetry in one space direction often enables us to reduce a 3Dgeometry to a 2D problem.
Examples:
Simple test configurations like unit cube flow or channel flow
Flow around cylinder in a rectangular box
– p.3/17
Semi-automatic grid generation
Symmetry in one space direction often enables us to reduce a 3Dgeometry to a 2D problem.
Examples:
Simple test configurations like unit cube flow or channel flow
Flow around cylinder in a rectangular box
– p.3/17
Semi-automatic grid generation
How can we benefit from this symmetry?
Squeeze the 3D geometry together.
Create geometry description and mesh for the remaining 2Dproblem (with DeViSoRGrid).
Use a software tool to extrude the 2D mesh to a 3D mesh.
– p.4/17
Semi-automatic grid generation
How can we benefit from this symmetry?
Squeeze the 3D geometry together.
Create geometry description and mesh for the remaining 2Dproblem (with DeViSoRGrid).
Use a software tool to extrude the 2D mesh to a 3D mesh.
– p.4/17
Semi-automatic grid generation
How can we benefit from this symmetry?
Squeeze the 3D geometry together.
Create geometry description and mesh for the remaining 2Dproblem (with DeViSoRGrid).
Use a software tool to extrude the 2D mesh to a 3D mesh.
– p.4/17
Semi-automatic grid generation
How can we benefit from this symmetry?
Squeeze the 3D geometry together.
Create geometry description and mesh for the remaining 2Dproblem (with DeViSoRGrid).
Use a software tool to extrude the 2D mesh to a 3D mesh.
– p.4/17
Semi-automatic grid generation
How can we benefit from this symmetry?
Squeeze the 3D geometry together.
Create geometry description and mesh for the remaining 2Dproblem (with DeViSoRGrid).
Use a software tool to extrude the 2D mesh to a 3D mesh.
– p.4/17
Semi-automatic grid generation
How can we benefit from this symmetry?
Squeeze the 3D geometry together.
Create geometry description and mesh for the remaining 2Dproblem (with DeViSoRGrid).
Use a software tool to extrude the 2D mesh to a 3D mesh.
– p.4/17
Semi-automatic grid generation
Which extrusion tool to use?
tr2to3 (part of the FEATFLOW package)
What do you need to be able to use it?
a prm file (containing the 2D geometry definition) and
a tri file (containing the 2D mesh)
Both can be created with DeViSoRGrid (or the outdated Omega)
How to configure tr2to3?
That’s very easy business, you will agree in a few minutes.
– p.5/17
Semi-automatic grid generation
Which extrusion tool to use?
tr2to3 (part of the FEATFLOW package)
What do you need to be able to use it?
a prm file (containing the 2D geometry definition) and
a tri file (containing the 2D mesh)
Both can be created with DeViSoRGrid (or the outdated Omega)
How to configure tr2to3?
That’s very easy business, you will agree in a few minutes.
– p.5/17
Semi-automatic grid generation
Which extrusion tool to use?
tr2to3 (part of the FEATFLOW package)
What do you need to be able to use it?
a prm file (containing the 2D geometry definition) and
a tri file (containing the 2D mesh)
Both can be created with DeViSoRGrid (or the outdated Omega)
How to configure tr2to3?
That’s very easy business, you will agree in a few minutes.
– p.5/17
Semi-automatic grid generation
Listing of a sample configuration file tr2to3.dat=================================================================File for input data for tr2to3=================================================================2 M1 MT1 ICHECK1 IMESH (0=FEAT-parametrisation,1=tri+prm file)’dfg2d.prm’ CPARM (name of parametrisation input file)3 IGMV (level for GMV-output)0 IAVS (level for AVS-output)’dfg2d.tri’ CFILEI (name of triangulation input file)’dfg3d.tri’ CFILEO (name of output file)8 NPZ (number of z-levels)0.0D0 PZMIN0.41D0 PZMAX0.051250.10250.153750.2050.256250.30750.35875
– p.6/17
Semi-automatic grid generation
Final step:
Invoke tr2to3
Check whether the resulting grid looks like you anticipated (usevisualisation program like GMV, AVS)
– p.7/17
IntermediateWhat to do if one cannot exploit some symmetry properties?If you don’t like DeViSoRGrid and want/have to create a 3D grid fromscratch?Or if some (minor) changes to an existing grid are necessary?
→ Hand-made grids
You need to learn about the internal structure/syntax of a 3D grid first.
Let us analyse a 3d tri file for a geometryconsisting of 4 unit cubes
Z
Y
X
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
– p.8/17
IntermediateWhat to do if one cannot exploit some symmetry properties?If you don’t like DeViSoRGrid and want/have to create a 3D grid fromscratch?Or if some (minor) changes to an existing grid are necessary?
→ Hand-made grids
You need to learn about the internal structure/syntax of a 3D grid first.
Let us analyse a 3d tri file for a geometryconsisting of 4 unit cubes
Z
Y
X
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
– p.8/17
IntermediateWhat to do if one cannot exploit some symmetry properties?If you don’t like DeViSoRGrid and want/have to create a 3D grid fromscratch?Or if some (minor) changes to an existing grid are necessary?
→ Hand-made grids
You need to learn about the internal structure/syntax of a 3D grid first.
Let us analyse a 3d tri file for a geometryconsisting of 4 unit cubes
Z
Y
X
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
– p.8/17
Manual grid generation
Coarse grid TRIAC1 comment line4 cubes comment line4 18 1 8 12 6 NEL NVT NBCT NVE NEE NAE summary information on the
grid:• number of elements,• number of vertices,• boundary components,• vertices per element,• edges per element,• faces per element
DCORVG0.0 0.0 0.00.5 0.0 0.00.5 0.5 0.00.0 0.5 0.0
0.0 0.0 0.00.5 0.0 0.00.5 0.5 0.00.0 0.5 0.00.0 0.0 0.50.5 0.0 0.50.5 0.5 0.50.0 0.5 0.5
0.0 0.0 0.50.5 0.0 0.50.5 0.5 0.50.0 0.5 0.51.0 0.0 0.01.0 0.5 0.01.0 0.0 0.51.0 0.5 0.50.0 0.0 1.00.5 0.0 1.00.5 0.5 1.00.0 0.5 1.01.0 0.0 1.01.0 0.5 1.0
Z
Y
X
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
1
23
4
Z
Y
X
1
23
4
5
67
8
Z
Y
X
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
Z
Y
X
– p.9/17
Manual grid generation
Coarse grid TRIAC1
comment line
4 cubes
comment line
4 18 1 8 12 6 NEL NVT NBCT NVE NEE NAE
summary information on thegrid:• number of elements,• number of vertices,• boundary components,• vertices per element,• edges per element,• faces per element
DCORVG0.0 0.0 0.00.5 0.0 0.00.5 0.5 0.00.0 0.5 0.0
0.0 0.0 0.00.5 0.0 0.00.5 0.5 0.00.0 0.5 0.00.0 0.0 0.50.5 0.0 0.50.5 0.5 0.50.0 0.5 0.5
0.0 0.0 0.50.5 0.0 0.50.5 0.5 0.50.0 0.5 0.51.0 0.0 0.01.0 0.5 0.01.0 0.0 0.51.0 0.5 0.50.0 0.0 1.00.5 0.0 1.00.5 0.5 1.00.0 0.5 1.01.0 0.0 1.01.0 0.5 1.0
Z
Y
X
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
1
23
4
Z
Y
X
1
23
4
5
67
8
Z
Y
X
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
Z
Y
X
– p.9/17
Manual grid generation
Coarse grid TRIAC1
comment line
4 cubes
comment line
4 18 1 8 12 6 NEL NVT NBCT NVE NEE NAE
summary information on thegrid:• number of elements,• number of vertices,• boundary components,• vertices per element,• edges per element,• faces per element
DCORVG
0.0 0.0 0.00.5 0.0 0.00.5 0.5 0.00.0 0.5 0.0
0.0 0.0 0.00.5 0.0 0.00.5 0.5 0.00.0 0.5 0.00.0 0.0 0.50.5 0.0 0.50.5 0.5 0.50.0 0.5 0.5
0.0 0.0 0.50.5 0.0 0.50.5 0.5 0.50.0 0.5 0.51.0 0.0 0.01.0 0.5 0.01.0 0.0 0.51.0 0.5 0.50.0 0.0 1.00.5 0.0 1.00.5 0.5 1.00.0 0.5 1.01.0 0.0 1.01.0 0.5 1.0
Z
Y
X
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
1
23
4
Z
Y
X
1
23
4
5
67
8
Z
Y
X
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
Z
Y
X
– p.9/17
Manual grid generation
Coarse grid TRIAC1
comment line
4 cubes
comment line
4 18 1 8 12 6 NEL NVT NBCT NVE NEE NAE
summary information on thegrid:• number of elements,• number of vertices,• boundary components,• vertices per element,• edges per element,• faces per element
DCORVG
0.0 0.0 0.00.5 0.0 0.00.5 0.5 0.00.0 0.5 0.0
0.0 0.0 0.00.5 0.0 0.00.5 0.5 0.00.0 0.5 0.0
0.0 0.0 0.50.5 0.0 0.50.5 0.5 0.50.0 0.5 0.5
0.0 0.0 0.50.5 0.0 0.50.5 0.5 0.50.0 0.5 0.51.0 0.0 0.01.0 0.5 0.01.0 0.0 0.51.0 0.5 0.50.0 0.0 1.00.5 0.0 1.00.5 0.5 1.00.0 0.5 1.01.0 0.0 1.01.0 0.5 1.0
Z
Y
X
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
1
23
4
Z
Y
X
1
23
4
5
67
8
Z
Y
X
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
Z
Y
X
– p.9/17
Manual grid generation
Next, we code the elements (hexahedrons). But how?
A hexahedron is determined by
a sequence of eight numbers indicating the eight vertices
Uniqueness is guaranteed by a certain order:
The first four numbers must indicate nodes that are vertices ofone single face of the hexahedron.
In addition, they must be ordered counterclockwisely.
The remaining four nodes must belong to the opposite face of thehexahedron and are ordered in counterclockwise sense as well.
The final condition is that there has to be an edge between thefirst and the fifth vertex in the sequence.
– p.10/17
Manual grid generation
Next, we code the elements (hexahedrons). But how?
A hexahedron is determined by
a sequence of eight numbers indicating the eight vertices
Uniqueness is guaranteed by a certain order:
The first four numbers must indicate nodes that are vertices ofone single face of the hexahedron.
In addition, they must be ordered counterclockwisely.
The remaining four nodes must belong to the opposite face of thehexahedron and are ordered in counterclockwise sense as well.
The final condition is that there has to be an edge between thefirst and the fifth vertex in the sequence.
– p.10/17
Manual grid generation
Next, we code the elements (hexahedrons). But how?
A hexahedron is determined by
a sequence of eight numbers indicating the eight vertices
Uniqueness is guaranteed by a certain order:
The first four numbers must indicate nodes that are vertices ofone single face of the hexahedron.
In addition, they must be ordered counterclockwisely.
The remaining four nodes must belong to the opposite face of thehexahedron and are ordered in counterclockwise sense as well.
The final condition is that there has to be an edge between thefirst and the fifth vertex in the sequence.
– p.10/17
Manual grid generation
Coarse grid TRIAC14 cubes4 18 1 8 12 6 NEL NVT NBCT NVE NEE NAE
DCORVG0.0 0.0 0.00.5 0.0 0.00.5 0.5 0.00.0 0.5 0.0...
KVERT1 2 3 4
KVERT1 2 3 4 5 6 7 8
KVERT1 2 3 4 5 6 7 82 9 10 3 6 11 12 75 6 7 8 13 14 15 166 11 12 7 14 17 18 15
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
Z
Y
X
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
Z
Y
X
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
Z
Y
X
Z
Y
X
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
– p.11/17
Manual grid generation
Coarse grid TRIAC14 cubes4 18 1 8 12 6 NEL NVT NBCT NVE NEE NAE
DCORVG0.0 0.0 0.00.5 0.0 0.00.5 0.5 0.00.0 0.5 0.0...
KVERT1 2 3 4
KVERT1 2 3 4 5 6 7 8
KVERT1 2 3 4 5 6 7 82 9 10 3 6 11 12 75 6 7 8 13 14 15 166 11 12 7 14 17 18 15
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
Z
Y
X
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
Z
Y
X
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
Z
Y
X
Z
Y
X
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
– p.11/17
Manual grid generation
Coarse grid TRIAC14 cubes4 18 1 8 12 6 NEL NVT NBCT NVE NEE NAE
DCORVG0.0 0.0 0.00.5 0.0 0.00.5 0.5 0.00.0 0.5 0.0...
KVERT1 2 3 4
KVERT1 2 3 4 5 6 7 8
KVERT1 2 3 4 5 6 7 8
2 9 10 3 6 11 12 75 6 7 8 13 14 15 166 11 12 7 14 17 18 15
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
Z
Y
X
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
Z
Y
X
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
Z
Y
X
Z
Y
X
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
– p.11/17
Manual grid generation
Coarse grid TRIAC14 cubes4 18 1 8 12 6 NEL NVT NBCT NVE NEE NAE
DCORVG0.0 0.0 0.00.5 0.0 0.00.5 0.5 0.00.0 0.5 0.0...
KVERT1 2 3 4
KVERT1 2 3 4 5 6 7 8
KVERT1 2 3 4 5 6 7 82 9 10 3 6 11 12 75 6 7 8 13 14 15 166 11 12 7 14 17 18 15
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
Z
Y
X
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
Z
Y
X
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
Z
Y
X
Z
Y
X
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
– p.11/17
Manual grid generation
Last section: boundary information
For each node one has to specify which boundary component itbelongs to.
0 inner node
1 node residing on boundary 1 (outer boundary)
2 node residing on boundary 2 (first inner boundary)
. . .
– p.12/17
Manual grid generation
Coarse grid TRIAC14 cubes4 18 1 8 12 6 NEL NVT NBCT NVE NEE NAE
DCORVG0.0 0.0 0.00.5 0.0 0.00.5 0.5 0.00.0 0.5 0.0...
KVERT1 2 3 4 5 6 7 82 9 10 3 6 11 12 75 6 7 8 13 14 15 166 11 12 7 14 17 18 15
KNPR1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Z
Y
X
1
23
4
5
67
8
9 10
1112
13
1415
16
1718
– p.13/17
ConclusionWhat did you learn about so far?
1. Creating a 3D grid from a 2D grid via extrusion
2. The internal structure of a 3D tri file; so you can modify existinggrids yourself (manually).
What did we not talk about yet?
1. Boundary approximation / parametrisation in 3D.
– p.14/17
ConclusionWhat did you learn about so far?
1. Creating a 3D grid from a 2D grid via extrusion
2. The internal structure of a 3D tri file; so you can modify existinggrids yourself (manually).
What did we not talk about yet?
1. Boundary approximation / parametrisation in 3D.
– p.14/17
Boundary approximation
In 2D a parametrisation file guarantees that a rough approximation ofa curved boundary within a coarse mesh file turns into a smoothapproximation during subsequent refinements. New boundary nodesare moved onto the boundary segment automatically:
Refine Parametrisation
In 3D there is no parametrisation file!
Thus, you have to implement the boundary approximation analyticallyin FEATFLOW, yourself!See the example ’3D flow within a channel’(parq3d.f contains the ’node adjustment code’).
– p.15/17
Boundary approximation
In 2D a parametrisation file guarantees that a rough approximation ofa curved boundary within a coarse mesh file turns into a smoothapproximation during subsequent refinements. New boundary nodesare moved onto the boundary segment automatically:
Refine Parametrisation
In 3D there is no parametrisation file!
Thus, you have to implement the boundary approximation analyticallyin FEATFLOW, yourself!See the example ’3D flow within a channel’(parq3d.f contains the ’node adjustment code’).
– p.15/17
Boundary approximation
In 2D a parametrisation file guarantees that a rough approximation ofa curved boundary within a coarse mesh file turns into a smoothapproximation during subsequent refinements. New boundary nodesare moved onto the boundary segment automatically:
Refine Parametrisation
In 3D there is no parametrisation file!
Thus, you have to implement the boundary approximation analyticallyin FEATFLOW, yourself!See the example ’3D flow within a channel’(parq3d.f contains the ’node adjustment code’).
– p.15/17
Boundary approximation in FEATFLOW
DO 10 IVT=1,NVTINPR=KNPR(IVT)IF (INPR.EQ.0) GOTO 10
IEL=KVEL(4,IVT)PX=DCORVG(1,IVT)PY=DCORVG(2,IVT)PZ=DCORVG(3,IVT)
IF ((ABS(PZ-0.0D0).GT.1D-8).AND.(ABS(PZ-0.41D0).GT.1D-8).AND.* (ABS(PX-0.0D0).GT.1D-8).AND.(ABS(PX-2.50D0).GT.1D-8).AND.* (ABS(PY-0.0D0).GT.1D-8).AND.(ABS(PY-0.41D0).GT.1D-8)) THENPXM=0.50D0PYM=0.20D0RAD=0.05D0DL=SQRT((PX-PXM)**2+(PY-PYM)**2)DCORVG(1,IVT)=PXM+RAD/DL*(PX-PXM)DCORVG(2,IVT)=PYM+RAD/DL*(PY-PYM)GOTO 10
ENDIF10 CONTINUE
– p.16/17
Some final remarksWhat else did we not talk about yet?
1. Plans for a tool to enhance the extrusion process:Automatically add additional element slices at the lateral walls ofa 3D grid to get "freely floating objects" in e.g. a channel (a ball,a car).
2. Moving or free boundary conditions(remember the talk on "ppxd and movbc solvers" by Dr. D. Wan)Inner boundaries are not at all coded into a tri file, butanalytically into FEATFLOW itself (fictitious boundary conditions,see handout for details).
3. Rotationally symmetrical geometriesUsing polar coordinates, the problem can be reduced to 2D. Noworking code available yet.
– p.17/17
Some final remarksWhat else did we not talk about yet?
1. Plans for a tool to enhance the extrusion process:Automatically add additional element slices at the lateral walls ofa 3D grid to get "freely floating objects" in e.g. a channel (a ball,a car).
2. Moving or free boundary conditions(remember the talk on "ppxd and movbc solvers" by Dr. D. Wan)Inner boundaries are not at all coded into a tri file, butanalytically into FEATFLOW itself (fictitious boundary conditions,see handout for details).
3. Rotationally symmetrical geometriesUsing polar coordinates, the problem can be reduced to 2D. Noworking code available yet.
– p.17/17
Some final remarksWhat else did we not talk about yet?
1. Plans for a tool to enhance the extrusion process:Automatically add additional element slices at the lateral walls ofa 3D grid to get "freely floating objects" in e.g. a channel (a ball,a car).
2. Moving or free boundary conditions(remember the talk on "ppxd and movbc solvers" by Dr. D. Wan)Inner boundaries are not at all coded into a tri file, butanalytically into FEATFLOW itself (fictitious boundary conditions,see handout for details).
3. Rotationally symmetrical geometriesUsing polar coordinates, the problem can be reduced to 2D. Noworking code available yet.
– p.17/17