-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Grid Renewable Energy Fraction #426
base: develop
Are you sure you want to change the base?
Conversation
@@ -195,6 +200,51 @@ struct ElectricUtility | |||
cambium_emissions_region = "NA - Cambium data not used for climate emissions" # will be overwritten if Cambium is used | |||
|
|||
if !is_MPC | |||
# Initialize clean energy fraction series |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you'll want to add the off_grid_flag check here as well (same as done for the grid emissions)
EDIT: Actually, I think you can avoid doing this if you make the change suggested in "scenario.jl" below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Off-grid flag to be added to "scenario.jl"
@@ -195,6 +200,51 @@ struct ElectricUtility | |||
cambium_emissions_region = "NA - Cambium data not used for climate emissions" # will be overwritten if Cambium is used | |||
|
|||
if !is_MPC | |||
# Initialize clean energy fraction series |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Low priority, but at some point we'll probably want a check that user-provided values are between 0-1 (inclusive), and throw an error if they are not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added checks for user provided values
start_year = cambium_start_year, | ||
lifetime = cambium_levelization_years, | ||
metric_col = cambium_cef_col, | ||
grid_level = cambium_grid_level, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pypapus could you check if changing the grid_level changes the values returned for the cef_load metric?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the grid level from "enduse" to "busbar" does not change the value of the cef_load.
@@ -551,6 +551,7 @@ function run_reopt(m::JuMP.AbstractModel, p::REoptInputs; organize_pvs=true) | |||
results = reopt_results(m, p) | |||
time_elapsed = time() - tstart | |||
@info "Results processing took $(round(time_elapsed, digits=3)) seconds." | |||
@info "REopt results have been processed." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can remove this :)
src/core/scenario.jl
Outdated
@@ -154,7 +156,8 @@ function Scenario(d::Dict; flex_hvac_from_json=false) | |||
emissions_factor_series_lb_CO2_per_kwh = 0, | |||
emissions_factor_series_lb_NOx_per_kwh = 0, | |||
emissions_factor_series_lb_SO2_per_kwh = 0, | |||
emissions_factor_series_lb_PM25_per_kwh = 0 | |||
emissions_factor_series_lb_PM25_per_kwh = 0, | |||
clean_energy_fraction_series = Float64[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh! could just set this clean_energy_fraction_series
to 0 for the off-grid case, and then would not have to check for off-grid within the electric_utility.jl code
src/core/scenario.jl
Outdated
@@ -129,7 +129,8 @@ function Scenario(d::Dict; flex_hvac_from_json=false) | |||
off_grid_flag=settings.off_grid_flag, | |||
time_steps_per_hour=settings.time_steps_per_hour, | |||
analysis_years=financial.analysis_years, | |||
load_year=electric_load.year | |||
load_year=electric_load.year, | |||
clean_energy_fraction_series = Float64[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these need to be here? This is typically used to pass inputs from other Structs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected this. Thanks
src/core/bau_inputs.jl
Outdated
@@ -162,6 +162,9 @@ function BAUInputs(p::REoptInputs) | |||
heating_loads_served_by_tes = Dict{String,Array{String,1}}() | |||
unavailability = get_unavailability_by_tech(p.s, techs, p.time_steps) | |||
|
|||
# Calculate clean energy contribution (kW) | |||
calculate_clean_energy_contribution(p.s.electric_utility, p.s.electric_load) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pypapus you don't actually have to calculate a "BAU clean energy contribution". We only have to do this for emissions so that we can implement a % reduction constraint compared to the bau, but we don't have an equivalent % increase or decrease constraint for RE. So, you should be able to remove this calculation from bau_inputs
and just add any results that you want to be generated for the bau case to the bau_outputs
list
… grid electricity serving the load and charging the batteries.
…electricity serving the load and the batteries
…n_profile() into one function
TODOs:
Nice to haves:
cambium_emissions_profile()
andcambium_clean_energy_fraction_profile()
into one function that can be used for both emissions and clean energy fraction (just to reduce the amount of code)