Tutorial M03 goingfurtherDraft
Description
In Meshing Model 03 the offshore mesh cell size was adjusted by redistributing vertices along the polygon boundaries. This section outlines an efficient workflow in SMS for defining mesh resolution using the Source function in the licensed version of SMS. In this tutorial, you’ll learn how to use the Source function to control mesh resolution based on depth. For example, in shallow areas, the mesh elements will be smaller, providing finer detail, while in deeper areas, the elements will be larger, creating a coarser mesh where high resolution is less critical. Specifically, you will be shown how to:
- Access a demonstration license for SMS.
- Generating a depth surface from from an existing scatter from existing dataset.
- Use the Size function to determine mesh resolution base on depth.
Accessing A Demonstration License
To complete following section a license for Aquaveo SMS is required. If currently using the unlicensed version, an evaluation license of SMS can be requested via: https://evaluate.aquaveo.com/.
Requirements And Download
Requirement | Brief Description |
---|---|
Data | Download the MADDYTODO UDPATE Constructing Breaklines and Bathymetry Data Package. |
Assumed Knowledge | It is recommended to complete the Meshing Module 3 prior to completing this tutorial. If you run into any problems or need help, please contact support@tuflow.com |
Prepare The Working Environment
Unzip the required Data Package to your preferred working location, for example E:\TUFLOWFV\Meshing_Module_03_Size_Function_Mesh.
- The Completed_Module folder has the files for the completed tutorial.
- The Module_Data folder has the files for the completed tutorial.
- The Working folder is where files associated with mesh development will be saved.

Provided Project files
To save time and allow focus on constructing the mesh multiple files have been provided:
- From data package copy the files in the Module_Data folder outlined in the Module_Data\ column (refer to below table).
- Paste these files into the relevant folders outlined in the Copy to column (refer to below table).
Module_Data\ | Description |
---|---|
Ocean_Mesh_001.map | SMS map data file that will assist in the generation of the mesh. The spatial reference system is GDA94 / MGA zone 56 (EPSG:28356). |
Bathy_Topo_001.tif | Combined offshore bathymetry and intertidal digital elevation model at a grid size of 30m.The spatial reference system is GDA94 / MGA zone 56 (EPSG:28356). The vertical datum is the Australian Height Datum (AHD). |
Setup The SMS Project
Launch SMS and use the below steps and video to save the workspace in the Working folder:
- 1. From the menu bar select File > Save As.
- 2. Navigate to Working folder.
- 3. Save the workspace as Size_Function_Mesh_001.sms.
Set the projection GDA 1994 MGA Zone 56 from the menu bar Display > Display Projection.... Use the below steps and video to set the workspace projection:
- Go to Display > Display Projection....
- Select Global projection.
- The Horizontal Projection dialog will appear. In the Filter strings: type GDA 1994 MGA Zone 56. Select the projection and OK > OK.
Use the below steps and video to open map file and elevation data and set the display options for :
- From the Windows Explorer drag and drop Module_Data/Ocean_mesh.map and Module_Data/Bathy_Topo.tif into the workspace.
- Select Display Options
to specify the map data display as below:
- Under Display Options select Map.
- Update Point/Node colour to Red.
- Make sure Arcs are checked.
- Check Vertex and update the symbol to a cross-hair +.
- Select OK
Refining Meshing
Create a Scatter dataset
- Right click on Bathy_Topo_001.tif and select Convert > Map -> 2D Scatter.
- Leave the default name and select OK.
- Zoom in to view the scatter points.
Creating A Depth Dataset
Before running the Source function tool, a depth dataset must be created. This section demonstrates how to use the Data Calculator to generate a depth surface from the scatter dataset created in the previous section. Follow the steps and equations provided in the video below to generate the depth data.
Use the steps and video below to remove high land elevations and convert depths to a standardized 0–1 range:
- Make sure the Bathy_Topo_001.tif Scatter Data is active
- From the Menu bar select Data > Data Set Toolbox....
- Under the Math tree select Data Calculator.
- Set the following:
- In the Calculator box type: abs(min(d1,1))
- Set the Output dataset name: as tmp1
- Click Compute.
- Under the Data Sets the new output d4. tmp1 will appear.
Use the steps and video below to prevent very small or zero values that could result in unstable or excessively small mesh elements:
- In the Data Calculator Set the following:
- In the Calculator box type: max(d4, 1)
- Set the Output dataset name as tmp2
- Click Compute
- Under the Data Sets the new output d5. tmp2 will appear.
Use the steps and video below to convert the normalized depth values into realistic mesh sizes:
- In the Data Calculator Set the following:
- In the Calculator box type: d5*25
- Set the Output dataset name as tmp3
- Click Compute
- Under the Data Sets the new output d6. tmp3 will appear.
Since the previous step may produce values smaller than 250 m in shallow areas, the steps below set a minimum size to avoid overly fine mesh elements:
- In the Data Calculator Set the following:
- In the Calculator box type: max(d6,250)
- Set the Output dataset name as sizing
- Click Compute
- Under the Data Sets the new output d7. sizing will appear. Note the minimum size function value sets a base target for mesh sizes, but actual mesh cells may be smaller in areas where geometry or mesh quality requires higher resolution.
Size Function
A size function determines mesh element size based on values from a scatter dataset. In this case, the depth dataset you created in the previous section Creating A Depth Dataset [update link] is used. Each point in the scatter dataset is assigned a value that represents the desired element size at that location. This tutorial will demonstrate how to generate size functions based on depth. For more information on how to use size functions refer to the SMS Wiki Size Function.
Use the below steps and video to to create a mesh using the size function:
- For visualisation purposes uncheck the Bathy_Topo_001.tif scatter data and make sure the Ocean_mesh under Map Data is active.
- Using the select feature arc select the offshore boundary arc. Right click and select Redistribute Vertices....
- Set the following attributes in the Redistribute Vertices:
- From the Specify drop down select Size Function.
- Select Options.
- In the Interpolation Source and Options set the following:
- Source geometry to Project\Scatter Data\Bathy_Topo_001.tif.
- Source dataset: Project\Scatter Data\Bathy_Topo_001.tif\sizing.
- Leave the rest as default. Select OK > OK.
Generate The Mesh
Now that the model domain has been is delineated the final mesh can be generated. Use the following steps and videos to generate the mesh, identify thin triangles that could impact model performance, and save the mesh.
Use the below steps and videos to generate the mesh:
- Make sure the Ocean_mesh under Map Data is active.
- From the toolbar select the Clean...
tool. In the Clean Options dialog set the following:
- Set Features: All
- Leave the Snap distance as the default.
- Check Full clean and check all options under Full clean.
- Keep Remove arcs less than unchecked. Select OK.
- From the toolbar select Build Polygons
tool.
- Using the Select Feature Polygon
tool select the offshore polygon. Right click and select Polygon Attributes....
- In the 2D Mesh Polygon Properties dialog set the Mesh type to Paving (triangles). Select OK.
- Right click Ocean_mesh and select Convert > Map ->2D Mesh. Accept the default name and select OK.
- Zoom in and review the mesh resolution. Notice how the mesh is finer in shallow water and gradually becomes coarser as it transitions into deeper areas.
Use the steps and video below to check the mesh for thin triangles:
- Make sure the Ocean_mesh Mesh under Mesh Data is active.
- From the menu bar select Elements > Options.
- In the elements options dialog update the Select thin triangle aspect ratio to 0.05 and select OK.
- Using the Select Elements
tool right click on the mesh and select Select Thin Triangles.
- If any triangles meet the threshold, they will be highlighted, and the element information will be displayed at the bottom of the workspace. In this example, there are no thin triangles that meet the threshold; however, it is always good practice to check for poor-quality elements.
Feedback
If you have any queries, feedback or requests for new functionality you would 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 generating the offshore mesh using the Size Function in SMS. You can now return to Meshing Module 03 to continue and complete the tutorial.