tutgenmesh

VSP to Cart3D Surface Mesh Generation Tutorial

This component of the Cart3D tutorial will walk through the process of generating a quality surface mesh on the Onera M6 wing to analyze with Cart3D. If you haven't built the Onera M6 wing, or you don't have your own geometry to analyze, you should go back to the geometry generation phase of the tutorial or you can download a ready-to-go Onera M6 geometry from the VSP Hangar.

Generating a Surface Mesh

As you proceed through the tutorial to mesh the Onera M6, remember that images have been included as thumbnails, so any place you see a picture, click on it for a larger version.

1. Onera M6 start
• Start with the Onera M6 model from the end of the model building tutorial.
2. Launch CFD Mesh interface
• The mesh generation process is controlled from the CFD Mesh interface. It is used to create, destroy, and control mesh sources and also to specify the output file names for the resulting mesh.
1. From the 'Geom' window, click 'CFD Mesh…' to launch the CFD Mesh interface.
3. Set initial edge length
• VSP will attempt to generate a surface mesh which meets all of the specified resolution criteria. In order to have a mesh definition which is intuitive to establish and change, it is recommended to keep the definition as simple as possible. The best way to keep the mesh definition simple is to start by specifying the global mesh control and then only add local control as necessary.
• The most significant global mesh parameter is the constraint on the maximum edge length throughout the mesh. If only this parameter is set, VSP will attempt to generate a uniform resolution mesh meeting this constraint. It is important to make sure the initial value of 'Max Edge Len' is in the right ballpark. Cutting this in half will result in four times the number of triangles; moving the decimal place one spot to the left will result in 100x the number of triangles. All of the VSP mesh size and radius parameters are in the units of the model; this makes them very easy to understand and control.
• For our model, with semispan of about 1.2 units, 'Max Edge Len' of 0.05 will result in about 22 triangles out the span of each side. In the physical dimensions of the OneraM6 wing with 1.2 m span and 80.6 cm root chord, out triangle edges will be about 5 cm.
1. Set the 'Max Edge Len' to 0.05.
4. Generate initial mesh
• It is a good idea to re-generate the mesh after each significant sourcing change to ensure the changes are having the desired effect.
1. In the 'CFD Mesh' window, click 'Mesh and Export' to generate a surface mesh.
• VSP will proceed through the mesh generation process and should result in a coarse, uniform, watertight mesh.
• Mesh sources must be added to provide localized mesh resolution control such as clustering at leading and trailing edges or wing root or tips. VSP includes a set of default sources for each component type. These defaults provide a reasonable starting point for most local mesh control.
1. In the 'CFD Mesh' window, click 'Add Default Sources' to add the default sources to the wing component.
• Note that in this case, these sources do not extend all the way to the wing root.
6. Regenerate mesh
1. Click 'Mesh and Export' to generate a surface mesh including the effects of the sources.
• Note that while the mesh is now clustered at the wing root and tip and along the leading and trailing edges, the leading and trailing edge clustering does not extend to the center of the wing.
7. Modify sources
• In order to better resolve the leading and trailing edges, the corresponding sources should be extended to the wing root.
1. In the 'CFD Mesh' window, select the 'Leading Edge' source from the list of sources in the box below 'Sources'.
2. Drag the 'U' slider under 'UW Position 1' to 0.0.
• Note the movement of the source endpoint on the model.
3. Drag the 'U' slider under 'UW Position 2' to 1.0.
4. Select the 'Trailing Edge' source from the list of sources.
5. Drag the 'U' slider under 'UW Position 1' to 0.0.
6. Drag the 'U' slider under 'UW Position 2' to 1.0.
8. Regenerate mesh
1. Click 'Mesh and Export' to generate a surface mesh including the effects of the modified sources.
2. Click the 'Show Sources' button to disable the source display and better show the final mesh.
9. Mesh tailoring and control
• Recall that the VSP mesh radius and size parameters are specified in the units of the VSP model. In this example, the trailing edge mesh sources have length of 0.01 (1 cm) and radius of 0.23926 (24 cm). At the center of the source, the triangles will be 1 cm on a side. This will gradually fade so that at the edge of the sphere of influence (24 cm away), the mesh size will not be affected by the trailing edge source.
• Controlling and understanding the mesh in the model units can greatly help you develop a set of sources which will generate a good mesh for your purposes. Model dimensions like the local chord length and the airfoil leading edge radius provide valuable guidance when setting sources.

Generating a Surface Mesh from the Command Line

The VSP interface is the best way to set up and adjust the mesh control sources, but once the mesh parameters are established, you may want to generate the mesh from the command prompt.

To generate an isotropic surface mesh from the command line, and write both STL and TRI files, enter the following command:

vsp -batch infile.vsp -cfdmesh 1.0

This command will generate the surface mesh and write both 'infile.stl' and 'infile.tri'.

The 1.0 parameter is a global scalar applied to the mesh size. Changing this value will increase or decrease the mesh resolution, but will qualitatively obey the same mesh distribution. Entering 0.5 will create a mesh with edge lengths half as long – resulting in approximately four times as many triangles.

Next Steps

Once the surface mesh is complete, the next step is to prepare the file for analysis in Cart3D. If you are using a STL file, it will need to be converted to a Cart3D TRI file; that process is detailed in the STL to TRI Tutorial. Otherwise, continue to the Cart3D Setup Tutorial.