diff --git a/hopp/simulation/hopp_interface.py b/hopp/simulation/hopp_interface.py index ba565f722..88df556cf 100644 --- a/hopp/simulation/hopp_interface.py +++ b/hopp/simulation/hopp_interface.py @@ -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)) diff --git a/hopp/simulation/technologies/financial/custom_financial_model.py b/hopp/simulation/technologies/financial/custom_financial_model.py index ab8f09fa9..079b46fff 100644 --- a/hopp/simulation/technologies/financial/custom_financial_model.py +++ b/hopp/simulation/technologies/financial/custom_financial_model.py @@ -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( diff --git a/tests/hopp/test_custom_financial.py b/tests/hopp/test_custom_financial.py index ffda1bd64..3c9df3e4c 100644 --- a/tests/hopp/test_custom_financial.py +++ b/tests/hopp/test_custom_financial.py @@ -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):