knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

capratTX

Travis build status DOI

The goal of capratTX is to simulate water storage reservoirs providing cooling water to thermal power plants in the ERCOT.

Contact

Data requirements

You must download the ERCOT Reservoir Watershed Delineations and Inflow Scenarios data files to run this software.

Installation

You can install the development version of capratTX using devtools:

library(devtools)
install_github("pnnl/capratTX")

Usage

Start by loading the library and setting the data path:

library(capratTX)
data_path <- "your_directory/ERCOT Reservoir Watershed Delineations and Inflow Scenarios/"
data_path <- "../../WECC-ERCOT/ERCOT/data/ERCOT Reservoir Watershed Delineations and Inflow Scenarios/"

Calibrate reservoirs and save a parameter file (calibration may take a minute or two reservoir operating functions are optimized):

calibrate_all_reservoirs(data_path) -> calibrated_parameters
head(calibrated_parameters)
readr::write_csv(calibrated_parameters, "params.csv")

To simulate all dams with the calibrated rules under a given period ("baseline" or "future"):

simulate_gcm_inflows_all_dams(data_path, period = "future",
                              params_path = "params.csv") -> sim_data
head(sim_data)

Plot storage projections for a particular reservoir:

library(ggplot2)
library(dplyr)

sim_data %>% 
  # select reservoir desired
  filter(reservoir == "Travis") %>% 
  # get annual minimums
  group_by(reservoir, gcm, year) %>% 
  summarise(s_min = min(s_sim)) %>% 
  ungroup() %>% 
  ggplot(aes(year, s_min, col = gcm)) +
  geom_line() +
  labs(y = "Minimum storage level (MCM)", x = NULL)


pnnl/capratTX documentation built on Dec. 9, 2020, 2:30 a.m.