SWAN GIS Model Builder

From TUFLOW FV Wiki
Revision as of 00:43, 7 July 2021 by Tuflowduncan (Talk | contribs) (Load Bathymetry, Wind and Wave Datasets)

Jump to: navigation, search

Introduction

This page guides you through the SWAN GIS Model Builder Panel of the TUFLOW Viewer Plugin and is the third step the step by step guide. We will use the Model Builder Panel to:

  • Assign our working directory and configuration
  • Digitise our model domains, assign cell resolution and optionally assign grid rotation
  • Layer the SWAN model bathymetry via a series of DEMs
  • Input our wind and wave data for boundary condition development
  • Define our model start and end times
  • Build the SWAN model, including all runs files, computation grids, nesting, boundary conditions and model check files

    Building Model in QGIS

    1. Start QGIS (version 3.16.3 or later). Under the plugins menu, navigate to the plugins/TUFLOW/SWAN GIS Tools (beta)/Model Builder. If you don't have this option please ensure that you've installed the TUFLOW Viewer Plugin for QGIS.
      SWAN GUI REFERENCE 000b.PNG
    2. Set the SWAN folder path at the top of the model builder window, this is the location where all SWAN model files will be saved (see model folder setup). If following the tutorial we will set the path to C:\Tutorial_Module_SWAN_GIS_Tools\Moreton_Bay_Waves\SWAN.
      SWAN BUILDING MODEL 001.PNG

      Setup Configuration File

    3. Create a new parameter configuration file by following these steps:
      1. Press the spanner icon in the 'Configuration File Input' row
      2. Set the parameter inputs to desired values. In this instance we will stick with the default values.
      3. Press the 'Save As' button
      4. Save file to C:\Tutorial_Module_SWAN_GIS_Tools\Moreton_Bay_Waves\SWAN\CONFIG.ini

      SWAN BUILDING MODEL 002.PNG

      Open the saved configuration file in a text editor. The configuration file contains text that describes the assignment of model parameters. The model builder will use the model parameters as set in the configuration file.

      SWAN BUILDING MODEL 003.PNG

    4. Set the file path of the newly created configuration file in the model builder:
      SWAN BUILDING MODEL 004.PNG

      Define Model Domains

    5. Create a new grid layer by pressing the 'New Grid Layer' button. Save the new grid layer to C:\Tutorial_Module_SWAN_GIS_Tools\Moreton_Bay_Waves\QGIS\SWAN_GRIDS_000.shp SWAN BUILDING MODEL 005.PNG

      When saved, the new layer will automatically be loaded and styled in the QGIS project.
    6. Create a new polygon for the first model grid in the newly created layer by following these steps:
      1. Select the newly created grid layer in the 'Grid Layer Input'
      2. Select the grid layer in the QGIS layers tree
      3. Unlock the grid layer for editing
      4. Digitise a polygon that covers the desired model extent, approximately [-29.5 -25] latitude and [152.5 156] longitude (it is recommended you use 'add rectangle from extent')

      Note: You don't need to exactly follow the polygons we have created, but please use them as a guide.
      For our model domain we will start with a relatively coarse mesh of Moreton Bay and the continental shelf and then add higher resolution through two levels of nesting.

      SWAN BUILDING MODEL 007.PNG

      When the feature is added to the layer, a new grid parameter input row will be created in the model builder, it will be blank as no parameters are set.

      SWAN BUILDING MODEL 008.PNG

    7. Apply the following values to populate the row:
      Name Rotation X Length Y Length
      REGIONAL 0 0.05 0.05

      On setting the values, a mesh of the computational grid will be automatically generated and displayed.

      SWAN BUILDING MODEL 009.PNG

    8. Repeat the above steps and add three more polygons, nesting them inside each other in similar locations as below and with the following names and parameters:
      Name Rotation X Length Y Length
      REGIONAL 0 0.050 0.050
      TRANSITION 0 0.025 0.025
      NORTH_MORETON 0 0.005 0.005
      POINT_LOOKOUT 0 0.005 0.005


      Approximate bounding box coordinates for each grid are provided as follows:

      Name X Min X Max Y Min Y Max
      REGIONAL 152.5 156.0 -29.5 -25.0
      TRANSITION 153.0 154.5 -28.3 -26.2
      NORTH_MORETON 153.1 153.5 -27.1 -26.7
      POINT_LOOKOUT 153.5 153.8 -27.7 -27.3


      Once you are happy with your model boundaries save your edits and toggle editing off.

      SWAN BUILDING MODEL 010.PNG

      Save Model Builder State

    9. We will now save the state of the model builder for demonstrative purposes. Press the 'save as button' and save your ini file to: C:\Tutorial_Module_SWAN_GIS_Tools\Moreton_Bay_Waves\SWAN\BUILD.ini. Note this does not save the 'grid input layer'. This layer is edited and saved as per normal QGIS layer editing interface.
      SWAN BUILDING MODEL 011.PNG

    10. Open the newly created BUILD.ini file in a text editor. As shown, the BUILD.ini file is a simple text file which stores the input\output of the model builder for loading at a later time.
      SWAN BUILDING MODEL 012.PNG

      Load Bathymetry, Wind and Wave Datasets

    11. Load the bathymetry datasets described in the Getting Data section into QGIS. If following along with the tutorial these datasets should be within: C:\Tutorial_Module_SWAN_GIS_Tools\Moreton_Bay_Waves\DATA\BATHY
    12. Use the bathymetry layer selector to add the Digital Terrain Models (DTM) one by one in decreasing order of priority (layer on bottom of list will be overwritten by layers above). The layers stored in this list are used to generate the bottom input files by interpolating values to the computational grid.
      SWAN BUILDING MODEL 013.PNG

    13. Set the wind source and wave source file inputs. These are references to the data files discussed in the Getting Data section. If following along with the tutorial these dataset should be within: C:\Tutorial_Module_SWAN_GIS_Tools\Moreton_Bay_Waves\DATA\WIND and C:\Tutorial_Module_SWAN_GIS_Tools\Moreton_Bay_Waves\DATA\WAVE
      SWAN BUILDING MODEL 014.PNG

      Set the Time Period and Build Run

    14. Set the start and end dates to a period which is covered by the wind and wave data sources then press the 'Build Run' button. This will generate and save the SWAN model input and control files into our SWAN folder.
      Please note that the creation of the SWAN model files and geometry may take up to minute to complete.
      SWAN BUILDING MODEL 015.PNG

      Conclusion

      You have now successfully populated and run the SWAN GIS Model Builder panel. Next we will review the various check files, boundary files and control files generated by the model build in the fourth step of our SWAN GIS tutorial.