Title: | Water Resources System Simulator |
---|---|
Description: | Water resources system simulator is a tool for simulation and analysis of large-scale water resources systems. 'WRSS' proposes functions and methods for construction, simulation and analysis of primary storage and hydropower water resources features (e.g. reservoirs, aquifers, and etc.) based on Standard Operating Policy (SOP). |
Authors: | Rezgar Arabzadeh; Parisa Aberi; Kaveh Panaghi; Shahab Araghinejad; Majid Montaseri |
Maintainer: | Rezgar Arabzadeh <[email protected]> |
License: | GPL-3 |
Version: | 3.1 |
Built: | 2024-11-17 04:25:07 UTC |
Source: | https://github.com/cran/WRSS |
The WRSS is an object-oriented R package, which provides tools for simulation and analysis of large-scale supply and hydropower water resources systems. The package includes functions and methods for building, simulation, and visualization of water resources components.
Package: | WRSS |
Type: | Package |
Version: | 3.0 |
Date: | 2022-05-17 |
License: | GPL-3 |
the package includes three major types of functions as follows:
1- functions for construction and manipulatation of water resources features:
createArea
constructor for basin/study area objects
createJunction
constructor for junction objects
createRiver
constructor for reach, river, and channel objects
createReservoir
constructor for reservoir objects
createDiversion
constructor for diversion objects
createAquifer
constructor for aquifer objects
createDemandSite
constructor for demand site objects
set.as
WRSS objects connector
addObjectToArea
adds objects form mentioned above constructors to a basin inherited from class of createBasin
2- functions for analysis and operation of water resources objects using Standard Operating Policy (SOP):
riverRouting
river operation using
reservoirRouting
reservoir operation
aquiferRouting
aquifer operation
diversionRouting
diversion operation
sim
simulates an objects inherited from class of createArea
rippl
computes no-failure storage volume using the sequent peak algorithm(SPA)
cap_design
computes RRV measures for a range of design parameters
3- functions for performance analysis and visualization.
plot.sim
plots the results of simulations for an object inherited from class of sim
plot.createArea
plots an object from class of createArea
risk
computes risk-based criateria for an object inherited from class of sim
GOF
Goodness of fit function
Rezgar Arabzadeh; Parisa Aberi; Kaveh Panaghi; Shahab Araghinejad; Majid Montaseri
Maintainer: Rezgar Arabzadeh <[email protected]>
Loucks, Daniel P., et al. Water resources systems planning and management: an introduction to methods, models and applications. Paris: Unesco, 2005. Arabzadeh, R.; Aberi, P.; Hesarkazzazi, S.; Hajibabaei, M.; Rauch, W.; Nikmehr, S.; Sitzenfrei, R. WRSS: An Object-Oriented R Package for Large-Scale Water Resources Operation. Water 2021, 13, 3037. https://doi.org/10.3390/w13213037
###---------- loading data data(zarrineh) ###---------- Constructing main features of Zerrineh river basin Area<-createArea(name='Zerrineh',location='Kurdistan', simulation=list(start='1900-01-01', end='1909-12-01', interval='month')) ###---------- Bukan dam Q<-zarrineh$bukan$timeSeries[,1] E<-zarrineh$bukan$timeSeries[,2] R<-zarrineh$bukan$timeSeries[,3] D<-zarrineh$bukan$timeSeries[,4] A<-zarrineh$bukan$timeSeries[,5] RC<-zarrineh$bukan$ratingCurve min<-zarrineh$bukan$capacity[1]$min max<-zarrineh$bukan$capacity[2]$max bukan<-createReservoir(name='bukan',netEvaporation=E, initialStorage=max, geometry=list(deadStorage=min, capacity=max, storageAreaTable=RC)) Zerrineh<-createRiver(name='Zerrineh-River',downstream=bukan,discharge=Q) R<-createDemandSite(name='E1',demandTS=R,suppliers=list(bukan),priority=1) D<-createDemandSite(name='U1',demandTS=D,suppliers=list(bukan),priority=2) A<-createDemandSite(name='A1',demandTS=A,suppliers=list(bukan),priority=3) Area<-addObjectToArea(Area,Zerrineh) Area<-addObjectToArea(Area,bukan) Area<-addObjectToArea(Area,R) Area<-addObjectToArea(Area,D) Area<-addObjectToArea(Area,A) ###---------- a junction located in Bukan dam upstream J<-createJunction(name='J1', downstream=Zerrineh) Area<-addObjectToArea(Area,J) ###---------- Markhuz dam Q<-zarrineh$Markhuz$timeSeries[,1] E<-zarrineh$Markhuz$timeSeries[,2] A<-zarrineh$Markhuz$timeSeries[,3] RC<-zarrineh$Markhuz$ratingCurve min<-zarrineh$Markhuz$capacity[1]$min max<-zarrineh$Markhuz$capacity[2]$max Markhuz<-createReservoir(name='Markhuz',netEvaporation=E, downstream=J,initialStorage=max, geometry=list(deadStorage=min, capacity=max, storageAreaTable=RC)) River<-createRiver(name='Markhuz-River',downstream=Markhuz,discharge=Q) A<-createDemandSite(name='A3',demandTS=A,returnFlowFraction=0.3, suppliers=list(Markhuz),downstream=J,priority=1) Area<-addObjectToArea(Area, River) Area<-addObjectToArea(Area, Markhuz) Area<-addObjectToArea(Area, A) ###---------- Cheragh Veys dam Q<-zarrineh$cheraghVeys$timeSeries[,1] E<-zarrineh$cheraghVeys$timeSeries[,2] R<-zarrineh$cheraghVeys$timeSeries[,3] D<-zarrineh$cheraghVeys$timeSeries[,4] A<-zarrineh$cheraghVeys$timeSeries[,5] RC<-zarrineh$cheraghVeys$ratingCurve min<-zarrineh$cheraghVeys$capacity[1]$min max<-zarrineh$cheraghVeys$capacity[2]$max cheraghVeys<-createReservoir(name='cheraghVeys',netEvaporation=E, downstream=J,initialStorage=max, geometry=list(deadStorage=min, capacity=max, storageAreaTable=RC)) River<-createRiver(name='Cheragh Veys-River',downstream=cheraghVeys,discharge=Q) R<-createDemandSite(name='E2',demandTS=R,returnFlowFraction=1.0, suppliers=list(cheraghVeys),downstream=J,priority=1) D<-createDemandSite(name='U2',demandTS=D,returnFlowFraction=0.7, suppliers=list(cheraghVeys),downstream=J,priority=2) A<-createDemandSite(name='A2',demandTS=A,returnFlowFraction=0.3, suppliers=list(cheraghVeys),downstream=J,priority=3) Area<-addObjectToArea(Area, River) Area<-addObjectToArea(Area, cheraghVeys) Area<-addObjectToArea(Area, R) Area<-addObjectToArea(Area, D) Area<-addObjectToArea(Area, A) ###---------- Sonata dam Q<-zarrineh$Sonata$timeSeries[,1] E<-zarrineh$Sonata$timeSeries[,2] R<-zarrineh$Sonata$timeSeries[,3] A<-zarrineh$Sonata$timeSeries[,4] RC<-zarrineh$Sonata$ratingCurve min<-zarrineh$Sonata$capacity[1]$min max<-zarrineh$Sonata$capacity[2]$max Sonata<-createReservoir(name='Sonata',netEvaporation=E,downstream=J, initialStorage=max, geometry=list(deadStorage=min, capacity=max, storageAreaTable=RC)) River<-createRiver(name='Sonata-River',downstream=Sonata,discharge=Q) R<-createDemandSite(name='E3',demandTS=R,returnFlowFraction=1.0, suppliers=list(Sonata),downstream=J,priority=1) A<-createDemandSite(name='A4',demandTS=A,returnFlowFraction=0.3, suppliers=list(Sonata),downstream=J,priority=2) Area<-addObjectToArea(Area, River) Area<-addObjectToArea(Area, Sonata) Area<-addObjectToArea(Area, R) Area<-addObjectToArea(Area, A) ###---------- Sarogh dam Q<-zarrineh$Sarogh$timeSeries[,1] E<-zarrineh$Sarogh$timeSeries[,2] D<-zarrineh$Sarogh$timeSeries[,3] A<-zarrineh$Sarogh$timeSeries[,4] RC<-zarrineh$Sarogh$ratingCurve min<-zarrineh$Sarogh$capacity[1]$min max<-zarrineh$Sarogh$capacity[2]$max Sarogh<-createReservoir(name='Sarogh',netEvaporation=E,downstream=J, initialStorage=max, geometry=list(deadStorage=min, capacity=max, storageAreaTable=RC)) River<-createRiver(name='Sarogh-River',downstream=Sarogh,discharge=Q) D<-createDemandSite(name='U3',demandTS=D,returnFlowFraction=0.7, suppliers=list(Sarogh),downstream=J,priority=1) A<-createDemandSite(name='A5',demandTS=A,returnFlowFraction=0.3, suppliers=list(Sarogh),downstream=J,priority=2) Area<-addObjectToArea(Area, River) Area<-addObjectToArea(Area, Sarogh) Area<-addObjectToArea(Area, D) Area<-addObjectToArea(Area, A) ## Not run: plot(Area) ## End(Not run) plot(sim(Area))
###---------- loading data data(zarrineh) ###---------- Constructing main features of Zerrineh river basin Area<-createArea(name='Zerrineh',location='Kurdistan', simulation=list(start='1900-01-01', end='1909-12-01', interval='month')) ###---------- Bukan dam Q<-zarrineh$bukan$timeSeries[,1] E<-zarrineh$bukan$timeSeries[,2] R<-zarrineh$bukan$timeSeries[,3] D<-zarrineh$bukan$timeSeries[,4] A<-zarrineh$bukan$timeSeries[,5] RC<-zarrineh$bukan$ratingCurve min<-zarrineh$bukan$capacity[1]$min max<-zarrineh$bukan$capacity[2]$max bukan<-createReservoir(name='bukan',netEvaporation=E, initialStorage=max, geometry=list(deadStorage=min, capacity=max, storageAreaTable=RC)) Zerrineh<-createRiver(name='Zerrineh-River',downstream=bukan,discharge=Q) R<-createDemandSite(name='E1',demandTS=R,suppliers=list(bukan),priority=1) D<-createDemandSite(name='U1',demandTS=D,suppliers=list(bukan),priority=2) A<-createDemandSite(name='A1',demandTS=A,suppliers=list(bukan),priority=3) Area<-addObjectToArea(Area,Zerrineh) Area<-addObjectToArea(Area,bukan) Area<-addObjectToArea(Area,R) Area<-addObjectToArea(Area,D) Area<-addObjectToArea(Area,A) ###---------- a junction located in Bukan dam upstream J<-createJunction(name='J1', downstream=Zerrineh) Area<-addObjectToArea(Area,J) ###---------- Markhuz dam Q<-zarrineh$Markhuz$timeSeries[,1] E<-zarrineh$Markhuz$timeSeries[,2] A<-zarrineh$Markhuz$timeSeries[,3] RC<-zarrineh$Markhuz$ratingCurve min<-zarrineh$Markhuz$capacity[1]$min max<-zarrineh$Markhuz$capacity[2]$max Markhuz<-createReservoir(name='Markhuz',netEvaporation=E, downstream=J,initialStorage=max, geometry=list(deadStorage=min, capacity=max, storageAreaTable=RC)) River<-createRiver(name='Markhuz-River',downstream=Markhuz,discharge=Q) A<-createDemandSite(name='A3',demandTS=A,returnFlowFraction=0.3, suppliers=list(Markhuz),downstream=J,priority=1) Area<-addObjectToArea(Area, River) Area<-addObjectToArea(Area, Markhuz) Area<-addObjectToArea(Area, A) ###---------- Cheragh Veys dam Q<-zarrineh$cheraghVeys$timeSeries[,1] E<-zarrineh$cheraghVeys$timeSeries[,2] R<-zarrineh$cheraghVeys$timeSeries[,3] D<-zarrineh$cheraghVeys$timeSeries[,4] A<-zarrineh$cheraghVeys$timeSeries[,5] RC<-zarrineh$cheraghVeys$ratingCurve min<-zarrineh$cheraghVeys$capacity[1]$min max<-zarrineh$cheraghVeys$capacity[2]$max cheraghVeys<-createReservoir(name='cheraghVeys',netEvaporation=E, downstream=J,initialStorage=max, geometry=list(deadStorage=min, capacity=max, storageAreaTable=RC)) River<-createRiver(name='Cheragh Veys-River',downstream=cheraghVeys,discharge=Q) R<-createDemandSite(name='E2',demandTS=R,returnFlowFraction=1.0, suppliers=list(cheraghVeys),downstream=J,priority=1) D<-createDemandSite(name='U2',demandTS=D,returnFlowFraction=0.7, suppliers=list(cheraghVeys),downstream=J,priority=2) A<-createDemandSite(name='A2',demandTS=A,returnFlowFraction=0.3, suppliers=list(cheraghVeys),downstream=J,priority=3) Area<-addObjectToArea(Area, River) Area<-addObjectToArea(Area, cheraghVeys) Area<-addObjectToArea(Area, R) Area<-addObjectToArea(Area, D) Area<-addObjectToArea(Area, A) ###---------- Sonata dam Q<-zarrineh$Sonata$timeSeries[,1] E<-zarrineh$Sonata$timeSeries[,2] R<-zarrineh$Sonata$timeSeries[,3] A<-zarrineh$Sonata$timeSeries[,4] RC<-zarrineh$Sonata$ratingCurve min<-zarrineh$Sonata$capacity[1]$min max<-zarrineh$Sonata$capacity[2]$max Sonata<-createReservoir(name='Sonata',netEvaporation=E,downstream=J, initialStorage=max, geometry=list(deadStorage=min, capacity=max, storageAreaTable=RC)) River<-createRiver(name='Sonata-River',downstream=Sonata,discharge=Q) R<-createDemandSite(name='E3',demandTS=R,returnFlowFraction=1.0, suppliers=list(Sonata),downstream=J,priority=1) A<-createDemandSite(name='A4',demandTS=A,returnFlowFraction=0.3, suppliers=list(Sonata),downstream=J,priority=2) Area<-addObjectToArea(Area, River) Area<-addObjectToArea(Area, Sonata) Area<-addObjectToArea(Area, R) Area<-addObjectToArea(Area, A) ###---------- Sarogh dam Q<-zarrineh$Sarogh$timeSeries[,1] E<-zarrineh$Sarogh$timeSeries[,2] D<-zarrineh$Sarogh$timeSeries[,3] A<-zarrineh$Sarogh$timeSeries[,4] RC<-zarrineh$Sarogh$ratingCurve min<-zarrineh$Sarogh$capacity[1]$min max<-zarrineh$Sarogh$capacity[2]$max Sarogh<-createReservoir(name='Sarogh',netEvaporation=E,downstream=J, initialStorage=max, geometry=list(deadStorage=min, capacity=max, storageAreaTable=RC)) River<-createRiver(name='Sarogh-River',downstream=Sarogh,discharge=Q) D<-createDemandSite(name='U3',demandTS=D,returnFlowFraction=0.7, suppliers=list(Sarogh),downstream=J,priority=1) A<-createDemandSite(name='A5',demandTS=A,returnFlowFraction=0.3, suppliers=list(Sarogh),downstream=J,priority=2) Area<-addObjectToArea(Area, River) Area<-addObjectToArea(Area, Sarogh) Area<-addObjectToArea(Area, D) Area<-addObjectToArea(Area, A) ## Not run: plot(Area) ## End(Not run) plot(sim(Area))
This function adds objects from the basin primary features to the object inherited from class of createArea
.
addObjectToArea(area, object)
addObjectToArea(area, object)
area |
An object inherited from |
object |
An objects inherited from any of the following constructors: |
The examples included in this documentation show construction and simulation of primary features of a water resources system using WRSS
package.
The Figure below presents schematic layouts attributed to the examples at the rest of the page:
an object from class of createArea
Rezgar Arabzadeh
Loucks, Daniel P., et al. Water resources systems planning and management: an introduction to methods, models and applications. Paris: Unesco, 2005.
#--------------------1st Example-------------------- R<-createRiver(name="river1",discharge=rnorm(120,5,1.5)) Res<-createReservoir(name="res3",type='storage', priority=1,netEvaporation=rnorm(120,0.5,0.1), geometry=list(deadStorage= 10 ,capacity= 90 , storageAreaTable= cbind(seq(0,90,10),seq(0,9,1)))) waterVariation<-round(sin(seq(0,pi,length.out=12))* 100/sum(sin(seq(0,pi,length.out=12)))) D<-createDemandSite(name ="Agri1", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000)) R<-set.as(Res,R,'downstream') D<-set.as(Res,D,'supplier') area<-createArea(name="unknown",location="unknown", simulation=list(start='2000-01-01', end ='2000-04-29', interval='day')) area<-addObjectToArea(area,R) area<-addObjectToArea(area,Res) area<-addObjectToArea(area,D) ## Not run: plot(area) simulated<-sim(area) plot(simulated) ## End(Not run) #--------------------2nd Example-------------------- Res<-createReservoir(name="res3",type='storage', priority=1,netEvaporation=rnorm(120,0.5,0.1), geometry=list(deadStorage= 10 ,capacity= 90 , storageAreaTable= cbind(seq(0,90,10),seq(0,9,1)))) R<-createRiver(name="river1",discharge=rnorm(120,5,1.5)) waterVariation<-round(sin(seq(0,pi,length.out=12))* 100/sum(sin(seq(0,pi,length.out=12)))) D1<-createDemandSite(name ="Agri1", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,priority=1) D2<-createDemandSite(name ="Agri2", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,priority=1) R<-set.as(Res,R,'downstream') D1<-set.as(Res,D1,'supplier') D2<-set.as(Res,D2,'supplier') area<-createArea(name="unknown",location="unknown", simulation=list(start='2000-01-01', end ='2000-04-29', interval='day')) area<-addObjectToArea(area,R) area<-addObjectToArea(area,Res) area<-addObjectToArea(area,D1) area<-addObjectToArea(area,D2) ## Not run: plot(area) simulated<-sim(area) plot(simulated) ## End(Not run) #--------------------3rd Example-------------------- J1<-createJunction(name="j1") Res1<-createReservoir(name="res1",type='storage', priority=1,netEvaporation=rnorm(120,0.5,0.1), geometry=list(deadStorage= 10 ,capacity= 90 , storageAreaTable= cbind(seq(0,90,10),seq(0,9,1)))) Res2<-createReservoir(name="res2",type='storage', priority=2,netEvaporation=rnorm(120,0.5,0.1), geometry=list(deadStorage= 10 ,capacity= 90 , storageAreaTable= cbind(seq(0,90,10),seq(0,9,1)))) R1<-createRiver(name="river1",discharge=rnorm(120,5,1.5)) R2<-createRiver(name="river2",discharge=rnorm(120,5,1.5)) waterVariation<-round(sin(seq(0,pi,length.out=12))* 100/sum(sin(seq(0,pi,length.out=12)))) D1<-createDemandSite(name ="Agri1", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,priority=1) D2<-createDemandSite(name ="Agri2", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,priority=2) D3<-createDemandSite(name ="Agri3", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,priority=1) area<-createArea(name="unknown",location="unknown", simulation=list(start='2000-01-01', end ='2000-04-29', interval='day')) R1<-set.as(Res1,R1,'downstream') R2<-set.as(Res2,R2,'downstream') Res1<-set.as(J1,Res1,'downstream') Res2<-set.as(J1,Res2,'downstream') D1<-set.as(J1,D1,'downstream') D2<-set.as(J1,D2,'downstream') D3<-set.as(J1,D3,'downstream') D1<-set.as(Res1,D1,'supplier') D2<-set.as(Res1,D2,'supplier') D2<-set.as(Res2,D2,'supplier') D3<-set.as(Res2,D3,'supplier') area<-addObjectToArea(area,R1) area<-addObjectToArea(area,R2) area<-addObjectToArea(area,Res1) area<-addObjectToArea(area,Res2) area<-addObjectToArea(area,D1) area<-addObjectToArea(area,D2) area<-addObjectToArea(area,D3) area<-addObjectToArea(area,J1) ## Not run: plot(area) simulated<-sim(area) plot(simulated) ## End(Not run) #--------------------4th Example-------------------- J1<-createJunction(name="j1") Res1<-createReservoir(name="res1",type='storage', priority=1,netEvaporation=rnorm(120,0.5,0.1),downstream =J1 , geometry=list(deadStorage= 10 ,capacity= 90 , storageAreaTable= cbind(seq(0,90,10),seq(0,9,1)))) Auq1<-createAquifer(name="Aquifer1",area=100,volume=5000, rechargeTS=rnorm(120,10,3),Sy=0.1, leakageFraction=0.02,leakageObject=J1,priority=2) waterVariation<-round(sin(seq(0,pi,length.out=12))* 100/sum(sin(seq(0,pi,length.out=12)))) R1<-createRiver(name="river1",downstream=Res1,discharge=rnorm(120,5,1.5)) R2<-createRiver(name="river2",downstream=Auq1,discharge=rnorm(120,5,1.5)) D1<-createDemandSite(name ="Agri1", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,suppliers=list(Res1,Auq1), downstream=J1,priority=1) D2<-createDemandSite(name ="Agri2", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,suppliers=list(Res1,Auq1), downstream=J1,priority=2) D3<-createDemandSite(name ="Agri3", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,suppliers=list(Res1,Auq1), downstream=J1,priority=1) area<-createArea(name="unknown",location="unknown", simulation=list(start='2000-01-01', end ='2000-04-29', interval='day')) area<-addObjectToArea(area,R1) area<-addObjectToArea(area,R2) area<-addObjectToArea(area,Res1) area<-addObjectToArea(area,Auq1) area<-addObjectToArea(area,D1) area<-addObjectToArea(area,D2) area<-addObjectToArea(area,D3) area<-addObjectToArea(area,J1) ## Not run: plot(area) simulated<-sim(area) plot(simulated) ## End(Not run) #--------------------5th Example-------------------- J1<-createJunction(name="junction1") Res1<-createReservoir(name="res1",type='storage', priority=1,netEvaporation=rnorm(120,0.5,0.1), geometry=list(deadStorage= 10 ,capacity= 90 , storageAreaTable= cbind(seq(0,90,10),seq(0,9,1)))) Auq1<-createAquifer(name="Aquifer1",area=100,volume=5000, rechargeTS=rnorm(120,10,3),Sy=0.1,priority=2) waterVariation<-round(sin(seq(0,pi,length.out=12))* 100/sum(sin(seq(0,pi,length.out=12)))) R1<-createRiver(name="River1", downstream=Res1,discharge=rnorm(120,20,3), seepageFraction=0.1,seepageObject=Auq1) D1<-createDemandSite(name ="Agri1", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,suppliers=list(Res1), downstream=J1,priority=1) D2<-createDemandSite(name ="Agri2", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,suppliers=list(Res1,Auq1), downstream=J1,priority=2) D3<-createDemandSite(name ="Agri3", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,suppliers=list(R1), downstream=Res1,priority=2) D4<-createDemandSite(name ="Agri4", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,suppliers=list(R1), downstream=Res1,priority=1) area<-createArea(name="unknown",location="unknown", simulation=list(start='2000-01-01', end ='2000-04-29', interval='day')) area<-addObjectToArea(area,R1) area<-addObjectToArea(area,Res1) area<-addObjectToArea(area,Auq1) area<-addObjectToArea(area,D1) area<-addObjectToArea(area,D2) area<-addObjectToArea(area,D3) area<-addObjectToArea(area,D4) area<-addObjectToArea(area,J1) ## Not run: plot(area) simulated<-sim(area) plot(simulated) ## End(Not run) #--------------------6th Example-------------------- Auq1<-createAquifer(name="Aquifer1",area=100,volume=5000, rechargeTS=rnorm(120,10,3),Sy=0.1) waterVariation<-round(sin(seq(0,pi,length.out=12))* 100/sum(sin(seq(0,pi,length.out=12)))) D0<-createDemandSite(name ="Agri0", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000),priority=1) Div1<-createDiversion(name="Div1",capacity=10) J2<-createJunction(name="junc2") Res2<-createReservoir(name="res2",type='storage', priority=1,netEvaporation=rnorm(120,0.5,0.1), geometry=list(deadStorage= 10 ,capacity= 90 , storageAreaTable= cbind(seq(0,90,10),seq(0,9,1)))) R2<-createRiver(name="river2",discharge=rnorm(120,12,3)) D3<-createDemandSite(name ="Agri3", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,priority=2) J1<-createJunction(name="junc1") Res1<-createReservoir(name="res1",type='storage', priority=1,netEvaporation=rnorm(120,0.5,0.1), geometry=list(deadStorage= 10 ,capacity= 90 , storageAreaTable= cbind(seq(0,90,10),seq(0,9,1)))) R1<-createRiver(name="river1",discharge=rnorm(120,5,1)) D2<-createDemandSite(name ="Agri2", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,priority=2) D1<-createDemandSite(name ="Agri1", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,priority=1) area<-createArea(name="unknown",location="unknown", simulation=list(start='2000-01-01', end ='2000-04-29', interval='day')) R1<-set.as(Res1,R1,'downstream') R2<-set.as(Res2,R2,'downstream') Res1<-set.as(J1,Res1,'downstream') Res2<-set.as(J2,Res2,'downstream') J1<-set.as(Div1,J1,'downstream') J2<-set.as(Auq1,J2,'downstream') Div1<-set.as(Auq1,Div1,'divertObject') D1<-set.as(J1,D1,'downstream') D2<-set.as(J1,D2,'downstream') D3<-set.as(J2,D3,'downstream') D1<-set.as(Res1,D1,'supplier') D2<-set.as(Res1,D2,'supplier') D2<-set.as(Res2,D2,'supplier') D3<-set.as(Res2,D3,'supplier') D0<-set.as(Auq1,D0,'supplier') area<-addObjectToArea(area,R1) area<-addObjectToArea(area,R2) area<-addObjectToArea(area,Res1) area<-addObjectToArea(area,Res2) area<-addObjectToArea(area,D0) area<-addObjectToArea(area,D1) area<-addObjectToArea(area,D2) area<-addObjectToArea(area,D3) area<-addObjectToArea(area,Div1) area<-addObjectToArea(area,Auq1) area<-addObjectToArea(area,J1) area<-addObjectToArea(area,J2) simulated<-sim(area) ## Not run: plot(area) plot(simulated) ## End(Not run)
#--------------------1st Example-------------------- R<-createRiver(name="river1",discharge=rnorm(120,5,1.5)) Res<-createReservoir(name="res3",type='storage', priority=1,netEvaporation=rnorm(120,0.5,0.1), geometry=list(deadStorage= 10 ,capacity= 90 , storageAreaTable= cbind(seq(0,90,10),seq(0,9,1)))) waterVariation<-round(sin(seq(0,pi,length.out=12))* 100/sum(sin(seq(0,pi,length.out=12)))) D<-createDemandSite(name ="Agri1", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000)) R<-set.as(Res,R,'downstream') D<-set.as(Res,D,'supplier') area<-createArea(name="unknown",location="unknown", simulation=list(start='2000-01-01', end ='2000-04-29', interval='day')) area<-addObjectToArea(area,R) area<-addObjectToArea(area,Res) area<-addObjectToArea(area,D) ## Not run: plot(area) simulated<-sim(area) plot(simulated) ## End(Not run) #--------------------2nd Example-------------------- Res<-createReservoir(name="res3",type='storage', priority=1,netEvaporation=rnorm(120,0.5,0.1), geometry=list(deadStorage= 10 ,capacity= 90 , storageAreaTable= cbind(seq(0,90,10),seq(0,9,1)))) R<-createRiver(name="river1",discharge=rnorm(120,5,1.5)) waterVariation<-round(sin(seq(0,pi,length.out=12))* 100/sum(sin(seq(0,pi,length.out=12)))) D1<-createDemandSite(name ="Agri1", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,priority=1) D2<-createDemandSite(name ="Agri2", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,priority=1) R<-set.as(Res,R,'downstream') D1<-set.as(Res,D1,'supplier') D2<-set.as(Res,D2,'supplier') area<-createArea(name="unknown",location="unknown", simulation=list(start='2000-01-01', end ='2000-04-29', interval='day')) area<-addObjectToArea(area,R) area<-addObjectToArea(area,Res) area<-addObjectToArea(area,D1) area<-addObjectToArea(area,D2) ## Not run: plot(area) simulated<-sim(area) plot(simulated) ## End(Not run) #--------------------3rd Example-------------------- J1<-createJunction(name="j1") Res1<-createReservoir(name="res1",type='storage', priority=1,netEvaporation=rnorm(120,0.5,0.1), geometry=list(deadStorage= 10 ,capacity= 90 , storageAreaTable= cbind(seq(0,90,10),seq(0,9,1)))) Res2<-createReservoir(name="res2",type='storage', priority=2,netEvaporation=rnorm(120,0.5,0.1), geometry=list(deadStorage= 10 ,capacity= 90 , storageAreaTable= cbind(seq(0,90,10),seq(0,9,1)))) R1<-createRiver(name="river1",discharge=rnorm(120,5,1.5)) R2<-createRiver(name="river2",discharge=rnorm(120,5,1.5)) waterVariation<-round(sin(seq(0,pi,length.out=12))* 100/sum(sin(seq(0,pi,length.out=12)))) D1<-createDemandSite(name ="Agri1", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,priority=1) D2<-createDemandSite(name ="Agri2", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,priority=2) D3<-createDemandSite(name ="Agri3", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,priority=1) area<-createArea(name="unknown",location="unknown", simulation=list(start='2000-01-01', end ='2000-04-29', interval='day')) R1<-set.as(Res1,R1,'downstream') R2<-set.as(Res2,R2,'downstream') Res1<-set.as(J1,Res1,'downstream') Res2<-set.as(J1,Res2,'downstream') D1<-set.as(J1,D1,'downstream') D2<-set.as(J1,D2,'downstream') D3<-set.as(J1,D3,'downstream') D1<-set.as(Res1,D1,'supplier') D2<-set.as(Res1,D2,'supplier') D2<-set.as(Res2,D2,'supplier') D3<-set.as(Res2,D3,'supplier') area<-addObjectToArea(area,R1) area<-addObjectToArea(area,R2) area<-addObjectToArea(area,Res1) area<-addObjectToArea(area,Res2) area<-addObjectToArea(area,D1) area<-addObjectToArea(area,D2) area<-addObjectToArea(area,D3) area<-addObjectToArea(area,J1) ## Not run: plot(area) simulated<-sim(area) plot(simulated) ## End(Not run) #--------------------4th Example-------------------- J1<-createJunction(name="j1") Res1<-createReservoir(name="res1",type='storage', priority=1,netEvaporation=rnorm(120,0.5,0.1),downstream =J1 , geometry=list(deadStorage= 10 ,capacity= 90 , storageAreaTable= cbind(seq(0,90,10),seq(0,9,1)))) Auq1<-createAquifer(name="Aquifer1",area=100,volume=5000, rechargeTS=rnorm(120,10,3),Sy=0.1, leakageFraction=0.02,leakageObject=J1,priority=2) waterVariation<-round(sin(seq(0,pi,length.out=12))* 100/sum(sin(seq(0,pi,length.out=12)))) R1<-createRiver(name="river1",downstream=Res1,discharge=rnorm(120,5,1.5)) R2<-createRiver(name="river2",downstream=Auq1,discharge=rnorm(120,5,1.5)) D1<-createDemandSite(name ="Agri1", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,suppliers=list(Res1,Auq1), downstream=J1,priority=1) D2<-createDemandSite(name ="Agri2", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,suppliers=list(Res1,Auq1), downstream=J1,priority=2) D3<-createDemandSite(name ="Agri3", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,suppliers=list(Res1,Auq1), downstream=J1,priority=1) area<-createArea(name="unknown",location="unknown", simulation=list(start='2000-01-01', end ='2000-04-29', interval='day')) area<-addObjectToArea(area,R1) area<-addObjectToArea(area,R2) area<-addObjectToArea(area,Res1) area<-addObjectToArea(area,Auq1) area<-addObjectToArea(area,D1) area<-addObjectToArea(area,D2) area<-addObjectToArea(area,D3) area<-addObjectToArea(area,J1) ## Not run: plot(area) simulated<-sim(area) plot(simulated) ## End(Not run) #--------------------5th Example-------------------- J1<-createJunction(name="junction1") Res1<-createReservoir(name="res1",type='storage', priority=1,netEvaporation=rnorm(120,0.5,0.1), geometry=list(deadStorage= 10 ,capacity= 90 , storageAreaTable= cbind(seq(0,90,10),seq(0,9,1)))) Auq1<-createAquifer(name="Aquifer1",area=100,volume=5000, rechargeTS=rnorm(120,10,3),Sy=0.1,priority=2) waterVariation<-round(sin(seq(0,pi,length.out=12))* 100/sum(sin(seq(0,pi,length.out=12)))) R1<-createRiver(name="River1", downstream=Res1,discharge=rnorm(120,20,3), seepageFraction=0.1,seepageObject=Auq1) D1<-createDemandSite(name ="Agri1", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,suppliers=list(Res1), downstream=J1,priority=1) D2<-createDemandSite(name ="Agri2", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,suppliers=list(Res1,Auq1), downstream=J1,priority=2) D3<-createDemandSite(name ="Agri3", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,suppliers=list(R1), downstream=Res1,priority=2) D4<-createDemandSite(name ="Agri4", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,suppliers=list(R1), downstream=Res1,priority=1) area<-createArea(name="unknown",location="unknown", simulation=list(start='2000-01-01', end ='2000-04-29', interval='day')) area<-addObjectToArea(area,R1) area<-addObjectToArea(area,Res1) area<-addObjectToArea(area,Auq1) area<-addObjectToArea(area,D1) area<-addObjectToArea(area,D2) area<-addObjectToArea(area,D3) area<-addObjectToArea(area,D4) area<-addObjectToArea(area,J1) ## Not run: plot(area) simulated<-sim(area) plot(simulated) ## End(Not run) #--------------------6th Example-------------------- Auq1<-createAquifer(name="Aquifer1",area=100,volume=5000, rechargeTS=rnorm(120,10,3),Sy=0.1) waterVariation<-round(sin(seq(0,pi,length.out=12))* 100/sum(sin(seq(0,pi,length.out=12)))) D0<-createDemandSite(name ="Agri0", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000),priority=1) Div1<-createDiversion(name="Div1",capacity=10) J2<-createJunction(name="junc2") Res2<-createReservoir(name="res2",type='storage', priority=1,netEvaporation=rnorm(120,0.5,0.1), geometry=list(deadStorage= 10 ,capacity= 90 , storageAreaTable= cbind(seq(0,90,10),seq(0,9,1)))) R2<-createRiver(name="river2",discharge=rnorm(120,12,3)) D3<-createDemandSite(name ="Agri3", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,priority=2) J1<-createJunction(name="junc1") Res1<-createReservoir(name="res1",type='storage', priority=1,netEvaporation=rnorm(120,0.5,0.1), geometry=list(deadStorage= 10 ,capacity= 90 , storageAreaTable= cbind(seq(0,90,10),seq(0,9,1)))) R1<-createRiver(name="river1",discharge=rnorm(120,5,1)) D2<-createDemandSite(name ="Agri2", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,priority=2) D1<-createDemandSite(name ="Agri1", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,priority=1) area<-createArea(name="unknown",location="unknown", simulation=list(start='2000-01-01', end ='2000-04-29', interval='day')) R1<-set.as(Res1,R1,'downstream') R2<-set.as(Res2,R2,'downstream') Res1<-set.as(J1,Res1,'downstream') Res2<-set.as(J2,Res2,'downstream') J1<-set.as(Div1,J1,'downstream') J2<-set.as(Auq1,J2,'downstream') Div1<-set.as(Auq1,Div1,'divertObject') D1<-set.as(J1,D1,'downstream') D2<-set.as(J1,D2,'downstream') D3<-set.as(J2,D3,'downstream') D1<-set.as(Res1,D1,'supplier') D2<-set.as(Res1,D2,'supplier') D2<-set.as(Res2,D2,'supplier') D3<-set.as(Res2,D3,'supplier') D0<-set.as(Auq1,D0,'supplier') area<-addObjectToArea(area,R1) area<-addObjectToArea(area,R2) area<-addObjectToArea(area,Res1) area<-addObjectToArea(area,Res2) area<-addObjectToArea(area,D0) area<-addObjectToArea(area,D1) area<-addObjectToArea(area,D2) area<-addObjectToArea(area,D3) area<-addObjectToArea(area,Div1) area<-addObjectToArea(area,Auq1) area<-addObjectToArea(area,J1) area<-addObjectToArea(area,J2) simulated<-sim(area) ## Not run: plot(area) plot(simulated) ## End(Not run)
Given a sort of demand(s), aquiferRouting
function simulates a lumped and simple model of an unconfined aquifer under an optional givn recharge time series, rechargeTS
, and specific yield, Sy
.
aquiferRouting(demand, priority = NA, area, volume, rechargeTS = NA, leakageFraction = NA, initialStorage = NA, Sy, simulation)
aquiferRouting(demand, priority = NA, area, volume, rechargeTS = NA, leakageFraction = NA, initialStorage = NA, Sy, simulation)
demand |
(optional) A matrix: is column-wise matrix of demands, at which the rows present demands for each monthly time step and columns are for different individual demand sites (MCM). |
priority |
(optional) A vector: is a vector of priorities associated to |
area |
The area of aquifer (Km^2) |
volume |
The aquifer volume (MCM) |
rechargeTS |
(optional) A vector : a vector of water flowing into the aquifer (MCM) |
leakageFraction |
(optional) The leakage coeffcient of aquifer storage. The leakage is computed as the product of |
initialStorage |
(optional) The initial volume of aquifer at the first step of the simulation (MCM). If missing, the function iterates to carry over the aquifer |
Sy |
Specific yield (default: 0.1) |
simulation |
A list: |
the aquiferRouting
function returns a list of objects as bellow:
release
: a matrix of release(s) equivalant to each demand
(MCM)
leakage
: a vector of leakage time series (MCM)
storage
: a vector of storage time series (MCM)
Rezgar Arabzadeh
Mart nez-Santos, P., and J. M. Andreu. "Lumped and distributed approaches to model natural recharge in semiarid karst aquifers." Journal of hydrology 388.3 (2010): 389-398.
area <-200 leakageFraction<-0.01 Sy <-0.15 volume <-20000 priority <-c(3,1,1,2) rechargeTS <-rnorm(120,60,8) demand <-matrix(rnorm(480,10,3),120) simulation <-list(start='2000-01-01',end='2009-12-29',interval='month') res<- aquiferRouting(demand =demand , priority =priority , area =area , volume =volume , rechargeTS =rechargeTS , leakageFraction=leakageFraction, Sy =Sy , simulation =simulation) plot(res$storage$storage,ylab='Storage (MCM)',xlab='time steps(month)',type='o')
area <-200 leakageFraction<-0.01 Sy <-0.15 volume <-20000 priority <-c(3,1,1,2) rechargeTS <-rnorm(120,60,8) demand <-matrix(rnorm(480,10,3),120) simulation <-list(start='2000-01-01',end='2009-12-29',interval='month') res<- aquiferRouting(demand =demand , priority =priority , area =area , volume =volume , rechargeTS =rechargeTS , leakageFraction=leakageFraction, Sy =Sy , simulation =simulation) plot(res$storage$storage,ylab='Storage (MCM)',xlab='time steps(month)',type='o')
cap_design
Calculates the RRV measures for multiple design candidates.
cap_design(area,params,w,plot)
cap_design(area,params,w,plot)
area |
An object from class of |
params |
A list of list(s), which each sub-list can contains an object from either of classes |
w |
(optional) A vector of weights of sustainability indices summing 1 with length of equal with the number of demand site objects built-in |
plot |
(optional) logical: plot the resault or not. The default is |
A matrix of RRV and sustainability index proposed by Hashemitto et al. (1982) and Loucks (1997).
Rezgar Arabzadeh
Hashimoto, T., Stedinger, J. R., & Loucks, D. P. (1982). Reliability, resiliency, and vulnerability criteria for water resource system performance evaluation. Water resources research, 18(1), 14-20. Loucks, D. P. (1997). Quantifying trends in system sustainability. Hydrological Sciences Journal, 42(4), 513-530.
Res1<-createReservoir(name="res1",type='storage', priority=1,netEvaporation=rnorm(120,0.5,0.1), geometry=list(deadStorage= 10 ,capacity= 50 , storageAreaTable= cbind(seq(0,90,10),seq(0,9,1)))) R1<-createRiver(name="river1",discharge=rnorm(120,25,1.5)) waterVariation<-round(sin(seq(0,pi,length.out=12))* 100/sum(sin(seq(0,pi,length.out=12)))) D1<-createDemandSite(name ="Agri1", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=500), returnFlowFraction =0.2,priority=2) area<-createArea(name="unknown",location="unknown", simulation=list(start='2000-01-01', end ='2000-04-29', interval='day')) R1<-set.as(Res1,R1,'downstream') D1<-set.as(Res1,D1,'supplier') area<-addObjectToArea(area,R1) area<-addObjectToArea(area,Res1) area<-addObjectToArea(area,D1) params<-list( list(Res1,seq(0.5,1.5,0.1)) ) cap_design(area,params)
Res1<-createReservoir(name="res1",type='storage', priority=1,netEvaporation=rnorm(120,0.5,0.1), geometry=list(deadStorage= 10 ,capacity= 50 , storageAreaTable= cbind(seq(0,90,10),seq(0,9,1)))) R1<-createRiver(name="river1",discharge=rnorm(120,25,1.5)) waterVariation<-round(sin(seq(0,pi,length.out=12))* 100/sum(sin(seq(0,pi,length.out=12)))) D1<-createDemandSite(name ="Agri1", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=500), returnFlowFraction =0.2,priority=2) area<-createArea(name="unknown",location="unknown", simulation=list(start='2000-01-01', end ='2000-04-29', interval='day')) R1<-set.as(Res1,R1,'downstream') D1<-set.as(Res1,D1,'supplier') area<-addObjectToArea(area,R1) area<-addObjectToArea(area,Res1) area<-addObjectToArea(area,D1) params<-list( list(Res1,seq(0.5,1.5,0.1)) ) cap_design(area,params)
cap_design
Calculates the RRV measures for multiple design candidates.
## S3 method for class 'base' cap_design(area,params,w,plot)
## S3 method for class 'base' cap_design(area,params,w,plot)
area |
An object from class of |
params |
A list of list(s), which each sub-list can contains an object from either of classes |
w |
(optional) A vector of weights of sustainability indices summing 1 with length of equal with the number of demand site objects built-in |
plot |
(optional) logical: plot the resault or not. The default is |
A matrix of RRV and sustainability index proposed by Hashemitto et al. (1982) and Loucks (1997).
Rezgar Arabzadeh
Hashimoto, T., Stedinger, J. R., & Loucks, D. P. (1982). Reliability, resiliency, and vulnerability criteria for water resource system performance evaluation. Water resources research, 18(1), 14-20. Loucks, D. P. (1997). Quantifying trends in system sustainability. Hydrological Sciences Journal, 42(4), 513-530.
cap_design
Calculates the RRV measures for multiple design candidates.
## Default S3 method: cap_design(area,params,w=NA,plot=TRUE)
## Default S3 method: cap_design(area,params,w=NA,plot=TRUE)
area |
An object from class of |
params |
A list of list(s), which each sub-list can contains an object from either of classes |
w |
(optional) A vector of weights of sustainability indices summing 1 with length of equal with the number of demand site objects built-in |
plot |
(optional) logical: plot the resault or not. The default is |
A matrix of RRV and sustainability index proposed by Hashemitto et al. (1982) and Loucks (1997).
Rezgar Arabzadeh
Hashimoto, T., Stedinger, J. R., & Loucks, D. P. (1982). Reliability, resiliency, and vulnerability criteria for water resource system performance evaluation. Water resources research, 18(1), 14-20. Loucks, D. P. (1997). Quantifying trends in system sustainability. Hydrological Sciences Journal, 42(4), 513-530.
createAquifer
this function constructs an object from class of createAquifer
that prescribes a simplified lupmped model of unconfined aquifer.
createAquifer(name, area, volume, rechargeTS, Sy, leakageFraction, initialStorage, leakageObject, priority)
createAquifer(name, area, volume, rechargeTS, Sy, leakageFraction, initialStorage, leakageObject, priority)
name |
(optional) A string: the name of the aquifer |
area |
The area of aquifer (Km^2) |
volume |
The aquifer volume (MCM) |
rechargeTS |
(optional) A vector : a vector of water flowing into the aquifer (MCM) |
Sy |
Specific yield (default: 0.1) |
leakageFraction |
(optional) The leakage coeffcient of aquifer storage. The leakage is computed as the product of |
initialStorage |
(optional) The initial volume of aquifer in the first step of the simulation (MCM). If missing, the function iterates to carry over the aquifer. |
leakageObject |
(optional) an object; from either of classes of |
priority |
(optional) An integer: the supplying priority. |
An object from class of createAquifer
Rezgar Arabzadeh
Mart nez-Santos, P., and J. M. Andreu. "Lumped and distributed approaches to model natural recharge in semiarid karst aquifers." Journal of hydrology 388.3 (2010): 389-398.
createAquifer
this function constructs an object from class of createAquifer
that prescribes a simplified lupmped model of unconfined aquifer.
## S3 method for class 'base' createAquifer(name, area, volume, rechargeTS, Sy,leakageFraction, initialStorage, leakageObject, priority)
## S3 method for class 'base' createAquifer(name, area, volume, rechargeTS, Sy,leakageFraction, initialStorage, leakageObject, priority)
name |
(optional) A string: the name of the aquifer |
area |
The area of aquifer (Km^2) |
volume |
The aquifer volume (MCM) |
rechargeTS |
(optional) A vector : a vector of water flowing into the aquifer (MCM) |
Sy |
Specific yield (default: 0.1) |
leakageFraction |
(optional) The leakage coeffcient of aquifer storage. The leakage is computed as the product of |
initialStorage |
(optional) The initial volume of aquifer in the first step of the simulation (MCM). If missing, the function iterates to carry over the aquifer. |
leakageObject |
(optional) an object; from either of classes of |
priority |
(optional) An integer: the supplying priority. Is a value in [1, 99] interval. If missing, the |
An object from class of list
createAquifer
this function constructs an object from class of createAquifer
that prescribes a simplified lupmped model of unconfined aquifer.
## Default S3 method: createAquifer(name = "Aquifer1", area , volume , rechargeTS = NA , Sy = 0.1, leakageFraction = NA , initialStorage = NA , leakageObject = NA , priority = NA)
## Default S3 method: createAquifer(name = "Aquifer1", area , volume , rechargeTS = NA , Sy = 0.1, leakageFraction = NA , initialStorage = NA , leakageObject = NA , priority = NA)
name |
(optional) A string: the name of the aquifer |
area |
The area of aquifer (Km^2) |
volume |
The aquifer volume (MCM) |
rechargeTS |
(optional) A vector : a vector of water flowing into the aquifer (MCM) |
Sy |
Specific yield (default: 0.1) |
leakageFraction |
(optional) The leakage coeffcient of aquifer storage. The leakage is computed as the product of |
initialStorage |
(optional) The initial volume of aquifer in the first step of the simulation (MCM). If missing, the function iterates to carry over the aquifer. |
leakageObject |
(optional) an object; from either of classes of |
priority |
(optional) An integer: the supplying priority. |
An object from class of createAquifer
createArea
this function constructs an object from class of createArea
, supporting objects inherited from any of the folowing classes: createAquifer
, createDemandSite
, createDiversion
, createJunction
, createReservoir
,and createRiver
.
createArea(name, location, simulation)
createArea(name, location, simulation)
name |
(optional) A string: the name of the aquifer |
location |
(optional) A string: the physical location of |
simulation |
A list: |
An object from class of createArea
Rezgar Arabzadeh
createArea
this function constructs an object from class of createArea
, supporting objects inherited from any of the folowing classes: createAquifer
, createDemandSite
, createDiversion
, createJunction
, createReservoir
,and createRiver
.
## S3 method for class 'base' createArea(name, location, simulation)
## S3 method for class 'base' createArea(name, location, simulation)
name |
(optional) A string: the name of the aquifer |
location |
(optional) A string: the physical location of |
simulation |
A list: |
An object from class of list
createArea
this function constructs an object from class of createArea
, supporting objects inherited from the any of folowing classes: createAquifer
, createDemandSite
, createDiversion
, createJunction
, createReservoir
,and createRiver
.
## Default S3 method: createArea(name = "unknown", location = "unknown", simulation = list(start = NULL, end = NULL, interval=NULL))
## Default S3 method: createArea(name = "unknown", location = "unknown", simulation = list(start = NULL, end = NULL, interval=NULL))
name |
(optional) A string: the name of the aquifer |
location |
(optional) A string: the physical location of |
simulation |
A list: |
An object from class of createArea
createDemandSite
this function constructs an object from class of createDemandSite
, which represents a demand site such as domestic, agricultural, and etc, with a specified demand time series.
createDemandSite(name, demandTS, demandParams, returnFlowFraction, suppliers, downstream, priority)
createDemandSite(name, demandTS, demandParams, returnFlowFraction, suppliers, downstream, priority)
name |
(optional) A string: the name of the demand site |
demandTS |
A vector: a vector of demand time series (MCM). If |
demandParams |
A list: If
|
returnFlowFraction |
(optional) |
suppliers |
(optional) A list of object(s) inherited from the folowing classes: |
downstream |
(optional) An object from either of classes of |
priority |
(optional) An integer: the priority to be supplied. A value in [1, 99] interval. |
An object from class of createDemandSite
Rezgar Arabzadeh
createDemandSite
this function constructs an object from class of createDemandSite
, which represents a demand site such as domestic, agricultural, and etc, with a specified demand time series.
## S3 method for class 'base' createDemandSite(name, demandTS, demandParams, returnFlowFraction, suppliers, downstream, priority)
## S3 method for class 'base' createDemandSite(name, demandTS, demandParams, returnFlowFraction, suppliers, downstream, priority)
name |
(optional) A string: the name of the demand site |
demandTS |
A vector: a vector of demand time series (MCM). If |
demandParams |
A list: If
|
returnFlowFraction |
(optional) |
suppliers |
(optional) A list of object(s) inherited from the folowing classes: |
downstream |
(optional) An object from either of classes of |
priority |
(optional) An integer: the priority to be supplied. A value in [1, 99] interval. |
An object from class of list
createDemandSite
this function constructs an object from class of createDemandSite
, which represents a demand site such as domestic, agricultural, and etc, with a specified demand time series.
## Default S3 method: createDemandSite(name ="Unknown", demandTS =NA , demandParams=list(waterUseRate=NULL , waterVariation=NULL , cropArea=NULL) , returnFlowFraction =0.0 , suppliers = NA , downstream =NA , priority =NA)
## Default S3 method: createDemandSite(name ="Unknown", demandTS =NA , demandParams=list(waterUseRate=NULL , waterVariation=NULL , cropArea=NULL) , returnFlowFraction =0.0 , suppliers = NA , downstream =NA , priority =NA)
name |
(optional) A string: the name of the demand site |
demandTS |
A vector: a vector of demand time series (MCM). If |
demandParams |
A list: If
|
returnFlowFraction |
(optional) |
suppliers |
(optional) A list of object(s) inherited from the folowing classes: |
downstream |
(optional) An object from either of classes of |
priority |
(optional) An integer: the priority to be supplied. A value in [1, 99] interval. |
An object from class of createDemandSite
createDiversion
this function constructs an object from class of createDiversion
, acting as a diversion dam which is able to divert water up to a specified capacity.
createDiversion(name, capacity, divertObject, downstream, priority)
createDiversion(name, capacity, divertObject, downstream, priority)
name |
(optional) A string: the name of the diversion |
capacity |
The maximum capacity of diversion dam (CMS). |
divertObject |
(optional) An object from either of classes of |
downstream |
(optional) An object from either of classes of |
priority |
(optional) An integer: the supplying priority. |
An object from class of createDiversion
Rezgar Arabzadeh
createDiversion
this function constructs an object from class of createDiversion
, acting as a diversion dam which is able to divert water up to a specified capacity.
## S3 method for class 'base' createDiversion(name, capacity, divertObject, downstream, priority)
## S3 method for class 'base' createDiversion(name, capacity, divertObject, downstream, priority)
name |
(optional) A string: the name of the diversion |
capacity |
The maximum capacity of diversion dam (CMS). |
divertObject |
(optional) An object from either of classes of |
downstream |
(optional) An object from either of classes of |
priority |
(optional) An integer: the supplying priority. |
An object from class of list
createDiversion
this function constructs an object from class of createDiversion
, acting as a diversion dam which is able to divert water up to a specified capacity.
## Default S3 method: createDiversion(name = "Div1", capacity , divertObject = NA, downstream = NA, priority = NA)
## Default S3 method: createDiversion(name = "Div1", capacity , divertObject = NA, downstream = NA, priority = NA)
name |
(optional) A string: the name of the diversion |
capacity |
The maximum capacity of diversion dam (CMS). |
divertObject |
(optional) An object from either of classes of |
downstream |
(optional) An object from either of classes of |
priority |
(optional) An integer: the supplying priority. |
An object from class of createDiversion
createJunction
this function constructs an object from class of createDiversion
, acting as a junction in the basin which is able to aggregate outflow water from upper tributaries and/or objects in the upstream.
createJunction(name, downstream)
createJunction(name, downstream)
name |
(optional) A string: the name of the junction |
downstream |
(optional) An object from either of classes of |
An object from class of createJunction
Rezgar Arabzadeh
createJunction
this function constructs an object from class of createDiversion
, acting as a junction in the basin which is able to aggregate outflow water from upper tributaries and/or objects in the upstream.
## S3 method for class 'base' createJunction(name, downstream)
## S3 method for class 'base' createJunction(name, downstream)
name |
(optional) A string: the name of the junction |
downstream |
(optional) An object from either of classes of |
An object from class of list
createJunction
this function constructs an object from class of createDiversion
, acting as a junction in the basin which is able to aggregate outflow water from upper tributaries and/or objects in the upstream.
## Default S3 method: createJunction(name = "junc1", downstream = NA)
## Default S3 method: createJunction(name = "junc1", downstream = NA)
name |
(optional) A string: the name of the junction |
downstream |
(optional) An object from either of classes of |
An object from class of list
createReservoir
this function constructs an object from class of createReservoir
, which is able to simulate a storage reservoir under given a sort of demand(s).
createReservoir(type, name, priority, downstream, netEvaporation, seepageFraction, seepageObject, geometry, plant, penstock, initialStorage)
createReservoir(type, name, priority, downstream, netEvaporation, seepageFraction, seepageObject, geometry, plant, penstock, initialStorage)
type |
A string: the type of the reservoir being instantiated: by default 'storage', however, it can be 'hydropower' |
name |
(optional) A string: the name of the reservoir. |
priority |
(optional) An integer: the supplying priority. |
downstream |
(optional) An object; from either of classes of |
netEvaporation |
A vector: is a vector of net evaporation depth time series at the location of dam site (meter). If omitted, the evaporation is assumed to be zero. |
seepageFraction |
(optional) The seepage coeffcient of reservoir storage. The seepage is computed as the product of |
seepageObject |
(optional) An object; from either of classes of |
geometry |
A list of reservoir geometric specifications:
|
plant |
A list of power plant specifications. It is provided if
|
penstock |
(optional) A list of penstock specifications. It is provided if
|
initialStorage |
(optional) The initial stored water at the reservoir in the first step of the simulation (MCM). If is missing the the function iterate to carry over the reservoir. |
An object from class of createReservoir
Rezgar Arabzadeh
createReservoir
this function constructs an object from class of createReservoir
, which is able to simulate a storage reservoir under given a sort of demand(s).
## S3 method for class 'base' createReservoir(type, name, priority, downstream, netEvaporation, seepageFraction, seepageObject, geometry, plant, penstock, initialStorage)
## S3 method for class 'base' createReservoir(type, name, priority, downstream, netEvaporation, seepageFraction, seepageObject, geometry, plant, penstock, initialStorage)
type |
A string: the type of the reservoir being instantiated: by default 'storage', however, it can be 'hydropower' |
name |
(optional) A string: the name of the reservoir. |
priority |
(optional) An integer: the supplying priority. |
downstream |
(optional) An object; from either of classes of |
netEvaporation |
A vector: is a vector of net evaporation depth time series at the location of dam site (meter). If omitted, the evaporation is assumed to be zero. |
seepageFraction |
(optional) The seepage coeffcient of reservoir storage. The seepage is computed as the product of |
seepageObject |
(optional) An object; from either of classes of |
geometry |
A list of reservoir geometric specifications:
|
plant |
A list of power plant specifications. It is provided if
|
penstock |
(optional) A list of penstock specifications. It is provided if
|
initialStorage |
(optional) The initial stored water at the reservoir in the first step of the simulation (MCM). If is missing the the function iterate to carry over the reservoir. |
An object from class of list
createReservoir
this function constructs an object from class of createReservoir
, which is able to simulate a storage reservoir under given a sort of demand(s).
## Default S3 method: createReservoir(type='storage', name='unknown', priority=NA, downstream=NA, netEvaporation=NA, seepageFraction=NA, seepageObject=NA, geometry=list(storageAreaTable=NULL, storageElevationTable=NULL, dischargeElevationTable=NULL, deadStorage=NULL, capacity=NULL), plant=list(installedCapacity=NULL, efficiency=NULL, designHead=NULL, designFlow=NULL, turbineAxisElevation=NULL, submerged=FALSE, loss=0), penstock=list(diameter=NULL, length=NULL, roughness=110), initialStorage=NA)
## Default S3 method: createReservoir(type='storage', name='unknown', priority=NA, downstream=NA, netEvaporation=NA, seepageFraction=NA, seepageObject=NA, geometry=list(storageAreaTable=NULL, storageElevationTable=NULL, dischargeElevationTable=NULL, deadStorage=NULL, capacity=NULL), plant=list(installedCapacity=NULL, efficiency=NULL, designHead=NULL, designFlow=NULL, turbineAxisElevation=NULL, submerged=FALSE, loss=0), penstock=list(diameter=NULL, length=NULL, roughness=110), initialStorage=NA)
type |
A string: the type of the reservoir being instantiated: by default 'storage', however, it can be 'hydropower' |
name |
(optional) A string: the name of the reservoir. |
priority |
(optional) An integer: the supplying priority. |
downstream |
(optional) An object; from either of classes of |
netEvaporation |
A vector: is a vector of net evaporation depth time series at the location of dam site (meter). If omitted, the evaporation is assumed to be zero. |
seepageFraction |
(optional) The seepage coeffcient of reservoir storage. The seepage is computed as the product of |
seepageObject |
(optional) An object; from either of classes of |
geometry |
A list of reservoir geometric specifications:
|
plant |
A list of power plant specifications. It is provided if
|
penstock |
(optional) A list of penstock specifications. It is provided if
|
initialStorage |
(optional) The initial stored water at the reservoir in the first step of the simulation (MCM). If is missing the the function iterate to carry over the reservoir. |
An object from class of createReservoir
createRiver
this function constructs an object from class of createRiver
, which is able to act as a chanel or resource to supply a seort of demand(s).
createRiver(name, downstream, seepageFraction, seepageObject, discharge, priority)
createRiver(name, downstream, seepageFraction, seepageObject, discharge, priority)
name |
(optional) A string: the name of the river |
downstream |
(optional) An object; from either of classes of |
seepageFraction |
(optional) The seepage coeffcient of river discharge flow. The seepage is computed as the product of |
seepageObject |
(optional) An object; from either of classes of |
discharge |
(optional) A vector: is a vector of river discharge time series (MCM). |
priority |
(optional) An integer: the supplying priority. |
An object from class of createRiver
Rezgar Arabzadeh
createRiver
this function constructs an object from class of createRiver
, which is able to act as a chanel or resource to supply a seort of demand(s).
## S3 method for class 'base' createRiver(name, downstream, seepageFraction, seepageObject, discharge, priority)
## S3 method for class 'base' createRiver(name, downstream, seepageFraction, seepageObject, discharge, priority)
name |
(optional) A string: the name of the river |
downstream |
(optional) An object; from either of classes of |
seepageFraction |
(optional) The seepage coeffcient of river discharge flow. The seepage is computed as the product of |
seepageObject |
(optional) An object; from either of classes of |
discharge |
(optional) A vector: is a vector of river discharge time series (MCM). |
priority |
(optional) An integer: the supplying priority. |
An object from class of list
createRiver
this function constructs an object from class of createRiver
, which is able to act as a chanel or resource to supply a seort of demand(s).
## Default S3 method: createRiver(name = "river1", downstream = NA, seepageFraction = NA, seepageObject = NA, discharge = NA, priority = NA)
## Default S3 method: createRiver(name = "river1", downstream = NA, seepageFraction = NA, seepageObject = NA, discharge = NA, priority = NA)
name |
(optional) A string: the name of the river |
downstream |
(optional) An object; from either of classes of |
seepageFraction |
(optional) The seepage coeffcient of river discharge flow. The seepage is computed as the product of |
seepageObject |
(optional) An object; from either of classes of |
discharge |
(optional) A vector: is a vector of river discharge time series (MCM). |
priority |
(optional) An integer: the supplying priority. |
An object from class of createRiver
Given a sort of demand(s), diversionRouting
function enable us to simulate the performance and effect of a diversion dam under a givn recharge time series, inflow
, on the drainage network.
diversionRouting(demand=NA, priority = NA, capacity, inflow, simulation)
diversionRouting(demand=NA, priority = NA, capacity, inflow, simulation)
demand |
A matrix: is column-wise matrix of demands, at which the rows presents demands for each time step and columns are for different individual demand sites (MCM). |
priority |
A vector: is a vector of priorities associated to |
capacity |
The maximum capacity of diversion dam (CMS). |
inflow |
A vector : a vector of water flowing into the diversion (MCM) |
simulation |
A list: |
the diversionRouting
function returns a list of features given as below:
release
: a matrix of release(s) equivalant to each demand
(MCM)
diverted
: a vector of diverted volumes (MCM), release(s) are included
overflow
: a vector of overflow passing through the diversion (MCM)
Rezgar Arabzadeh
demand <-matrix(rnorm(480,10,3),120) priority <-sample(1:3,4,replace=TRUE) capacity <-12 inflow <-rlnorm(120,log(50),log(4)) simulation <-list(start='2000-01-01',end='2009-12-29',interval='month') res<-diversionRouting(demand=demand, priority=priority, capacity=capacity, inflow=inflow, simulation=simulation) plot(ecdf(res$diverted$diverted),xlab='cms',ylab='exceedance probability')
demand <-matrix(rnorm(480,10,3),120) priority <-sample(1:3,4,replace=TRUE) capacity <-12 inflow <-rlnorm(120,log(50),log(4)) simulation <-list(start='2000-01-01',end='2009-12-29',interval='month') res<-diversionRouting(demand=demand, priority=priority, capacity=capacity, inflow=inflow, simulation=simulation) plot(ecdf(res$diverted$diverted),xlab='cms',ylab='exceedance probability')
this function calculates the goodness of fit (gof) using chi-squared test.
GOF(basin,object,observed)
GOF(basin,object,observed)
basin |
An object from class of |
object |
An object from either of classes of |
observed |
A vector of observed time series. |
A list with class "htest"
.
Rezgar Arabzadeh
J1<-createJunction(name="j1") Res1<-createReservoir(name="res1",type='storage', priority=1,netEvaporation=rnorm(120,0.5,0.1), geometry=list(deadStorage= 10 ,capacity= 90 , storageAreaTable= cbind(seq(0,90,10),seq(0,9,1)))) Res2<-createReservoir(name="res2",type='storage', priority=2,netEvaporation=rnorm(120,0.5,0.1), geometry=list(deadStorage= 10 ,capacity= 90 , storageAreaTable= cbind(seq(0,90,10),seq(0,9,1)))) R1<-createRiver(name="river1",discharge=rnorm(120,5,1.5)) R2<-createRiver(name="river2",discharge=rnorm(120,5,1.5)) waterVariation<-round(sin(seq(0,pi,length.out=12))* 100/sum(sin(seq(0,pi,length.out=12)))) D1<-createDemandSite(name ="Agri1", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,priority=1) D2<-createDemandSite(name ="Agri2", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,priority=2) D3<-createDemandSite(name ="Agri3", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,priority=1) area<-createArea(name="unknown",location="unknown", simulation=list(start='2000-01-01', end ='2000-04-29', interval='day')) R1<-set.as(Res1,R1,'downstream') R2<-set.as(Res2,R2,'downstream') Res1<-set.as(J1,Res1,'downstream') Res2<-set.as(J1,Res2,'downstream') D1<-set.as(J1,D1,'downstream') D2<-set.as(J1,D2,'downstream') D3<-set.as(J1,D3,'downstream') D1<-set.as(Res1,D1,'supplier') D2<-set.as(Res1,D2,'supplier') D2<-set.as(Res2,D2,'supplier') D3<-set.as(Res2,D3,'supplier') area<-addObjectToArea(area,R1) area<-addObjectToArea(area,R2) area<-addObjectToArea(area,Res1) area<-addObjectToArea(area,Res2) area<-addObjectToArea(area,D1) area<-addObjectToArea(area,D2) area<-addObjectToArea(area,D3) area<-addObjectToArea(area,J1) ## Not run: plot(area) ## End(Not run) simulated<-sim(area) observed<-apply(simulated$operation$operation$junctions[[1]]$operation$outflow,1,sum) observed<-observed+rnorm(length(observed),mean(observed)*0.2,sd(observed)*0.1) GOF(simulated,J1,observed)
J1<-createJunction(name="j1") Res1<-createReservoir(name="res1",type='storage', priority=1,netEvaporation=rnorm(120,0.5,0.1), geometry=list(deadStorage= 10 ,capacity= 90 , storageAreaTable= cbind(seq(0,90,10),seq(0,9,1)))) Res2<-createReservoir(name="res2",type='storage', priority=2,netEvaporation=rnorm(120,0.5,0.1), geometry=list(deadStorage= 10 ,capacity= 90 , storageAreaTable= cbind(seq(0,90,10),seq(0,9,1)))) R1<-createRiver(name="river1",discharge=rnorm(120,5,1.5)) R2<-createRiver(name="river2",discharge=rnorm(120,5,1.5)) waterVariation<-round(sin(seq(0,pi,length.out=12))* 100/sum(sin(seq(0,pi,length.out=12)))) D1<-createDemandSite(name ="Agri1", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,priority=1) D2<-createDemandSite(name ="Agri2", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,priority=2) D3<-createDemandSite(name ="Agri3", demandParams=list(waterUseRate=1, waterVariation=waterVariation, cropArea=1000), returnFlowFraction =0.2,priority=1) area<-createArea(name="unknown",location="unknown", simulation=list(start='2000-01-01', end ='2000-04-29', interval='day')) R1<-set.as(Res1,R1,'downstream') R2<-set.as(Res2,R2,'downstream') Res1<-set.as(J1,Res1,'downstream') Res2<-set.as(J1,Res2,'downstream') D1<-set.as(J1,D1,'downstream') D2<-set.as(J1,D2,'downstream') D3<-set.as(J1,D3,'downstream') D1<-set.as(Res1,D1,'supplier') D2<-set.as(Res1,D2,'supplier') D2<-set.as(Res2,D2,'supplier') D3<-set.as(Res2,D3,'supplier') area<-addObjectToArea(area,R1) area<-addObjectToArea(area,R2) area<-addObjectToArea(area,Res1) area<-addObjectToArea(area,Res2) area<-addObjectToArea(area,D1) area<-addObjectToArea(area,D2) area<-addObjectToArea(area,D3) area<-addObjectToArea(area,J1) ## Not run: plot(area) ## End(Not run) simulated<-sim(area) observed<-apply(simulated$operation$operation$junctions[[1]]$operation$outflow,1,sum) observed<-observed+rnorm(length(observed),mean(observed)*0.2,sd(observed)*0.1) GOF(simulated,J1,observed)
GOF
this function calculates the goodness of fit (gof) using chi-squared test.
## S3 method for class 'base' GOF(basin,object,observed)
## S3 method for class 'base' GOF(basin,object,observed)
basin |
An object from class of |
object |
An object from either of classes of |
observed |
A vector of observed time series. |
A list with class "htest"
.
Rezgar Arabzadeh
GOF
this function calculates the goodness of fit (gof) using chi-squared test.
## Default S3 method: GOF(basin,object,observed)
## Default S3 method: GOF(basin,object,observed)
basin |
An object from class of |
object |
An object from either of classes of |
observed |
A vector of observed time series. |
A list with class "htest"
.
Rezgar Arabzadeh
createArea
plot method for objects inherited from class of createArea
## S3 method for class 'createArea' plot(x,...)
## S3 method for class 'createArea' plot(x,...)
x |
an object from class of |
... |
other objects that can be passed to |
Rezgar Arabzadeh
plot method for objects inherited from class of sim
## S3 method for class 'sim' plot(x,...)
## S3 method for class 'sim' plot(x,...)
x |
an object from class of |
... |
other objects that can be passed to |
Rezgar Arabzadeh
Given a sort of demand(s), reservoirRouting
function simulates the effect of a dam under givn hydrometeorological time series, e.g. inflow
and netEvaporation
, on the drainage network.
reservoirRouting(type='storage', inflow, netEvaporation=NA, demand=NA, priority=NA, seepageFraction=NA, geometry=list(storageAreaTable=NULL, storageElevationTable=NULL, dischargeElevationTable=NULL, deadStorage=0, capacity=NULL), plant=list(installedCapacity=NULL, efficiency=NULL, designHead=NULL, designFlow=NULL, turbineAxisElevation=NULL, submerged=FALSE, loss=0), penstock=list(diameter=NULL, length=0, roughness=110), initialStorage=NA, simulation)
reservoirRouting(type='storage', inflow, netEvaporation=NA, demand=NA, priority=NA, seepageFraction=NA, geometry=list(storageAreaTable=NULL, storageElevationTable=NULL, dischargeElevationTable=NULL, deadStorage=0, capacity=NULL), plant=list(installedCapacity=NULL, efficiency=NULL, designHead=NULL, designFlow=NULL, turbineAxisElevation=NULL, submerged=FALSE, loss=0), penstock=list(diameter=NULL, length=0, roughness=110), initialStorage=NA, simulation)
type |
A string: the type of the reservoir being instantiated: by default 'storage', however, it can be 'hydropower' |
inflow |
A vector : a vector of water flowing into the diversion (MCM) |
netEvaporation |
A vector: is a vector of net evaporation depth time series at the location of dam site (meter). If omitted, the evaporation is assumed to be zero. |
demand |
A matrix: is column-wise matrix of demands, at which the rows presents demands for each monthly time steps and columns are for different individual demand sites (MCM). |
priority |
(optional) A vector: is a vector of priorities associated to |
seepageFraction |
(optional) The seepage coeffcient of reservoir storage. The seepage is computed as the product of |
geometry |
A list of reservoir geometric specifications:
|
plant |
A list of power plant specifications. It is provided if
|
penstock |
(optional) A list of penstock specifications. It is provided if
|
initialStorage |
(optional) The initial stored water at the reservoir in the first step of the simulation (MCM). If is missing the the function iterate to carry over the reservoir. |
simulation |
A list: |
the reservoirRouting
function returns a list of features given as folows:
release
: a matrix of release(s) equivalant to each demand
(MCM)
spill
: a vector of spilage time series (MCM)
seepage
: a vector of steepage time series (MCM)
storage
: a vector of storage time series (MCM)
loss
: a vector of evaporation loss time series (MCM)
Rezgar Arabzadeh
Yeh, William WG. "Reservoir management and operations models: A state of the art review." Water resources research 21.12 (1985): 1797-1818.
type <-c('storage','hydropower') demand <-matrix(rnorm(480,10,3),120) priority <-sample(1:3,4,replace=TRUE) inflow <-rlnorm(120,log(50),log(4)) netEvaporation <-rnorm(120,0.4,0.1) simulation <-list(start='2000-01-01',end='2009-12-29',interval='month') seepageFraction<-0.05 geometry <-list(storageAreaTable=cbind(seq(0,100,10),seq(0,10,1)), storageElevationTable=cbind(seq(0,100,10),seq(0,200,20)), dischargeElevationTable=cbind(seq(0,50,10),seq(0,10,2)), deadStorage=50, capacity=100) plant <-list(installedCapacity=50, efficiency=cbind(c(5,25,45),c(0.5,0.9,0.7)), designHead=c(100,200), designFlow=c(10,40), turbineAxisElevation=5, submerged=TRUE, loss=2) penstock <-list(diameter=2, length=50, roughness=110) #-----Storage Reservoir---------- reservoirRouting(type=type[1], inflow=inflow, netEvaporation=netEvaporation, demand=demand, priority=priority, seepageFraction=seepageFraction, geometry=geometry, plant=plant, penstock=penstock, simulation=simulation) ## Not run: ##-----Takes Several Minutes---------- #-----Hydropower Reservoir with demand---------- reservoirRouting(type=type[2], inflow=inflow, netEvaporation=netEvaporation, demand=demand, priority=priority, seepageFraction=seepageFraction, geometry=geometry, plant=plant, penstock=penstock, simulation=simulation) #-----Hydropower Reservoir---------- reservoirRouting(type=type[2], inflow=inflow, netEvaporation=netEvaporation, priority=priority, seepageFraction=seepageFraction, geometry=geometry, plant=plant, penstock=penstock, simulation=simulation) ## End(Not run)
type <-c('storage','hydropower') demand <-matrix(rnorm(480,10,3),120) priority <-sample(1:3,4,replace=TRUE) inflow <-rlnorm(120,log(50),log(4)) netEvaporation <-rnorm(120,0.4,0.1) simulation <-list(start='2000-01-01',end='2009-12-29',interval='month') seepageFraction<-0.05 geometry <-list(storageAreaTable=cbind(seq(0,100,10),seq(0,10,1)), storageElevationTable=cbind(seq(0,100,10),seq(0,200,20)), dischargeElevationTable=cbind(seq(0,50,10),seq(0,10,2)), deadStorage=50, capacity=100) plant <-list(installedCapacity=50, efficiency=cbind(c(5,25,45),c(0.5,0.9,0.7)), designHead=c(100,200), designFlow=c(10,40), turbineAxisElevation=5, submerged=TRUE, loss=2) penstock <-list(diameter=2, length=50, roughness=110) #-----Storage Reservoir---------- reservoirRouting(type=type[1], inflow=inflow, netEvaporation=netEvaporation, demand=demand, priority=priority, seepageFraction=seepageFraction, geometry=geometry, plant=plant, penstock=penstock, simulation=simulation) ## Not run: ##-----Takes Several Minutes---------- #-----Hydropower Reservoir with demand---------- reservoirRouting(type=type[2], inflow=inflow, netEvaporation=netEvaporation, demand=demand, priority=priority, seepageFraction=seepageFraction, geometry=geometry, plant=plant, penstock=penstock, simulation=simulation) #-----Hydropower Reservoir---------- reservoirRouting(type=type[2], inflow=inflow, netEvaporation=netEvaporation, priority=priority, seepageFraction=seepageFraction, geometry=geometry, plant=plant, penstock=penstock, simulation=simulation) ## End(Not run)
Computes the Rippl-no-failure storage for given set of discharges and target.
rippl(discharge,target,plot=TRUE)
rippl(discharge,target,plot=TRUE)
discharge |
a vector of natural discharge at the reservoir site. |
target |
a vector of demand time series with length equal that of |
plot |
logical: whether plot the Rippl's method process or merely report the result. |
no-failure storage value for the given time series, discharge
and target
.
Rippl, Wengel. The capacity of storage reservoirs for water supply. Van Nostrand's Engineering Magazine (1879-1886) 29.175 (1883): 67.
## Not run: rippl(Nile,mean(Nile)*0.95) ## End(Not run)
## Not run: rippl(Nile,mean(Nile)*0.95) ## End(Not run)
this function returns risk-based criteria for demand site(s) built-in the object inherited from class of sim
.
risk(object , s.const = 0.95)
risk(object , s.const = 0.95)
object |
an object from class of |
s.const |
satisfactory constant: a value in [0, 1] interval, which refers to the level at which if a demand is supplied over the |
This function computes the riks criteria based on the formulations proposed by Hashimoto et.al (1982).
a matrix of criteria
Rezgar Arabzadeh
Hashimoto, Tsuyoshi, Jery R. Stedinger, and Daniel P. Loucks. "Reliability, resiliency, and vulnerability criteria for water resource system performance evaluation." Water resources research 18.1 (1982): 14-20.
Res<-createReservoir(name="R1",type='storage', netEvaporation=rnorm(120,0.5,0.1), geometry=list(deadStorage= 10, capacity= 700, storageAreaTable= cbind(seq(0,900,100),seq(0,9,1)))) R<-createRiver(name="Riv1",downstream=Res,discharge=rnorm(120,500,4)) waterVariation<-round(sin(seq(0,pi,length.out=12))* 100/sum(sin(seq(0,pi,length.out=12)))) D1<-createDemandSite(name ="D1", demandParams=list(waterUseRate=5, waterVariation=waterVariation, cropArea=500), suppliers=list(Res),priority=1) D2<-createDemandSite(name ="D2", demandParams=list(waterUseRate=5, waterVariation=waterVariation, cropArea=500), suppliers=list(Res),priority=2) D3<-createDemandSite(name ="D3", demandParams=list(waterUseRate=5, waterVariation=waterVariation, cropArea=500), suppliers=list(Res),priority=3) area<-createArea(simulation=list(start='2000-01-01',end='2009-12-29',interval='month')) area<-addObjectToArea(area,R) area<-addObjectToArea(area,Res) area<-addObjectToArea(area,D1) area<-addObjectToArea(area,D2) area<-addObjectToArea(area,D3) risk(sim(area))
Res<-createReservoir(name="R1",type='storage', netEvaporation=rnorm(120,0.5,0.1), geometry=list(deadStorage= 10, capacity= 700, storageAreaTable= cbind(seq(0,900,100),seq(0,9,1)))) R<-createRiver(name="Riv1",downstream=Res,discharge=rnorm(120,500,4)) waterVariation<-round(sin(seq(0,pi,length.out=12))* 100/sum(sin(seq(0,pi,length.out=12)))) D1<-createDemandSite(name ="D1", demandParams=list(waterUseRate=5, waterVariation=waterVariation, cropArea=500), suppliers=list(Res),priority=1) D2<-createDemandSite(name ="D2", demandParams=list(waterUseRate=5, waterVariation=waterVariation, cropArea=500), suppliers=list(Res),priority=2) D3<-createDemandSite(name ="D3", demandParams=list(waterUseRate=5, waterVariation=waterVariation, cropArea=500), suppliers=list(Res),priority=3) area<-createArea(simulation=list(start='2000-01-01',end='2009-12-29',interval='month')) area<-addObjectToArea(area,R) area<-addObjectToArea(area,Res) area<-addObjectToArea(area,D1) area<-addObjectToArea(area,D2) area<-addObjectToArea(area,D3) risk(sim(area))
Given a sort of demand(s), riverRouting
function enable us to simulate rivers and channels under givn a hydrologic time series, inflow
, and optional demand
(s).
riverRouting(demand=NA, priority = NA, discharge, seepageFraction=NA, simulation)
riverRouting(demand=NA, priority = NA, discharge, seepageFraction=NA, simulation)
demand |
(optional) A matrix: is column-wise matrix of demands, at which the rows presents demands for each time step and columns are for different individual demand sites (MCM). |
priority |
(optional) A vector: is a vector of priorities associated to |
discharge |
(optional) A vector : a vector of water flowing into the diversion (MCM) |
seepageFraction |
(optional) The seepage coeffcient of river discharge flow. The seepage is computed as the product of seepageFraction and river discharge. It is in |
simulation |
A list: |
the riverRouting
returns a matrix of release(s) corresponding to each demand(s).
Rezgar Arabzadeh
demand <-matrix(rnorm(480,15,3),120) priority <-sample(1:3,4,replace=TRUE) discharge <-rlnorm(120,log(50),log(4)) simulation <-list(start='2000-01-01',end='2000-04-29',interval='day') riverRouting(demand = demand , priority = priority , discharge = discharge, simulation= simulation)
demand <-matrix(rnorm(480,15,3),120) priority <-sample(1:3,4,replace=TRUE) discharge <-rlnorm(120,log(50),log(4)) simulation <-list(start='2000-01-01',end='2000-04-29',interval='day') riverRouting(demand = demand , priority = priority , discharge = discharge, simulation= simulation)
this function connects a base
object as a either of: 'downstream'
, 'supplier'
, 'leakageObject'
, 'seepageObject'
, or 'divertObject'
to a target
object, which are both instantiated by WRSS constructors.
set.as(base,target,type='downstream')
set.as(base,target,type='downstream')
base |
An object; from either of classes of |
target |
An object; from either of classes of |
type |
the type of |
an object from class of target
object.
Rezgar Arabzadeh
sim
sim
simulates an object inherited from class of createArea
using Standard Operating Policy (SOP).
sim(object)
sim(object)
object |
an object inherited from class of |
an object inherited from class of sim
.
Address keys to access components built-in an object inherited from class of sim
is as figure below:
Rezgar Arabzadeh
Loucks, Daniel P., et al. Water resources systems planning and management: an introduction to methods, models and applications. Paris: Unesco, 2005.
sim
sim
simulates an object inherited from class of createArea
using Standard Operating Policy (SOP).
## S3 method for class 'base' sim(object)
## S3 method for class 'base' sim(object)
object |
an object inherited from class of |
an object inherited from class of list
and including features as list(s), which are accessable as follows:
reservoirs: operation$reservoirs rivers: operation$rivers junctions: operation$junctions aquifers: operation$aquifers diversions: operation$diversions demands: operation$demands
sim
sim
simulates an object inherited from class of createArea
using Standard Operating Policy (SOP).
## Default S3 method: sim(object)
## Default S3 method: sim(object)
object |
an object inherited from class of |
an object inherited from class of sim
and including features as list(s), which are accessable as follows:
reservoirs: $operation$operation$reservoirs rivers: $operation$operation$rivers junctions: $operation$operation$junctions aquifers: $operation$operation$aquifers diversions: $operation$operation$diversions demands: $operation$operation$demands
The zarrineh
object, is a list of objects including time series and detail a five-reservoir systen in the Zarrineh-rud river basin.
list object
Iran Water Resources Management Company, 2016.