You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Square Mesh Example: Note that the figure uses Tecplot node and element number (starting at 1). The node and element numbering for SU2 start at 0.**
22
+
**Square Mesh Example: Note that the figure uses Tecplot node and element number (1-based). The node and element numbering for SU2 start at 0.**
23
23
24
-
The first line of the .su2 mesh declares the dimensionality of the problem. SU2 can handle 2-D or 3-D geometries. As a note, for 2D simulations, it is recommended that a truly 2D mesh is used (no z-coordinates) rather than a quasi-2D mesh (one or more cells deep in the third dimension with symmetry boundary conditions). For the 2D square mesh, the dimension is defined as follows:
24
+
The first line of the .su2 mesh declares the dimensionality of the problem. SU2 can handle 2D or 3D geometries. As a note, for 2D simulations, it is recommended that a truly 2D mesh is used (no z-coordinates) rather than a quasi-2D mesh (one or more cells deep in the third dimension with symmetry boundary conditions). For the 2D square mesh, the dimension is defined as follows:
25
25
26
26
```
27
27
NDIME= 2
28
28
```
29
29
30
-
SU2 searches specifically for the keyword "NDIME=" in order to set the dimension, and the dimension value will be stored for use throughout the code. This value would be 3 for a 3-D mesh. Note that while "%" is used here to denote comments, SU2 does not officially recognize it as such. Extra text added to the mesh file between sections (such as lines following a "%") will simply be ignored. The next part of the file describes the interior element connectivity.
30
+
SU2 searches specifically for the keyword `NDIME=` in order to set the dimension, and the dimension value will be stored for use throughout the code. This value would be 3 for a 3D mesh. Note that while "%" is used here to denote comments, SU2 does not officially recognize it as such. Extra text added to the mesh file between sections (such as lines following a "%") will simply be ignored.
31
+
32
+
To specify the point list, SU2 first searches for the string `NPOIN=` and stores the total number of nodes in the mesh. This value is given first, as it is used to set up a loop over all of the grid points that must immediately follow this line. Then, the coordinates for each of the nodes are given. This is specified in the .su2 format as:
33
+
34
+
```
35
+
NPOIN= 9
36
+
0.00000000000000 0.00000000000000
37
+
0.50000000000000 0.00000000000000
38
+
1.00000000000000 0.00000000000000
39
+
0.00000000000000 0.50000000000000
40
+
0.50000000000000 0.50000000000000
41
+
1.00000000000000 0.50000000000000
42
+
0.00000000000000 1.00000000000000
43
+
0.50000000000000 1.00000000000000
44
+
1.00000000000000 1.00000000000000
45
+
```
46
+
47
+
In this case, there are 9 nodes in the 3x3 square above. Immediately after the node number specification comes the list of node coordinates in cartesian space. Each line gives the coordinates for a single grid vertex. The grid points are assigned a global element index of 0 through 8 in the order they appear in the file. This global element index is implied by the ordering and does not need to be explicitly specified by the file, although some legacy meshes may still contain an explicit index at the end of the line that can be ignored.
48
+
49
+
For a 2D mesh, only x and y coordinates are required, but a 3D mesh would give x, y, and z coordinates. Note that the global index values for the nodes and elements stored within SU2 are zero-based, as opposed to starting from 1 as Tecplot does. The location of each node in the list can be confirmed in space by adding 1 to the implied global index from the ordering and comparing with the figure above.
50
+
51
+
The next part of the file describes the interior element connectivity, which begins with the `NELEM=` keyword:
31
52
32
53
```
33
54
NELEM= 8
34
-
5 0 1 3 0
35
-
5 1 4 3 1
36
-
5 1 2 4 2
37
-
5 2 5 4 3
38
-
5 3 4 6 4
39
-
5 4 7 6 5
40
-
5 4 5 7 6
41
-
5 5 8 7 7
55
+
5 0 1 3
56
+
5 1 4 3
57
+
5 1 2 4
58
+
5 2 5 4
59
+
5 3 4 6
60
+
5 4 7 6
61
+
5 4 5 7
62
+
5 5 8 7
42
63
```
43
64
44
-
SU2 is based on unstructured mesh technology, and thus supports several element types for both 2-D and 3-D elements. Unlike for structured meshes where a logical, ordered indexing can be assumed for neighboring nodes and their corresponding cells (rectangles in 2-D and hexahedral elements in 3-D), for an unstructured mesh, a list of nodes that make up each element, or the connectivity as it is often called, must be provided. First, SU2 will search for the string "NELEM=" and then store the number of interior elements. This value is given first, as it is used to set up a loop over all of the elements which must immediately follow this line. For the square mesh above, this corresponds to the 8 triangular interior elements which are labeled from 1 to 8.
45
-
Each following line describes the connectivity of a single element. The first integer on each line is a unique identifier for the type of element that is described. SU2 supports line, triangle, rectangle, tetrahedral, pyramid, wedge, and hexahedral elements. The identifiers follow the VTK format:
65
+
SU2 is based on unstructured mesh technology, and thus supports several element types for both 2D and 3D elements. Unlike for structured meshes where a logical, ordered indexing can be assumed for neighboring nodes and their corresponding cells (quadrilaterals in 2D and hexahedral elements in 3D), for an unstructured mesh, a list of nodes that make up each element, or the connectivity as it is often called, must be provided. First, SU2 will search for the string `NELEM=` and then store the number of interior elements. This value is given first, as it is used to set up a loop over all of the elements which must immediately follow this line. For the square mesh above, this corresponds to the 8 triangular interior elements that are assigned a global element index of 0 through 7 in the order they appear in the file. This global element index is implied by the ordering and does not need to be explicitly specified by the file, although some legacy meshes may still contain an explicit index at the end of the line that can be ignored.
66
+
67
+
Each following line describes the connectivity of a single element. The first integer on each line is a unique identifier for the type of element that is described. SU2 supports line, triangle, quadrilateral, tetrahedral, pyramid, prism, and hexahedral elements. The identifiers follow the VTK format:
46
68
47
69
48
70
|Element Type | Identifier |
@@ -52,29 +74,12 @@ Each following line describes the connectivity of a single element. The first in
52
74
|Quadrilateral |9|
53
75
|Tetrahedral |10|
54
76
|Hexahedral |12|
55
-
|Wedge|13|
77
+
|Prism|13|
56
78
|Pyramid |14|
57
79
58
-
In our square mesh, all elements are triangles, and thus the identifier (first integer) on all lines is 5. Following the identifier is a list of the node indices that make up the element. Each triangular element will have 3 nodes specified, a rectangular element would have 4 nodes specified, a tetrahedral element would have 4 nodes specified, and so on. The final value is the element index given to each interior element in the mesh. Note that the .su2 format indexes the nodes and elements starting from zero, as opposed to starting from 1 as Tecplot does, which was used to create the mesh image. For example, take the triangular element described in the first line which is indexed as 0 (1 in Tecplot). The SU2 nodes are given as (0,1,3) which would correspond to (1,2,4) in Tecplot. Looking at the figure of the mesh above, we see that this is the lower left triangular element. The ordering of the nodes given in the connectivity list for a specific element is important, and the user is referred to the VTK format guide for the correct ordering for each supported element type (page 9).
59
-
60
-
After the connectivity information for all interior elements, the coordinates for each of the nodes are given. This is specified in the .su2 format as:
61
-
62
-
```
63
-
NPOIN= 9
64
-
0.00000000000000 0.00000000000000 0
65
-
0.50000000000000 0.00000000000000 1
66
-
1.00000000000000 0.00000000000000 2
67
-
0.00000000000000 0.50000000000000 3
68
-
0.50000000000000 0.50000000000000 4
69
-
1.00000000000000 0.50000000000000 5
70
-
0.00000000000000 1.00000000000000 6
71
-
0.50000000000000 1.00000000000000 7
72
-
1.00000000000000 1.00000000000000 8
73
-
```
74
-
75
-
Again, SU2 searches for the string "NPOIN=" and stores the total number of nodes in the mesh. In this case, there are 9 nodes in the 3x3 square above. Immediately after the node number specification comes the list of node coordinates in cartesian space. Each line gives the coordinates for a single node followed by its index number. The node index numbers are the indices used for specifying the connectivity information for elements. For a 2-D mesh, the x and y coordinates are given followed by the index, but a 3-D mesh would give x, y, and z, followed by the index. The location of each node can be confirmed in space by comparing with the figure above after adding 1 to the index value.
80
+
In our square mesh, all elements are triangles, and thus the identifier (first integer) on all lines is 5. Following the identifier is a list of the node indices that make up the element. Each triangular element will have 3 nodes specified, a rectangular element would have 4 nodes specified, a tetrahedral element would have 4 nodes specified, and so on. Note again that the global index values for the nodes and elements stored within SU2 are zero-based, as opposed to starting from 1 as Tecplot does, which was used to create the mesh image. For example, take the triangular element described in the first line, which would be indexed as 0 in SU2 (1 in Tecplot). The SU2 nodes are given as (0,1,3) which would correspond to (1,2,4) in Tecplot. Looking at the figure of the mesh above, we see that this is the lower left triangular element. The ordering of the nodes given in the connectivity list for a specific element is important, and the user is referred to the VTK format guide for the correct ordering for each supported element type (page 9).
76
81
77
-
The final component of the mesh is a description of all boundaries (which we call markers), including a name (what we call a tag). For each boundary, the connectivity information is given which is based off of the same node indices given above. For a 2-D mesh, only line elements are supported along the boundaries. For a 3-D mesh, triangular and rectangular elements are the possible options for boundary elements. This section of the .su2 mesh file appears as:
82
+
The final component of the mesh is a description of all boundaries (which we call markers), including a name (what we call a tag). For each boundary, the connectivity information is specified using the same node global index values given above. For a 2D mesh, only line elements are supported along the boundaries. For a 3D mesh, triangular and quadrilateral elements are the possible options for boundary elements. This section of the .su2 mesh file appears as:
78
83
79
84
```
80
85
NMARK= 4
@@ -96,7 +101,7 @@ MARKER_ELEMS= 2
96
101
3 3 0
97
102
```
98
103
99
-
First, the number of boundaries, or markers, is specified using the "NMARK=" string. Then for each marker, a name, or tag, is specified using "MARKER_TAG=." This tag can be any string name, and the tag name is used in the configuration file for the solver when specifying boundary conditions. Here, the tags "lower," "right," "upper," and "left" would be used. The number of elements on each marker, using "MARKER_ELEMS=," must then be specified before listing the connectivity information as is done for the interior mesh elements at the start of the file. Again, the unique VTK identifier is given at the start of each line followed by the node list for that element. Note that no index is given for boundary elements. For our example, only line elements (identifier 3) exist along the markers, and on each boundary of the square there are 2 edges of a triangle that make up the marker. These elements can again be verified with the mesh figure above.
104
+
First, the number of boundaries, or markers, is specified using the "NMARK=" string. Then for each marker, a name, or tag, is specified using "MARKER_TAG=." This tag can be any string name, and the tag name is used in the configuration file for the solver when specifying boundary conditions. Here, the tags "lower," "right," "upper," and "left" would be used. The number of elements on each marker, using "MARKER_ELEMS=," must then be specified before listing the connectivity information as is done for the interior mesh elements at the start of the file. Again, the unique VTK identifier is given at the start of each line followed by the node list for that element. For our example, only line elements (identifier 3) exist along the markers, and on each boundary of the square there are 2 edges of a triangle that make up the marker. These elements can again be verified with the mesh figure above.
100
105
101
106
### Examples
102
107
Attached here is the simple square mesh from above in .su2 format, along with codes for creating this file in the Python, C++, and Fortran 90 programming languages. These scripts are meant to be examples of how to write .su2 meshes in a few common languages which can be easily modified for creating new meshes:
@@ -108,11 +113,11 @@ First, the number of boundaries, or markers, is specified using the "NMARK=" str
108
113
109
114
## CGNS Format
110
115
111
-
The native format is straightforward and readable, and meshes for simple or analytic geometries can be made very easily using scripts like those provided above. However, for creating meshes around very complex geometries, third party meshing software can make the process much simpler than attempting to build meshes via scripting. With this in mind, support for the CGNS data standard has been included within SU2. The main advantage gained here is that complex meshes created in a thirdparty software package (one that supports unstructuredCGNS file export) can be used directly within SU2. Furthermore, a converter from CGNS to the .su2 format has been built into SU2.
116
+
To make creating your own meshes easier and more accessible, support for the open CGNS data standard has been included within SU2. The main advantage gained is that complex meshes created in a third-party software package (one that supports unstructured, single-zone CGNS file export) can be used directly within SU2 without the need for conversion to the native format. Moreover, as CGNS is a binary format, the size of the mesh files can be significantly reduced. If needed, a converter from CGNS to the SU2 format has been built into SU2 (See the [inviscid wedge tutorial](../tutorials/Inviscid_Wedge)).
112
117
113
118
### Compiling with CGNS Support
114
119
115
-
First, obtain and build the CGNS library (Version 3.1.4 recommended, built without HDF support) on the machine where SU2 will be running and follow the instruction provided in [[Parallel and CGNS Build]].
120
+
Starting with SU2 v4.3, the source for version 3.3.0 of the CGNS library is shipped with SU2 in the externals/ directory, and it is automatically built and linked for you when compiling SU2 (ADF support only).
116
121
117
122
### Using and Converting CGNS Meshes
118
123
@@ -126,6 +131,6 @@ It is important to note that SU2 will not use any specific boundary conditions t
126
131
127
132
## Third-Party Mesh Software
128
133
129
-
We are continuously working to integrate SU2 with industry-standard tools. We currently have an output plugin for the Pointwise(R) meshing software. This custom addition allows users of Pointwise version 17.00 and later to directly output their meshes in the native SU2 format. The plugin is available natively within recent versions of Pointwise (V17.0R2 or later), and the source code for the plugin can also be found in the Mesh_Tools/ folder within the root of the SU2 source directory.
134
+
We are continuously working to integrate SU2 with industry-standard tools. We currently have an output plugin for the Pointwise(R) meshing software. This custom addition allows users of Pointwise version 17.00 and later to directly output their meshes in the native SU2 format. The plugin is available natively within recent versions of Pointwise (V17.0R2 or later).
130
135
131
136
In addition, a number of other packages support direct output to the SU2 format, such as GMSH and CENTAUR. CGNS files created by a number of other meshing packages have been successfully tested and used, such as those from ICEM CFD, for instance.
0 commit comments