From 4b27408747346c63001a27ef4efc68864ec2d291 Mon Sep 17 00:00:00 2001 From: adfarth Date: Thu, 12 Dec 2024 10:58:54 -0700 Subject: [PATCH] update cambium inputs and tests --- src/core/electric_utility.jl | 6 +++--- test/runtests.jl | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/core/electric_utility.jl b/src/core/electric_utility.jl index bd99b9540..fa8d64075 100644 --- a/src/core/electric_utility.jl +++ b/src/core/electric_utility.jl @@ -20,7 +20,7 @@ # 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", "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", # Geographic boundary at which emissions are calculated. Options: ["Nations", "GEA Regions"] + 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 = 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. @@ -160,7 +160,7 @@ 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). - cambium_location_type::String = "GEA Regions", # Geographic boundary at which emissions are calculated. Options: ["Nations", "GEA Regions", "States"] + 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 = 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. @@ -573,7 +573,7 @@ function cambium_emissions_profile(; scenario::String, "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] + "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 ) diff --git a/test/runtests.jl b/test/runtests.jl index 3550e6b70..69fb81038 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -2308,13 +2308,12 @@ else # run HiGHS tests @test results["Site"]["total_renewable_energy_fraction_bau"] ≈ 0.132118 atol=1e-3 # 0.1354 atol=1e-3 # CO2 emissions - totals ≈ from grid, from fuelburn, ER, $/tCO2 breakeven @test results["Site"]["lifecycle_emissions_reduction_CO2_fraction"] ≈ 0.8 atol=1e-3 # 0.8 - @test results["Site"]["annual_emissions_tonnes_CO2"] ≈ 11.662 rtol=0.01 - @test results["Site"]["annual_emissions_tonnes_CO2_bau"] ≈ 58.3095 rtol=0.01 + @test results["Site"]["annual_emissions_tonnes_CO2"] ≈ 11.79 rtol=0.01 + @test results["Site"]["annual_emissions_tonnes_CO2_bau"] ≈ 58.97 rtol=0.01 @test results["Site"]["annual_emissions_from_fuelburn_tonnes_CO2"] ≈ 0.0 atol=1 # 0.0 - @test results["Financial"]["lifecycle_emissions_cost_climate"] ≈ 8397.85 rtol=0.01 + @test results["Financial"]["lifecycle_emissions_cost_climate"] ≈ 8496.6 rtol=0.01 @test results["Site"]["lifecycle_emissions_from_fuelburn_tonnes_CO2"] ≈ 0.0 atol=1 # 0.0 @test results["Site"]["lifecycle_emissions_from_fuelburn_tonnes_CO2_bau"] ≈ 0.0 atol=1 # 0.0 - @test results["ElectricUtility"]["annual_emissions_tonnes_CO2_bau"] ≈ 58.3095 rtol=0.01 @test results["ElectricUtility"]["lifecycle_emissions_tonnes_CO2"] ≈ 235.9 rtol=0.01