Challenge

FINAL INDEPENDENT PROJECT

Simulation of water reservoir system

Objective:

  • The objective of Water Reservoir Simulation is to calculate all the important variables which affect the performance of the water reservoir system.

While simulating this system, the following assumptions are made:

  • Simulation is done for 90 consecutive months.
  • Water received through direct Rain Fall is assumed to be not more than 30% of the capacity of the reservoir. iii. Maximum water received through River Inflow is not more than 130% of the capacity of the reservoir.
  • Seepage loss is not more than 5%. v. Evaporation loss is not more than 8%.
  • The water demand is never more than the Capacity of the Reservoir.
  • Print the variables (VI, VPM, GV, SL, EL, TL, VNET, DEMAND, SHORTAGE, SPILL, MONTHS) in the command window.
  • Plot the graph between:
  • Plot the graph of the variations in Net Volume and Demand over the months.
  • Plot the graph of the variations in Shortage and Spill over the months.
  • Plot the graph of the variations in Total Loss and Gross Volume over the

Theory:

  • The increasing water demand for economic development, on the one hand, and the necessity of environmental control including water control, on the other, makes the problem of water management one of the most urgent tasks today. To solve this problem, it is essential to develop large-scale water resources systems. The term "water resource systems" comprises water sources, means of their control, and transportation to water users. Though the water resource system has many common features with all large-scale national economic systems, they differ from them to some extent due to a number of peculiarities. One of them, variability of river runoff, causes the stochastic character of process connected with the selection of parameters of water resources systems and their operational rules. Water consumption is also stochastic.
  • This is determined by fluctuations of peculiarities, the process of soil formation.
  • Moreover, other unknown or uncertain factors of a technical and economic character may also be of considerable importance. Therefore, to solve the problem of water supply to the national economy, one must analyze the problem of coordination between stochastic water resources and the demand in them.
  • Reservoir simulation is a widely used tool for making decisions on the development of new fields, the location of infill wells, and the implementation of enhanced recovery projects. It is the focal point of an integrated effort of geosciences, petrophysics, reservoir, production and facilities engineering, computer science, and economics.
  • Storage is necessary to regulate highly variable water flows. Reservoir for more constant uses such as municipal and industrial water supply, irrigation, hydroelectric power generation, and navigation.
  • Typically, the water drawn from a reservoir is used at a much slower (and constant) rate than the rate and consistency of the water flowing into the reservoir
  • Reservoir modeling has typically been employed to help size reservoir storage capacities, establishing operating policies, evaluating operating plans, administering water allocations, developing management strategies, and real-time operations.
  • The term "Reservoir System Operations" refers to the practice of maintaining and managing a reservoir for multiple purposes, under dynamic conditions.
  • The word "system" is used because of the complexity inherent in the operations of a typical reservoir or network of reservoirs.
  • The state of the reservoir system is constantly in flux,requiring dynamic methods of simulation to evaluate and model them.
  • The term "Reservoir System Operations Model” refers to a computer program used for simulating and optimizing changes in storage, water deliveries, and flood control for one or multiple reservoirs.
  • Oftentimes, the objective of the reservoir operation is to balance the control of flood storage and maintain a reliable water supply.
  • Operational procedures are different for flood events than what is employed under water-scarce conditions and therefore, the model must be adapted for these changing conditions.
  • To better manage potential changes to reservoir operations given uncertainties or changes in circumstances, it is helpful to develop a calibrated simulation model of the reservoir.

Single pool operations

  • The main purpose of a reservoir is to control a determined amount of water during some period of time. The amounts that are controlled depend on the properties of the reservoir system, which include components such as the dam, spillway, inflow facility, and outlet works. Figure 2 depicts a simple example of a basic reservoir system. Inflow to a reservoir is typically uncontrolled if the reservoir is on the river. Some dams are built off-stream and water is delivered to the reservoir in a controlled manner. Usually, the controls on inflows to the reservoir are a function of the water level in the reservoir.

Simple Reservoir Diagram

  • As the reservoir begins to approach an upper limit, the flow into the reservoir is turned off if the inflows are able to be controlled. For reservoirs that are located on a stream, the inflows cannot be controlled so the reservoir must operate a flood control system that usually includes an outlet works and an uncontrolled spillway. When the outlet works are not able to discharge enough water to lower the reservoir level, then the water will rise above the spillway and water will discharge over the spillway at a flow rate that is dependent on the height of water above the spillway.
  • Often times the reservoir system operations need to be simulated in a computer model. Typically, a reservoir model must include the major parts of the reservoir system in order to evaluate the reservoir system operations. The fundamental aspect of reservoir modeling is the routing of water. This is done in various ways, depending on the situation and modeling requirements. All routing methods are based on the continuity of volume.

Abbreviation and Terms used:

  • M= Months
  • C= Capacity RF Rainfall
  • RI-River Inflow
  • VI Volume Inflow
  • VPM= Volume of Previous Month
  • GV= Gross Volume
  • SL= Seepage Loss
  • EL- Evaporative Loss
  • TL= Total Loss
  • V_NET= Net Volume
  • Demand
  • Shortage
  • Spill

Program code :

clear all
close all
clc

% The initial value of VPM is assumed 0;
VPM(1) = 0 ;
% Simulation run (in months)
M = 90 ;

C=input('Enter the capacity of reservior(in Million Cubic Feet): '); % To request user input

% To make header of the output data

Header1=('n Months Volume Inflow Volume of Gross Volume Seepage Loss Evap. Loss Total Loss Net Volume Demand Shortage Spill n');

Header2=(' Prev. Month n');

% To print header in output

fprintf(Header1)

fprintf(Header2)

warning('off')

%To ignore this warning: Ignoring extra legend entries.

% Loop and Conditions

for i =2:M+1

Months(i)=i-1 ;
r1=rand;% To generate random number-1 for rainfall


r2=rand;% To generate random number-2 for river inflow


r3=rand;% To generate random number-3 for demand


% Condition for rainfall
RF(i)=r1*C*0.3;

% Condition for river inflow
RI(i)=r2*C*1.3;

% Condition for volume inflow
VI(i)=RF(i)+RI(i);

% Condition for gross volume of water
GV(i)=VI(i)+VPM(i-1) ;

% Condition for seepage loss
SL(i)= GV(i)*0.05;

% Condition for evaporative loss
EL(i)=GV(i)*0.08;

TL(i)=SL(i)+EL(i);% Condition for total loss of water from reservoir

V_Net(i)=GV(i)-TL(i);% Net volume

Demand(i)= r3*C ;% Demand of water by consumers

if Demand(i) > V_Net(i)

Shortage(i)= Demand(i)-V_Net(i);
VPM (i)=0 ;
Spill(i)= 0 ;

else

Difference(i)= V_Net(i)-Demand (i);

if Difference (i) > C

Spill(i)= Difference(i)-C;
VPM(i)=C;

Shortage (i) = 0 ;

else

VPM(i)= Difference(i);

Spill(i) = 0;

Shortage (i) = 0 ;

end

end

% End of the conditions

% To print all the data in output

fprintf('%d',Months (i))

fprintf(' %80.2f',VI(i))

fprintf(' %80.2f',VPM(i))

fprintf(' %80.2f',GV(i))

fprintf(' %80.2f',SL(i))

fprintf(' %80.2f',EL(i))

fprintf(' %80.2f',TL(i))

fprintf(' %80.2f',V_Net (i))

fprintf(' %80.2f',Demand (i))

fprintf(' %80.2f',Shortage(i))
fprintf(' %80.2f n', Spill(i))

%Plotting Figures
% Create figure window-1
figure (1)

plot(Months,Demand,'color','k','marker','o')% To plot demand graph vs month

plot(Months, V_Net, 'color', 'b', 'marker', 's')% To plot net volume graph vs month
% To retains plots in the current axes

hold on

xlabel('Months')% Labelling x-axis

ylabel('Water Quantity (mcft)')% Labelling y-axis

title('Variation in Demand and Net Volume of Reservoir')

figure

legend('Net Volume', 'Demand')% Add legend to axes

grid on% To show the grids in plot

figure (2)% Create figure window-2

plot(Months, Spill, 'color', 'g', 'marker', 'o')% To plot spill graph vs month

plot(Months, Shortage, 'color', 'r', 'marker', 's') % To plot shortage graph vs month

hold on % To retains plots in the current axes

xlabel('Months')% Labelling x-axis

ylabel('Water Quantity (mcft)')% Labelling y-axis

title('Variation in Shortage and Spill of Reservoir')% To specify title of the figure

legend('Shortage', 'Spill')% Add legend to axes

grid on% To show the grids in plot
% Create figure window-3
figure(3)

plot (Months, TL, 'color', 'b', 'marker', 'o')% To plot total loss graph vs month

plot (Months, GV, 'color', 'm', 'marker', 's')% To plot gross volume graph vs month

hold on% To retains plots in the current axes

xlabel('Months')% Labelling x-axis

ylabel('Water Quantity (mcft)')% Labelling y-axis

title('Variation in Gross Volume and Total Loss of Reservoir') % To specify title of the fig

legend('Gross Volume', 'Total Loss')% Add legend to axes

grid on% To show the grids in plot

end %

Code Explanation:

  • Firstly, clear all, close all, and clc commands were used to clear the workspace, close all the current open windows, and clean the command window, respectively.
  • The initial value of VPM was assumed to zero [VPM(1)=O].
  • The total month of simulation run is stored in variable "M" and after that input, the syntax is written to take the input of capacity of the reservoir.
  • Print the header of the data.
  • Now, a syntax is written to ignore the warning.
  • Now from here, our loop starts. The loop will run from 2 to M+1. where "M" is months (simulation run). The value of M is already provided at the starting of the program.
  • After that, the value of "i" is stored in the variable "Months(i)".
  • Now three random numbers are generated. These random numbers will be generated between 0 and 1 for every iteration run. These random numbers will be different in each iteration.
  • Rainfall, River inflow, and Volume inflow are calculated. According to conditions, the amount of rainfall cannot be higher than 30% of the capacity of the reservoir and the water received from the river inflow cannot be more than 130% of the capacity of the reservoir. As we know that the amount of water received from rainfall and river inflow is random. So here I used random numbers for both cases. The random number is multiplied with the capacity of the reservoir and after that, I calculate their 30% (rainfall) and 130% (river inflow) to get value Rainfall= random No. * Capacity of River Inflow= random No. * Capacity of
  • After that, I sum up both rainfall and river inflow amounts to calculate volume inflow. Volume Inflow= Rainfall + River Inflow
  • After next, to calculate the gross volume I have to add the volume inflow and the reservoir volume of the previous month. By adding these two we will get the gross volume of water. Initially, it was considered that the VPM for the first iteration is zero. Gross Volume= Volume inflow + Volume of water in the previous month
  • Now it's time to consider the water loss. Here I have taken two parameters in water loss i.e. Seepage Loss and Evaporative Loss. As per condition, I have assumed that seepage loss will be 5% of gross volume and evaporative loss will be 8% of gross volume. This will be the maximum amount of water loss from both. Seepage Loss Gross volume * 0.05 Evaporative Loss- Gross volume * 0.08
  • By adding seepage and evaporative loss be will get the value of the total loss of water from the reservoir. Total Loss Seepage loss + Evaporative Loss
  • At final, the net volume of water will be:Net Volume= Gross volume - Total loss
  • After that, by using random number 3 (r3) we will calculate the demand of water from the reservoir Demand is also a random factor that why the r number is used here
  • After that, by using random number 3 (r3) we will calculate the demand of water from the reservoir. Demand is also a random factor that why the random number is used here. Demand= Random No. * Capacity of reservoir
  • If the demand of water is more than the net volume, then there will be a shortage of water. If there is a shortage, then the water for next month (VPM) will be O and the spill will be also zero.ifDemand > Net Volume then Shortage= Demand - Net Volume VPM = 0 Spill = 0
  • If the above statement is not true or say if demand is lower than the net volume then we have to calculate the difference between them. Difference Net Volume - Demand
  • If the difference is lower than the capacity, which means we have extra water. That extra water needs to be spill because we can't store them. Now we will follow these statements: if Difference > Capacity of Reservoir then Spill = Difference - Capacity of Reservoir Shortage=0
  • At this point, our loop and all conditions were ended. Here I plot three figures: After that will we print all the variables in the output.
  • Now we will plot the graphs of variations in variables.
  • Graph of the variations in Net Volume and Demand over the months.
  • Graph of the variations in Shortage and Spill over the months.
  • Graph of the variations in Total Loss and Gross Volume over the months.
  • After plotting the graphs, I provided the labeling, title, and legends for all three plots.
  • Now the program is ended.

Result :

Command window in put:

Enter the capacity of reservior(in Million Cubic Feet): 5000

Plots :

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.