Skip to content

Commit 3d3e3ce

Browse files
Fix LCOH calculation bug for Heat Pump + BICYCLE
1 parent 30f8e11 commit 3d3e3ce

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/geophires_x/Economics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ def CalculateLCOELCOHLCOC(self, model: Model) -> tuple:
535535
NPVgrt = self.GTR.value / (1 - self.GTR.value) * (NPVcap + NPVoandm + NPVfc + NPVit - NPVitc)
536536
LCOH = (NPVcap + NPVoandm + NPVfc + NPVit + NPVgrt - NPVitc) / np.sum(
537537
model.surfaceplant.HeatkWhProduced.value * inflationvector * discountvector) * 1E8
538-
LCOH = self.LCOH.value * 2.931 # $/MMBTU
538+
LCOH = LCOH * 2.931 # $/MMBTU
539539

540540
elif model.surfaceplant.enduse_option.value == EndUseOptions.HEAT and model.surfaceplant.plant_type.value == PlantType.DISTRICT_HEATING:
541541
PumpingCosts = model.surfaceplant.PumpingkWh.value * model.surfaceplant.electricity_cost_to_buy.value / 1E6

tests/test_geophires_x.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,3 +854,16 @@ def test_field_gathering_cost(self):
854854
)
855855

856856
self.assertEqual(fg_cost, result.result['CAPITAL COSTS (M$)']['Field gathering system costs']['value'])
857+
858+
def test_heat_pump_lcoh_bicycle(self):
859+
result = GeophiresXClient().get_geophires_result(
860+
GeophiresInputParameters(
861+
from_file_path=self._get_test_file_path('examples/example10_HP.txt'),
862+
params={
863+
'Economic Model': 3,
864+
},
865+
)
866+
)
867+
868+
lcoh = result.result['SUMMARY OF RESULTS']['Direct-Use heat breakeven price (LCOH)']['value']
869+
self.assertTrue(10 < lcoh < 20) # Sanity-check that value is non-zero and broadly within the expected range.

0 commit comments

Comments
 (0)