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

Update Emissions to Latest Data #460

Closed
wants to merge 15 commits into from
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ Classify the change according to the following categories:
### Deprecated
### Removed

## avert-update
### Changed
- Updated AVERT emissions data to v4.3, which uses Regional Data Files for year 2023 for CONUS. For Alaska and Hawaii (regions AKGD, HIMS, HIOA), updated eGRID data to eGRID2022 datafile, adjusted to CO2e values. Emissions profiles are saved in `data/emissions/AVERT_Data`.
- Updated Cambium API call for CO2e emissions within CONUS to Cambium 2023 dataset. This includes updates to the default values and valid options for the following **ElectricUtility** inputs: **cambium_scenario**, **cambium_location_type**, and **cambium_start_year**
- Updated EMISSIONS_DECREASE_DEFAULTS from 0.02163 to 0.0459 based on Cambium 2023 data

## leap-year-fix
### Fixed
Expand Down
8,761 changes: 0 additions & 8,761 deletions data/emissions/AVERT_Data/AVERT_2022_CO2_lb_per_kwh.csv

This file was deleted.

8,761 changes: 0 additions & 8,761 deletions data/emissions/AVERT_Data/AVERT_2022_NOx_lb_per_kwh.csv

This file was deleted.

8,761 changes: 0 additions & 8,761 deletions data/emissions/AVERT_Data/AVERT_2022_PM25_lb_per_kwh.csv

This file was deleted.

8,761 changes: 0 additions & 8,761 deletions data/emissions/AVERT_Data/AVERT_2022_SO2_lb_per_kwh.csv

This file was deleted.

8,761 changes: 8,761 additions & 0 deletions data/emissions/AVERT_Data/AVERT_2023_CO2_lb_per_kwh.csv

Large diffs are not rendered by default.

8,761 changes: 8,761 additions & 0 deletions data/emissions/AVERT_Data/AVERT_2023_NOx_lb_per_kwh.csv

Large diffs are not rendered by default.

8,761 changes: 8,761 additions & 0 deletions data/emissions/AVERT_Data/AVERT_2023_PM25_lb_per_kwh.csv

Large diffs are not rendered by default.

8,761 changes: 8,761 additions & 0 deletions data/emissions/AVERT_Data/AVERT_2023_SO2_lb_per_kwh.csv

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/REopt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ const FUEL_DEFAULTS = Dict(
)
)
const EMISSIONS_DECREASE_DEFAULTS = Dict(
adfarth marked this conversation as resolved.
Show resolved Hide resolved
"CO2e" => 0.02163,
"NOx" => 0.02163,
"SO2" => 0.02163,
"PM25" => 0.02163
"CO2e" => 0.0459,
"NOx" => 0.0459,
"SO2" => 0.0459,
"PM25" => 0.0459
)
const INDICATOR_COMPATIBLE_SOLVERS = ["CPLEX","Xpress"]

Expand Down
37 changes: 18 additions & 19 deletions src/core/electric_utility.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
### Grid Climate Emissions Inputs ###
# Climate Option 1 (Default): Use levelized emissions data from NREL's Cambium database by specifying the following fields:
cambium_scenario::String = "Mid-case", # Cambium Scenario for evolution of electricity sector (see Cambium documentation for descriptions).
## Options: ["Mid-case", "Mid-case with tax credit expiration", "Low renewable energy cost", "Low renewable energy cost with tax credit expiration", "High renewable energy cost", "High electrification", "Low natrual gas prices", "High natrual gas prices", "Mid-case with 95% decarbonization by 2050", "Mid-case with 100% decarbonization by 2035"]
cambium_location_type::String = "GEA Regions", # Geographic boundary at which emissions are calculated. Options: ["Nations", "GEA Regions", "States"]
## Options: ["Mid-case", "Low renewable energy cost", "High renewable energy cost", "High demand growth", "Low natural gas prices", "High natural gas prices", "Mid-case with 95% decarbonization by 2050", "Mid-case with 100% decarbonization by 2035"]
cambium_location_type::String = "GEA Regions 2023", # Geographic boundary at which emissions are calculated. Options: ["Nations", "GEA Regions 2023"]
cambium_metric_col::String = "lrmer_co2e", # Emissions metric used. Default: "lrmer_co2e" - Long-run marginal emissions rate for CO2-equivalant, combined combustion and pre-combustion emissions rates. Options: See metric definitions and names in the Cambium documentation
cambium_start_year::Int = 2024, # First year of operation of system. Emissions will be levelized starting in this year for the duration of cambium_levelization_years. # Options: any year 2023 through 2050.
cambium_start_year::Int = 2025, # First year of operation of system. Emissions will be levelized starting in this year for the duration of cambium_levelization_years. # Options: any year 2023 through 2050.
cambium_levelization_years::Int = analysis_years, # Expected lifetime or analysis period of the intervention being studied. Emissions will be averaged over this period.
cambium_grid_level::String = "enduse", # Options: ["enduse", "busbar"]. Busbar refers to point where bulk generating stations connect to grid; enduse refers to point of consumption (includes distribution loss rate).

Expand Down Expand Up @@ -86,7 +86,7 @@
- For sites in the contiguous United States:
- Default climate-related emissions factors come from NREL's Cambium database (Current version: 2022)
- By default, REopt uses *levelized long-run marginal emission rates for CO2-equivalent (CO2e) emissions* for the region in which the site is located.
By default, the emissions rates are levelized over the analysis period (e.g., from 2024 through 2048 for a 25-year analysis)
By default, the emissions rates are levelized over the analysis period (e.g., from 2025 through 2049 for a 25-year analysis)
- The inputs to the Cambium API request can be modified by the user based on emissions accounting needs (e.g., can change "lifetime" to 1 to analyze a single year's emissions)
- Note for analysis periods extending beyond 2050: Values beyond 2050 are estimated with the 2050 values. Analysts are advised to use caution when selecting values that place significant weight on 2050 (e.g., greater than 50%)
- Users can alternatively choose to use emissions factors from the EPA's AVERT by setting `co2_from_avert` to `true`
Expand Down Expand Up @@ -159,11 +159,10 @@ struct ElectricUtility

### Grid Climate Emissions Inputs ###
# Climate Option 1 (Default): Use levelized emissions data from NREL's Cambium database by specifying the following fields:
cambium_scenario::String = "Mid-case", # Cambium Scenario for evolution of electricity sector (see Cambium documentation for descriptions).
## Options: ["Mid-case", "Mid-case with tax credit expiration", "Low renewable energy cost", "Low renewable energy cost with tax credit expiration", "High renewable energy cost", "High electrification", "Low natrual gas prices", "High natrual gas prices", "Mid-case with 95% decarbonization by 2050", "Mid-case with 100% decarbonization by 2035"]
adfarth marked this conversation as resolved.
Show resolved Hide resolved
cambium_location_type::String = "GEA Regions", # Geographic boundary at which emissions are calculated. Options: ["Nations", "GEA Regions", "States"]
cambium_scenario::String = "Mid-case", # Cambium Scenario for evolution of electricity sector (see ELectricUtility docsting for options and/or Cambium docs for descriptions).
cambium_location_type::String = "GEA Regions 2023", # Geographic boundary at which emissions are calculated. Options: ["Nations", "GEA Regions 2023"]
cambium_metric_col::String = "lrmer_co2e", # Emissions metric. Default: "lrmer_co2e" - Long-run marginal emissions rate for CO2-equivalant, combined combustion and pre-combustion emissions rates. Options: See metric definitions and names in the Cambium documentation
cambium_start_year::Int = 2024, # First year of operation of system. # Options: any year now through 2050.
cambium_start_year::Int = 2025, # First year of operation of system. # Options: any year now through 2050.
cambium_levelization_years::Int = analysis_years, # Expected lifetime or analysis period of the intervention being studied. Emissions will be averaged over this period.
cambium_grid_level::String = "enduse", # Busbar refers to point where bulk generating station connects to grid; enduse refers to point of consumption (includes distribution loss rate)

Expand Down Expand Up @@ -243,9 +242,9 @@ struct ElectricUtility
end
else # if not user-provided, get emissions factors from AVERT and/or Cambium
if ekey == "CO2" && co2_from_avert == false # Use Cambium for CO2
if cambium_start_year < 2023 || cambium_start_year > 2050
@warn("The cambium_start_year must be between 2023 and 2050. Setting to cambium_start_year to 2024.")
cambium_start_year = 2024 # Must update annually
if cambium_start_year < 2025 || cambium_start_year > 2050
cambium_start_year = 2025 # Must update annually
@warn("The cambium_start_year must be between $(cambium_start_year) and 2050. Setting cambium_start_year to $(cambium_start_year).")
end
try
cambium_response_dict = cambium_emissions_profile( # Adjusted for day of week alignment with load and time_steps_per_hour
Expand All @@ -270,7 +269,7 @@ struct ElectricUtility
end
else # otherwise use AVERT
if !isnothing(region_abbr)
avert_data_year = 2022 # Must update when AVERT data are updated
avert_data_year = 2023 # Must update when AVERT data are updated
emissions_series_dict[ekey] = avert_emissions_profiles(
avert_region_abbr = region_abbr,
latitude = latitude,
Expand Down Expand Up @@ -479,7 +478,7 @@ function region_name_to_abbr(region_name)
end

"""
avert_emissions_profiles(; avert_region_abbr::String="", latitude::Real, longitude::Real, time_steps_per_hour::Int=1, load_year::Int=2017, avert_data_year::Int=2022)
avert_emissions_profiles(; avert_region_abbr::String="", latitude::Real, longitude::Real, time_steps_per_hour::Int=1, load_year::Int=2017, avert_data_year::Int=2023)

This function gets CO2, NOx, SO2, and PM2.5 grid emission rate profiles (1-year time series) from the AVERT dataset.
If avert_region_abbr is supplied, this will overwrite the default region that would otherwise be selected using the lat, long.
Expand All @@ -489,7 +488,7 @@ This function is used for the /emissions_profile endpoint in the REopt API, in p
for the webtool to display grid emissions defaults before running REopt,
but is also generally an external way to access AVERT data without running REopt.
"""
function avert_emissions_profiles(; avert_region_abbr::String="", latitude::Real, longitude::Real, time_steps_per_hour::Int=1, load_year::Int=2017, avert_data_year::Int=2022)
function avert_emissions_profiles(; avert_region_abbr::String="", latitude::Real, longitude::Real, time_steps_per_hour::Int=1, load_year::Int=2017, avert_data_year::Int=2023)
if avert_region_abbr == "" # Region not supplied
avert_region_abbr, avert_meters_to_region = avert_region_abbreviation(latitude, longitude)
else
Expand Down Expand Up @@ -559,22 +558,22 @@ function cambium_emissions_profile(; scenario::String,
)

url = "https://scenarioviewer.nrel.gov/api/get-levelized/" # Production
project_uuid = "82460f06-548c-4954-b2d9-b84ba92d63e2" # Cambium 2022
project_uuid = "0f92fe57-3365-428a-8fe8-0afc326b3b43" # Cambium 2023


payload=Dict(
"project_uuid" => project_uuid,
"scenario" => scenario,
"location_type" => location_type, # Nations, States, GEA Regions (Default: GEA Regions)
# "location" => "Colorado", # e.g., Contiguous United States, Colorado, Kansas, p33, p34
"location_type" => location_type,
"latitude" => string(round(latitude, digits=3)),
"longitude" => string(round(longitude, digits=3)),
"start_year" => string(start_year), # biennial from 2022-2050 (data year covers nominal year and years proceeding; e.g., 2040 values cover time range starting in 2036)
"start_year" => string(start_year), # data year covers nominal year and 4 years proceeding; e.g., 2040 values cover time range starting in 2036
"lifetime" => string(lifetime), # Integer 1 or greater (Default 25 yrs)
"discount_rate" => "0.0", # Zero = simple average (a pwf with discount rate gets applied to projected CO2 costs, but not quantity.)
"time_type" => "hourly", # hourly or annual
"metric_col" => metric_col, # lrmer_co2e
"smoothing_method" => "rolling", # rolling or none (only applicable to hourly queries). "rolling" best with TMY data; "none" best if 2012 weather data used.
"gwp" => "100yrAR6", # Global warming potential values. Default: "100yrAR6". Options: "100yrAR5", "20yrAR5", "100yrAR6", "20yrAR6" or a custom tuple [1,10.0,100] with GWP values for [CO2, CH4, N2O]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this supposed to be reverted before merging?

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 great catch. I don't think this necessarily needs to be reverted because [1, 29.8, 273.0] should == using "100yrAR6". However, it would be good to find out if "100yrAR6" is still a viable option (currently, it errors). I'm still waiting to hear back from the Cambium team on this so let's keep this as an open TODO.

"gwp" => [1, 29.8, 273.0], # TODO update back to "100yrAR6", # Global warming potential values. Default: "100yrAR6". Options: "100yrAR5", "20yrAR5", "100yrAR6", "20yrAR6" or a custom tuple [1,10.0,100] with GWP values for [CO2, CH4, N2O]
"grid_level" => grid_level, # enduse or busbar
"ems_mass_units" => "lb" # lb or kg
)
Expand Down
8 changes: 4 additions & 4 deletions src/results/pv.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
- `year_one_energy_produced_kwh` Energy produced over the first year
- `annual_energy_produced_kwh` Average annual energy produced when accounting for degradation
- `lcoe_per_kwh` Levelized Cost of Energy produced by the PV system
- `electric_to_load_series_kw` Vector of power used to meet load over the first year
- `electric_to_storage_series_kw` Vector of power used to charge the battery over the first year
- `electric_to_grid_series_kw` Vector of power exported to the grid over the first year
- `electric_curtailed_series_kw` Vector of power curtailed over the first year
- `electric_to_load_series_kw` Vector of power used to meet load over an average year
- `electric_to_storage_series_kw` Vector of power used to charge the battery over an average year
- `electric_to_grid_series_kw` Vector of power exported to the grid over an average year
- `electric_curtailed_series_kw` Vector of power curtailed over an average year
- `annual_energy_exported_kwh` Average annual energy exported to the grid
- `production_factor_series` PV production factor in each time step, either provided by user or obtained from PVWatts

Expand Down
2 changes: 2 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
DotEnv = "4dc1fcf4-5e3b-5448-94ab-0c38ec0385c1"
HiGHS = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"
Expand Down
Loading
Loading