Skip to content

Commit

Permalink
Add OM costs and update defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
indu-manogaran authored and hdunham committed Sep 29, 2023
1 parent 756f95d commit ab2f6e9
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 44 deletions.
24 changes: 18 additions & 6 deletions src/constraints/hydrogen_constraints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,27 @@ function add_electrolyzer_constraints(m, p; _n="")
==
sum(m[Symbol("dvProductionToStorage"*_n)][b,t,ts] for b in p.s.storage.types.hydrogen_lp, t in p.techs.electrolyzer)
)

m[:TotalElectrolyzerPerUnitProdOMCosts] = @expression(m, p.third_party_factor * p.pwf_om *
sum(p.s.electrolyzer.om_cost_per_kwh * p.hours_per_time_step *
m[:dvRatedProduction][t, ts] for t in p.techs.electrolyzer, ts in p.time_steps)
)
end

end

function add_fuel_cell_constraints(m, p; _n="")
@constraint(m, [ts in p.time_steps],
(p.hours_per_time_step * sum(p.production_factor[t, ts] * p.levelization_factor[t] * m[Symbol("dvRatedProduction"*_n)][t,ts] for t in p.techs.fuel_cell))
/ p.s.fuel_cell.efficiency_kwh_per_kg
==
sum(m[Symbol("dvProductionToStorage"*_n)][b,t,ts] for b in p.s.storage.types.hydrogen_lp, t in p.techs.fuel_cell)
)
if !isempty(p.techs.fuel_cell)
@constraint(m, [ts in p.time_steps],
(p.hours_per_time_step * sum(p.production_factor[t, ts] * p.levelization_factor[t] * m[Symbol("dvRatedProduction"*_n)][t,ts] for t in p.techs.fuel_cell))
/ p.s.fuel_cell.efficiency_kwh_per_kg
==
sum(m[Symbol("dvProductionToStorage"*_n)][b,t,ts] for b in p.s.storage.types.hydrogen_lp, t in p.techs.fuel_cell)
)

m[:TotalFuelCellPerUnitProdOMCosts] = @expression(m, p.third_party_factor * p.pwf_om *
sum(p.s.fuel_cell.om_cost_per_kwh * p.hours_per_time_step *
m[:dvRatedProduction][t, ts] for t in p.techs.fuel_cell, ts in p.time_steps)
)
end
end
38 changes: 19 additions & 19 deletions src/core/electrolyzer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@
```julia
min_kw = 0.0,
max_kw = 1.0e9,
installed_cost_per_kw = 5000,
om_cost_per_kw = 631.3,
om_cost_per_kg = 0.0,
efficiency_kwh_per_kg = 54.6,
installed_cost_per_kw = 1500,
om_cost_per_kw = 12.8,
om_cost_per_kwh = 0.006,
efficiency_kwh_per_kg = 54.3,
macrs_option_years = 7,
macrs_bonus_fraction = 0.0,
macrs_bonus_fraction = 0.8,
macrs_itc_reduction = 0.5,
federal_itc_fraction = 0,
federal_itc_fraction = 0.3,
federal_rebate_per_kw = 0.0,
state_ibi_fraction = 0.0,
state_ibi_max = 1.0e10,
Expand All @@ -56,16 +56,16 @@
can_net_meter = false,
can_wholesale = false,
can_export_beyond_nem_limit = false,
can_curtail = false,
min_turn_down_pct = 0.9
can_curtail= false,
min_turn_down_fraction = 0.2
```
"""
struct Electrolyzer <: AbstractElectrolyzer
min_kw::Real
max_kw::Real
installed_cost_per_kw::Real
om_cost_per_kw::Real
om_cost_per_kg::Real
om_cost_per_kwh::Real
efficiency_kwh_per_kg::Real
macrs_option_years::Int
macrs_bonus_fraction::Real
Expand All @@ -88,19 +88,19 @@ struct Electrolyzer <: AbstractElectrolyzer
can_wholesale::Bool
can_export_beyond_nem_limit::Bool
can_curtail::Bool
min_turn_down_pct::Real
min_turn_down_fraction::Real

function Electrolyzer(;
min_kw = 0.0,
max_kw = 1.0e9,
installed_cost_per_kw = 15782.5,
om_cost_per_kw = 631.3,
om_cost_per_kg = 0,
efficiency_kwh_per_kg = 54.6,
installed_cost_per_kw = 1500,
om_cost_per_kw = 12.8,
om_cost_per_kwh = 0.006,
efficiency_kwh_per_kg = 54.3,
macrs_option_years = 7,
macrs_bonus_fraction = 0.0,
macrs_bonus_fraction = 0.8,
macrs_itc_reduction = 0.5,
federal_itc_fraction = 0.0,
federal_itc_fraction = 0.3,
federal_rebate_per_kw = 0.0,
state_ibi_fraction = 0.0,
state_ibi_max = 1.0e10,
Expand All @@ -118,15 +118,15 @@ struct Electrolyzer <: AbstractElectrolyzer
can_wholesale = false,
can_export_beyond_nem_limit = false,
can_curtail= false,
min_turn_down_pct = 0.9
min_turn_down_fraction = 0.2
)

new(
min_kw,
max_kw,
installed_cost_per_kw,
om_cost_per_kw,
om_cost_per_kg,
om_cost_per_kwh,
efficiency_kwh_per_kg,
macrs_option_years,
macrs_bonus_fraction,
Expand All @@ -149,7 +149,7 @@ struct Electrolyzer <: AbstractElectrolyzer
can_wholesale,
can_export_beyond_nem_limit,
can_curtail,
min_turn_down_pct
min_turn_down_fraction
)
end
end
12 changes: 6 additions & 6 deletions src/core/energy_storage/hydrogen_storage_LP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
```julia
min_kg::Real = 0.0
max_kg::Real = 1.0e9
max_kg::Real = 1.0e6
soc_min_fraction::Float64 = 0.05
soc_init_fraction::Float64 = 0.5
installed_cost_per_kg::Real = 1500.0
replace_cost_per_kg::Real = 1000.0
soc_init_fraction::Float64 = 0.05
installed_cost_per_kg::Real = 500.0
replace_cost_per_kg::Real = 300.0
replacement_year::Int = 25
macrs_option_years::Int = 7
macrs_bonus_fraction::Float64 = 0.8
Expand All @@ -51,8 +51,8 @@ Base.@kwdef struct HydrogenStorageLPDefaults
max_kg::Real = 1.0e6
soc_min_fraction::Float64 = 0.05
soc_init_fraction::Float64 = 0.05
installed_cost_per_kg::Real = 1500.0
replace_cost_per_kg::Real = 1000.0
installed_cost_per_kg::Real = 500.0
replace_cost_per_kg::Real = 300.0
replacement_year::Int = 25
macrs_option_years::Int = 7
macrs_bonus_fraction::Float64 = 0.8
Expand Down
26 changes: 13 additions & 13 deletions src/core/fuel_cell.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@
```julia
min_kw = 0.0,
max_kw = 1.0e9,
installed_cost_per_kw = 5000,
om_cost_per_kw = 50,
om_cost_per_kwh = 0.0,
installed_cost_per_kw = 1320,
om_cost_per_kw = 12.8,
om_cost_per_kwh = 0.0013,
efficiency_kwh_per_kg = 16.745,
macrs_option_years = 7,
macrs_bonus_fraction = 0.0,
macrs_bonus_fraction = 0.8,
macrs_itc_reduction = 0.5,
federal_itc_fraction = 0,
federal_itc_fraction = 0.3,
federal_rebate_per_kw = 0.0,
state_ibi_fraction = 0.0,
state_ibi_max = 1.0e10,
Expand All @@ -57,8 +57,8 @@
can_net_meter = false,
can_wholesale = false,
can_export_beyond_nem_limit = false,
can_curtail = false,
min_turn_down_pct = 0.3
can_curtail= false,
min_turn_down_pct = 0.2
```
"""
struct FuelCell <: AbstractFuelCell
Expand Down Expand Up @@ -94,14 +94,14 @@ struct FuelCell <: AbstractFuelCell
function FuelCell(;
min_kw = 0.0,
max_kw = 1.0e9,
installed_cost_per_kw = 5000,
om_cost_per_kw = 50,
om_cost_per_kwh = 0,
installed_cost_per_kw = 1320,
om_cost_per_kw = 12.8,
om_cost_per_kwh = 0.0013,
efficiency_kwh_per_kg = 16.745,
macrs_option_years = 7,
macrs_bonus_fraction = 0.0,
macrs_bonus_fraction = 0.8,
macrs_itc_reduction = 0.5,
federal_itc_fraction = 0.0,
federal_itc_fraction = 0.3,
federal_rebate_per_kw = 0.0,
state_ibi_fraction = 0.0,
state_ibi_max = 1.0e10,
Expand All @@ -119,7 +119,7 @@ struct FuelCell <: AbstractFuelCell
can_wholesale = false,
can_export_beyond_nem_limit = false,
can_curtail= false,
min_turn_down_pct = 0.3
min_turn_down_pct = 0.2
)

new(
Expand Down
2 changes: 2 additions & 0 deletions src/core/reopt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ function build_reopt!(m::JuMP.AbstractModel, p::REoptInputs)

if !isempty(p.techs.electrolyzer)
add_electrolyzer_constraints(m, p)
m[:TotalPerUnitProdOMCosts] += m[:TotalElectrolyzerPerUnitProdOMCosts]
else
@constraint(m, [t in p.techs.elec, ts in p.time_steps],
m[:dvProductionToElectrolyzer][t, ts] == 0)
Expand Down Expand Up @@ -358,6 +359,7 @@ function build_reopt!(m::JuMP.AbstractModel, p::REoptInputs)

if !isempty(p.techs.fuel_cell)
add_fuel_cell_constraints(m, p)
m[:TotalPerUnitProdOMCosts] += m[:TotalFuelCellPerUnitProdOMCosts]
else
@constraint(m, [t in p.techs.fuel_cell, ts in p.time_steps],
m[:dvRatedProduction][t,ts] == 0)
Expand Down

0 comments on commit ab2f6e9

Please sign in to comment.