-
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
Cambium Grid Climate Emissions and Updated AVERT #235
Conversation
using Cambium instead of AVERT for CO2 emissions by default
Based on Cambium 2022 Mid-Case Scenario, LRMER CO2e (Combustion+Precombustion) 2024-2049 values
no longer an output under Site
under ElectricUtility
end use or busbar
This will prevent a Cambium API call with each unit test
For tests: - changed "region_abbreviation" to "avert_region_abbreviation" - Updated RE and Emissions expected values to account for alignment between load year and emissions year (tested with assumed AVERT emissions year of 2017 to ensure that this is why the emissions values changed) - Added 0 grid emissions to scenario.jl when off_grid_flag is true
should help with test stability
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.
Thanks for this @adfarth! I've trued a few different locations including slightly-offshore locations within 5 miles of an AVERT region and things generally look good. I have one clarifying question and a few comments throughout which I tried to directly address. Assuming tests past and you agree with the edits, this is ok to merge.
"emissions_factor_lb_CO2_per_mmbtu" => Dict( | ||
"natural_gas"=>116.9, | ||
"landfill_bio_gas"=>114.8, | ||
"propane"=>138.6, | ||
"diesel_oil"=>163.1 | ||
"natural_gas"=>117.03, | ||
"landfill_bio_gas"=>115.38, | ||
"propane"=>139.16, | ||
"diesel_oil"=>163.61 |
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.
These numbers match the PR description but regarding the migration to CO2-equivalent emissions: the costs in the objective function for NOx here is health-related only like the two non-GHG pollutants (SO2 and PM25), is that correct? That would ensure we aren't double-counting if NOx is included in the CO2e calculation as it's an indirect GHG.
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.
@zolanaj Yes, the NOx cost equation only accounts for health-related costs that are a direct result of the emissions (rather than health outcomes from climate change).
However, isn't CO2e a combination of CO2, CH4, and N2O (which is not a subset of NOx emissions?)?
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.
@adfarth Yes, that matches my understanding of CO2e calculation too. I think the net-positive global warming impact is NOx triggering reactions in the atmosphere to make ozone at certain concentrations, and only molecules that directly trap heat are considered in the CO2e calculation. Sounds like we are on the same page here, thanks for confirming!
"natural_gas"=>117.03, | ||
"landfill_bio_gas"=>115.38, | ||
"propane"=>139.16, | ||
"diesel_oil"=>163.61 | ||
), |
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.
The other potentially obnoxious comment: is it worth changing CO2
to CO2e
in the expressions and results?
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.
As discussed we will bring this up in our next dev meeting. Will involve a breaking change to inputs and outputs
@@ -21,7 +21,8 @@ export | |||
get_steam_turbine_defaults_size_class, | |||
simulated_load, | |||
get_absorption_chiller_defaults, | |||
emissions_profiles, | |||
avert_emissions_profiles, |
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.
Just a note that this change should be added to the Changelog entry
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 in ab3ae64
r["avert_emissions_region"] = p.s.electric_utility.avert_emissions_region | ||
r["distance_to_avert_emissions_region_meters"] = p.s.electric_utility.distance_to_avert_emissions_region_meters |
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.
Add these naming changes changes to the changelog entry as well.
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.
@zolanaj The change to avert_emissions_region
and distance_to_avert_emissions_region_meters
are already in there, and the mention of the change in calculation to the annual_...
outputs are as well. Did I miss something else?
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.
Nope, these are good! I edited the changelog for some of these comments and neglected to mention that in the commits I pushed, thanks for filling in blanks!
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 thank you!
src/core/electric_utility.jl
Outdated
emissions_factor_NOx_decrease_fraction::Real = 0.02163, | ||
emissions_factor_SO2_decrease_fraction::Real = 0.02163, | ||
emissions_factor_PM25_decrease_fraction::Real = 0.02163, | ||
) |
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.
Since this is an assumption used elsewhere in the code and in testing, and is likely to be updated as often as yearly, I'll recommend we add this as a dictionary in the defaults the way we do for FUEL_DEFAULTS
(same for CO2e above
@test scen.electric_utility.cambium_emissions_region == "RMPAc" | ||
@test sum(scen.electric_utility.emissions_factor_series_lb_CO2_per_kwh) / 8760 ≈ 0.394608 rtol=1e-3 | ||
@test scen.electric_utility.emissions_factor_series_lb_CO2_per_kwh[1] ≈ 0.677942 rtol=1e-4 # Should start on Friday | ||
@test scen.electric_utility.emissions_factor_series_lb_CO2_per_kwh[8760] ≈ 0.6598207198 rtol=1e-5 # Should end on Friday | ||
@test sum(scen.electric_utility.emissions_factor_series_lb_SO2_per_kwh) / 8760 ≈ 0.00061165 rtol=1e-5 # check avg from AVERT data for RM region |
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'm adding a few additional tests here and in the non-CONUS locations for things like the avert and cambium region ID's returned. Will the values here change with future defaults, or can we keep legacy files and refer to them in older model years? I ask only because I wonder if these test values will change if we refresh AVERT numbers.
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.
@zolanaj Thank you for adding tests!
Yes, with this setup many of the test values will change with future updates to default values, for either changes in the Cambium data or AVERT data. I probably should set these tests up to not do that, but may punt on that unless you think it's high priority for this PR!
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.
@adfarth Punt away! The new tests are for things like region detection which should be (more) stable, and I didn't see an easy way of pulling the test value from the data files so I punted on that myself in the review.
@@ -1519,7 +1560,7 @@ end | |||
@test results["HotThermalStorage"]["size_gal"] ≈ 50000 atol=1e1 | |||
@test results["ColdThermalStorage"]["size_gal"] ≈ 30000 atol=1e1 | |||
yr1_nat_gas_mmbtu = results["ExistingBoiler"]["annual_fuel_consumption_mmbtu"] + results["CHP"]["annual_fuel_consumption_mmbtu"] | |||
nat_gas_emissions_lb_per_mmbtu = Dict("CO2"=>116.9, "NOx"=>0.09139, "SO2"=>0.000578592, "PM25"=>0.007328833) | |||
nat_gas_emissions_lb_per_mmbtu = Dict("CO2"=>117.03, "NOx"=>0.09139, "SO2"=>0.000578592, "PM25"=>0.007328833) | |||
TONNE_PER_LB = 1/2204.62 | |||
@test results["Site"]["annual_emissions_from_fuelburn_tonnes_CO2"] ≈ nat_gas_emissions_lb_per_mmbtu["CO2"] * yr1_nat_gas_mmbtu * TONNE_PER_LB atol=1 | |||
@test results["Site"]["annual_emissions_from_fuelburn_tonnes_NOx"] ≈ nat_gas_emissions_lb_per_mmbtu["NOx"] * yr1_nat_gas_mmbtu * TONNE_PER_LB atol=1e-2 |
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.
just a note that we'll need to refresh these tests in runtests.jl
once they are moved back into the GitHub actions (after indicator constraints are worked around for solvers that cannot handle them). I'll add a TODO in runtests.jl
for this.
@@ -96,6 +97,12 @@ const FUEL_DEFAULTS = Dict( | |||
"diesel_oil"=>0.0 | |||
) | |||
) | |||
const EMISSIONS_DECREASE_DEFAULTS = Dict( |
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.
Thanks for adding this!
Cambium Grid Climate Emissions and Updated AVERT
Changed
src/core/electric_utility.jl
. Include option for user to use AVERT data for CO2 using co2_from_avert boolian.electric_utility
emissions_region to avert_emissions_region and distance_to_emissions_region_meters to distance_to_avert_emissions_region_meters.emissions_factor_XXX_decrease_fraction
(where XXX is CO2, NOx, SO2, and PM2.5) from 0.01174 to 0.02163 based on Cambium 2022 Mid-Case scenario, LRMER CO2e (Combustion+Precombustion) 2024-2049 projected values. CO2 projected decrease defaults to 0 if Cambium data are used for CO2 (Cambium API call will levelize values).data/emissions/AVERT_Data
. For Alaska and Hawaii (regions AKGD, HIMS, HIOA), updated eGRID data to eGRID2021 datafile and adjusted CO2 values to CO2e values to align with default used for Cambium data.src/core/generator.jl
, updated emissions_factor_lb_CO2_per_gal from 22.51 to 22.58. Insrc/REopt.jl
updated emissions_factor_lb_CO2_per_mmbtu => Dict("natural_gas"=>116.9 to 117.03,
"landfill_bio_gas"=>114,8 to 115.38,
"propane"=>138.6 to 139.16,
"diesel_oil"=>163.1 to 163.61
)
annual
emissions results to simple annual averages (lifecycle emissions divided by analysis_years). This is because the default climate emissions from Cambium are already levelized over the analysis horizon and therefore "year_one" emissions cannot be easily obtained.Added
src/REopt.jl
, added cambium_emissions_profile as an export for use via the REopt_API.src/results/electric_utility.jl
cambium_emissions_regionFixed
test_with_xpress.jl
, updated "Emissions and Renewable Energy Percent" expected values to account for load year adjustment.src/core/electric_utility.jl
, error when user-provided emissions series does not match timestep per hour, as is done in other cases of incorrect user-provided data.