Skip to content

Commit 9404a7e

Browse files
Update example two-node spec to match new format
1 parent cf91e7a commit 9404a7e

File tree

1 file changed

+33
-35
lines changed

1 file changed

+33
-35
lines changed
Lines changed: 33 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
406219:
22
node_type: IHACRESBilinearNode
33
inlets:
4-
outlets: 406000
4+
outlets:
5+
- "406000"
56
area: 1985.73
67
route: true
78
parameters:
@@ -14,9 +15,7 @@
1415
b: 0.0989925603647026
1516
storage_coef: 1.8613364808233752 # gw storage factor
1617
alpha: 0.7279050097363565
17-
18-
initial_storage: 100.0
19-
18+
initial_storage: 100.0
2019
level_params:
2120
- -3.3502
2221
- 0.68340
@@ -29,35 +28,34 @@
2928
- 193.915
3029

3130
406000:
32-
node_type: DamNode
33-
inlets: 406219
34-
outlets: 406201
35-
area: 30.11
36-
max_storage: 306000.0
37-
parameters:
38-
storage_coef: 0.001
39-
# Methods defined here must take volume as input
40-
calc_dam_level: >-
41-
function c_dam_level(volume)
42-
return 156.8 + 0.9463 * volume^0.2922
43-
end
44-
calc_dam_area: >-
45-
function c_dam_area(volume)
46-
return 0.0021 * volume^0.762
47-
end
48-
# Discharge calculation must take volume and max_storage parameters
49-
calc_dam_discharge: >-
50-
function c_dam_discharge(volume, max_storage)
51-
discharge = 0.0
52-
if volume > max_storage
53-
discharge = 0.001492 * (volume - max_storage)^1.5280
54-
end
31+
node_type: "DamNode"
32+
area: 30.11
33+
parameters:
34+
storage_coef: 5.243068550275504
35+
initial_storage: 304398.6
36+
max_storage: 306000.0
37+
functions:
38+
calc_dam_level: |-
39+
function c_dam_level(volume)
40+
return 156.8 + 0.9463 * volume^0.2922
41+
end
42+
calc_dam_area: |-
43+
function c_dam_area(volume)
44+
return 0.0021 * volume^0.762
45+
end
46+
calc_dam_discharge: |-
47+
function c_dam_discharge(volume, max_storage)
48+
discharge = 0.0
49+
if volume > max_storage
50+
discharge = 0.001492 * (volume - max_storage)^1.5280
51+
end
5552
56-
return max(0.0, discharge)
57-
end
58-
# Outflow must accept discharge and extraction inputs
59-
calc_dam_outflow: >-
60-
function c_dam_outflow(discharge, irrigation_extraction)
61-
return discharge + irrigation_extraction
62-
end
63-
initial_storage: 304398.6
53+
return max(0.0, discharge)
54+
end
55+
calc_dam_outflow: |-
56+
function c_dam_outflow(discharge, irrigation_extraction)
57+
return discharge + irrigation_extraction
58+
end
59+
inlets:
60+
- "406219"
61+
outlets: ~

0 commit comments

Comments
 (0)