Meshing M01

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

Read the Tutorial Introduction before starting this tutorial. It outlines the required links to download SMS, which we will use for mesh generation.

This tutorial is designed to introduce the fundamentals of creating a mesh. Using the steps outlined in this tutorial you will create two alternate trapezoidal channel computational meshes. Specifically in this tutorial you will:

  • Create a trapezoidal mesh topology.
  • Define the elevation data.
  • Build and adjust two alternative mesh designs.

Trapezoidal Channel Project Area

The trapezoidal channel has dimensions as shown below:

  • 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 will have a resolution of 12.5 m across the channel and 25 m along the channel.
Oblique view of the completed model mesh displayed in SMS

Requirements And Downloads

Requirement Brief Description
Meshing Data Download the Meshing Module 1 Data Package.
Assumed Knowledge No prior knowledge is required for the completion of this tutorial. However it is assumed that you have read and downloaded the required software outlined in the Tutorial Introduction. We have designed this tutorial to provide an introduction to meshing for all modelling levels. If you run into any problems or need help, please contact support@tuflow.com

Prepare Your Working Environment

Unzip the required Model Data to your preferred working location, for example E:\TUFLOWFV\Meshing_M01.

  • The Complete_Mesh folder has the files for the completed tutorial in case you get stuck.
  • The Working folder is where we will save our files and build our mesh.
    DataPackage meshing.png
    Note: All file paths referred to will be relative to this base directory. For example, Complete_Mesh\Trap_Channel_001 refers to E:\TUFLOWFV\Meshing_M01\Complete_Mesh\Trap_Channel_001.

Setup Your SMS Project

Before we start meshing we'll setup our working projection and save off a new SMS project. Launch SMS and the workspace will be as shown below:

M01 SC 001.png

Setting The Workspace Projection

Set the projection WGS 84 UTM zone 60s from the menu bar Display > Display Projection....

M01 mesh SI 001.png

In the Display Projection dialogue box set Global projection and click Set Projection.

M01 mesh SI 004.png

The Horizontal Projection dialogue will appear. In Filter Strings: search WGS 84 UTM zone 60s and under Southern Hemisphere select WGS 84 UTM zone 60 > OK > OK.

M01 mesh SI.png

Save The SMS Project

Save the new project by selecting File > Save As....

M01 Int 003 Image.png

Navigate to your Working folder and save the project as Trap_Channel_000.sms.

M01 Int 004 Image.png

Constructing The Mesh

In this section we will complete key steps required to build your mesh including:

  • Creating the mesh topology by digitising a series nodes and arcs within a mesh generator map coverage.
  • Defining our bathymetry data.
  • Building polygons in our mesh generator map coverage to define materials and the bathymetry dataset for interpolation.
  • Generating an initial mesh, followed by mesh refinement and improvement.

Create The Mesh Topology

1. Create a Mesh Generator coverage type by right clicking on the Map Data label and select New Coverage. Under Coverage Type: Generic select Mesh Generator:
Tut 01 Mesh Gen Setup 01.png
2. We won't need the default coverage Area Property. Delete it by right clicking on Area Property > Delete > Yes. This keeps our workspace tidy.
M01 InterSms 001.png
3. Define the model extent by selecting the Create Feature Point button 1.1.1B.png and create a point by clicking in the SMS Graphics Window. As each feature point is created use the coordinate boxes in the toolbar above the main display window to manually update the coordinates (x and y), and elevation value (z) via the Coordinate Boxes. Create eight points in total and update their x, y, and z values as specified in the table below:
M01 SMSInter 002.png
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
Your window should look the same as the below:
M01 SMSInt 008.png
4. Enabled snapping by selecting Edit > Preferences
Mtut01 SI 001.png
5. In SMS Preferences select Map check Snap feature object to displayed nodes and vertices:
M01 SMSInt 010.png
6. Use the Create Feature Arc button Tute1 FV002.PNG to join the nodes together:
M01 SMSInter 009.png
7. Save your SMS Project by selecting the Save Project button in the tool bar:
M01 SMSInter 004.png

Define Elevation Data

In SMS, scatter points are x, y, z coordinates used to define mesh bathymetry and topography. We use them during the mesh generation build phase to interpolate elevation data onto the model mesh. In this tutorial the scatter dataset will be created from the previously created Map Coverage. Follow the below steps to generate a scatter dataset:

1. Select Feature Objects > Map -> Scatter from the menu.
M01 SMSInt 012.png
2. Under Scatter point Z-Value Source specify Arc end points and vertex elevations and uncheck Convert selections only in the dialog box. select OK:
M01 Map Scatter 000.png
3. Use the display button Mod 01 Display options.01.png to view the newly created Scatter dataset. In the Display Options check the Contours box and select the Contours tab in the Scatter Display Options:
Tut SI 042.png
4. Select Color Fill to visualise the z values and select the Color Ramp button. 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

Your window should now show the below contoured z values:

M01 SMSInt 011.png

Note: The approach demonstrated presents an introductory test case. For real world applications often contain a variety of data sources are required. To learn more about working with scatter data in SMS refer to the scatter dataset tutorials on the Aquaveo Wiki.

Build Polygons

Before we generate our mesh we need to Build Polygons. The polygons are generated from the arcs and nodes we previously created in our Mesh Generator coverage and define the structure and properties of the mesh. Using polygons we can define if the mesh should be patch (quadrilaterals) or paving (triangles), assign bathymetry or set the mesh to active or inactive, for example to omit an island from the mesh.

To build polygons select Feature Objects > Map -> Build Polygons:

M01 SMSInt 013.png

Generate The Mesh

Generate the mesh by right clicking on the Mesh Generator coverage type and select Convert > Map ->2D Mesh. You can leave the mesh name as the default "Mesh Generator Mesh".

M01 Int 015 Image.png


The resulting mesh has been created using 6 triangular elements (paving element type) connected by nodes which are the 8 points used to define the extents of the trapezoidal channel. It doesn’t look very good, but it is a mesh! We will improve it shortly. As this mesh does a poor job of representing the channel geometry right click on Mesh Generator Mesh and select Remove to delete the mesh prior to moving to the next section.

Tut01 SI pave mesh.png

Modify Polygons

To improve the mesh the next steps will show how to create a quadrilateral (patch) mesh that follows the geometry of the trapezoidal channel.

1. Make the Mesh Generator map coverage editable by selecting Map Data entry in the explorer window:
Mod 01 Select mapdata.00.png
2. Before we change anything review the polygon properties of each polygon. Using the Select Feature Polygon button 1.1.5A.png double click on the lower polygon.
M01 SMSInt 016.png
The 2D Mesh Polygon Properties will appear as shown below:
Mod 01 chk mesh properties 02.png
Some of the key options we will use during our tutorials 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 a full summary of the features available check out the 2D Mesh Polygon Properties on the XMS Wiki.

Our mesh will adopt a resolution of 12.5 m across the channel and 25 m along the channel:

3. From the tool bar click Select Feature Arc 1.1.5B.png tool.
4. Select the top and bottom arc. Hold the shift key to select both the top and bottom arcs at the same time.
5. Under Arc Options distribute the number of vertices to 1,000 / 25 - 1 = 39 vertices.
M01 Int 018 Image.png
6. Select the left and right arcs and distribute the number of vertices to 25 / 12.5 - 1 = 1 vertices. Use the Zoom button 1.1.5C.png to assist with the arc selection.
M01 Int 019 Image.png
7. Set the Mesh Type to Patch.
8. In the Elevation (bathy/topo) type drop down select Scatter set.
8a. Select Scatter Options.
8b. The interpolation dialog box now be visible. Make sure the elevation data is selected and select OK.
M01 Int 020 Image.png
9. Use the Preview Mesh and Zoom function to view the mesh.
M01 Int 021 Image.png
10. Repeat the steps 3-9 for the remaining polygons. The upper polygon has the same vertex count as the bottom polygon. The middle polygon has 50 / 12.5 - 1 = 3 vertices across the channel and 1,000 / 25 -1 = 39 vertices along the channel.
11. Build the mesh using the steps listed in Generate The Mesh or use 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:

M01 Int 022.png


Note: that if a mesh covering only one polygon is produced 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 11.

Visualisation

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

M01 Int 025 Image.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.

Going Further (Optional)

The best way to learn more is to experiment. In the following example, we step through how to adjust your mesh to include a “bump” in the center and a flow constriction further downstream. To adjust your mesh 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, save a copy of the previous SMS workspace Trap_Channel_000.sms and rename it to Trap_Channel_001.sms.

Duplicate the original Mesh Generator map file by right clicking Mesh Generator > Duplicate.

M01 Int image 028.png

Right click on the duplicated map file Mesh Generator (2) and select Rename and call it Trap_Channel_001.

M01 Int image 029.png

In the Display Options make sure that the Vertex option is checked:

M01 Vertex option.png

Editing the Mesh

We will add the bump to the mesh by increasing the elevation. Use the Create Feature Arc Tute1 FV002.PNG tool to digitise 12 Arcs perpendicular to the flow toward the middle of the mesh. The horizontal length of the bump should contain approximately 3 vertices along the mesh, see the example below:


Tut 01 bump feature Arc 01.png

To apply new elevations values to create the bump use the Select Feature Point Tut 02 Select Feature Point.png tool and select the arc within the bump and update the following Z values for nodes A to H:

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

Tut 01 node elv 03.png

Using the Select Feature Arc 1.1.5B.png tool select each arc within the bump (selection shown in figure below) and right click selecting Redistribute > Vertices and specify Number a of Segments as 1:

M01 SMSIn image 030.png



Add the mesh constriction using follow the below steps:

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


Tut 01 contriction feature Arc 02.png


Use the Select Feature Point Tut 02 Select Feature Point.png tool to update the following Y values for nodes A to D:

Tut 01 contriction nodes 02.png

1. Y value at nodes A & B = 65.
2. Y value at nodes C & D = 35.

Your Mesh Generator map file should now look similar to the below:

Tut 01 goignFurther mesh01.png

Create Scatter Points

Scatter points contain elevation information which will be interpolated onto the model mesh. Use these steps to create scatter points:

1.Click on Map Data Trap_Channel_001 then select Feature Objects > Map -> Scatter from the menu.
Tut01 SI map scatter.png

2. Make sure you specify the z value source from the Arc end points and vertex elevations and uncheck Convert selections only in the dialog box:
M01 Map scatter 001.png

The above configuration update should now show the below contoured z values. You may need to change your display settings: see section Create Scatter Points for help.

Tut 01 elv 00.png

Distributing the Mesh Vertices

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

Add vertices within the bump using the Select Feature Arc to select the 4 arcs shown below. Right click and select Redistribute Vertices then specify Number of Segments as 4.

M01 SMSInt Image 031.png

Use the below information to redistribute vertices at Arcs 1-12:

1. Use Select Feature Arc 1.1.5B.png tool and holding shift select Arcs 1, 2, 3 & 4 and right click to select Redistribute Vertices.
2. For Arcs 1-4 we will Specify Number of Segments as 2.
Tut 01 bump distribute verticies 01.png
3. Repeat the process for Arcs 5 & 6. We will Specify Number of Segments as 4.
4. Repeat the process for Arcs 7 & 8. We will Specify Number of Segments as 6.
5. Repeat the process for Arcs 9-12. We will Specify Number of Segments as 2.


Use the below information to redistribute vertices at the constriction along Arcs 1-7:

Tut 01 contriction verticies 00.png


1. Use Select Feature Arc 1.1.5B.png tool and holding shift select Arcs 1 & 2 and right click to 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 Generator map file should now look similar to the below figure:

Tut01 mesh goingfurther.png

Build polygons by selecting 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. See below animation:

In the 2D Mesh Multiple Polygon Properties 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 repeat the steps listed for Build Polygons or use 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:

M01 SI mesh 001.png


Note: that if a mesh covering only one polygon is produced 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.

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.

Congratulations you have completed the construction of two meshes, Trap_Channel_000.2dm & Trap_Channel_001.2dm. Great work!

Feedback

If you have any queries, feedback or requests for new functionality you'd like added to the tutorial modules, please feel free to get in contact with support@tuflow.com.

If you wish to keep up to date with all things TUFLOW and TUFLOW FV, then please join our LinkedIn group.

Conclusion And Next Steps

Well done on completing the Trapezoidal Channel Mesh Build. You have now learnt how to build and modify a simple mesh.

Return to the Tutorial Introduction Page to complete further meshing and model build tutorials.