calc_system.wateres_system: Calculation of system of reservoirs

View source: R/system.R

calc_systemR Documentation

Calculation of system of reservoirs

Description

Calculates time series of variables for reservoirs organized in a system. Four types of calculation are available, depending on whether inflows from upstream reservoirs and water transfer between reservoirs are considered.

Usage

calc_system(system, yields, initial_storages, types, yields_intercatch,
  get_routing_output)

## S3 method for class 'wateres_system'
calc_system(system, yields = NULL,
  initial_storages, types = c("single_plain", "system_plain"),
  yields_intercatch = FALSE, get_routing_output = FALSE)

Arguments

system

A wateres_system object.

yields

A vector of required fixed yield values in m3.s-1, its names have to correspond with the names of the reservoirs in the system. If values for some reservoirs are not provided, they are taken from the storage property of that reservoirs (if the property is available).

initial_storages

A vector of initial reservoir storages in m3 whose names correspond to the reservoirs names. If missing or NULL, value for each reservoir is obtained from the “storage_initial” property of reservoir; if that property is not available, the reservoir is considered to be full initially.

types

A vector of types of calculation whose valid values are “single_plain”, “system_plain”, “single_transfer” and “system_transfer” (see details).

yields_intercatch

Whether the vector of yields consists of values for intercatchment, i.e. whether total yields will be calculated as a sum of yields from upstream reservoirs.

get_routing_output

Whether routing output for each reservoir will be provided as the routing attribute of their results (only for the “system_plain” type).

Details

The types of calculation selected as the types argument are as follows:

  • single_plain - reservoirs are calculated independently of the system.

  • single_transfer - as above, and water transfer is added to decrease deficit volumes; a fictional scenario for testing purposes.

  • system_plain - reservoirs are calculated within the system, i.e. reservoir inflow consists of yield of corresponding upstream reservoirs and runoff from the intercatchment (derived from the original inflow series to reservoirs or given by the “QI” column when creating a reservoir by the as.wateres function).

  • system_transfer - as above, and water transfer is added.

The water transfer (redistribution) is carried out independently for the time steps when deficit in any of the reservoirs occurs. Future time steps are not considered, i.e. it is possible that deficit decrease in a time step will cause deficit increase in the next time step.

For a given time step, the following algorithm is applied:

For each reservoir, the maximum water volume available to be transferred is determined (starting from top reservoirs and continuing with reservoirs whose upper reservoirs have been already processed).

  • If sum of current reservoir storage and potential transfer is greater than zero, this sum is equal to the potential transfer from the current reservoir to the reservoir downwards.

  • Otherwise, there is a deficit which can be satisfied by the potential transfer from upper reservoirs; then the exceeding water is equal to the potential transfer to the reservoir downwards.

Finally, volume resulting from all potential transfers is collected in the bottom reservoir. If it is greater than the bottom reservoir deficit, the exceeding part is redistributed back to the corresponding source reservoirs. The only criterion of the redistribution is volume of the transfer, distance between reservoirs is not taken into account. (The same redistribution method is applied when information about source reservoir is determined – this happens if there is a potential transfer from another reservoir than bottom whose deficit is zero or has been completely satisfied.)

If provided in the reservoir object in the system, the time series of water balance variables are included the same way as in the calc_series function. Other arguments of this function are set to their default values.

The system structure is checked by the check function before the calculation starts.

Value

A list consisting of items corresponding with the values of the types argument. Each of the items is a list of the wateres_series objects for individual reservoirs. The object contains the water balance variables returned by the calc_series functions. Moreover, transfer variable is added for the system results if has non-zero value at least in one time step.

If the yields are given as yields_intercatch, the list contains also the yields item with total yields calculated for the reservoirs.

See Also

calc_series for calculating individual reservoirs

Examples

period = seq(as.Date("2000-01-01"), by = "months", length.out = 24)
riv_data = data.frame(
    Q =  c(0.111, 0.339, 0.723, 0.165, 0.14, 0.088, 0.098, 0.052, 0.034, 0.022, 0.152, 0.162,
        0.156, 0.19, 0.259, 0.142, 0.075, 0.054, 0.118, 0.119, 0.267, 0.105, 0.194, 0.126),
    DTM = period)
riv = as.wateres(riv_data, 14.4e6, 754e3, id = "riv", down_id = "thar")
thar_data = data.frame(
    Q =  c(9.275, 32.586, 64.53, 16.702, 12.749, 9.646, 6.748, 6.645, 4.018, 3.523, 3.118, 4.009,
        7.137, 20.377, 47.467, 15.501, 8.199, 7.014, 7.086, 6.769, 9.038, 4.859, 12.006, 22.218),
    DTM = period)
thar = as.wateres(thar_data, 41.3e6, 2672e3, id = "thar")
sys = as.system(riv, thar)
resul = calc_system(sys, c(riv = 0.14, thar = 8))

tgmwri/wateres documentation built on Feb. 13, 2024, 10:25 p.m.