Tutorial Module01 Meshing SMS

From TUFLOW FV Wiki
Jump to navigation Jump to search
USEFUL LINKS
Wiki Links Help Downloads
TUFLOW FV Wiki Main Page Products Support/Contact TUFLOW FV Downloads
TUFLOW FV Tutorials Requesting a Licence Tutorial Module Data
TUFLOW Classic/HPC Wiki TUFLOW FV Glossary Manuals

Tutorial Description

The following example demonstrates the development of a very simple model mesh using Aquaveo SMS Community Edition version 13.2.0. SMS supports the building of meshes for TUFLOW FV. For this tutorial, step by step instructions are given to get you started with the Aquaveo SMS.

This example problem demonstrates the development of a basic model mesh. Follow the steps performed here and expand upon them to develop more complex, real-world models.

The example is a trapezoidal channel, dimensions as shown:

  • Top width = 100 m
  • Bottom width = 50 m
  • Depth = 5 m
  • Length of channel = 1,000 m
  • Grade of channel = 1 in 1,000
  • The model domain should have a resolution of 12.5 m across the channel and 25 m along the channel.

Note: Try completing the following steps to create a mesh that can be later used in TUFLOW FV tutorial X [TBC]. For reference, complete versions of the models can be downloaded from the TUFLOW website.

Building the Mesh

Please note this tutorial has been created using SMS 13.2.0 in Community Edition. You may use other versions of SMS however some minor differences may exist between the screenshots in this tutorial and the SMS version you are using.

In this tutorial, we will use SMS to accomplish the following:

  • Define the model domain
  • Define the elevation data
  • Define the mesh sizes
  • Specify the nodestring locations

The folders provided in this tutorial include Complete_Model and working. Copy these folders to where you would like to work with the project.

  • The Complete_Mesh folder has the files for the completed tutorial, in case you get stuck, and
  • The working folder is for the files you create and work within.

Open a new SMS project and save as Trap_Channel_000.sms into the working directory.

Map Coverage

Data contained within the SMS Map Coverage is used to define the model mesh layout. Follow the below steps to define your Map Coverage:

1. The first step is to setup the SMS Map coverage. To build a mesh in SMS we use the Mesh Generator coverage type. Right click on the Map Data label, then select New Coverage and then Mesh Generator from the pop-up window, as shown below.

Tut 01 ComEd Mesh Gen Setup 01.png

Note: if you would like to convert an existing coverage type to Mesh Generator, right click on the coverage label in the explorer bar, as shown below.
caption

2. The map coverage works in a plan view. Using the Create Feature Point button 1.1.1B.png, create the 8 points that define the channel. As each feature point is created, use the coordinate boxes in the toolbar above the main display window to specify the precise coordinates (x and y), and elevation value (z) Module2 Coordinate Boxes.jpg. Please use the below table to spefic the x, y, and z values.

PT X Y Z
1 0.0 0.0 0.0
2 0.0 25 -5
3 0.0 75 -5
4 0.0 100 0.0
5 1000 0.0 0.0
6 1000 25 -6
7 1000 75 -6
8 1000 100 0.0

The feature points should look like the below

caption
3. Now use the Create Feature Arc button Tute1 FV002.PNG to join the dots together. To enable the snapping function, navigate to the Edit > Preferences > Map tab and make sure the Snap feature object is checked.
caption
4. Don't forget to Save your SMS Project as you step through this tutorial.

You have now created the basic map layout that will define the model geometry.

Create Scatter Points

Scatter points contain elevation information which will at a later stage be interpolated onto the model mesh. To create scatter points, please follow the following steps:

1. In this example, the scatter dataset will be created from the previously created Map Coverage. Do this by selecting Feature Objects > Map -> Scatter from the menu.

Mod 01 mapscatter drpdown 02.png

2. Make sure you specify the Z value source from the Arc end points and vertex elevations in the dialog box:

Mod 01 mapscatter selction 02.png

3. Use the display button Mod 01 Display options.01.png to turn on contours in the scatter data module and view the newly created dataset:

a. Select the Contours tab in the Scatter Display Options.

Mod 01 disp opt scatter 02.png

b. Select Color Fill to visualize the z values. Then select the Color Ramp button and Reverse the colour palette so that blue aligns with the minimum values and red with the maximum values.

Mod 01 countors 02.pngMod 01 colour ramp 02.png

The above configuration update should now show the below contoured z values

Mod 01 scatter mesh 02.png

Note: These steps relating to the scatter point dataset have replaced the often complex steps associated with inputting GIS layers, scatter datasets, etc to create the base topography/bathymetry for the model. The approach demonstrated is fine for a simple test case, but real world applications are often more complex and contain a variety of data sources. This can be done in SMS in a more rigorous manner (discussed in the SMS manuals) but is also done using other software such as GIS and CAD.

Build Polygons

Before we build our mesh we need to Build Polygons. To do this, follow the below steps
1. Make sure the Map Data entry in the explorer window is selected
Mod 01 Select mapdata.00.png

2. Now we will build polygons, which is done from the menu Feature Objects > Build Polygons.
Mod 01 build poly.00.png

This takes the feature arcs and creates a series of polygons. It is these polygons for which we can now individually investigate and specify mesh properties.

Build The Mesh

Now we can build a mesh. To build the mesh, use the menu commands Feature Objects > Map -> 2D Mesh.

Mod 01 map to mesh.00.png

The resulting mesh, as shown. It doesn’t look very good. But it is a mesh! A mesh has been created using 6 triangular elements (pave), connected by the nodes which, in this case, are the 8 points used to define the extents of the trapezoidal channel.

Mod 01 mesh pave 02.png

Note that in the image that the scatter data set has been unticked in the explorer window – this hides the scatter data in the display, which makes the other information easier to see. Also unclick the map data set to better inspect the mesh data information. This model geometry is not good enough. We require a much higher resolution than this. A higher resolution is achieved by updating the information within the map data coverage to create more vertices, and hence more elements. More vertices along the polygon arcs = higher mesh resolution.

Please remove the 6 element triangular mesh prior to moving on on the next steps.

Modify Polygons

To make the coverage editable Click on the Map Data entry in the explorer window

Mod 01 Select mapdata.00.png

Using the Select Feature Polygon button 1.1.5A.png, double click on each of the polygons. A dialog box will appear with many options. Check out the SMS manual for a better description, or try a few different options and see what happens.

Mod 01 chk mesh properties 02.png

Some of the key options worth noting are:

  • Mesh type:
    • Paving is the classic triangular mesh, where triangles are used to fill the polygon area.
    • Patch fills the polygon area with a patch of quadrilateral (rectangular) elements. There are some limitations to using this mesh type (like having 4 arcs defining the polygon).
  • Bathymetry Type:
    • Scatter Set will use the scatter data we have created in the 'Create Scatter Points' step to set the z values in the mesh.
  • Preview Mesh:
    • Use this to see how your mesh design looks for this polygon area.
  • Along the bottom of the display image is a series of buttons which let you adjust arc lines and the vertices that define them.


For this model example we will adopt a resolution of 12.5 m across the channel and 25 m along the channel. Please follow the below steps to define your mesh:

1. Using the Select Feature Arc button 1.1.5B.png, select the top arc and adjust the number of vertices (Arc Options) to suit the desired mesh resolution. In this instance, there should be 1,000 / 25 - 1 = 39 vertices. Repeat this for the bottom arc.
Mod 01 mesh properties 02.png
2. Repeat for the left and right arcs, which will have 25 / 12.5 - 1 = 1 vertices. You may need to use the Zoom button 1.1.5C.png to assist with the arc selection.
3. Once this is done, select a Patch mesh type. For a straight trapezoidal channel such as this, a Patch mesh type is the most efficient.
4. Update the Bathymetry Type from Constant to Scatter Set and select Scatter Options to choose the specific dataset to apply to the mesh.
Tute1 FV007.PNG
5. Use the Preview Mesh to see what the mesh looks like. Use the Zoom function to see the finer details.
Mod mesh prop preview 02.png
6. Once you are happy with the layout of the mesh within this specific polygon, repeat the steps for the remaining polygons. The middle polygon has 50 / 12.5 - 1 = 3 vertices across the channel and 1,000 / 25 -1 = 39 vertices along the channel. The lower polygon has the same vertex count as the top polygon. Note that as each polygon is edited, the arc vertices are updated – this highlights how the mesh generator tracks each polygon to ensure that the overall mesh is consistent.

7. Now repeat the steps listed for Build Polygons and Build The Mesh using the menu commands Feature Objects > Build Polygons and Feature Objects > Map -> 2D Mesh to create the mesh and call it Trap_Channel_000.

This time, a reasonable looking mesh should appear. You may need to apply the contour display options to visualise your mesh as the below

Mod 01 mesh 02.png

Note that if a mesh covering only one polygon is produced, please use the Select Feature Polygon button1.1.5A.png and click at any empty location in the screen to deselect all polygons and repeat step 7.

Nodestrings (Boundary Conditions)

The last step is to insert nodestrings. Nodestrings are a string of nodes that can be used to define the location of boundary condition inflows/outflows. For this example, there will be each of an upstream and a downstream boundary condition applied (ie along the left and right edges of the model domain).

Tut 01 US DS mesh side 01.png

Please follow the below steps:

1. Select the Create Nodestring button 1.1.7.png, then click along the nodes that make up the left (upstream) edge of the mesh. Nodestrings should all be created from right to left while looking downstream.
2. Repeat this procedure along the right (downstream) edge of the mesh.
3. To visualise the direction of your nodestrings, press the Select Nodestring button Mod 01 Select NS.00.png and select a nodestring.
Hint – hold the Shift button down to select all nodes between first clicked and second clicked nodes. Hit Enter to finish editing.

Congratulations, you have completed the construction of a mesh! Resave your SMS project.

Visualisation

A useful way to review the created mesh is to visualise it in perspective view. To do this use the Rotate button 1.1.8.png. Use shift-P to return to plan view.

Mod 01 rotate mesh view.00.png

Saving your Mesh

  • Select File > Save As to save the SMS project Trap_Channel_000.sms. This will preserve all of the input data used to develop our mesh (in case we wish to make updates in the future).
  • Select File > Save As and select the type 2D Mesh files (*.2dm). Save the file using the name Trap_Channel_000.2dm. This can later become the geometry input file for the TUFLOW FV tutorial model in XHYPERLINKX [TBC].

Going Further

The best way to learn how to setup and run TUFLOW FV is to experiment. In the following example, we will walk you through how to adjust your mesh to include a “bump” in the centre and a constriction further downstream, which will induce transitions to supercritical flow. Mesh resolution has been increased around these features. We can later run this mesh in TUFLOWFV SEE TUT TBC. To adjust your mesh, please follow the steps outlined in this section. In case you get stuck, we have provided the completed mesh files in Complete_Mesh/Trap_Channel_001.

Firstly, we need to duplicate our original Mesh Generator map file. Do this by right clicking Mesh Generator > Duplicate.

Tut 01 duplicate mesh.png


Editing the Mesh

In the new Mesh Generator map file we will add a bump to the mesh by increasing the elevation within the mesh. Towards the middle of the mesh, using the Create Feature Arc Tute1 FV002.PNG tool, digitise 12 Arcs perpendicular to the flow. See the example below:


Tut 01 bump feature Arc.png

We will now apply the new elevations values to create the bump in the new mesh. Use the Select Feature Point Tut 02 Select Feature Point.png tool update the following Z values for nodes A to H

1. Change the Z value at nodes A & B to -5.3
2. Change the Z value at nodes C, D, E, & F to -3.5
3. Change the Z value at nodes G & H to -5.5

Tut 01 node elv.png

In order for the elevation data to be interpolated across the Bump we need to remove the vertices. Using the Select Feature Arc 1.1.5B.png please select the arcs within the bump and Redistribute > Vertices and specify Number a of Segments as 1.


Tut 01 bump redist vert 001.png


To add a constriction to your mesh, please follow the below steps:

Using the Create Feature Arc Tute1 FV002.PNG tool, digitise 6 Arcs perpendicular to the flow at the downstream end of the mesh. See the example below:


Tut 01 contriction feature Arc 002.png


We will now use the nodes within the mesh to apply a contriction. Use the Select Feature Point Tut 02 Select Feature Point.png tool update the following Y values for nodes A to D.

Tut 01 contriction nodes.png

1. Change the Y value at nodes A & B to 65
2. Change the Y value at nodes C & D to 35

Create Scatter Points

Scatter points contain elevation information which will be interpolated onto the model mesh. To create scatter points, please follow the following steps:

1. In this example, the scatter dataset will be created from your new Mesh Generator Map Coverage. Make sure your new Mesh Generator file is selected and select Feature Objects > Map -> Scatter from the menu.

Mod 01 mapscatter drpdown 02.png

2. Make sure you specify the z value source from the Arc end points and vertex elevations in the dialog box:

Mod 01 mapscatter selction 02.png

The above configuration update should now show the below contoured z values. You may need to change your display settings; please see section [TBC] for help.

Tut 01 elv 00.png

Distributing the Mesh Vertices

Now that we have made the scatter dataset, we will now Redistribute Vertices within our mesh.

Firstly, we will add back in the earlier removed vertices within the Bump. Using the Select Feature Arc tool, please select the 4 arcs shown below. Select Redistribute Vertices and specify Number of Segments as 4.

Tut 01 bump redist vert 001.png


At Bump please make the following adjustments to Arcs 1-12:

1. Using the Select Feature Arc 1.1.5B.png tool and holding shift, select ARC 1,2,3 & 4, right click, and then select Redistribute Vertices
2. For Arcs 1-4 we will Specify Number of Segments as 2

Tut 01 bump distribute verticies.png

3. Repeat the process for Arcs 5 & 6. We will Specify Number of Segments as 4
3. Repeat the process for Arcs 7 & 8. We will Specify Number of Segments as 6
4. Repeat the process for Arcs 9-12. We will Specify Number of Segments as 2


For the downstream Constriction we will also need to Redistribute Vertices along the new Arcs.

Tut 01 contriction feature Arc 001.png


1. Using the Select Feature Arc 1.1.5B.png tool and holding shift, select Arcs 1 & 2, right click, and then select Redistribute Vertices
2. For Arcs 1 & 2 we will Specify Number of Segments as 2
3. Repeat the process for Arcs 3 & 4. We will Specify Number of Segments as 6
4. Repeat the process for Arcs 5 & 6. We will Specify Number of Segments as 2
5. Repeat the process for Arc 7. We will Specify Number of Segments as 6

Your Mesh Genrator map file should now look similar to the below figure.

Tut 01 final mesh.png

Now we will build polygons, which is done from the menu Feature Objects > Build Polygons.
Mod 01 build poly.00.png

Applying Elevation data and Mesh Generation

Using the Select Feature Polygon 1.1.5A.png tool, drag the tool across the entire Mesh Generator file and then right click, selecting Polygon Attributes.

In the dialog box, input the following:

1. Check Mesh Type and select Patch from the drop down
2. Check Elevation (bathy/topo) type
3. Select Scatter Options
4. Select your new scatter dataset Mesh Generator (2) Scatter
5. OK

tut_01_applyingScatter_MeshMods_00.png


To generate your new mesh file, please repeat the steps listed for [TBC] Build Polygons, using the menu commands Feature Objects > Build Polygons and Feature Objects > Map -> 2D Mesh to create the mesh and call it Trap_Channel_001.

You have now successfully modified and generated a new mesh. You may need to apply the contour display options to visualise your mesh as the below

File:Tut 01Modified Mesh 00.png

Note that if a mesh covering only one polygon is produced, please use the Select Feature Polygon button1.1.5A.png and click at any empty location in the screen to deselect all polygons and regenerate your mesh.

Nodestrings (Boundary Conditions)

The last step is to insert nodestrings. Nodestrings are strings of nodes that can be used to define the location of boundary condition inflows/outflows. For this example, there will be each of an upstream and a downstream boundary condition applied (ie along the left and right edges of the model domain).

Please follow the below steps:

1. Select the Create Nodestring button 1.1.7.png, then click along the nodes that make up the left (upstream) edge of the mesh. Nodestrings should all be created from right to left while looking downstream.
2. Repeat this procedure along the right (downstream) edge of the mesh.
3. To visualise the direction of your nodestrings, press the Select Nodestring button Mod 01 Select NS.00.png and select a nodestring.
Hint – hold the Shift button down to select all nodes between first clicked and second clicked nodes. Hit Enter to finish editing.

Congratulations, you have completed the construction of a mesh! Resave your SMS project.

Saving your Mesh

  • Select File > Save As to save the SMS project Trap_Channel_001.sms. This will preserve all of the input data used to develop our mesh (in case we wish to make updates in the future).
  • Select File > Save As and select the type 2D Mesh files (*.2dm). Save the file using the name Trap_Channel_001.2dm. This can later become the geometry input file for the TUFLOW FV tutorial model in XHYPERLINKX [TBC].

Conclusion

Congratulations on completing Tutorial XX [TBC]. You have now learnt how to build a simple mesh model in SMS which can be used in Tutorial X [TBC].

To complete more tutorials or learn more tips and tricks, please return to the TUFLOW FV Wiki Mainpage.

We will continue to add more functionality over time, so please periodically review. If you wish to keep up to date with all things TUFLOW and TUFLOW FV, then please join our LinkedIn group.

If you have any queries, feedback or requests for new functionality, please feel free to get in contact with support@tuflow.com