Skip to content
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

Draft
wants to merge 19 commits into
base: develop
Choose a base branch
from
Draft

Add Grid Renewable Energy Fraction #426

wants to merge 19 commits into from

Conversation

adfarth
Copy link
Collaborator

@adfarth adfarth commented Jul 26, 2024

TODOs:

  • Add a testset in runtests.jl that tests several scenarios against expected total RE fractions, and tests edge cases (ideas: with and without existing PV, with no credit for RE exports vs. with, with vs. without battery)

Nice to haves:

  • Combine cambium_emissions_profile() and cambium_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)

@adfarth adfarth self-assigned this Jul 26, 2024
.gitignore Outdated Show resolved Hide resolved
@@ -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
Copy link
Collaborator Author

@adfarth adfarth Aug 2, 2024

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

Copy link
Collaborator

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
Copy link
Collaborator Author

@adfarth adfarth Aug 2, 2024

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

Copy link
Collaborator

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,
Copy link
Collaborator Author

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?

Copy link
Collaborator

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."
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can remove this :)

@@ -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[]
Copy link
Collaborator Author

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

@@ -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[]
Copy link
Collaborator Author

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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected this. Thanks

@@ -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)
Copy link
Collaborator Author

@adfarth adfarth Aug 2, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants