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

Cambium Grid Climate Emissions and Updated AVERT #235

Merged
merged 76 commits into from
Mar 8, 2024
Merged

Cambium Grid Climate Emissions and Updated AVERT #235

merged 76 commits into from
Mar 8, 2024

Conversation

adfarth
Copy link
Collaborator

@adfarth adfarth commented Jun 23, 2023

Changed

  • Change default source for CO2 grid emissions values to NREL's Cambium 2022 Database (by default: CO2e, long-run marginal emissions rates levelized (averaged) over the analysis period, assuming start year 2024). Add new emissions inputs and call to Cambium API in src/core/electric_utility.jl. Include option for user to use AVERT data for CO2 using co2_from_avert boolian.
  • Update electric_utility emissions_region to avert_emissions_region and distance_to_emissions_region_meters to distance_to_avert_emissions_region_meters.
  • Update default 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).
  • Update AVERT emissions data to v4.1, which uses Regional Data Files (RDFs) for year 2022. Data is saved in 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.
  • Updated default fuel emissions factors from CO2 to CO2-equivalent (CO2e) values. In src/core/generator.jl, updated emissions_factor_lb_CO2_per_gal from 22.51 to 22.58. In src/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
    )
  • Changed all 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

  • In src/REopt.jl, added cambium_emissions_profile as an export for use via the REopt_API.
  • In src/results/electric_utility.jl cambium_emissions_region

Fixed

  • Adjust grid emissions profiles for day of week alignment with load_year.
  • In test_with_xpress.jl, updated "Emissions and Renewable Energy Percent" expected values to account for load year adjustment.
  • In 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.

using Cambium instead of AVERT for CO2 emissions by default
Based on Cambium 2022 Mid-Case Scenario, LRMER CO2e (Combustion+Precombustion) 2024-2049 values
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
@adfarth adfarth marked this pull request as ready for review February 1, 2024 14:37
@adfarth adfarth requested a review from zolanaj February 7, 2024 19:21
Copy link
Collaborator

@zolanaj zolanaj left a 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.

Comment on lines 75 to +79
"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
Copy link
Collaborator

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.

Copy link
Collaborator Author

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?)?

Copy link
Collaborator

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

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?

Copy link
Collaborator Author

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

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added in ab3ae64

Comment on lines +64 to +65
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
Copy link
Collaborator

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.

Copy link
Collaborator Author

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?

Copy link
Collaborator

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!

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 thank you!

Comment on lines 189 to 192
emissions_factor_NOx_decrease_fraction::Real = 0.02163,
emissions_factor_SO2_decrease_fraction::Real = 0.02163,
emissions_factor_PM25_decrease_fraction::Real = 0.02163,
)
Copy link
Collaborator

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

Comment on lines +1869 to +1873
@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
Copy link
Collaborator

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.

Copy link
Collaborator Author

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!

Copy link
Collaborator

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

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

Choose a reason for hiding this comment

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

Thanks for adding this!

@adfarth adfarth merged commit f6155e7 into develop Mar 8, 2024
4 checks passed
@adfarth adfarth mentioned this pull request Mar 8, 2024
@adfarth adfarth deleted the cambium branch March 14, 2024 19:17
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.

update default emissions % increase to use Cambium 2021 data Switch from AVERT data to Cambium API
3 participants