NCSU GIS 714:
Geospatial Computing and Simulations

Surface water: process-based simulation using Itzi and SIMWE

Resources:

For animating in GRASS GIS 7, see the video instructions or instructions for the Spatio-temporal data handling and visualization in GRASS GIS workshop

Before we start

To run Itzi on Linux, follow installation instructions. If you are on Windows, we recommend using VCL - OSGeoLive v12.0 where we already have GRASS installed. Once logged in, open terminal and run:
sudo apt-get install python-dev
pip install itzi --user
On OSGeoLive v12.0 VCL you will also need to do:
pip install --upgrade --force-reinstall networkx==1.11 --user
To test whether installation was successful, try to run:
itzi run -h
# alternatively:
# ~/.local/bin/itzi run -h

Start GRASS in nc_spm_08_grass7 Location and create new mapset. Go to Settings - GRASS working environment - Change working directory and browse to a folder where you will create all the text files we will need.

Modeling flooding with Itzi

We will simulate flood within a watershed derived from an outlet point. We copy first elevation raster from PERMANENT to our current mapset (needed for Itzi).
g.copy raster=elevation,elevation
g.region raster=elevation
r.watershed -s elevation=elevation threshold=1000 accumulation=flowacc stream=streams drainage=drainage
r.water.outlet input=drainage output=watershed coordinates=637715,218815
We will limit our computation just to the watershed using mask.
r.mask raster=watershed
g.region zoom=watershed
The default boundary condition is closed boundary, we need to change it to let water flow out of our region. Create a text file with the outlet point coordinates outlet.txt and save it.
637715|218815
Import it to create a vector map:
v.in.ascii input=outlet.txt output=outlet
And create boundary conditions:
v.to.rast input=outlet type=point output=bctype use=val value=4
v.to.rast input=outlet type=point output=bcvalue use=val value=0
Create uniform rain:
r.mapcalc expression="rain = 100"
We also need friction raster (Manning's n value). We can create uniform friction:
r.mapcalc expression="friction = 0.05"
We can also create spatially variable friction based on landcover. For that we will use landcover raster (landuse96_28m) and reclassify it using these rules (e.g. 7:9:0.2 means categories 7 to 9 will become value 0.2). Save these rules into a text file friction.txt:
1:1:0.01
2:2:0.1
3:3:0.1
4:6:0.2
7:9:0.2
10:19:0.5
20:20:0.9
And now run r.recode for reclassification:
r.recode input=landuse96_28m output=friction rules=friction.txt
Finally create a configuration file (see documentation for details):
[time]
duration = 02:00:00
record_step = 00:05:00

[input]
dem = elevation
friction = friction
rain = rain
bctype = bctype
bcval = bcvalue

[output]
prefix = itzi
values = h, wse, v, vdir

[statistics]
stats_file = stats.csv
And run Itzi, providing path to the configuration file.
itzi run itzi_config.txt
# alternatively:
# ~/.local/bin/itzi run itzi_config.txt
Once the simulation ends, set the color table on the resulting time series of water depth. Save these color rules in a text file itzi_color.txt.
0 240:249:232
0.3 186:228:188
0.5 123:204:196
1 67:162:202
2 8:104:172
10 8:104:172
And set the color:
t.rast.colors input=itzi_h rules=itzi_color.txt
Create a 2D or 3D animation of the flooding, explore also other outputs of the simulation and exported file with stats.

Modeling flooding with SIMWE

We will use the same area to model overland water flow with SIMWE (r.sim.water).
r.slope.aspect elevation=elevation dx=dx dy=dy
r.sim.water -t elevation=elevation dx=dx dy=dy rain_value=100 man=friction depth=simwe niterations=120 output_step=5
We will register the output as a space time raster dataset to match the Itzi output and set matching color table:
t.create output=simwe temporaltype=relative semantictype=mean title="Water depth" description="Water depth from SIMWE"
g.list type=raster pattern=simwe* output=simwe_list.txt
t.register file=simwe_list.txt start=300 unit=seconds increment=300
t.rast.colors input=simwe rules=itzi_color.txt

Modeling flooding with HAND

For comparison, we will also compute inundation extent with HAND:
r.watershed -s elevation=elevation threshold=1000 stream=streams drainage=drainage
r.stream.distance stream_rast=streams direction=drainage elevation=elevation method=downstream difference=hand
r.lake.series elevation=hand output=hand start_water_level=0 end_water_level=2 water_level_step=0.1 seed_raster=streams time_step=300 time_unit=seconds nproc=4
t.rast.colors input=hand rules=itzi_color.txt

Compare methods

Discuss how these different methods compare? What is the applicability of each method?