Table of Contents
OpenVSP CFD Meshing Guide
OpenVSP includes an unstructured mesh generator. If you need more control over your CFD meshes, you might like to read about Controlling snappyHexMesh with OpenVSP subsurfaces.
This section of the wiki aims to give a basic understanding of the CFD Meshing interface within OpenVSP. Throughout this interface, it is important to make the distinction between a “scaled” and “un-scaled” parameters. In this context, scaled means that the parameter value is in the scale of the given geometry. This means that the value is in the scale of the current geometry. Un-scaled parameters, however, are relative to the current geometry's scale. Therefore, any value given to them will hold its meaning regardless of the size of the input geometry.
Once you have created your own geometry or have download a geometry from the hangar, you can create a triangulated surface mesh for use in CFD. To begin, open the CFD Mesh interface from the Geom pulldown menu. The CFD Mesh interface will then open, and you will begin on the “Global” tab. Along with this, there are tabs for “Display”, “Output”, “Sources”, “Domain”, and “Wakes”. The choices and parameters to be set within each will be discussed below.
Present on all tabs of the CFD Mesh window are the output window and the “Mesh and Export” button along the bottom of the window. The Mesh and Export button behaves as expected, and runs the CFD Meshing program. If any output files are selected, this will also export the mesh to the selected file types and locations. The output window will display what the CFD Meshing program is currently doing, so users can track what the program is actually doing in the background. This window also displays any error or warning messages that may be displayed. After every mesh and export, this window will display the total number of triangles produced on the geometry, including any possible far field or wakes, and the water tightness check. This water tightness check ensures that the produced mesh is connected properly and meets water tight criteria for use in many CFD codes.
This is the first grouping of parameters when the CFD Mesh interface is opened. It includes the basic parameters that are necessary to define a mesh. These parameters include:
- Maximum Edge Length
- Minimum Edge Length
- Maximum Allowable Gap
- Number of Circular Segments
- Growth Ratio Limit
Among these, the parameters for Maximum Edge Length, Minimum Edge Length, and Maximum Allowable Gap are scaled parameters. Number of Circular Segments and the Growth Ratio Limit are non-scaled parameters.
Maximum Edge Length controls the maximum edge length for any triangle produced on the surface of the given geometry. This maximum length holds for all components of the geometry. Maximum Edge Length holds highest priority in determining triangles, and will overrule any other parameter.
Minimum Edge Length controls the minimum edge length for any triangle produced on the surface of the given geometry. Like Maximum Edge Length, this minimum length holds for all components of the geometry. Minimum Edge Length holds priority over all following parameters. The main purpose of minimum edge length is for control in geometries where the Maximum Allowable Gap and Number of Circular Segments would drive the triangle lengths infinitesimally small. It also allows for a basic control on the overall number of triangles to be produced in the surface mesh.
Maximum Allowable Gap controls the maximum distance between the mathematically defined surface of the input geometry and the actual triangles produced during CFD meshing. This allows a user to set how well defined the triangulated mesh matches the given geometry. As said before, this parameter will only be implemented up to the limits set by Minimum Edge Length. It has equal priority to Number of Circular Segments and priority over Growth Ratio Limit.
Number of Circular Segments defines the minimum number of segments required for a given radius of curvature. Like Maximum Allowable Gap, this parameter generally controls the precision between given mathematical geometry and the output triangulated mesh. Again, this parameter is limited by the Minimum Edge Length parameter and has priority over the Growth Ratio Limit.
The lowest parameter in terms of priority, Growth Ratio Limit determines how quickly the edge lengths of the triangles within the mesh can grow. When not withheld by the other parameters, triangles will be allowed to grow relative to their previous triangle up to this ratio. In essence, this parameter controls how smoothly triangles grow in size when moving away for complex portions of a given geometry. This can also be a useful tool in limiting the number of triangles produced when geometries have only small areas of complexity.
Also included on the Global tab are options for Rigorous 3D Growth Limiting and controls for Length and Radius of sources. Rigorous 3D Growth Limiting applies the Growth Ratio in a 3D sense such that components of a geometry that are not directly connected still must obey the Growth Ratio where they are near a portion of a geometry with smaller triangles. This can be useful in complex geometries, or geometries with multiple bodies. The Global Source Control Adjustments control the length and radius of all sources in the given geometry. The impacts of these parameters will be further discussed in the Source section.
The Display tab contains basic controls over what is seen in the main GUI window. Each button is self explanatory and will either show or hide the given aspect of the CFD mesh. The “Show Mesh” button is a global control that will either show or hide the entire mesh. The “Show Bad Edges and Triangles” button will highlight any Edges or Triangles that do not meet the basic criteria for the water-tight mesh check.
The Output tab controls the exported files from a given mesh. The file types supported are described in greater detail in the File Formats section of this wiki.
In general, turning on a given file type will export the final mesh to a file of this type. The “…” button next to each file type will allow you to designate the file name along with the location to save the exported file. The default behavior is to export the mesh to a file named “VspAircraft” in the current working directory.
Currently, OpenVSP does not automatically append the file extension to a given file type when a custom name for export is used. Keep this in mind when setting up the output settings for a CFD Mesh.
The Source tab allows for the addition and control of sources within the meshing of a geometry. Sources are a good way to add additional triangles to an area of increased complexity in a given geometry. The main features used in defining all sources are the length and radius parameters. The radius parameter controls the size of the area of influence for a given source, while the length parameter controls the maximum edge length while within this area of influence. Sources can be attached to any component of the input geometry and come in three main styles:
- Point Source
- Line Source
- Box Source
These styles behave as their names suggest. Point sources are concentrated at a single point and act only within the sphere like area of influence. Line sources take a point source and extend it along a single dimension. Box sources then create a box for the area of influence defined by the two corners of bounding box. Sources can be seen in the main GUI window while the “Show Sources and Wakes” button is active under the Display tab. This can be used to ensure that the source is located properly and will behave as expected.
Sources are added by first selecting which component to add sources to. The type of source is then selected in the “Type” dropdown menu and added with the “Add Source” button. Each added source can be given a name as well for simpler recall of which source goes where. If at any point it is decided that a source is no longer needed, it can be removed by selecting the source in the list of sources and clicking the “Delete Source” button.
Instead of adding sources manually, the “Add Default Sources” button can be pressed to add the default sources to the currently selected component. These default sources are based on generally thought of use cases for each component, such as along the leading and trailing edges and root and tip chords of a wing component. Some component types have no default sources, so this button will not be effective.
Once sources are added to the geometry, their behavior can be adjusted with the sliders below. The Radius and Length sliders control behavior as described above. The U and W sliders control the location of each defining source for the different source types. As a point source is only a single source, adjusting the parameters for the second source will have no effect while a point source is selected. For a line source, each of the positions defines the sources at the endpoints of the line. For a box source, the positions define the sources located at the bounding vertices of the box that their position defines.
As said before, the behavior of all sources can also be adjust through the global tab. These controls are limited to radius and length controls, but can be useful for quickly adjusting the resolution of the overall mesh once an initial set of sources have been set.
The Domain tab contains controls that allow a far field to be defined for either direct import to CFD codes or for import into other volume meshing programs. When first moved to, all of the options are blanked out. These options will remain inactive until an option is selected that requires input to them. For instance, clicking the “Generate Far Field Mesh” button will activate a majority of the screen. Other sections will not be activated until necessary.
The top two buttons, “Generate Half Mesh” and “Generate Far Field Mesh”, are the main choices to be made by the user. Both buttons enable the behavior as they describe. The half mesh option will add a slicing plane to the geometry at the Y=0 plane and save the created triangles on the positive half of the usable space. Note that if the Far Field Mesh option is not selected as well this will simply cut the produced mesh in half and delete any triangles in the negative Y half of the geometry space. This will leave the given geometry open ended an will produce a warning of “NOT Water Tight” in the output window. If a far field is meshed, the symmetry plane will be meshed along with it and will be connected to the defined domain.
For the Far Field, the first controls are similar to those encountered under the Global tab. These are the Maximum Edge Length, Maximum Allowable Gap and Number of Circle Segments controls. These behave exactly the same as their global counterparts, but are used only along surfaces that define the domain of the mesh. This allows for two sets of parameters to be defined: one for the given body geometry (defined under the Global tab) and one exclusively for the far field. This allows a variance between the resolution in the far field and along the body that is advantageous for efficiency of triangle placement.
The next main choice for the user is to select the type of far field to be created. Far fields can be produced in two ways: by selecting a component from the input geometry or by allowing VSP to automatically create a far field based on the input geometry. Also under the far the far field type is an “Update” button. Clicking this will force an update of far field parameters when a change has been made in the geometry.
A component type far field behaves as expected. It uses any component selected from the main geometry as use for the far field. The component to be used is selected from the dropdown menu. Any component type can be used The size and shape of this far field are controlled through the input geometry. The only controls over this type of far field under the Domain tab are used for resolution control.
The automatically produced far field is the “Box” type far field. As its name suggests, this automatically creates a box that contains the input geometry. If the “Show Far Field Preview” option is active under the Display tab, a preview of this box will be shown as a green outline in the main GUI window. It's values can be adjusted in the options below the type selection. Of highest importance is likely the size of the far field. This can be controlled through either relative or absolute values. A relatively defined far field is created when the “Rel” button is active. This creates the far field based on scaling the bounding box of the given geometry. The absolutely defined far field is created when the “Abs” button is active. This defines the far field box lengths in an absolute sense in the units of the current geometry. In this way, the far field can be defined in both a scaled and an un-scaled sense, as previously discussed.
As you'll notice in changing these values, the selection of relative or absolute size doesn't seem to have an initial effect from the CFD Mesh interface, as updating one value updates the other. The main way this choice effects the far field generation is in reference to a changing geometry. The choice of absolute or relative effects what holds constant when the input geometry is changed. If absolute is chosen, the actual side lengths remain constant regardless of changes to the input geometry. If scaled is chose, the actual side lengths of the far field box are dependent on the input geometry, as they are the input's bounding box lengths times the scaling factor.
Another choice for the user is the location of the far field box. If the far field is a component type, its location must be set through the geometry interface just like placing any other component. If it is of the box type, the far field location can either be defined automatically by VSP or manually by the user. The automatic location option is default and is selected with the “Cen” button. This choice automatically centers the far field box around the input geometry's bounding box. The manual option, selected with the “Man” button, allows the user to arbitrarily define the location of the far field box. This will activate the location sliders below. These are used do define the coordinates of the center of the front plane of the far field box. These are done in scaled units, so the coordinates are in the units of the input geometry.
The Wakes tab contains controls for defining wakes in the CFD Mesh. Wakes can only be attached to wing components and are treated as a transparent surface. This means that they are not seen by the rest of the components within CFD Mesh, and will not interact with them.
When defining a wake, the first thing to be done is selecting which component to attach the wake to. This is done by selecting a component from the dropdown menu of components. Once a component is selected, click the “Add Wake” button to add a wake to the selected input. If the “Show Sources and Wake Preview” option is selected, a preview of this wake will be shown in the main GUI window as yellow lines extending from trailing edge of the selected component.
The other options to set are the Wake Scale and Wake Angle Parameters. The Wake Scale parameter behaves similarly to the relative size option of the far field scale. This will tell the meshing tool how large to make the trailing wake in relation to the X-direction length of the geometry's bounding box. The Wake Angle parameter sets the angle at which the extending wake will come off of the components trailing edge. This angle is taken from the components neutral axis, so it will remain aligned along the X-axis even if the component is rotated in the Geometry window.
In general, the simpler the mesh the better when created isotropic triangulated meshes in OpenVSP. In this way, the interface was created to allow more advanced options as you move to the right through the tabs in the CFD Mesh window. In many cases, only the first three tabs (Global, Display, and Output) are necessary to create a satisfactory mesh.
When first creating a mesh, it is often helpful to work with each parameter on the global page independently. In this way, the user can obtain a better understanding of what each parameter actually does. Generally, it is a good idea to begin at the top of the global parameters and work your way down until the produced mesh is satisfactory. To begin, Maximum Edge Length can be isolated and adjusted until it is set to a point that will give a good minimum resolution of the mesh. This isolation can be done by increasing the Minimum Edge Length and Maximum Allowable Gap (keeping in mind that these are scaled values) to very large values and Number of Circular Segments to a very low value. If Minimum Edge Length is set such that it is equal to or greater than the Maximum Edge length, than all triangles will be produced at the Maximum edge length.
Once the maximum length has been set, a minimum length can be set. It is often best to set a minimum length of roughly 10-20 times smaller than the maximum length. This value can be further adjusted once the geometry based parameters of Maximum Gap and Circular Segments are set to find a balance between resolution and file size.
In general, the Maximum Allowable Gap and Number of Circular Segments accomplish the same thing. In this way, it is helpful to set only one or the other, with the choice being mainly personal preference. Each offers its advantages and disadvantages. Maximum Allowable Gap is a more physical parameter and may be easier to understand and see its effects. However, as a scaled value, it may need to be reset as a geometry changes. Number of Circular Segments is a non-scaled parameter, so it can be set for a wide range of geometry scales without modification, but takes a more nuanced understanding of geometry based meshing to be understood. To isolate one parameter or the other, set the value for the non-used option to a prohibitive level. This would be a very large value for Maximum Gap relative to the current geometry's scale, or a very small value for Number of Circular Segments.
The options present under the other tabs are more advanced than the options under the Global tab. The best practices for each depend on the intended use of the triangulated mesh. Varying uses make it difficult to set a general set of best practices for each, so these options are only suggested for users with greater experience in CFD meshing or for use in specialized cases where the options are required.