Skip to content

Commit

Permalink
Merge pull request #235 from NREL/cambium
Browse files Browse the repository at this point in the history
Cambium Grid Climate Emissions and Updated AVERT
  • Loading branch information
adfarth authored and indu-manogaran committed Sep 16, 2024
1 parent b9ce737 commit 558355d
Show file tree
Hide file tree
Showing 48 changed files with 189 additions and 557 deletions.
3 changes: 2 additions & 1 deletion src/REopt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export
get_steam_turbine_defaults_size_class,
simulated_load,
get_absorption_chiller_defaults,
emissions_profiles,
avert_emissions_profiles,
cambium_emissions_profile,
easiur_data,
get_existing_chiller_default_cop

Expand Down
2 changes: 1 addition & 1 deletion src/core/electric_load.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
path_to_csv::String = "", # for csv containing loads_kw
doe_reference_name::String = "",
blended_doe_reference_names::Array{String, 1} = String[],
blended_doe_reference_percents::Array{<:Real,1} = Real[],
blended_doe_reference_percents::Array{<:Real,1} = Real[], # Values should be between 0-1 and sum to 1.0
year::Int = doe_reference_name ≠ "" || blended_doe_reference_names ≠ String[] ? 2017 : 2022, # used in ElectricTariff to align rate schedule with weekdays/weekends. DOE CRB profiles must use 2017. If providing load data, specify year of data.
city::String = "",
annual_kwh::Union{Real, Nothing} = nothing,
Expand Down
2 changes: 1 addition & 1 deletion src/core/electric_tariff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function ElectricTariff(;
urdb_response::Dict=Dict(),
urdb_utility_name::String="",
urdb_rate_name::String="",
year::Int=2022, # Will be passed from ElectricLoad
year::Int=2022, # Passed from ElectricLoad
time_steps_per_hour::Int=1,
NEM::Bool=false,
wholesale_rate::T1=nothing,
Expand Down
35 changes: 25 additions & 10 deletions src/core/scenario.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,17 @@ function Scenario(d::Dict; flex_hvac_from_json=false)
)
else
financial = Financial(; latitude=site.latitude, longitude=site.longitude,
off_grid_flag = settings.off_grid_flag
off_grid_flag = settings.off_grid_flag,
include_health_in_objective = settings.include_health_in_objective
)
end

electric_load = ElectricLoad(; dictkeys_tosymbols(d["ElectricLoad"])...,
latitude=site.latitude, longitude=site.longitude,
time_steps_per_hour=settings.time_steps_per_hour,
off_grid_flag = settings.off_grid_flag
)

if haskey(d, "ElectricUtility") && !(settings.off_grid_flag)
electric_utility = ElectricUtility(; dictkeys_tosymbols(d["ElectricUtility"])...,
latitude=site.latitude, longitude=site.longitude,
Expand All @@ -120,11 +127,20 @@ function Scenario(d::Dict; flex_hvac_from_json=false)
include_climate_in_objective=settings.include_climate_in_objective,
include_health_in_objective=settings.include_health_in_objective,
off_grid_flag=settings.off_grid_flag,
time_steps_per_hour=settings.time_steps_per_hour
time_steps_per_hour=settings.time_steps_per_hour,
analysis_years=financial.analysis_years,
load_year=electric_load.year
)
elseif !(settings.off_grid_flag)
electric_utility = ElectricUtility(; latitude=site.latitude, longitude=site.longitude,
time_steps_per_hour=settings.time_steps_per_hour
CO2_emissions_reduction_min_fraction=site.CO2_emissions_reduction_min_fraction,
CO2_emissions_reduction_max_fraction=site.CO2_emissions_reduction_max_fraction,
include_climate_in_objective=settings.include_climate_in_objective,
include_health_in_objective=settings.include_health_in_objective,
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
)
elseif settings.off_grid_flag
if haskey(d, "ElectricUtility")
Expand All @@ -133,7 +149,12 @@ function Scenario(d::Dict; flex_hvac_from_json=false)
electric_utility = ElectricUtility(; outage_start_time_step = 1,
outage_end_time_step = settings.time_steps_per_hour * 8760,
latitude=site.latitude, longitude=site.longitude,
time_steps_per_hour=settings.time_steps_per_hour
time_steps_per_hour=settings.time_steps_per_hour,
off_grid_flag=settings.off_grid_flag,
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
)
end

Expand Down Expand Up @@ -166,12 +187,6 @@ function Scenario(d::Dict; flex_hvac_from_json=false)

storage = Storage(storage_structs)

electric_load = ElectricLoad(; dictkeys_tosymbols(d["ElectricLoad"])...,
latitude=site.latitude, longitude=site.longitude,
time_steps_per_hour=settings.time_steps_per_hour,
off_grid_flag = settings.off_grid_flag
)

if !(settings.off_grid_flag) # ElectricTariff only required for on-grid
electric_tariff = ElectricTariff(; dictkeys_tosymbols(d["ElectricTariff"])...,
year=electric_load.year,
Expand Down
5 changes: 3 additions & 2 deletions src/results/electric_utility.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
- `lifecycle_emissions_tonnes_NOx` # Total tons of NOx emissions associated with the site's grid-purchased electricity over the analysis period. If include_exported_elec_emissions_in_total is False, this value only reflects grid purchaes. Otherwise, it accounts for emissions offset from any export to the grid.
- `lifecycle_emissions_tonnes_SO2` # Total tons of SO2 emissions associated with the site's grid-purchased electricity over the analysis period. If include_exported_elec_emissions_in_total is False, this value only reflects grid purchaes. Otherwise, it accounts for emissions offset from any export to the grid.
- `lifecycle_emissions_tonnes_PM25` # Total tons of PM2.5 emissions associated with the site's grid-purchased electricity over the analysis period. If include_exported_elec_emissions_in_total is False, this value only reflects grid purchaes. Otherwise, it accounts for emissions offset from any export to the grid.
- `emissions_region` # EPA AVERT region of the site (populated if default emissions values are used).
- `distance_to_emissions_region_meters`
- `avert_emissions_region` # EPA AVERT region of the site. Used for health-related emissions from grid electricity (populated if default emissions values are used) and climate emissions if "co2_from_avert" is set to true.
- `distance_to_avert_emissions_region_meters` # Distance in meters from the site to the nearest AVERT emissions region.
- `cambium_emissions_region` # NREL Cambium region of the site. Used for climate-related emissions from grid electricity (populated only if default (Cambium) climate emissions values are used)
!!! note "'Series' and 'Annual' energy and emissions outputs are average annual"
REopt performs load balances using average annual production values for technologies that include degradation.
Expand Down
6 changes: 1 addition & 5 deletions src/results/results.jl
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,7 @@ function combine_results(p::REoptInputs, bau::Dict, opt::Dict, bau_scenario::BAU
("Site", "lifecycle_emissions_from_fuelburn_tonnes_CO2"),
("Site", "lifecycle_emissions_from_fuelburn_tonnes_NOx"),
("Site", "lifecycle_emissions_from_fuelburn_tonnes_SO2"),
("Site", "lifecycle_emissions_from_fuelburn_tonnes_PM25"),
("Site", "lifecycle_emissions_from_elec_grid_tonnes_CO2"),
("Site", "lifecycle_emissions_from_elec_grid_tonnes_NOx"),
("Site", "lifecycle_emissions_from_elec_grid_tonnes_SO2"),
("Site", "lifecycle_emissions_from_elec_grid_tonnes_PM25")
("Site", "lifecycle_emissions_from_fuelburn_tonnes_PM25")
)

for t in bau_outputs
Expand Down
Loading

0 comments on commit 558355d

Please sign in to comment.