Skip to content

Commit

Permalink
adjust battery financials to use discharged energy instead of annual …
Browse files Browse the repository at this point in the history
…energy for levelized costs
  • Loading branch information
jaredthomas68 committed Oct 9, 2024
1 parent ac73efb commit f03bfc1
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
19 changes: 14 additions & 5 deletions hopp/simulation/hopp_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,19 @@ def parse_output(self):
self.hybrid_installed_cost = self.hopp.system.grid.total_installed_cost

def print_output(self):
print("Wind Installed Cost: {}".format(self.wind_installed_cost))
print("Solar Installed Cost: {}".format(self.solar_installed_cost))
print("Hybrid Installed Cost: {}".format(self.hybrid_installed_cost))
print("Wind Installed Cost: {}".format(self.system.wind.total_installed_cost))
print("Solar Installed Cost: {}".format(self.system.pv.total_installed_cost))
print("Wave Installed Cost: {}".format(self.system.wave.total_installed_cost))
print("Battery Installed Cost: {}".format(self.system.battery.total_installed_cost))
print("Hybrid Installed Cost: {}".format(self.system.grid.total_installed_cost))
print("Wind NPV: {}".format(self.hopp.system.net_present_values.wind))
print("Solar NPV: {}".format(self.hopp.system.net_present_values.pv))
print("Hybrid NPV: {}".format(self.hopp.system.net_present_values.hybrid))
print("Wind + Solar Expected NPV: {}".format(self.wind_plus_solar_npv))
print("Wave NPV: {}".format(self.hopp.system.net_present_values.wave))
print("Battery NPV: {}".format(self.hopp.system.net_present_values.battery))
print("Wave NPV: {}".format(self.hopp.system.net_present_values.hybrid*1E-2))
print("Wind LCOE (USD/kWh): {}".format(self.hopp.system.lcoe_nom.wind*1E-2))
print("Solar LCOE (USD/kWh): {}".format(self.hopp.system.lcoe_nom.pv*1E-2))
print("Wave LCOE (USD/kWh): {}".format(self.hopp.system.lcoe_nom.wave*1E-2))
print("Battery LCOE (USD/kWh): {}".format(self.hopp.system.lcoe_nom.battery*1E-2))
print("Hybrid LCOE (USD/kWh): {}".format(self.hopp.system.lcoe_nom.hybrid*1E-2))
# print("Wind + Solar Expected NPV: {}".format(self.wind_plus_solar_npv))
15 changes: 11 additions & 4 deletions hopp/simulation/technologies/financial/custom_financial_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,17 @@ def run_profast(self,
},
)

pf.set_params(
"capacity",
abs(self.value("annual_energy_kwh"))/365.0,
) # kWh/day
if self.value("batt_annual_discharge_energy") is not None:
pf.set_params(
"capacity",
max([1E-6, self.value("batt_annual_discharge_energy")[0]/365.0]),
) # kWh/day
else:
pf.set_params(
"capacity",
max([1E-6, self.value("annual_energy_kwh")/365.0]),
) # kWh/day

pf.set_params("maintenance", {"value": self.o_and_m_cost(), "escalation": gen_inflation})

# pf.add_fixed_cost(
Expand Down
2 changes: 2 additions & 0 deletions tests/hopp/test_custom_financial.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,8 @@ def test_hybrid_simple_pv_with_wind_storage_dispatch(site, subtests):
with subtests.test("lcoe hybrid"):
lcoe_expected_hybrid = 4.426740247764236
assert lcoes.hybrid == approx(lcoe_expected_hybrid, 1e-3)
with subtests.test("total installed cost"):
assert 27494592.0 == approx(hybrid_plant.grid.total_installed_cost, 1E-6)


def test_hybrid_detailed_pv_with_wind_storage_dispatch(site, subtests):
Expand Down

0 comments on commit f03bfc1

Please sign in to comment.