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

Add Grid Renewable Energy Fraction #426

Draft
wants to merge 39 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
0d4a787
Add API call for renewable energy fraction
pypapus Jul 30, 2024
71acc5e
Fixed cambium API call
pypapus Jul 31, 2024
eca3f12
Clean energy fraction added to scenarios
pypapus Aug 1, 2024
80d1d3e
Include profile of grid clean energy contribution in kW
pypapus Aug 1, 2024
c095d48
Updated help text and added checks for user-provided values
pypapus Aug 2, 2024
b67ff48
Corrected off-grid flag in scenario.jl
pypapus Aug 2, 2024
9a8f09f
Edited to remove cef calculation using BAU electric load
pypapus Aug 12, 2024
379eeab
Added new "cef_constraints" to calculate clean energy fraction of the…
pypapus Aug 12, 2024
26f5cec
Added cef (kWh) from the grid in accounting for renewable energy perc…
pypapus Aug 12, 2024
4cce89e
Added new function to calculate the clean_energy_fraction (kWh) grid …
pypapus Aug 12, 2024
6500b40
Added new input to include grid cef (kWh) in renewable energy percent…
pypapus Aug 12, 2024
98d22b5
Updated function adds grid clean energy kWh serving the load to results
pypapus Aug 12, 2024
c3c4d90
Merge branch 'develop' into gridRE-dev
adfarth Aug 12, 2024
e3b0300
removed "hours_per_time_step" to use model time step.
pypapus Aug 15, 2024
248481b
Added "annual_clean_grid_to_load_kwh" in results
pypapus Aug 15, 2024
1d77ec8
Merge branch 'gridRE-dev' of https://github.com/NREL/REopt.jl into gr…
pypapus Aug 15, 2024
fbf7691
Combined cambium_emissions_profile() and cambium_clean_energy_fractio…
pypapus Aug 16, 2024
29518dc
Update electric_utility.jl
adfarth Sep 10, 2024
132f982
Merge branch 'develop' into gridRE-dev
adfarth Nov 4, 2024
3a4bafd
spelling
adfarth Nov 5, 2024
8a34550
Merge branch 'develop' into gridRE-dev
adfarth Nov 12, 2024
dec6733
change cambium_metric_col to cambium_co2_metric
adfarth Nov 12, 2024
3916ba8
Change **cambium_emissions_region** to **cambium_region** and clean u…
adfarth Nov 12, 2024
37de923
Update electric_utility.jl
adfarth Nov 13, 2024
ff29a78
emissions_profile to profile_data
adfarth Nov 13, 2024
cee8176
reorganize constraints
adfarth Nov 13, 2024
8571808
minor edits
adfarth Nov 13, 2024
60cdeae
simplify constraints
adfarth Nov 14, 2024
7596768
Update renewable_energy_constraints.jl
adfarth Nov 14, 2024
434f928
Update site.jl
adfarth Nov 14, 2024
3b7a93a
update outputs
adfarth Nov 14, 2024
f2bb448
add outputs
adfarth Nov 14, 2024
a058fed
fix to align_profile_with_load_year
adfarth Nov 14, 2024
c2353fb
fixes to calcs
adfarth Nov 15, 2024
42be276
Update financial.jl
adfarth Nov 15, 2024
b9b1509
Update runtests.jl
adfarth Nov 15, 2024
82aaba4
add a test
adfarth Nov 15, 2024
394ffc8
Update CHANGELOG.md
adfarth Nov 15, 2024
bf72ef7
avoid annual grid RE if mpc
adfarth Nov 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ Classify the change according to the following categories:
### Removed


## gridRE-dev
### Added
- Added ElectricUtility inputs to account for the clean or renewable energy fraction of grid-purchased electricity:
- **cambium_cef_metric** to utilize clean energy data from NREL's Cambium database
- **clean_energy_fraction_series** to supply a custom grid clean energy scalar or series
- Added Site input to allow user to choose whether to include grid RE in min max constraints: **include_grid_renewable_electricity_in_min_max_constraints**
### Changed
- Changed name of ElectricUtility input **cambium_metric_col** to **cambium_co2_metric**, to distinguish between the CO2 and clean energy fraction metrics
- Changed name of ElectricUtility **cambium_emissions_region** to **cambium_region**
- Changed name of function (also available as endpoint through REopt API) from **cambium_emissions_profile** to **cambium_profile**

## Develop
### Added
- Battery residual value if choosing replacement strategy for degradation
Expand Down
23 changes: 18 additions & 5 deletions src/constraints/renewable_energy_constraints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
add_re_elec_constraints(m,p)

Function to add minimum and/or maximum renewable electricity (as percentage of load) constraints, if specified by user.
Includes renewable energy from grid if specified by user.

!!! note
When a single outage is modeled (using outage_start_time_step), renewable electricity calculations account for operations during this outage (e.g., the critical load is used during time_steps_without_grid)
Expand All @@ -11,14 +12,17 @@ Function to add minimum and/or maximum renewable electricity (as percentage of l
#Renewable electricity constraints
function add_re_elec_constraints(m,p)
if !isnothing(p.s.site.renewable_electricity_min_fraction)
@constraint(m, MinREElecCon, m[:AnnualREEleckWh] >= p.s.site.renewable_electricity_min_fraction*m[:AnnualEleckWh])
@constraint(m, MinREElecCon, m[:AnnualOnsiteREEleckWh] +
include_grid_renewable_electricity_in_min_max_constraints * m[:AnnualGridREEleckWh]
>= p.s.site.renewable_electricity_min_fraction*m[:AnnualEleckWh])
end
if !isnothing(p.s.site.renewable_electricity_max_fraction)
@constraint(m, MaxREElecCon, m[:AnnualREEleckWh] <= p.s.site.renewable_electricity_max_fraction*m[:AnnualEleckWh])
@constraint(m, MaxREElecCon, m[:AnnualOnsiteREEleckWh] +
include_grid_renewable_electricity_in_min_max_constraints * m[:AnnualGridREEleckWh]
<= p.s.site.renewable_electricity_max_fraction*m[:AnnualEleckWh])
end
end


"""
add_re_elec_calcs(m,p)

Expand Down Expand Up @@ -50,7 +54,7 @@ function add_re_elec_calcs(m,p)
# ))
# end

m[:AnnualREEleckWh] = @expression(m,p.hours_per_time_step * (
m[:AnnualOnsiteREEleckWh] = @expression(m, p.hours_per_time_step * (
sum(p.production_factor[t,ts] * p.levelization_factor[t] * m[:dvRatedProduction][t,ts] *
p.tech_renewable_energy_fraction[t] for t in p.techs.elec, ts in p.time_steps
) - #total RE elec generation, excl steam turbine
Expand All @@ -69,11 +73,20 @@ function add_re_elec_calcs(m,p)
# Note: if battery ends up being allowed to discharge to grid, need to make sure only RE that is being consumed onsite is counted so battery doesn't become a back door for RE to grid.
# Note: calculations currently do not ascribe any renewable energy attribute to grid-purchased electricity

m[:AnnualGridREEleckWh] = @expression(m, p.hours_per_time_step * (
sum(m[:dvGridPurchase][ts, tier] - m[:dvGridToStorage][b, ts] *
(1 - p.s.storage.attr[b].charge_efficiency * p.s.storage.attr[b].discharge_efficiency) *
p.s.electric_utility.clean_energy_fraction_series[ts]
for ts in p.time_steps, tier in 1:p.s.electric_tariff.n_energy_tiers, b in p.s.storage.types.elec
) # clean energy from grid, minus battery efficiency losses
)
)

m[:AnnualEleckWh] = @expression(m,p.hours_per_time_step * (
# input electric load
sum(p.s.electric_load.loads_kw[ts] for ts in p.time_steps_with_grid)
+ sum(p.s.electric_load.critical_loads_kw[ts] for ts in p.time_steps_without_grid)
# tech electric loads
# tech electric loads #TODO: Uncomment?
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 is this something we could uncomment, or is it still a WIP?

# + sum(m[:dvCoolingProduction][t,ts] for t in p.ElectricChillers, ts in p.time_steps )/ p.ElectricChillerCOP # electric chiller elec load
# + sum(m[:dvCoolingProduction][t,ts] for t in p.AbsorptionChillers, ts in p.time_steps )/ p.AbsorptionChillerElecCOP # absorportion chiller elec load
# + sum(p.GHPElectricConsumed[g,ts] * m[:binGHP][g] for g in p.GHPOptions, ts in p.time_steps) # GHP elec load
Expand Down
Loading
Loading