as.catchment: Catchment with water reservoirs creation

View source: R/catchment.R

as.catchmentR Documentation

Catchment with water reservoirs creation

Description

Creates an object of system of provided wateres reservoirs organized in a catchment.

Usage

as.catchment(id, down_id, data, area, res_data, branches, main_branch,
  res_wateruse = NULL, res_properties = NULL)

Arguments

id

A catchment ID.

down_id

An ID of catchment located downwards.

data

A data frame containing time series for the catchment: dates as DTM, runoff in mm as R, optionally precipitation in mm as P, potential evapotranspiration in mm as PET and water use in mm as WU (see details how the water use is handled).

area

Whole catchment area in km2.

res_data

A data frame containing columns describing catchment reservoirs: storage means potential storage in m3, area flooded area for the storage, part is area of the reservoir catchment relative to the whole catchment area, branch_id an ID of the reservoir branch (they have to be provided in the branches argument) and id an identifier of the reservoir. Optional column part_wateruse contains parts of water use assigned to individual reservoirs (see also details).

If the catchment contains no reservoir, this is NULL.

branches

A list of individual branches with reservoirs; list names correspond to reservoir IDs. Each branch is represented by a list consisting of an ID of the downstream branch (down_id; NA for the main branch in the catchment) and a point where the branch is connected to the downstream branch (connect_to_part; not relevant for the main branch). The connection point is given as a catchment area (relative to the whole catchment area) of the downstream branch after the junction with this branch, i.e. including the area of the connecting branch.

If missing or NULL, the catchment is supposed to contain only one branch whose name is given as the main_branch argument.

main_branch

An ID of the main branch, i.e. inflow from upstream catchments goes to this branch.

res_wateruse

A list of time series of water use in m3 for individual reservoirs. The list names corresponds to reservoir IDs (for catchment outlet, use outlet). If not NULL, this overrides any water use data given in the data argument.

res_properties

A list whose keys are property names (as used in set_property) containing lists whose keys are reservoir IDs and contain corresponding values.

Details

Water use can be given directly as time series for reservoirs in m3 (as the res_wateruse argument) or for the whole catchment in mm (within the data argument). If the direct series are given, the water use in data is ignored. Water use for the whole catchment is divided to individual reservoirs (or to the outlet). By default, the division is done proportionally to the area of intercatchment belonging to the reservoir or outlet. However, the default divison can be overriden by setting the part_wateruse column of the res_data argument. Sum of the parts has to be lesser than 1, the rest to 1 represents the part for the outlet.

An error occurs if there is a branch (downstream or in res_data) which has not been provided in the branches list or if branch connecting point does not comply with catchment parts (if sum of part of the connecting branch and part of the corresponding reservoir at the downstream branch is greater than part for the connecting point).

Value

A catchment object which is also of list class.

Examples

data_catch = data.frame(DTM = seq(as.Date("1982-11-01"), length.out = 7, by = "day"), PET = rep(0.5, 7), R = rep(24 * 3.6, 7), P = rep(1, 7))
res_data = data.frame(
    storage = c(1e7, 1e7, 1e7), area = c(1e4, 1e4, 1e4), part = c(0.25, 0.25, 0.5), branch_id = c("main", "lateral", "lateral"), id = c("M1", "L1", "L2"))
branches = list(main = list(down_id = NA), lateral = list(down_id = "main", connect_to_part = 0.8))
catch = as.catchment(id = "C1", down_id = "C2", data = data_catch, area = 100, res_data = res_data, branches = branches, main_branch = "main")

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