How to create a 2D computational area
    • 27 Oct 2022
    • 6 Minutes to read
    • Dark
      Light

    How to create a 2D computational area

    • Dark
      Light

    Article Summary

    Flood Modeller provides the facility to create a 2D model computational area. A computational area is a grid of cells defined by a series of parameters, i.e. lower left corner coordinates, grid cell size, number of rows and columns and grid orientation angle. In a GIS environment these parameters define a rectangular area. The size of the grid needs to encompass the entire area that is expected to be affected by flooding, and the cell size will affect the resolution of the model as well as the runtime. A very small grid cell size will ensure all flow pathways are included (and not averaged out by adjacent features, e.g. buildings); however, this is offset against the increased runtimes required for finer resolutions. A grid cell size smaller than the underlying DEM may be required if the model needs to represent small scale hydraulic features.

    The computational area shapefile is essentially a standard polygon shapefile and does not need to contain any special attributes other than the parameters required for defining the computational area, i.e. dimensions, location, orientation angle, etc., which are automatically extracted from the shapefile during the simulation build process.

    You can create a specific computational area shapefile in Flood Modeller, which is defined with the required properties extracted and written as attributes (only for your information, i.e. not actually used in Flood Modeller). Alternatively, a standard polygon shapefile can be created and used in Flood Modeller to represent a computational area.

    To create a computational area:

    1. Select a New Shapefile
      To create a new 2D computational area shapefile, go to the 2D Build tab on the main toolbar and click on the Computational Area icon (first on the left, in the ‘2D Model’ section). This will open up a window allowing you to set a filename and location for your new shapefile that you will be generating.
      Alternatively, you can create a new shapefile from the Home tab by clicking on New > Shapefile and selecting 2D Computational Area (custom polygon, rectangle)
      Note
      Some existing data must first be loaded into the Flood Modeller to fix the location of the computational area in space, e.g. a ground grid covering the modelled region. This will also help to guide the definition of the computational area.
      After setting a name and location for your shapefile, click the Save button to proceed. You will be returned to the main Flood Modeller interface with the Layer Editor tab now visible at the top, and your new shapefile added to the Layers panel on the left of your screen. Note the red asterisk next to your shapefile, indicating that it is in editing mode.
    2. Draw a Computational Area Rectangle
      After your shapefile has been added, while in Edit mode, go to the ‘Draw’ section of the Layer Editor tab and click on the Computational Area button.
      To start drawing, click at the desired location in the Map view for the lower left corner of your rectangle. Drag the mouse upwards and to the right, a rectangular polygon should develop. When the required size is generated, double click the mouse to stop drawing. A green rectangle showing the extents of the computational area should now be shown.
      When you are done drawing the shapefile, click the Stop Edit button which you can access in the Layer Editor tab. You will be asked whether you would like to save changes to the file, click Yes to accept the creation of the shapefile. The colour of the rectangle should now change to purple. Note that, until a save operation is performed, the new edits will not be saved.
      A number of editing tools are provided to enable the size and shape of your computational area (rectangle) to be changed or to enable the extent to be rotated or moved. These editing tools can be accessed from the Layer Editor tab, which will automatically appear at the top of your screen when you have a shapefile in Edit mode.
      All of the available editing tools require that the shapefile is first selected, which can be done by double-clicking on the shape in your Map view (ensure it is in Edit mode first). When the shapefile is selected, you will see a thin red border outlining the shape. Alternatively, you can click on the Select button available from the Layer Editortab and then drag the mouse across an edge of your rectangle (with the left button depressed). The available editing options for your computational area are as follows:
      • Draw Computational Area – use this option instead of the standard polygon drawing option to draw your computational area, as it is aimed specifically at creating a polygon for defining the 2D computational area.
      • CA Properties– use this option to view the properties of your computational area. A new window will open in which you can edit or specify the following properties:
        • Orientation Angle: this can be modified by dragging the slider tool to increase the angle. As you move the slider, you’ll see the rectangle rotate about its lower left corner (allowable range is 0 to 90 degrees). Alternatively, you can specify a value for the orientation angle in the text box. The original location of your rectangle will remain visible in the viewport until the new location is accepted (by clicking the “update” button). 
          Note
          When using rotated grids, certain approximations are made to translate the input data to grids with rotated square cells. The quality of this translation depends on the discretisation of the domain and may affect simulations of channel flows, especially when the number of cells across channels is low. Therefore, a finer resolution (i.e. a smaller cell size) will reduce such effects.
        • Lower Left Point: this displays the coordinates of your computational area’s lower left corner. You can change this location by providing new coordinates.
        • Cell Size: the size of cells within the defined extent, specified in metres. If you change the cell size, then the number of rows and columns will be re-calculated to best-fit into the current rectangle.
        • N Columns: number of columns
        • N Rows: number of rows
        • Fix Rectangle Size: If this option is checked, then the rectangle size will be locked and the text boxes for N Rows and N Columns will be disabled. If unchecked, then changing the number of rows and columns will change the size of your model extent.
      • Undo – undo recent edits to your layer (note that you cannot undo an action after saving your file)
      • Redo – redo recent edits to your layer
      • Snapping Tools – opens the snapping control window allowing you to specify layers to snap to when drawing
      • Attribute Window – opens the attribute table showing features of your shapefile.
    3. Save the Computational Area Shapefile
      After you have finished working with the Computational Area shapefile, you should save it and exit the editing session. Select Stop Edit from the Layer Editor tab and save your changes when prompted. A standard explorer window will appear for you to specify a filename and location for the new shapefile.
    4. Save Parameters of the Computational Area Shapefile to an XML file
      The Computational Area shapefile in Flood Modeller is created in order to obtain the computational area parameters required in the 2D control XML file. You can review these parameters by either clicking on the CA Properties button or by opening the layer’s Attributes Table. The parameters required in the XML file are: Cell spacing, Orientation angle, Number of Columns, Number of Rows, and the coordinates of the bottom left corner of the rectangle.
      You have three options for saving the computational area parameters to a 2D Control XML file, as follows:
      • Drag the filename from the Layers panel into the 2D simulation window
      • Use the Load from shapefile option in the 2D simulation window to browse to the shapefile.
      • Read off the CA Properties from the shapefile attribute window and manually enter into the 2D simulation window.

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.