Skip to content

Commit

Permalink
Merge branch 'develop' into cambium
Browse files Browse the repository at this point in the history
  • Loading branch information
adfarth committed Aug 22, 2023
2 parents 682f240 + df43c89 commit 9d7da95
Show file tree
Hide file tree
Showing 8 changed files with 220 additions and 368 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,21 @@ Classify the change according to the following categories:
- In `test_with_xpress.jl`, updated "Emissions and Renewable Energy Percent" expected values to account for load year adjustment.

## Develop 2023-08-09
## v0.32.6
### Changed
- Required **fuel_cost_per_mmbtu** for modeling **Boiler** tech, otherwise throw a handled error.
### Fixed
- Additional **SteamTurbine** defaults processing updates and bug fixes

## v0.32.5
### Changed
- Updated `get_existing_chiller_cop` function to accept scalar values instead of vectors to allow for faster API transactions.
- Refactored `backup_reliability.jl` to enable easier development: added conversion of all scalar generator inputs to vectors in `dictkeys_to_symbols` and reduced each functions with two versions (one with scalar and one with vector generator arguments) to a single version
- Simplify generator sizing logic in function `backup_reliability_reopt_inputs` (if user sets `generator_size_kw` or `num_generators`to 0, don't override based on REopt solution) and add a validation error
### Fixed
- Steamturbine defaults processing
- simulated_load monthly values processing
- Fixed incorrect name when accessing result field `Outages` **generator_microgrid_size_kw** in `outag_simulator.jl`

## v0.32.4
### Changed
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 <[email protected]>", "Bill Becker <[email protected]>", "Bhavesh Rathod <[email protected]>", "Alex Zolan <[email protected]>", "Amanda Farthing <[email protected]>"]
version = "0.32.4"
version = "0.32.6"

[deps]
ArchGDAL = "c9ce4bd3-c3d5-55b8-8973-c0e20141b8c3"
Expand Down
6 changes: 5 additions & 1 deletion src/core/boiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function Boiler(;
min_mmbtu_per_hour::Real = 0.0,
max_mmbtu_per_hour::Real = 0.0,
efficiency::Real = 0.8,
fuel_cost_per_mmbtu::Union{<:Real, AbstractVector{<:Real}} = 0.0,
fuel_cost_per_mmbtu::Union{<:Real, AbstractVector{<:Real}} = [], # REQUIRED. Can be a scalar, a list of 12 monthly values, or a time series of values for every time step
time_steps_per_hour::Int = 1, # passed from Settings
macrs_option_years::Int = 0,
macrs_bonus_fraction::Real = 0.0,
Expand All @@ -83,6 +83,10 @@ function Boiler(;
# emissions_factor_lb_CO2_per_mmbtu::Real,
)

if isempty(fuel_cost_per_mmbtu)
throw(@error("The Boiler.fuel_cost_per_mmbtu is a required input when modeling a heating load which is served by the Boiler in the optimal case"))
end

min_kw = min_mmbtu_per_hour * KWH_PER_MMBTU
max_kw = max_mmbtu_per_hour * KWH_PER_MMBTU

Expand Down
9 changes: 6 additions & 3 deletions src/core/steam_turbine.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ function SteamTurbine(d::Dict; avg_boiler_fuel_load_mmbtu_per_hour::Union{Float6
:outlet_steam_pressure_psig => st.outlet_steam_pressure_psig,
:isentropic_efficiency => st.isentropic_efficiency,
:gearbox_generator_efficiency => st.gearbox_generator_efficiency,
:net_to_gross_electric_ratio => st.net_to_gross_electric_ratio
:net_to_gross_electric_ratio => st.net_to_gross_electric_ratio,
:size_class => st.size_class
)

# set all missing default values in custom_chp_inputs
Expand All @@ -109,7 +110,9 @@ function SteamTurbine(d::Dict; avg_boiler_fuel_load_mmbtu_per_hour::Union{Float6

defaults = stm_defaults_response["default_inputs"]
for (k, v) in custom_st_inputs
if isnan(v)
if k == :size_class && isnothing(v) # size class is outside "default_inputs" key.
setproperty!(st, k, stm_defaults_response[string(k)])
elseif isnan(v)
if !(k == :inlet_steam_temperature_degF && !isnan(st.inlet_steam_superheat_degF))
setproperty!(st, k, defaults[string(k)])
else
Expand All @@ -118,7 +121,7 @@ function SteamTurbine(d::Dict; avg_boiler_fuel_load_mmbtu_per_hour::Union{Float6
end
end

if isnan(st.electric_produced_to_thermal_consumed_ratio) || isnan(thermal_produced_to_thermal_consumed_ratio)
if isnan(st.electric_produced_to_thermal_consumed_ratio) || isnan(st.thermal_produced_to_thermal_consumed_ratio)
assign_st_elec_and_therm_prod_ratios!(st)
end

Expand Down
6 changes: 6 additions & 0 deletions src/core/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,12 @@ function dictkeys_tosymbols(d::Dict)
end
end
end
if k in ["generator_operational_availability", "generator_failure_to_start", "generator_mean_time_to_failure",
"num_generators", "generator_size_kw", "fuel_limit", "fuel_limit_is_per_generator",
"generator_fuel_intercept_per_hr", "generator_fuel_burn_rate_per_kwh"] &&
!(typeof(v) <: Array)
v = [v]
end
d2[Symbol(k)] = v
end
return d2
Expand Down
Loading

0 comments on commit 9d7da95

Please sign in to comment.