Tute M02 QGIS 1d2d Link Archive

From Tuflow
Jump to navigation Jump to search

    Introduction

    This page describes the process of using QGIS to create links between the 1D culverts and the 2D model. Three methods are described, this is done to demonstrate the available methods. Generally one of the described methods would be used.

    The methods described are:

    • Using a point object in the 2d_bc type layer;
    • Using a line object in the 2d_bc type layer; and
    • Using a point object in a 1d_nwk layer.

    Method

    The 2d_bc methods are described first.

    2d_bc Link as Point Object

    1. Open QGIS and ensure that the DEM (in the Module_Data) and the 1d_nwk_M02_culverts_001_L.shp are loaded.
    2. Open the 2d_bc_empty_P.shp file from the TUFLOW\model\gis\empty\ folder. Save this in the TUFLOW\model\gis\ as 2d_bc_M02_culv_001_P.shp. Close the template file down and open the newly created 2d_bc_M02_culv_001_P file.
    3. Zoom into the culvert at the south-eastern corner of the model. This culvert has the ID "FC04.1_C".
    4. In the Settings >>> Snapping Options, ensure that the check box for the 1d_nwk layer is selectable and enter an appropriate snap tolerance (e.g. 5 metres).
    5. Tute M02 QGIS 2d bc 01.png


    6. Make the 2c_bc_M02_culv_001_P layer editable by toggle the layer as editable.
    7. Digitise a point at the upstream of the culvert by selecting the Capture Point and drawing the point at the upstream of the culvert.
    8. In the attributes enter the following "SX" into the "Type" Attribute. It is also necessary to enter 0 into the f, d, td, a and b attributes. The dialogue should appear as per the image below:
    9. Tute M02 QGIS 2d bc 02.png


    10. Repeat the process at the downstream of the culvert.
      TIP: The order in which these points are digitised does not matter.
    11. Finalise the edit, by toggling the editing to off and when prompted save the file.

    2d_bc Link as Line Object

    1. Open the 2d_bc line object template (2d_bc_empty_L.shp) and save a copy into the TUFLOW\model\gis\ as 2d_bc_M02_culv_001_L.shp. Close the template file and open the newly created 2d_bc_M02_culv_001_L.shp file.
    2. Zoom into the northern culvert location (culvert ID "FC01.2_R")
    3. The reason for using a line object rather than a point object is to allow the culvert to connect to more than one 2D cell. This is important where the dimensions of the 1D channel or culvert are greater than the 2D cell size. For this box culvert there are 5 cells each with a width of 2.4 metres. This could cause stability when connected to a single 2D cell.
      In order to see where the 2D cells, we will open a check file created when the model was run during module 1. In QGIS open the grid check file "M01_5m_002_grd_check_R.shp" from file can be open from the TUFLOW\check\2d\ directory.
    4. It may be necessary to change the style of the grid check file so that the layers underneath can be seen. To do this right click on the layer and select properties, change the style so that "no brush" is used in the fill style. The map window should look like the image below:
      Tute M02 QGIS 2d bc 03.png


    5. Make the 2d bc lines layer editable by selecting it in the layer control and toggling editing.
    6. Draw a line in the location shown below and enter "SX" into the "Type" attribute and 0 into the f, d, td, a and b attributes. This will create an "SX" type connection which selects three cells.
    7. Tute M02 QGIS 2d bc 04.png


      The "SX" line digitised in the step above, does not snap to the end of the culvert, to link the SX connection and the culvert we need to digitise another line from the end of the culvert to one end of the SX line.

    8. To do this, first make sure that 2d_bc_M02_culv_001_L layer has snapping enabled (Settings >>> Snapping Options).
    9. With the snapping enabled, digitise a line connecting the culvert and the SX line. Enter "CN" in the "Type" attribute and 0 into the f, d, td, a and b attributes. This "CN" type line tells TUFLOW that there is a connection (CN) between the two layers.
    10. Tute M02 QGIS 2d bc 05.png


    11. Repeat the process for the upstream of the culvert. The final configuration is shown in the image below, the red lines are the "SX" type lines and the yellow lines are the "CN" type lines.
    12. Tute M02 QGIS 2d bc 06.png


    13. Toggle the editing off, and save the changes to the layer.

    1d_nwk link

    It is also possible to create the 1D/2D links using the 1d_nwk layer. This is done by creating a node in the 1d_nwk type layer. As the shapefile format does not support lines and points in the same layer, it is necessary to create a new 1d_nwk layer.

    1. Open the 1d_nwk_empty_P.shp (the _P designates that this file contains points), save a copy of the file into the TUFLOW\model\gis\ as 1d_nwk_M02_culverts_001_P.shp. Close the template file and open the newly created 1d_nwk_M02_culverts_001_P.shp file.
    2. Zoom into the culvert at the south-western part of the model (ID = "FC01.1_R")
    3. Toggle editing on the 1d_nwk_M02_culverts_001_P layer and digitise a point object at the upstream of the culvert. Enter the attributes as per the image below.
    4. Tute M02 QGIS 1d nwk bc 01.png


      The -99,999 values entered into the US and DS_invert attributes, tells TUFLOW to find the data elsewhere, this data was entered into the culvert lines. The "SX" in the "Conn_1D_2D" attribute is creating the 1D/2D connection.

    5. Repeat the process for the downstream of the culvert.
    6. Finish editing the layer and save the changes.

    Conclusion

    In order to demonstrate three methods for linking the 1D elements to the 2D model we have created three new files:

    • 2d_bc_M02_culv_001_P.shp
    • 2d_bc_M02_culv_001_L.shp
    • 1d_nwk_M02_culverts_001_P.shp

    The next step is to update the TUFLOW control files and run the model! Return to the module 2 page.