Skip to content

Commit

Permalink
Merge pull request #357 from NREL/develop
Browse files Browse the repository at this point in the history
v0.41.0 master < develop
  • Loading branch information
adfarth committed Mar 12, 2024
2 parents 2c7ced6 + cb6d9d9 commit 677f3d9
Show file tree
Hide file tree
Showing 67 changed files with 142,345 additions and 35,278 deletions.
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,33 @@ Classify the change according to the following categories:
### Deprecated
### Removed

## v0.41.0
### Changed
- Changed 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). Added new emissions inputs and call to Cambium API in `src/core/electric_utility.jl`. Included option for user to use AVERT data for CO2 using **co2_from_avert** boolean.
- Updated `electric_utility` **emissions_region** to **avert_emissions_region** and **distance_to_emissions_region_meters** to **distance_to_avert_emissions_region_meters** in `src/electric_utility.jl` and `results/electric_utility.jl`.
- Updated 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).
- Updated 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 calculation of all `annual` emissions results (e.g. **Site.annual_emissions_tonnes_CO2**) 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.
- Changed name of exported function **emissions_profiles** to **avert_emissions_profiles**

### Added
- In `src/REopt.jl` and `src/electric_utility.jl`, added **cambium_emissions_profile** as an export for use via the REopt_API.
- In `src/REopt.jl`, added new const **EMISSIONS_DECREASE_DEFAULTS**
- In `src/results/electric_utility.jl` **cambium_emissions_region**
- In `test/runtests.jl` and `test/test_with_xpress.jl`, added testset **Cambium Emissions**

### 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.
- Avoid adjusting rates twice when time_steps_per_hour > 1

## v0.40.0
### Changed
- Changed **macrs_bonus_fraction** to from 0.80 to 0.60 (60%) for CHP, ElectricStorage, ColdThermalStorage, HotThermalStorage GHP, PV, Wind
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "REopt"
uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6"
authors = ["Nick Laws", "Hallie Dunham <hallie.dunham@nrel.gov>", "Bill Becker <william.becker@nrel.gov>", "Bhavesh Rathod <bhavesh.rathod@nrel.gov>", "Alex Zolan <alexander.aolan@nrel.gov>", "Amanda Farthing <amanda.farthing@nrel.gov>"]
version = "0.40.0"
version = "0.41.0"

[deps]
ArchGDAL = "c9ce4bd3-c3d5-55b8-8973-c0e20141b8c3"
Expand Down
8,761 changes: 0 additions & 8,761 deletions data/emissions/AVERT_Data/AVERT_2021_CO2_lb_per_kwh.csv

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

8,761 changes: 8,761 additions & 0 deletions data/emissions/AVERT_Data/AVERT_2022_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_2022_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_2022_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_2022_SO2_lb_per_kwh.csv

Large diffs are not rendered by default.

17 changes: 12 additions & 5 deletions src/REopt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,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 Expand Up @@ -72,10 +73,10 @@ const FUEL_DEFAULTS = Dict(
"diesel_oil"=>0.0
),
"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
),
"emissions_factor_lb_NOx_per_mmbtu" => Dict(
"natural_gas"=>0.09139,
Expand All @@ -96,6 +97,12 @@ const FUEL_DEFAULTS = Dict(
"diesel_oil"=>0.0
)
)
const EMISSIONS_DECREASE_DEFAULTS = Dict(
"CO2e" => 0.02163,
"NOx" => 0.02163,
"SO2" => 0.02163,
"PM25" => 0.02163
)

include("logging.jl")

Expand Down
5 changes: 0 additions & 5 deletions src/constraints/emissions_constraints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ function add_yr1_emissions_calcs(m,p)
yr1_emissions_offset_from_elec_exports_lbs_SO2
m[:yr1_emissions_from_elec_grid_net_if_selected_lbs_PM25] = m[:yr1_emissions_from_elec_grid_lbs_PM25] -
yr1_emissions_offset_from_elec_exports_lbs_PM25

m[:EmissionsYr1_Total_LbsCO2] = m[:yr1_emissions_onsite_fuel_lbs_CO2] + m[:yr1_emissions_from_elec_grid_net_if_selected_lbs_CO2]
m[:EmissionsYr1_Total_LbsNOx] = m[:yr1_emissions_onsite_fuel_lbs_NOx] + m[:yr1_emissions_from_elec_grid_net_if_selected_lbs_NOx]
m[:EmissionsYr1_Total_LbsSO2] = m[:yr1_emissions_onsite_fuel_lbs_SO2] + m[:yr1_emissions_from_elec_grid_net_if_selected_lbs_SO2]
m[:EmissionsYr1_Total_LbsPM25] = m[:yr1_emissions_onsite_fuel_lbs_PM25] + m[:yr1_emissions_from_elec_grid_net_if_selected_lbs_PM25]
nothing
end

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
12 changes: 7 additions & 5 deletions 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 Expand Up @@ -294,7 +294,7 @@ function ElectricTariff(;
- if NEM then set ExportRate[:Nem, :] to energy_rate[tier_with_lowest_energy_rate, :]
- user can provide either scalar wholesale rate or vector of time_steps,
=#
whl_rate = create_export_rate(wholesale_rate, length(energy_rates[:,1]), time_steps_per_hour)
whl_rate = create_export_rate(wholesale_rate, length(energy_rates[:,1]), time_steps_per_hour)
if !isnothing(u) && sum(u.sell_rates) < 0
whl_rate += u.sell_rates
end
Expand Down Expand Up @@ -369,20 +369,22 @@ end


"""
function create_export_rate(e::Nothing, N::Int, ts_per_hour::Int=1)
function create_export_rate(e::Nothing, N::Int, ts_per_hour::Int=1)
No export rate provided by user: set to 0 dollars/kWh for all time
N = length(energy_rates[:,1]) and should already account for time_steps_per_hour
"""
function create_export_rate(e::Nothing, N::Int, ts_per_hour::Int=1)
[0 for _ in range(1, stop=N) for ts in 1:ts_per_hour]
[0 for _ in range(1, stop=N)]
end


"""
function create_export_rate(e::T, N::Int, ts_per_hour::Int=1) where T<:Real
Case for scaler export rate provided -> convert to array of time_steps
N = length(energy_rates[:,1]) and should already account for time_steps_per_hour
"""
function create_export_rate(e::T, N::Int, ts_per_hour::Int=1) where T<:Real
repeat([float(-1*e)], N * ts_per_hour)
repeat([float(-1*e)], N)
end


Expand Down

2 comments on commit 677f3d9

@adfarth
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/102738

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.41.0 -m "<description of version>" 677f3d9959729843be11b6fc59a66ce064e95518
git push origin v0.41.0

Please sign in to comment.