Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
385
D
Water
Resources
Planning
and
Management
River
Basin
Simulation
Tutorial
Samuel
Sandoval
Solis,
M.S.
and
Daene
C.
McKinney,
Ph.D.,
PE
September,
2009
(Revised
January,
2011)
CENTER
FOR
RESEARCH
IN
WATER
RESOURCES
Contents
Overview
......................................................................................................................................................
1
Introduction
.................................................................................................................................................
1
Part
I
Modeling
the
River
..........................................................................................................................
2
Construct
the
Model
................................................................................................................................
2
Create
a
New
Area
...............................................................................................................................
2
Set
General
Parameters
.......................................................................................................................
3
Define
the
Water
Resources
System
...................................................................................................
4
Run
the
Model
.......................................................................................................................................
12
Part
II
Modeling
a
Reservoir
...................................................................................................................
15
Define
Scenarios
....................................................................................................................................
15
Add
the
Reservoir
..................................................................................................................................
17
Create
Environmental
Flow
Requirement
for
Winter
............................................................................
19
Re-run
the
Model
..................................................................................................................................
20
Part
III
Modeling
a
Reservoir
Operating
Policy
...........................................
Error!
Bookmark
not
defined.
Operation
Policy
for
the
Reservoir
............................................................
Error!
Bookmark
not
defined.
Declare
the
Operation
Policy
in
WEAP
......................................................
Error!
Bookmark
not
defined.
Flow
Chart
..............................................................................................
Error!
Bookmark
not
defined.
Variables
................................................................................................
Error!
Bookmark
not
defined.
Variable
Schema
....................................................................................
Error!
Bookmark
not
defined.
Define
New
Scenario
.................................................................................
Error!
Bookmark
not
defined.
Enter
the
Variable
Schema
in
the
Model
...............................................
Error!
Bookmark
not
defined.
Incorporating
the
Operating
Policy
Into
the
Model
..............................
Error!
Bookmark
not
defined.
Re-running
the
model
................................................................................
Error!
Bookmark
not
defined.
References
.................................................................................................................................................
22
Overview
The
aim
of
this
exercise
is
to
provide
guidance
on
the
construction
of
water
resources
simulation
models
using
the
Water
Evaluation
And
Planning
System
(WEAP1)
software.
The
document
is
comprised
of
steps
that
will
help
you
to
build
a
simple
water
resources
system
model,
including:
one
river,
two
users
(the
environment,
and
an
irrigation
district)
and
one
reservoir.
The
example
for
the
system
is
taken
from
the
textbook
of
Loucks
and
Van
Beek
(20052).
Introduction
The
river
system
with
and
without
the
reservoir
is
shown
in
the
figures
below.
River
inflows
-
File:
Headflows.csv
-
21
Years
of
Inflows
Irrigation
District
-
Variable
summer
demand:
30-45
MCM/year
-
File:
Demands.csv
Big
Reservoir
Capacity:
40
MCM
Operation
policy:
Winter:
Release
only
environmental
flows
Summer:
Release
water
to
Irrigation
Dist.
Heaflow
-
Headflows.csv
-
21
Years
of
Inflows
-
25
Realizations
Irrigation
District
-
Variable
demand:
30-45
MCM/year
Demands.csv
System
with
the
reservoir
1
http://www.weap21.org/
2
Loucks, Daniel P. and Eelco van Beek, Water Resources Systems Planning and Management: An
Introduction to Methods, Models and Applications, Chapter
7,
Section
9.2
River
Basin
Simulation
pages
219
222, UNESCO, Paris, 2005
The
reservoir
winter
operation
policy
is
to
store
as
much
of
the
winters
inflow
as
possible.
The
summer
release
policy
is
to
meet
each
years
projected
demand
if
possible.
Further
details
of
the
operating
policy
are
given
later
and
in
Chapter
7,
Section
9.3
of
Loucks
and
Van
Beek
(2005).
Name
the
new
area
Tutorial_Exercise
and
Select
Initially
blank
Click
OK
on
the
following
window.
Select
an
area
around
Texas.
Hint:
Use
the
small
window
on
your
left
to
make
a
zoom
in
or
out
on
the
world
map,
use
the
scroll
bars
in
the
right
window
to
locate
Texas.
Drag
a
rectangle
around
the
central
area
of
Texas.
Click
OK.
Save
your
model,
select
Area,
Save
menu
or
press
Ctrl+S.
Name
your
model
Tutorial_Exercise3.
Tip If you want to back up your model and take it with you to another computer, open the Area menu
and select Manage Areas, click on Back up to and select the folder where you want to back up your
model (this can be on a removable disk). WEAP models are backed up as zip files. When you want to open
your backed up model, open the Area menu and select Manage Areas, click on Restore from and
browse to your models zip file and click on open. This way you will be able to save, backup and restore
your models.
Set
General
Parameters
By
default,
the
model
stars
in
2000
with
12
time
steps
per
year,
based
on
calendar
years
and
starting
in
January.
We
will
use
2
time
steps
per
year
for
20
years.
Select
the
General
menu,
and
select
Years
and
Time
Steps.
,1100
Lets
modify
the
time
horizon.
In
the
time
horizon
box
change
the
Last
Year
of
Scenarios:
to
2020.
In
the
Time
Steps
per
Year
box,
click
in
the
pull-down
menu
icon
and
select
Other,
then
set
2
time
steps
per
year.
Verify
that
in
Time
Step
Boundary
you
have
selected
the
Based
on
calendar
month
option.
Also
verify
that
you
have
selected
Water
Year
Start
at
Time
Step
1.
We
are
going
to
consider
time
step
1
as
Winter
and
time
step
2
as
Summer
in
the
example.
Notice
that
the
winter
period
is
has
182
days
and
summer
has
183
days.
Save
your
model
by
typing
Ctrl+S.
Define
the
Water
Resources
System
Enter
the
River
Inflows
Now,
lets
define
our
water
resource.
Lets
start
with
the
river.
Click
on
the
River
symbol
in
the
Element
window
and
hold
the
click
as
you
drag
the
symbol
over
to
the
map.
Release
the
click
when
you
have
positioned
the
cursor
over
the
upper
left
starting
point
of
the
main
section
of
the
river.
Move
the
cursor,
and
you
will
notice
a
line
being
generated
from
that
starting
point.
When
you
double
click
to
finish
drawing
the
river,
a
dialog
box
appears
asking
for
the
name
of
the
river
(see
below).
Name
the
river
"Main
River."
Click
Finish.
Lets
declare
the
inflows
to
the
river
called
headflows
in
WEAP.
These
are
the
upstream
inflows
to
major
tributaries
for
the
model.
These
values
are
stored
in
the
file
Headflows.csv.
You
will
notice
that
this
is
a
CSV
file,
or
a
Comma
Separated
Value
file
that
stores
25
sets
of
inflows
(in
m3/sec).
First,
unzip
the
compressed
archive
(*.zip
file)
and
copy
the
file
Headflows.csv
to
the
folder
C:\Program
Files\WEAP21\Tutorial_Exercise
on
your
computer4.
Lets
take
a
look
inside
the
Headflows.csv
file,
which
is
shown
below:
The
first
column
has
the
years
with
one
row
for
each
of
the
two
seasons
of
the
year,
summer
followed
by
winter;
then
the
season
number
is
shown
in
column
B,
and
finally
the
25
flow
values
in
columns
C
through
AA
for
the
separate
simulations;
each
column
is
a
separate
realization
of
the
inflows
for
the
20
year
period.
To
begin
with
we
will
focus
on
the
first
realization
in
column
C.
Now,
lets
go
back
to
WEAP
and
enter
the
data
for
the
river.
To
enter
and
edit
data
for
the
Main
River,
either
right-click
on
the
Main
River
and
select
Edit
data
and
select
Headflows.
4
If
you
are
using
the
latest
version
of
WEAP
(January
2011),
then
the
path
should
be:
C:\Documents
and
Settings\your
user
name\My
Documents\WEAP
Areas\Tutorial_Exercise
The
"Inflows
and
Outflows"
window
should
be
open
-
if
it
isn't,
click
on
the
Inflows
and
Outflows
button.
Click
on
the
"Headflow"
tab.
Be
sure
that
the
input
window
Data
for
has
Current
Accounts
[2000]
selected.
If
it
doesnt,
then
select
it
from
the
drop
down
menu.
Click
on
the
area
just
beneath
the
bar
labeled
2000
in
the
data
input
window
to
view
a
pull-down
menu.
Select
the
Expression
Builder
from
the
drop--down
menu.
In
the
Expression
Builder
select
the
Functions
tag;
scroll
down
and
find,
select
and
drag
down
into
the
text
field
the
ReadFromFile
expression
from
the
list
of
built
in
expressions.
Type
the
following
expression
in
the
parentheses:
Headflows.csv,1;
so,
the
expression
should
look
like5:
ReadFromFile(Headflows.csv,1)
The
1
in
this
expression
refers
to
the
number
in
the
column
above
the
inflows.
If
you
wanted
to
read
the
inflows
from
the
second
realization
of
inflows,
you
would
enter
2.
Click
on
Verify.
Then
a
window
will
appear
that
says
your
expression
is
verified.
If
the
expression
is
not
verified,
please
check
that
you
have
copied
the
file
Headflows.csv
into
the
folder
C:\Program
Files\WEAP21\Tutorial_Exercise
and
that
the
command
you
have
written
is
correct.
5
Actually,
you
can
just
copy
this
expression
from
this
document
and
paste
it
into
Expression
Builder.
7
WEAP
is
reading
the
data
from
the
Headflows.csv
file
in
column
1.
WEAP
reads
the
year
and
time
step
columns,
after
this
it
starts
counting
the
column
numbers;
this
is
the
reason
we
are
declaring
column
1
in
the
expression.
Click
on
Finish.
Note
that
now
there
is
inflow
declared
for
the
river.
Save
your
model.
Enter
the
Irrigation
Demand
Data
Creating
a
demand
node
is
similar
to
the
process
you
used
to
create
a
river.
Click
on
the
Schematic
view
(little
map
icon
in
upper
left-hand
corner)
and
select
and
pull
a
Demand
Site
node
symbol
over
to
the
map
from
the
Element
window,
releasing
the
mouse
when
you
have
positioned
the
node
on
the
right
bank
of
the
river
(facing
downstream).
Enter
the
name
of
this
demand
node
as
Irrigation
District.
Declare
a
Demand
Priority
of
2.
Click
on
Finish.
Copy
the
water
demand
for
the
Irrigation
District
that
is
stored
in
the
file
Demands.csv
to
the
C:\Program
Files\WEAP21\Tutorial_Exercise
folder6.
This
file
is
reproduced
in
the
figure
below
(demands
in
million
m3
per
year)
If
you
are
using
the
latest
version
of
WEAP
(January
2011),
then
the
path
should
be:
C:\Documents
and
Settings\your
user
name\My
Documents\WEAP
Areas\Tutorial_Exercise
Go
back
to
WEAP,
right
click
on
the
Irrigation
District
demand
site
and
select
"Edit
data"
and
"Annual
Water
Use
Rate."
Once
again
open
the
expression
builder
and
lets
read
the
demands
from
the
file
Demands.csv
using
the
ReadFromFile()
function.
The
expression
should
look
like:
ReadFromFile(Demands.csv,1)
Click
on
Verify
The
previous
expression
should
be
verified
OK.
If
not,
double
check
that
the
Demands.csv
file
was
copied
to
the
correct
directory
(see
above)
and
that
the
expression
was
written
correctly.
Click
below
the
Scale
label
and
select
Million
because
the
data
uploaded
has
this
unit.
10
Now,
lets
declare
the
distribution
of
water
for
Irrigation
District
in
Summer
and
Winter
.
Click
on
the
tab
of
Sub-yearly
Variation
Click
below
2000
and
select
Sub-yearly
Time-Series
Wizard
Declare
a
value
of
0%
for
time
step
1
(Winter)
and
a
value
of
100%
for
time
step
2
(Summer).
Click
Finish.
11
Now,
you
need
to
tell
WEAP
where
the
water
will
come
from;
this
is
accomplished
by
connecting
a
supply
resource
to
the
demand
site
through
a
transmission
link.
Return
to
the
Schematic
view
and
create
a
Transmission
Link
from
the
Main
River
to
the
Irrigation
District.
Do
this
by
dragging
the
Transmission
Link
first
to
a
position
on
the
river,
releasing
the
mouse,
then
pulling
the
link
to
Irrigation
District
and
double
clicking
on
this
demand
node.
Select
a
Supply
Preference
of
1
for
the
Transmission
Link.
Run
the
Model
Let
see
the
first
result
of
our
model.
Click
on
Results
and
Yes.
12
Select
Demand
and
then
Reliability.
Notice
that
more
than
60%
of
the
time
the
demand
for
Irrigation
District
is
supplied
fully.
Click
on
the
Table
tab
and
you
will
see
that
the
reliability
for
Irrigation
District
is
64.3%.
13
Go
back
to
the
Chart
view,
and
select
Demand\Supply
Delivered.
At
the
bottom
of
the
screen
select
All
Years,
in
the
middle
upper
pull
down
menu
All
Time
Steps
and
check
the
option
Annual
Total.
Notice
how
variable
the
water
demand
is
for
the
Irrigation
district.
Select
Table
and
click
on
the
Stat
icon
that
is
in
the
right
tool
bar
of
the
screen.
Drag
the
displacement
bar
to
the
right
in
order
to
see
the
statistics
at
the
end
of
the
Supply
Delivered
results.
Notice
that
the
average
supply
delivered
is
24.7
MCM/year,
and
the
minimum
and
maximum
values
are
11.1
and
45
MCM/year
respectively.
Now
lets
see
when
the
deficits
happened.
Click
on
the
Chart
tab,
and
select
Unmet
Demand.
Notice
that
the
deficits
happened
in
several
years,
9
to
be
precise.
14
Click
on
the
Table
tab.
Notice
that
the
total
deficit
(Unmet
demand)
for
the
Irrigation
district
in
this
scenario
is
335.5
MCM
(under
Sum
in
the
table).
Also,
notice
that
the
mean
deficit
is
16.0
MCM
and
the
minimum
and
maximum
deficits
are
0
and
32.9
MCM,
respectively.
Save
your
model.
15
Select
the
Reference
Scenario
and
then
click
on
Rename.
Rename
the
Reference
Scenario
as
w/o
Reservoir.
Click
OK.
We
are
going
to
keep
this
scenario
as
a
reference
for
what
would
happen
with
no
reservoir.
Now,
lets
create
another
scenario
that
will
consider
the
creation
of
a
reservoir.
Select
Current
Accounts
and
then
click
on
Add
and
name
the
new
scenario
with
Reservoir.
Click
OK
Click
on
Close.
Save
your
model.
16
Now,
lets
declare
the
reservoir
in
the
with
Reservoir
scenario.
Right
click
on
the
Reservoir
icon,
select
Edit
Data
and
Startup
Year
Select
the
with
Reservoir
scenario
in
the
Data
for
view.
17
Declare
the
Startup
Year
to
be
2001.
Now,
lets
declare
the
characteristics
of
the
Big
Reservoir.
Click
on
the
Physical
button
and
declare
the
storage
of
the
reservoir
to
be
40
Million
m3
in
the
Storage
Capacity
tab.
Click
on
the
Operation
bottom
and
enter
40
Million
m3
in
the
Top
of
Conservation
tab
(this
will
be
the
active
capacity
of
the
reservoir).
18
Under
the
Operation
button,
select
the
Top
of
Inactive
tab
and
enter
0
Million
m3.
Save
your
model.
19
Right
click
on
the
flow
requirement
node
and
select
Edit
Data
Minimum
Flow
Requirement.
Enter
the
Expression
Builder
and
enter
the
following
command:
If(
TS=1,
0.317969,
0
)
This
will
require
the
flow
to
be
0.317968
m3/sec
passing
the
Environmental
Flow
Node
in
Time
Step
1
of
every
year.
20
Look
at
the
results.
Select
Demand,
Supply
Delivered
and
notice
that
more
water
was
delivered
in
the
with
Reservoir
scenario
than
w/o
Reservoir.
In
fact,
the
mean
supply
delivered
increased
from
24.7
to
37.3
Million
m3/year.
Be
sure
to
select
All
Year
at
the
bottom,
and
All
Scenarios
to
the
right
hand
side.
Select
Reliability
and
note
the
difference:
64.3%
(w/o
reservoir
scenario)
versus
85.7%
(reservoir
scenario).
Go
to
Demand,
Unmet
Demand
and
All
Years
(at
the
bottom)
and
notice
that
for
the
with
Reservoir
scenario,
the
deficits
decreased
compared
to
w/o
Reservoir
scenario.
In
fact,
the
mean
and
the
maximum
deficit
decreased
from
16.0
to
3.4
MCM/year
and
from
32.9
to
15.9
MCM
respectively.
Save
your
model,
Ctrl+S.
21
You
can
also
explore
several
other
interesting
aspects
of
the
simulation,
such
as
reservoir
storage
and
flow
through
the
environmental
flow
requirement
node.
References
Loucks D. P. and E. Van Beek (2005). Water Resources Systems Planning and Management. Page
213. UNESCO
22