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

4 bug fix PRs #374

Merged
merged 35 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
29f4bf7
generalize generator_fuel_slope_and_intercept to any fuel
hdunham Nov 16, 2023
2bc4774
chp fuel HHV is 1 because fuel measured in kwh
hdunham Nov 16, 2023
cfde602
Update CHANGELOG.md
hdunham Nov 16, 2023
1ba1227
Merge branch 'develop' into erp-chp-fuel-bug
hdunham Nov 29, 2023
53bea0b
avoid indexing using i in 1:length() paradigm
hdunham Jan 29, 2024
ad9ea3f
ensure period index is int in tariff processing
hdunham Jan 29, 2024
e0a0982
Update CHANGELOG.md
hdunham Jan 29, 2024
223a442
Merge branch 'develop' into indexing-robustness
hdunham Jan 29, 2024
4f728c5
add option soc_min_applies_during_outages
hdunham Apr 3, 2024
e45969e
soc_min_applies_during_outages logic
hdunham Apr 3, 2024
9ba0eb1
fix typo
hdunham Apr 3, 2024
dacdc39
default soc_min_applies_during_outages default to false
hdunham Apr 3, 2024
9032600
Update CHANGELOG.md
hdunham Apr 3, 2024
0b33591
fix export_rate_beyond_net_metering_limit type error
adfarth Apr 5, 2024
daf0d5f
Merge branch 'develop' into outage-soc
hdunham Apr 9, 2024
22fdbb9
Merge pull request #371 from NREL/input-types
hdunham Apr 10, 2024
555e85c
Fix divByZero issue with blended CRB profiles
Bill-Becker Apr 11, 2024
db7ef45
Merge pull request #375 from NREL/fix-blended-zero
Bill-Becker Apr 11, 2024
ed32c20
Update Changelog for PR 374
Bill-Becker Apr 11, 2024
a1ef00d
Merge branch 'develop' of https://github.com/NREL/REopt.jl into develop
Bill-Becker Apr 11, 2024
fefedd0
Merge branch 'develop' into outage-soc
hdunham Apr 11, 2024
fc814a7
Merge branch 'develop' into indexing-robustness
hdunham Apr 11, 2024
8f5f509
Update CHANGELOG.md
hdunham Apr 11, 2024
db6156f
Merge branch 'develop' into erp-chp-fuel-bug
hdunham Apr 11, 2024
54dbb3f
Update CHANGELOG.md
hdunham Apr 11, 2024
2160ac4
Merge pull request #370 from NREL/outage-soc
hdunham Apr 18, 2024
b50de4a
Hot Fix handle array of length 1
Bill-Becker Apr 18, 2024
8b06a7e
Update CHANGELOG.md
Bill-Becker Apr 18, 2024
c2eb7b0
use fuel_slope_and_intercept util function more places
hdunham Apr 18, 2024
2d5b3dc
Update CHANGELOG.md
hdunham Apr 18, 2024
e10c983
Merge branch 'develop' into indexing-robustness
hdunham Apr 18, 2024
3762d7a
Merge pull request #346 from NREL/indexing-robustness
hdunham Apr 18, 2024
fc2f43f
Merge branch 'develop' into erp-chp-fuel-bug
hdunham Apr 18, 2024
44597ef
Merge branch 'develop' into erp-chp-fuel-bug
hdunham Apr 19, 2024
d19f9b3
Merge pull request #325 from NREL/erp-chp-fuel-bug
hdunham Apr 19, 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
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ Classify the change according to the following categories:
### Deprecated
### Removed

## Develop - 2024-04-05
### Fixed
- Added `export_rate_beyond_net_metering_limit` to list of inputs to be converted to type Real, to avoid MethodError if type is vector of Any.
- Fix blended CRB processing when one or more load types have zero annual energy
- Handle an array of length 1 for CHP.installed_cost_per_kw which fixes the API using this parameter
### Changed
- add **ElectricStorage** input option **soc_min_applies_during_outages** (which defaults to _false_) and only apply the minimum state of charge constraint in function `add_MG_storage_dispatch_constraints` if it is _true_

## v0.44.0
### Added
- in `src/settings.jl`, added new const **INDICATOR_COMPATIBLE_SOLVERS**
Expand Down Expand Up @@ -712,7 +720,7 @@ Other changes:
## v0.3.0
### Added
- add separate decision variables and constraints for microgrid tech capacities
- new Site input `mg_tech_sizes_equal_grid_sizes` (boolean), when `false` the microgrid tech capacities are constrained to be <= the grid connected tech capacities
- new Site input `mg_tech_sizes_equal_grid_sizes` (boolean), when _false_ the microgrid tech capacities are constrained to be <= the grid connected tech capacities
### Fixed
- allow non-integer `outage_probabilities`
- correct `total_unserved_load` output
Expand Down
10 changes: 6 additions & 4 deletions src/constraints/outage_constraints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,12 @@ function add_MG_storage_dispatch_constraints(m,p)
)
)

# Minimum state of charge
@constraint(m, [s in p.s.electric_utility.scenarios, tz in p.s.electric_utility.outage_start_time_steps, ts in p.s.electric_utility.outage_time_steps],
m[:dvMGStoredEnergy][s, tz, ts] >= p.s.storage.attr["ElectricStorage"].soc_min_fraction * m[:dvStorageEnergy]["ElectricStorage"]
)
if p.s.storage.attr["ElectricStorage"].soc_min_applies_during_outages
# Minimum state of charge
@constraint(m, [s in p.s.electric_utility.scenarios, tz in p.s.electric_utility.outage_start_time_steps, ts in p.s.electric_utility.outage_time_steps],
m[:dvMGStoredEnergy][s, tz, ts] >= p.s.storage.attr["ElectricStorage"].soc_min_fraction * m[:dvStorageEnergy]["ElectricStorage"]
)
end

# Dispatch to MG electrical storage is no greater than inverter capacity
# and can't charge the battery unless binMGStorageUsed = 1
Expand Down
4 changes: 2 additions & 2 deletions src/core/chp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ function CHP(d::Dict;
end
elseif length(chp.installed_cost_per_kw) > 1 && length(chp.installed_cost_per_kw) != length(chp.tech_sizes_for_cost_curve)
throw(@error("To model CHP cost curve, you must provide `chp.tech_sizes_for_cost_curve` vector of equal length to `chp.installed_cost_per_kw`"))
elseif typeof(chp.installed_cost_per_kw) == Vector && length(chp.installed_cost_per_kw) == 1
elseif typeof(chp.installed_cost_per_kw) <: Array && length(chp.installed_cost_per_kw) == 1
chp.installed_cost_per_kw = chp.installed_cost_per_kw[1]
elseif isempty(chp.tech_sizes_for_cost_curve) && isempty(chp.installed_cost_per_kw)
update_installed_cost_params = true
Expand Down Expand Up @@ -541,4 +541,4 @@ function get_size_class_from_size(chp_elec_size_heuristic_kw, class_bounds, n_cl
end
end
return size_class
end
end
4 changes: 3 additions & 1 deletion src/core/doe_commercial_reference_building_loads.jl
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,9 @@ function blend_and_scale_doe_profiles(
monthly_scaler = length(blended_doe_reference_names)
end
for idx in 1:length(profiles)
profiles[idx] .*= total_kwh / annual_kwhs[idx] / monthly_scaler
if !(annual_kwhs[idx] == 0.0)
profiles[idx] .*= total_kwh / annual_kwhs[idx] / monthly_scaler
end
end
end
for idx in 1:length(profiles) # scale the profiles
Expand Down
4 changes: 4 additions & 0 deletions src/core/energy_storage/electric_storage.jl
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ end
inverter_efficiency_fraction::Float64 = 0.96
rectifier_efficiency_fraction::Float64 = 0.96
soc_min_fraction::Float64 = 0.2
soc_min_applies_during_outages::Bool = false
soc_init_fraction::Float64 = off_grid_flag ? 1.0 : 0.5
can_grid_charge::Bool = off_grid_flag ? false : true
installed_cost_per_kw::Real = 910.0
Expand Down Expand Up @@ -176,6 +177,7 @@ Base.@kwdef struct ElectricStorageDefaults
inverter_efficiency_fraction::Float64 = 0.96
rectifier_efficiency_fraction::Float64 = 0.96
soc_min_fraction::Float64 = 0.2
soc_min_applies_during_outages::Bool = false
soc_init_fraction::Float64 = off_grid_flag ? 1.0 : 0.5
can_grid_charge::Bool = off_grid_flag ? false : true
installed_cost_per_kw::Real = 910.0
Expand Down Expand Up @@ -214,6 +216,7 @@ struct ElectricStorage <: AbstractElectricStorage
inverter_efficiency_fraction::Float64
rectifier_efficiency_fraction::Float64
soc_min_fraction::Float64
soc_min_applies_during_outages::Bool
soc_init_fraction::Float64
can_grid_charge::Bool
installed_cost_per_kw::Real
Expand Down Expand Up @@ -301,6 +304,7 @@ struct ElectricStorage <: AbstractElectricStorage
s.inverter_efficiency_fraction,
s.rectifier_efficiency_fraction,
s.soc_min_fraction,
s.soc_min_applies_during_outages,
s.soc_init_fraction,
s.can_grid_charge,
s.installed_cost_per_kw,
Expand Down
2 changes: 1 addition & 1 deletion src/core/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ function dictkeys_tosymbols(d::Dict)
end
end
if k in [
"fuel_cost_per_mmbtu", "wholesale_rate",
"fuel_cost_per_mmbtu", "wholesale_rate", "export_rate_beyond_net_metering_limit",
# for ERP
"generator_size_kw", "generator_operational_availability",
"generator_failure_to_start", "generator_mean_time_to_failure",
Expand Down
3 changes: 2 additions & 1 deletion test/scenarios/outage.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
"installed_cost_per_kw": 840.0,
"installed_cost_per_kwh": 420.0,
"replace_cost_per_kw": 410.0,
"replace_cost_per_kwh": 200.0
"replace_cost_per_kwh": 200.0,
"soc_min_applies_during_outages": true
},
"Financial": {
"value_of_lost_load_per_kwh": 100.0,
Expand Down
1 change: 1 addition & 0 deletions test/scenarios/outages_gen_pv_stor.json
Original file line number Diff line number Diff line change
Expand Up @@ -43925,6 +43925,7 @@
"inverter_efficiency_fraction": 0.96,
"rectifier_efficiency_fraction": 0.96,
"soc_min_fraction": 0.2,
"soc_min_applies_during_outages": true,
"soc_init_fraction": 0.5,
"can_grid_charge": false,
"installed_cost_per_kw": 840.0,
Expand Down
2 changes: 1 addition & 1 deletion test/scenarios/outages_gen_pv_wind_stor.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion test/scenarios/wind_outages.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"max_kw": 5000,
"size_class": "large"
},
"ElectricStorage": {},
"ElectricStorage": {
"soc_min_applies_during_outages": true
},
"Financial": {
"value_of_lost_load_per_kwh": 0.0,
"microgrid_upgrade_cost_fraction": 0.0
Expand Down
Loading