From 0a245ade8e57b8312b7d4f6721fa2e02e29a5e51 Mon Sep 17 00:00:00 2001 From: hdunham <70401017+hdunham@users.noreply.github.com> Date: Thu, 9 Nov 2023 11:19:46 -0700 Subject: [PATCH 01/10] Don't allow min_resil_time_steps greater than max value in outage_durations --- src/core/electric_utility.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/electric_utility.jl b/src/core/electric_utility.jl index 8cf5966fb..c1940982f 100644 --- a/src/core/electric_utility.jl +++ b/src/core/electric_utility.jl @@ -156,6 +156,9 @@ struct ElectricUtility end end + if !isempty(outage_durations) && min_resil_time_steps > maximum(outage_durations) + throw(@error("Site input min_resil_time_steps cannot be greater than the maximum value in ElectricUtility input outage_durations")) + end if (!isempty(outage_start_time_steps) && isempty(outage_durations)) || (isempty(outage_start_time_steps) && !isempty(outage_durations)) throw(@error("ElectricUtility inputs outage_start_time_steps and outage_durations must both be provided to model multiple outages")) end From 63ab1feb3cb53edeeb0f436ee3d0830b2fcc9775 Mon Sep 17 00:00:00 2001 From: hdunham <70401017+hdunham@users.noreply.github.com> Date: Thu, 9 Nov 2023 11:22:44 -0700 Subject: [PATCH 02/10] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 728695ae1..af95da305 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,8 @@ Classify the change according to the following categories: ## Develop 2023-11-07 ### Fixed - Fixed AVERT emissions profiles for NOx. Were previously the same as the SO2 profiles. AVERT emissions profiles are currently generated from AVERT v3.2 https://www.epa.gov/avert/download-avert. See REopt User Manual for more information. +- Don't allow **Site** **min_resil_time_steps** input to be greater than the maximum value element in **ElectricUtility** **outage_durations** + ## v0.37.4 ### Fixed - Include `year` in creation of electric-only CHP for unavailability profile From 80e273ce6ef959e52401e3912dba980e603e7d1e Mon Sep 17 00:00:00 2001 From: adfarth Date: Mon, 27 Nov 2023 13:32:40 -0700 Subject: [PATCH 03/10] add LCC components to BAU outputs excluding offgrid results, since BAU is not run with off-grid --- src/results/results.jl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/results/results.jl b/src/results/results.jl index 298d72b8d..bd26be2c9 100644 --- a/src/results/results.jl +++ b/src/results/results.jl @@ -118,6 +118,13 @@ function combine_results(p::REoptInputs, bau::Dict, opt::Dict, bau_scenario::BAU ("Financial", "lifecycle_om_costs_after_tax"), ("Financial", "year_one_om_costs_before_tax"), ("Financial", "lifecycle_fuel_costs_after_tax"), + ("Financial", "lifecycle_generation_tech_capital_costs"), + ("Financial", "lifecycle_storage_capital_costs"), + ("Financial", "lifecycle_chp_standby_cost_after_tax"), + ("Financial", "lifecycle_elecbill_after_tax"), + ("Financial", "lifecycle_production_incentive_after_tax"), + ("Financial", "lifecycle_outage_cost"), + ("Financial", "lifecycle_MG_upgrade_and_fuel_cost"), ("ElectricTariff", "year_one_energy_cost_before_tax"), ("ElectricTariff", "year_one_demand_cost_before_tax"), ("ElectricTariff", "year_one_fixed_cost_before_tax"), From d30fc21888fe2fee6ee78f3552ef4a589d3c298e Mon Sep 17 00:00:00 2001 From: adfarth Date: Mon, 27 Nov 2023 13:35:30 -0700 Subject: [PATCH 04/10] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0aacf25ea..6c40d2c70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,10 @@ Classify the change according to the following categories: ### Deprecated ### Removed +## Develop - 2023-11-27 +### Added +- Added the following output to BAU outputs: lifecycle_generation_tech_capital_costs, lifecycle_storage_capital_costs, lifecycle_chp_standby_cost_after_tax, lifecycle_elecbill_after_tax, lifecycle_production_incentive_after_tax, lifecycle_outage_cost, lifecycle_MG_upgrade_and_fuel_cost + ## v0.38.1 ### Fixed - Fix CHP standby charge modeling - bad reference to pwf_e From eb3164cf36709ede6ffebaba52b220b73962b1ec Mon Sep 17 00:00:00 2001 From: adfarth Date: Mon, 27 Nov 2023 13:42:38 -0700 Subject: [PATCH 05/10] remove tech and storage costs from bau outputs will always be zero as REopt is currently formulated --- CHANGELOG.md | 2 +- src/results/results.jl | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c40d2c70..d5fc083c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,7 @@ Classify the change according to the following categories: ## Develop - 2023-11-27 ### Added -- Added the following output to BAU outputs: lifecycle_generation_tech_capital_costs, lifecycle_storage_capital_costs, lifecycle_chp_standby_cost_after_tax, lifecycle_elecbill_after_tax, lifecycle_production_incentive_after_tax, lifecycle_outage_cost, lifecycle_MG_upgrade_and_fuel_cost +- Added the following output to BAU outputs: lifecycle_chp_standby_cost_after_tax, lifecycle_elecbill_after_tax, lifecycle_production_incentive_after_tax, lifecycle_outage_cost, lifecycle_MG_upgrade_and_fuel_cost ## v0.38.1 ### Fixed diff --git a/src/results/results.jl b/src/results/results.jl index bd26be2c9..519dfaed0 100644 --- a/src/results/results.jl +++ b/src/results/results.jl @@ -118,8 +118,6 @@ function combine_results(p::REoptInputs, bau::Dict, opt::Dict, bau_scenario::BAU ("Financial", "lifecycle_om_costs_after_tax"), ("Financial", "year_one_om_costs_before_tax"), ("Financial", "lifecycle_fuel_costs_after_tax"), - ("Financial", "lifecycle_generation_tech_capital_costs"), - ("Financial", "lifecycle_storage_capital_costs"), ("Financial", "lifecycle_chp_standby_cost_after_tax"), ("Financial", "lifecycle_elecbill_after_tax"), ("Financial", "lifecycle_production_incentive_after_tax"), From c173a58f72d798ccf8055d00e57975e0c9e8daf7 Mon Sep 17 00:00:00 2001 From: hdunham <70401017+hdunham@users.noreply.github.com> Date: Tue, 28 Nov 2023 10:45:22 -0800 Subject: [PATCH 06/10] pass min_resil_time_steps into ElectricUtility constructor --- src/core/electric_utility.jl | 1 + src/core/scenario.jl | 1 + 2 files changed, 2 insertions(+) diff --git a/src/core/electric_utility.jl b/src/core/electric_utility.jl index c1940982f..0e6801137 100644 --- a/src/core/electric_utility.jl +++ b/src/core/electric_utility.jl @@ -105,6 +105,7 @@ struct ElectricUtility # fields from other models needed for validation CO2_emissions_reduction_min_fraction::Union{Real, Nothing} = nothing, # passed from Site CO2_emissions_reduction_max_fraction::Union{Real, Nothing} = nothing, # passed from Site + min_resil_time_steps::Int=0, # passed from Site include_climate_in_objective::Bool = false, # passed from Settings include_health_in_objective::Bool = false # passed from Settings ) diff --git a/src/core/scenario.jl b/src/core/scenario.jl index c2ac57688..17c0011e7 100644 --- a/src/core/scenario.jl +++ b/src/core/scenario.jl @@ -112,6 +112,7 @@ function Scenario(d::Dict; flex_hvac_from_json=false) latitude=site.latitude, longitude=site.longitude, CO2_emissions_reduction_min_fraction=site.CO2_emissions_reduction_min_fraction, CO2_emissions_reduction_max_fraction=site.CO2_emissions_reduction_max_fraction, + min_resil_time_steps=site.min_resil_time_steps, include_climate_in_objective=settings.include_climate_in_objective, include_health_in_objective=settings.include_health_in_objective, off_grid_flag=settings.off_grid_flag, From efe2ec8ce45628bfba7b776cf7d51628a6678b9c Mon Sep 17 00:00:00 2001 From: adfarth Date: Wed, 29 Nov 2023 08:59:43 -0700 Subject: [PATCH 07/10] more help text for multiple outage modeling --- src/core/electric_utility.jl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/core/electric_utility.jl b/src/core/electric_utility.jl index 0e6801137..62b89c4f9 100644 --- a/src/core/electric_utility.jl +++ b/src/core/electric_utility.jl @@ -25,12 +25,24 @@ ``` !!! note "Outage modeling" + # Indexing Outage indexing begins at 1 (not 0) and the outage is inclusive of the outage end time step. For instance, to model a 3-hour outage from 12AM to 3AM on Jan 1, outage_start_time_step = 1 and outage_end_time_step = 3. To model a 1-hour outage from 6AM to 7AM on Jan 1, outage_start_time_step = 7 and outage_end_time_step = 7. + # Can only use singular or multiple outage modeling inputs, not both Cannot supply singular outage_start(or end)_time_step and multiple outage_start_time_steps. Must use one or the other. + # Using min_resil_time_steps to ensure critical load is met + With multiple outage modeling, the model will choose to meet the critical loads only if the expected outage cost (see `Financial | value_of_lost_load_per_kwh`) + is greater than the microgrid upgrade cost (see `Financial | microgrid_upgrade_cost_fraction`). If you wish to ensure that REopt recommends a system that can meet + critical loads during a defined outage period, specify this duration under `Site | min_resil_time_steps` + + # Multiple outage costs will be included in NPV and LCC + Note that when using multiple outage modeling, the expected outage cost will be included in the net present value and lifecycle cost calculations (for both the BAU and optimized case). + You can set `Financial | value_of_lost_load_per_kwh` to 0 to ignore these costs. However, doing so will remove incentive for the model to meet critical loads during outages, + and you should therefore consider also specifying `Site | min_resil_time_steps`. You can alternatively post-process results to remove `lifecycle_outage_cost` from the NPV and LCCs. + !!! note "Outages, Emissions, and Renewable Energy Calculations" If a single deterministic outage is modeled using outage_start_time_step and outage_end_time_step, emissions and renewable energy percentage calculations and constraints will factor in this outage. From 95d442442a7e996f3c85daa868e4f104610efa60 Mon Sep 17 00:00:00 2001 From: hdunham <70401017+hdunham@users.noreply.github.com> Date: Wed, 29 Nov 2023 11:09:51 -0800 Subject: [PATCH 08/10] update ElectricUtility docstring --- src/core/electric_utility.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/electric_utility.jl b/src/core/electric_utility.jl index 62b89c4f9..f077d935a 100644 --- a/src/core/electric_utility.jl +++ b/src/core/electric_utility.jl @@ -30,15 +30,15 @@ For instance, to model a 3-hour outage from 12AM to 3AM on Jan 1, outage_start_time_step = 1 and outage_end_time_step = 3. To model a 1-hour outage from 6AM to 7AM on Jan 1, outage_start_time_step = 7 and outage_end_time_step = 7. - # Can only use singular or multiple outage modeling inputs, not both + # Can use either singular or multiple outage modeling inputs, not both Cannot supply singular outage_start(or end)_time_step and multiple outage_start_time_steps. Must use one or the other. # Using min_resil_time_steps to ensure critical load is met - With multiple outage modeling, the model will choose to meet the critical loads only if the expected outage cost (see `Financial | value_of_lost_load_per_kwh`) - is greater than the microgrid upgrade cost (see `Financial | microgrid_upgrade_cost_fraction`). If you wish to ensure that REopt recommends a system that can meet - critical loads during a defined outage period, specify this duration under `Site | min_resil_time_steps` + With multiple outage modeling, the model will choose to meet the critical loads only as cost-optimal. This trade-off depends on cost of not meeting load (see `Financial | value_of_lost_load_per_kwh`) + and the costs of meeting load, such as microgrid upgrade cost (see `Financial | microgrid_upgrade_cost_fraction`), fuel costs, and additional DER capacity. To ensure that REopt recommends a system that can meet + critical loads during a defined outage period, specify this duration using `Site | min_resil_time_steps`. - # Multiple outage costs will be included in NPV and LCC + # Outage costs will be included in NPV and LCC Note that when using multiple outage modeling, the expected outage cost will be included in the net present value and lifecycle cost calculations (for both the BAU and optimized case). You can set `Financial | value_of_lost_load_per_kwh` to 0 to ignore these costs. However, doing so will remove incentive for the model to meet critical loads during outages, and you should therefore consider also specifying `Site | min_resil_time_steps`. You can alternatively post-process results to remove `lifecycle_outage_cost` from the NPV and LCCs. From cffcd1dfb77d586235baa0bc217dd17313f8d72b Mon Sep 17 00:00:00 2001 From: adfarth Date: Fri, 1 Dec 2023 09:08:19 -0700 Subject: [PATCH 09/10] changelog and project.toml --- CHANGELOG.md | 4 +--- Project.toml | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 469d59801..9c6202a1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,11 +23,9 @@ Classify the change according to the following categories: ### Deprecated ### Removed -## Develop - 2023-11-27 +## v0.38.2 ### Added - Added the following output to BAU outputs: lifecycle_chp_standby_cost_after_tax, lifecycle_elecbill_after_tax, lifecycle_production_incentive_after_tax, lifecycle_outage_cost, lifecycle_MG_upgrade_and_fuel_cost - -## Develop ### Fixed - Don't allow **Site** **min_resil_time_steps** input to be greater than the maximum value element in **ElectricUtility** **outage_durations** diff --git a/Project.toml b/Project.toml index 7bb0b48b6..7b1585d82 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "REopt" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" authors = ["Nick Laws", "Hallie Dunham ", "Bill Becker ", "Bhavesh Rathod ", "Alex Zolan ", "Amanda Farthing "] -version = "0.38.1" +version = "0.38.2" [deps] ArchGDAL = "c9ce4bd3-c3d5-55b8-8973-c0e20141b8c3" From e1c37e26c3161931e7cad620ce228bf614c889ac Mon Sep 17 00:00:00 2001 From: adfarth Date: Fri, 1 Dec 2023 09:18:40 -0700 Subject: [PATCH 10/10] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c6202a1c..fb9d842be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,7 @@ Classify the change according to the following categories: ## v0.38.2 ### Added -- Added the following output to BAU outputs: lifecycle_chp_standby_cost_after_tax, lifecycle_elecbill_after_tax, lifecycle_production_incentive_after_tax, lifecycle_outage_cost, lifecycle_MG_upgrade_and_fuel_cost +- Added the following BAU outputs: lifecycle_chp_standby_cost_after_tax, lifecycle_elecbill_after_tax, lifecycle_production_incentive_after_tax, lifecycle_outage_cost, lifecycle_MG_upgrade_and_fuel_cost ### Fixed - Don't allow **Site** **min_resil_time_steps** input to be greater than the maximum value element in **ElectricUtility** **outage_durations**