TUFLOW SWMM Tutorial M04: Difference between revisions

Content deleted Content added
 
(43 intermediate revisions by 3 users not shown)
Line 1:
= Introduction =
This tutorial, Module 4 of the TUFLOW SWMM tutorial dataset will demonstrate TUFLOW's in-bulitbuilt event management functionality. This powerful functionality runs multiple event combinations (e.g. magnitude, duration, temporal patterns, climate change) using a single set of control files, rather than creating a new set of control files for every event simulation. This tutorial demonstrates how event management can be used on a smaller scale, running only 6 models.<br>
The real power of event management is seen when running a model of a much greater size. For example, without implementing event management, a project requiring simulation of the following event combinations would require 144 TCF and bc_dbase files:
:*6 x Event Magnitude: 01%, 2%, 5%, 10%, 20% and 50% Annual Exceedance Probability (AEP)
Line 40:
The files with 'rainfall' in their name are rainfall depth hyetographs used to define rainfall timeseries in the SWMM urban hydrology section of the model.
 
<li>Save a copy of the '''bc_dbasebc_dbase_TS03_001.csv''' as '''bc_dbase_TS04_001.csv'''.
<li>Open the file and make the following updates to the 'Source' column. The '''AEP''' and '''DUR''' wildcards must be between the special character '''~''' to function as a variable. Note, columns E to I are to remain blank. The final '''bc_dbase_TS04_001.csv''' should look like this: <br>
<br>
[[File:SWMM_M04_Event_bcdbase_001SWMM_M04_event_bcdbase_01a.JPG||500pxpng]]<br>
<br>
<li>Save '''bc_dbase_TS04_001.csv'''.
<br><br>
{{Video|name=Animation_TS4_Sim_Control_01b.mp4|width=12351236}}
<br>
</ol>
Line 70:
<li> When TUFLOW runs a simulation, it reads all of the defined events in the TEF, though only uses the event variables specified in the batch file. We will create a compatible batch file shortly.
<br><br>
{{Video|name=Animation_TS4_Sim_Control_02c.mp4|width=12351236}}
<br>
</ol>
Line 85:
<li>Save the TCF.
<br><br>
{{Video|name=Animation_TS4_Sim_Control_03c.mp4|width=12351236}}
<br>
</ol>
Line 94:
 
<li>Update the batch file to reference the '''TS04_5m_~e1~_~e2~_001.tcf''' and include event switches (-e1, -e2) defining event magnitude and event duration:<br>
<font color="blue"><tt>'''set'''</tt></font> <font color="black"><tt>exe</tt></font><font color="red"><tt>=</tt></font><font color="black"><tt>"..\..\..\exe\2023-03-AAAF\TUFLOW_iSP_w64.exe"</tt></font> <br>
<font color="blue"><tt>'''set'''</tt></font> <font color="black"><tt>run</tt></font><font color="red"><tt>=</tt></font><font color="black"><tt>start "TUFLOW" /wait</tt></font> <font color="orange"><tt> %exe%</tt></font> <font color="black"><tt> -b</tt></font> <br>
<font color="orange"><tt>%run% </tt></font> <font color="black"><tt> -e1 05p -e2 1hr TS04_5m_~e1~_~e2~_001.tcf </tt></font> <br>
Line 105:
If the model simulation doesn't run, here is a link to some common <u>[[Tutorial_Troubleshooting_QGIS | Trouble Shooting]]</u> advice.
<br><br>
{{Video|name=Animation_TS4_Run_Sim_01c.mp4|width=12351236}}
<br>
</ol>
Line 113:
 
=Advanced Looping Batch File (Optional)=
Looping batch files are a powerful tool to enable high volume simulation management with the least amount syntax, and subsequently manual effort. For example, the following looped batch file executed 1440 simulation using 15 lines of syntax!
<br><br>
[[File:SWMM_M04_Looped_Batch_File_003SWMM_M04_advanced_looping_batch_01c.png||700px]]<br>
<br>
 
Line 123:
<li>Add the following commands. Indentation is important in batch files, insert tabs to match the below spacing:<br>
<font color="blue"><tt>echo </tt></font> <font color="black"><tt>off</tt></font><br>
<font color="blue"><tt>set </tt></font> <font color="black"><tt>exe</tt></font><font color="red"><tt>=</tt></font><font color="black"><tt>"..\..\..\exe\2023-03-AAAF\TUFLOW_iSP_w64.exe"</tt></font><br>
<font color="blue"><tt>set </tt></font> <font color="black"><tt>run</tt></font><font color="red"><tt>=</tt></font><font color="black"><tt>start "TUFLOW" /wait </tt></font><font color="orange"><tt>%exe%</tt></font><font color="black"><tt> -b</tt></font><br>
<br>
Line 135:
</ol></ol>)<br>
</ol>)<br>
'''Note:''' The 'AEP' and 'DUR' are user defined batch file variables. Projects may use different variable names. The 'AEP' refers to an event magnitude (Annual Exceedance Probability) and 'DUR' refers to an event duration.
 
<li>Save the batch file and double click it in Windows File Explorer to run the simulation.
If the model simulation doesn't run, here is a link to some common <u>[[Tutorial_Troubleshooting_QGIS | Trouble Shooting]]</u> advice.
<br><br>
{{Video|name=Animation_TS4_Run_Sim_02b.mp4|width=12351236}}
<br>
</ol>
Line 147:
When the TUFLOW models were executed via the batch file, the names of check and result files should have been updated to include the event variables from the simulation. For example:
 
{| class="wikitable" width="60%" style="text-align:center"
!style="background-color:#005581; font-weight:bold; color:white;"| TCF
!style="background-color:#005581; font-weight:bold; color:white;"| Event 1 (-e1)
Line 167:
|}
 
==Check Sucessful Completion of Multiple Simulations==
Open '''_TUFLOW Simulations.log''' from the '''TUFLOW_SWMM_Module_04\TUFLOW\runs''' folder. Confirm "'Finished"' is tagged next to the entry for each of the six simulations we executed. This execution log confirms the model simulation was completed.<br>
<br>
{{Video|name=Animation_TS4_Results_01b.mp4|width=1350}}
<br>
 
==Viewing Multiple Simulation Results==
Open the simulation results in QGIS. When loading multiple simulations which include 1D results (all with the same object IDs), a two step load workflow is recommended to avoid filling the QGIS layer panel with duplicate 1D object entires.
===Load Results===
Open the simulation results in QGIS. When loading multiple simulations which include 1D results (all with the same object IDs), a two step load workflow is recommended to avoid filling the QGIS layer panel with duplicate 1D object entiresentries.
<ol>
<li> Open TUFLOwTUFLOW Viewer from the TUFLOW Plugin toolbar.<br>
<br>
<li> Open 1D and 2D results: Select File > 'Load Results'. Navigate to the TUFLOW\runs folder and select TS04_5m_~e1~_~e2~_001.tcf.
[[File:tuflow_plugin_tuflow_viewer.png]]<br>
<br>
<li> Open 1D and 2D results: Select File > 'Load Results'. Navigate to the '''TUFLOW\runs''' folder and select '''TS04_5m_~e1~_~e2~_001.tcf'''.
<li> When asked which simulation to load, select '''TS04_5m_01p_1hr_001'''.
<li> Select '''Yes''' whenWhen asked, "'Do you want to open result GIS layer?"', select 'Yes'.
<li> After '''TS04_5m_01p_1hr_001''' has loaded, open the reminaingremaining result files:
* Select File > 'Load Results'. Navigate to the '''TUFLOW\runs''' folder and select '''TS04_5m_~e1~_~e2~_001.tcf'''.
* When asked which simulation to load, select all remiainingremaining resultresults (except '''TS04_5m_01p_1hr_001''').
* Select '''No''' whenWhen asked, "'Do you want to open result GIS layer?"', select 'No'. The 1D results will still be loaded, though will all be associated with the GIS objects already loaded for the '''TS04_5m_01p_1hr_001''' simulation.
<li> In the QGIS Layers Panel, move the GIS vector (line and point) layers to the top of the list. This will ensure these layers are displayed above all mesh result layers in the project.
</ol>
<br><br>
'''<<Video>>'''
{{Video|name=Animation_TS4_Results_02c.mp4|width=1350}}
<br>
</ol>
 
===Mesh Results (Map Output)===
Inspect the results for all events.
<ol>
<li>Zoom in to the pipe network area.
<li> Use the TUFLOW Viewer'''Open Result''' list to select different event results for viewing.
<li>Click on the scalar dataset 'Depth' under the 'Result Type' in the TUFLOW Viewer 'Map Outputs' list. Toggle on the maximum depth output by clicking the [[File: max_output_icon.png]] symbol.
<li> '''Emilie to fill in remaining bullet points - give me a call when you get to this point and I'll show you what I want upi to do - CDH'''
<li>Click through the results in the 'Open Results' list to observe the different max depth values.
<br><br>
{{Video|name=Animation_TS4_Results_03c.mp4|width=1350}}
<br>
</ol>
 
===Vector Results (Pipe Network Output)===
<ol>
<li>In the QGIS Layers Panel, right click '''TS04_5m_01p_1hr_001_swmm_ts_L''', and select 'Show Labels'.
<li>Use the 'Select Features' tool to highlight 'Pipe 3'.
<li>In the 'Open Results' list, select all 1hr duration event results (hold Ctrl to select multiple).
<li>Click on a scalar dataset 'Flow' under the 'Result Type' in the TUFLOW Viewer 'Time Series' list.
<li>Try multiple combinations of the simulation results to observe how the different events impacted flow through 'Pipe 3'.
<li>Click the 'Refresh Current Plot' [[File: Refreshplotblack.png || 20px]] button to update the plot window after making new selections.
<li>Click the 'Clear Current Plot' [[File: QGIS_Plugin_Icon_ClearPlot.png || 20px]] button to remove all data from the plot window if needed prior to making a new selection.
<br><br>
{{Video|name=Animation_TS4_Results_04c.mp4|width=1350}}
<br>
</ol>
'''<<Video>>'''
 
= Conclusion =
Line 193 ⟶ 223:
*Multiple event simulations were run in sequence from a batch file.
*Creation of looped batch file was demonstrated for the efficient execution of bulk simulations.
*Multiple event simulation results were inspected using the QGIS TUFLOW Viewer.
*For further training opportunities see <u>[https://tuflow.com/training/training-course-catalogue/ TUFLOW Training Catalogue]</u> and/or contact <u>[mailto:training@tuflow.com training@tuflow.com]</u>. <br>
<br>
 
=Other TUFLOW SWMM Tutorials=
*<u>[[TUFLOW_SWMM_Tutorial_M01 | TUFLOW SWMM Module 1]]</u> - 1D SWMM Culverts
*<u>[[TUFLOW_SWMM_Tutorial_M02 | TUFLOW SWMM Module 2]]</u> - 1D SWMM Pipe Network / 2D TUFLOW Direct Rainfall Hydrology
*<u>[[TUFLOW_SWMM_Tutorial_M03 | TUFLOW SWMM Module 3]]</u> - 1D SWMM Pipe Network / 1D SWMM Urban Hydrology
*<u>[[TUFLOW_SWMM_Tutorial_M04 | TUFLOW SWMM Module 4]]</u> - 1D SWMM Pipe Network / 1D SWMM Urban Hydrology: Executing multiple different event simulations from a single model control file.
*<u>[[XPSWMM_to_TUFLOW-SWMM | XPSWMM to TUFLOW SWMM]]</u> - How to convert an XPSWMM model to TUFLOW SWMM.
<br>
{{Tips Navigation