Skip to content

Commit

Permalink
Merge pull request #134 from kurbansitterley/sys_costing_bandaid
Browse files Browse the repository at this point in the history
Remove electricity_cost from REFLOSystemCosting build
  • Loading branch information
kurbansitterley authored Oct 10, 2024
2 parents 7929725 + c9790cc commit 204e66c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ def cost_deep_well_injection_as_opex(blk):
make_variable_operating_cost_var(blk)
blk.costing_package.add_cost_factor(blk, None)

blk.capital_cost.fix(0)
blk.capital_cost_constraint = Constraint(
expr=blk.capital_cost == 0 * blk.costing_package.base_currency
)

blk.base_period_flow = pyunits.convert(
blk.unit_model.properties[0].flow_vol_phase["Liq"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,11 @@ def build_global_params(self):

self.base_currency = pyo.units.USD_2021

self.del_component(self.electricity_cost)

self.electricity_cost = pyo.Param(
mutable=True,
initialize=0.0718, # From EIA for 2021
doc="Electricity cost",
units=pyo.units.USD_2021 / pyo.units.kWh,
)

self.register_flow_type("electricity", self.electricity_cost)

# Fix the parameters
self.fix_all_vars()
self.plant_lifetime.fix(20)
self.utilization_factor.fix(1)
self.electricity_cost.fix(0.0718)

# Build the integrated system costs
self.build_integrated_costs()
Expand Down Expand Up @@ -195,7 +185,7 @@ def add_LCOE(self, e_model="pysam"):
pysam = self._get_pysam()

if not pysam._has_been_run:
raise Exception(
raise RuntimeError(
f"PySAM model {pysam._pysam_model_name} has not yet been run, so there is no annual_energy data available."
"You must run the PySAM model before adding LCOE metric."
)
Expand All @@ -220,7 +210,7 @@ def add_LCOE(self, e_model="pysam"):
)
self.add_component("LCOE", LCOE_expr)

if e_model == "surrogate":
else:
raise NotImplementedError(
"add_LCOE for surrogate models not available yet."
)
Expand Down

0 comments on commit 204e66c

Please sign in to comment.