Skip to content

Commit

Permalink
use MMBTU for user inputs instead of kW
Browse files Browse the repository at this point in the history
  • Loading branch information
zolanaj committed Aug 25, 2023
1 parent a4cdc69 commit d38b2ae
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
4 changes: 2 additions & 2 deletions data/electric_heater/electric_heater_defaults.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"installed_cost_per_kw": 500,
"om_cost_per_kw": 60,
"installed_cost_per_mmbtu_per_hour": 115686,
"om_cost_per_mmbtu_per_hour": 0.0,
"macrs_option_years": 0,
"macrs_bonus_fraction": 0.0,
"can_supply_steam_turbine": false,
Expand Down
21 changes: 14 additions & 7 deletions src/core/electric_heater.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,20 @@ this new `ElectricHeater` to meet the heating load in addition to using the `Exi
```julia
function ElectricHeater(;
min_kw::Real = 0.0, # Minimum thermal power size
max_kw::Real = BIG_NUMBER, # Maximum thermal power size
installed_cost_per_kw::Union{Real, nothing} = nothing, # Thermal power-based cost
om_cost_per_kw::Union{Real, nothing} = nothing, # Thermal power-based fixed O&M cost
min_mmbtu_per_hour::Real = 0.0, # Minimum thermal power size
max_mmbtu_per_hour::Real = BIG_NUMBER, # Maximum thermal power size
installed_cost_per_mmbtu_per_hour::Union{Real, nothing} = nothing, # Thermal power-based cost
om_cost_per_mmbtu_per_hour::Union{Real, nothing} = nothing, # Thermal power-based fixed O&M cost
macrs_option_years::Int = 0, # MACRS schedule for financial analysis. Set to zero to disable
macrs_bonus_fraction::Real = 0.0, # Fraction of upfront project costs to depreciate under MACRS
can_supply_steam_turbine::Union{Bool, nothing} = nothing # If the boiler can supply steam to the steam turbine for electric production
)
```
"""
function ElectricHeater(;
min_kw::Real = 0.0,
max_kw::Real = BIG_NUMBER,
installed_cost_per_kw::Union{Real, Nothing} = nothing,
min_mmbtu_per_hour::Real = 0.0,
max_mmbtu_per_hour::Real = BIG_NUMBER,
installed_cost_per_mmbtu_per_hour::Union{Real, Nothing} = nothing,
om_cost_per_kw::Union{Real, Nothing} = nothing,
macrs_option_years::Int = 0,
macrs_bonus_fraction::Real = 0.0,
Expand All @@ -72,6 +72,13 @@ function ElectricHeater(;

defaults = get_electric_heater_defaults()

min_kw = min_mmbtu_per_hour * KWH_PER_MMBTU
max_kw = max_mmbtu_per_hour * KWH_PER_MMBTU

# Convert cost basis of mmbtu/mmbtu_per_hour to kwh/kw
installed_cost_per_kw = installed_cost_per_mmbtu_per_hour / KWH_PER_MMBTU
om_cost_per_kw = om_cost_per_mmbtu_per_hour / KWH_PER_MMBTU

# populate defaults as needed
if isnothing(installed_cost_per_kw)
installed_cost_per_kw = defaults["installed_cost_per_kw"]
Expand Down
4 changes: 2 additions & 2 deletions test/scenarios/electric_heater.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"min_kw": 0.0,
"max_kw": 100000,
"heating_cop": 1.0,
"installed_cost_per_kw": 1000,
"om_cost_per_kw": 0.0,
"installed_cost_per_mmbtu_per_hour": 115686,
"om_cost_per_mmbtu_per_hour": 0.0,
"macrs_option_years": 0,
"macrs_bonus_fraction": 0.0,
"can_supply_steam_turbine": false
Expand Down

0 comments on commit d38b2ae

Please sign in to comment.