Skip to content

Commit

Permalink
Merge pull request #250 from NREL/develop
Browse files Browse the repository at this point in the history
SteamTurbine defaults updates, Boiler require fuel cost
  • Loading branch information
rathod-b authored Aug 21, 2023
2 parents 716e277 + c3b78b5 commit 3fecd74
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ Classify the change according to the following categories:
### Deprecated
### Removed

## 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
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.5"
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

0 comments on commit 3fecd74

Please sign in to comment.