Skip to content

Commit 2f632bd

Browse files
Revised the turbine outflow logic in the reservoir hydropower calculation
1 parent 4cb5da1 commit 2f632bd

1 file changed

Lines changed: 28 additions & 38 deletions

File tree

routing/model/reservoir.f

Lines changed: 28 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,11 +1220,7 @@ SUBROUTINE MAKE_CONVOLUTIONRS
12201220
IF (FLOWOUT(J,I,W)<0) THEN
12211221
FLOWOUT(J,I,W)=0
12221222
END IF
1223-
IF (HYDROPOWER_GENERATOR(J,W) .EQ. 1) THEN
1224-
FLOWOUT_TURB(J,I,W)=FLOWOUT(J,I,W) ! forcing the turbine release to be equal to the provided release in operation strategy 4 (otherwise flowout is going through changes due to changes in storage; if storage is greater than scap)
1225-
ELSE
1226-
FLOWOUT_TURB(J,I,W)=0.0
1227-
END IF
1223+
12281224
VOL(J,I+1,W) = VOL(J,I,W) + (FLOWIN(J,I,W)-FLOWOUT(J,I,W))*24*3.6
12291225
GOTO 123
12301226
c xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
@@ -1286,33 +1282,38 @@ SUBROUTINE MAKE_CONVOLUTIONRS
12861282
IF (ENERGYPRO(J,I,W)<0) THEN
12871283
ENERGYPRO(J,I,W)=0
12881284
END IF
1289-
IF (FLOWOUT(J,I,W)<0) THEN
1290-
FLOWOUT(J,I,W)=Qmin(J,I,W)
1291-
END IF
1292-
IF (VOL(J,I,W)<0)THEN ! Not allow dropping below the minimum water level (mostly due to evaporation)
1285+
IF (VOL(J,I,W)<0)THEN ! Not allow dropping below the minimum water level (mostly due to evaporation)
12931286
VOL(J,I,W)=0
12941287
END IF
1288+
c ! Check the neccesity to spill water
1289+
IF (VOL(J,I+1,W)>VRESER(J,W,I)) THEN
1290+
FLOWOUT(J,I,W) = FLOWOUT(J,I,W)+(VOL(J,I+1,W)-VRESER(J,W,I))/24/3.6
1291+
VOL(J,I+1,W) = VRESER(J,W,I)
1292+
END IF
1293+
1294+
! Checking conditions for outflow
1295+
IF (FLOWOUT(J,I,W)<Qmin(J,I,W)) THEN ! Check for minimum environmental flow
1296+
FLOWOUT(J,I,W)=Qmin(J,I,W)
1297+
END IF
1298+
12951299
c Remote water for irrigation
12961300
IF (FLOWOUT(J,I,W)>=IRRIGATION(J,II)) THEN
12971301
FLOWOUT(J,I,W) = FLOWOUT(J,I,W) - IRRIGATION(J,II)
12981302
ELSE
12991303
FLOWOUT(J,I,W) = Qmin(J,I,W)
13001304
END IF
1301-
1302-
1303-
! Calculate energy production
1304-
IF (VOL(J,I+1,W)<=VRESER(J,W,I)) THEN
1305-
IF (RULE(J,W) .EQ. 4) THEN ! Force the hydropower to follow the input release (even if VOL>VRESER)
1306-
ENERGYPRO(J,I,W) = 0.9 * 9.81 * FLOWOUT_TURB(J,I,W)
1307-
ELSE
1308-
ENERGYPRO(J,I,W) = 0.9 * 9.81 * FLOWOUT(J,I,W)
1309-
END IF
1305+
1306+
! Checking conditions for turbine outflow
1307+
IF (HYDROPOWER_GENERATOR(J,W) .EQ. 1) THEN
1308+
FLOWOUT_TURB(J,I,W)=FLOWOUT(J,I,W) ! forcing the turbine release to be equal to the provided release in operation strategy 4 (otherwise flowout is going through changes due to changes in storage; if storage is greater than scap)
1309+
ELSE
1310+
FLOWOUT_TURB(J,I,W)=0.0 ! If the turbine is not connected to generator (generator shutdown)
1311+
END IF
1312+
1313+
IF (FLOWOUT(J,I,W)>=QRESER(J,W)) THEN ! turbine + spillway flow
1314+
FLOWOUT_TURB(J,I,W) = QRESER(J,W)
13101315
ELSE
1311-
IF (RULE(J,W) .EQ. 4) THEN ! Force the hydropower to follow the input release (even if VOL>VRESER)
1312-
ENERGYPRO(J,I,W) = 0.9 * 9.81 * FLOWOUT_TURB(J,I,W)
1313-
ELSE
1314-
ENERGYPRO(J,I,W) = 0.9 * 9.81 * QRESER(J,W)
1315-
END IF
1316+
FLOWOUT_TURB(J,I,W) = FLOWOUT(J,I,W)
13161317
END IF
13171318

13181319
! Update water losses due to seepage and infiltration
@@ -1327,24 +1328,13 @@ SUBROUTINE MAKE_CONVOLUTIONRS
13271328
VOL(J,I+1,W) = 0
13281329
END IF
13291330

1330-
c ! Check the neccesity to spill water
1331-
IF (VOL(J,I+1,W)>VRESER(J,W,I)) THEN
1332-
FLOWOUT(J,I,W) = FLOWOUT(J,I,W)+(VOL(J,I+1,W)-VRESER(J,W,I))/24/3.6
1333-
VOL(J,I+1,W) = VRESER(J,W,I)
1334-
END IF
1331+
13351332
HHO(J,I,W)=VOL(J,I,W)/VRESER(J,W,I)*(HRESERMAX(J,W)-H0(J,W))+H0(J,W)
13361333
HHO(J,I+1,W)=VOL(J,I+1,W)/VRESER(J,W,I)* (HRESERMAX(J,W)-H0(J,W))+H0(J,W)
13371334
! Note: hydraulic head calculated from the maximum water level
1338-
IF (HYDROPOWER_GENERATOR(J,W) .EQ. 0) THEN
1339-
ENERGYPRO(J,I,W) = 0 ! If the turbine is not connected to generator (generator shutdown)
1340-
ELSE
1341-
ENERGYPRO(J,I,W) = ENERGYPRO(J,I,W) *((HHO(J,I,W)+HHO(J,I+1,W))/2-(HRESERMAX(J,W)-REALHEAD(J,W)))/1000 ! this part is for hydropower production estimation, ignore if work with irrigation reservoirs
1342-
END IF
1343-
1344-
! Check for minimum environmental flow
1345-
IF (FLOWOUT(J,I,W) .LE. Qmin(J,I,W)) THEN
1346-
FLOWOUT(J,I,W) = Qmin(J,I,W)
1347-
END IF
1335+
! Calculate energy production
1336+
ENERGYPRO(J,I,W) = 0.9 * 9.81 * FLOWOUT_TURB(J,I,W)*((HHO(J,I,W)+HHO(J,I+1,W))/2-(HRESERMAX(J,W)-REALHEAD(J,W)))/1000 ! this part is for hydropower production estimation, ignore if work with irrigation reservoirs
1337+
13481338

13491339
! Set Hydrologic Budget (States & Fluxes) for ROR Dams (Run-of-the-River)
13501340
IF (RULE(J,W) .EQ. 0) THEN

0 commit comments

Comments
 (0)