Skip to content

Peaking boiler cost override #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 3.9.17
current_version = 3.9.18
commit = True
tag = True

Expand Down
2 changes: 1 addition & 1 deletion .cookiecutterrc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ default_context:
sphinx_doctest: "no"
sphinx_theme: "sphinx-py3doc-enhanced-theme"
test_matrix_separate_coverage: "no"
version: 3.9.17
version: 3.9.18
version_manager: "bump2version"
website: "https://github.com/NREL"
year_from: "2023"
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ Free software: `MIT license <LICENSE>`__
:alt: Supported implementations
:target: https://pypi.org/project/geophires-x

.. |commits-since| image:: https://img.shields.io/github/commits-since/softwareengineerprogrammer/GEOPHIRES-X/v3.9.17.svg
.. |commits-since| image:: https://img.shields.io/github/commits-since/softwareengineerprogrammer/GEOPHIRES-X/v3.9.18.svg
:alt: Commits since latest release
:target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.9.17...main
:target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.9.18...main

.. |docs| image:: https://readthedocs.org/projects/GEOPHIRES-X/badge/?style=flat
:target: https://nrel.github.io/GEOPHIRES-X
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
year = '2025'
author = 'NREL'
copyright = f'{year}, {author}'
version = release = '3.9.17'
version = release = '3.9.18'

pygments_style = 'trac'
templates_path = ['./templates']
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def read(*names, **kwargs):

setup(
name='geophires-x',
version='3.9.17',
version='3.9.18',
license='MIT',
description='GEOPHIRES is a free and open-source geothermal techno-economic simulator.',
long_description='{}\n{}'.format(
Expand Down
33 changes: 29 additions & 4 deletions src/geophires_x/Economics.py
Original file line number Diff line number Diff line change
Expand Up @@ -1111,6 +1111,18 @@ def __init__(self, model: Model):
ErrMessage="assume default peaking boiler efficiency (85%)",
ToolTipText="Peaking boiler efficiency"
)
self._default_peaking_boiler_cost_USD_per_kw = 65
self.peaking_boiler_cost_per_kw = self.ParameterDict[self.peaking_boiler_cost_per_kw.Name] = floatParameter(
"Peaking Boiler Cost per KW",
DefaultValue=self._default_peaking_boiler_cost_USD_per_kw,
Min=0,
Max=1000,
UnitType=Units.ENERGYCOST,
PreferredUnits=EnergyCostUnit.DOLLARSPERKW,
CurrentUnits=EnergyCostUnit.DOLLARSPERKW,
Required=False,
ToolTipText="Peaking boiler cost per KW of maximum peaking boiler demand"
)
self.dhpipingcostrate = self.ParameterDict[self.dhpipingcostrate.Name] = floatParameter(
"District Heating Piping Cost Rate",
DefaultValue=1200,
Expand Down Expand Up @@ -1689,13 +1701,18 @@ def __init__(self, model: Model):
PreferredUnits=CurrencyFrequencyUnit.MDOLLARSPERYEAR,
CurrentUnits=CurrencyFrequencyUnit.MDOLLARSPERYEAR
)

# district heating
self.peakingboilercost = self.OutputParameterDict[self.peakingboilercost.Name] = OutputParameter(
Name="Peaking boiler cost",
UnitType=Units.CURRENCY,
PreferredUnits=CurrencyUnit.MDOLLARS,
CurrentUnits=CurrencyUnit.MDOLLARS
CurrentUnits=CurrencyUnit.MDOLLARS,
ToolTipText=f'Default cost: ${self._default_peaking_boiler_cost_USD_per_kw}/KW '
f'of maximum peaking boiler demand. '
f'Provide {self.peaking_boiler_cost_per_kw.Name} override the default.'
)

self.dhdistrictcost = self.OutputParameterDict[self.dhdistrictcost.Name] = OutputParameter(
Name="District Heating System Cost",
UnitType=Units.CURRENCY,
Expand Down Expand Up @@ -2381,10 +2398,18 @@ def Calculate(self, model: Model) -> None:
if self.ccplantfixed.Valid:
self.Cplant.value = self.ccplantfixed.value
else:
# 1.15 for 15% contingency and 1.12 for 12% indirect costs
# TODO https://github.com/NREL/GEOPHIRES-X/issues/383?title=Parameterize+indirect+cost+factor
self.Cplant.value = 1.12 * 1.15 * self.ccplantadjfactor.value * 250E-6 * np.max(
model.surfaceplant.HeatExtracted.value) * 1000. # 1.15 for 15% contingency and 1.12 for 12% indirect costs
self.peakingboilercost.value = 65 * model.surfaceplant.max_peaking_boiler_demand.value / 1000 # add 65$/KW for peaking boiler
self.Cplant.value += self.peakingboilercost.value # add peaking boiler cost to surface plant cost
model.surfaceplant.HeatExtracted.value) * 1000.

# add 65$/KW for peaking boiler
self.peakingboilercost.value = (self.peaking_boiler_cost_per_kw.quantity()
.to('USD / kilowatt').magnitude
* model.surfaceplant.max_peaking_boiler_demand.value / 1000)

# add peaking boiler cost to surface plant cost
self.Cplant.value += self.peakingboilercost.value


else: # all other options have power plant
Expand Down
2 changes: 1 addition & 1 deletion src/geophires_x/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '3.9.17'
__version__ = '3.9.18'
9 changes: 9 additions & 0 deletions src/geophires_x_schema_generator/geophires-request.json
Original file line number Diff line number Diff line change
Expand Up @@ -1861,6 +1861,15 @@
"minimum": 0,
"maximum": 1
},
"Peaking Boiler Cost per KW": {
"description": "Peaking boiler cost per KW of maximum peaking boiler demand",
"type": "number",
"units": "USD/kW",
"category": "Economics",
"default": 65,
"minimum": 0,
"maximum": 1000
},
"District Heating Piping Cost Rate": {
"description": "District heating piping cost rate ($/m)",
"type": "number",
Expand Down
24 changes: 24 additions & 0 deletions tests/geophires_x_tests/test_economics.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import os
import sys
from pathlib import Path
Expand All @@ -7,6 +9,7 @@
# ruff: noqa: I001 # Successful module initialization is dependent on this specific import order.
from geophires_x.Model import Model
from geophires_x.Economics import CalculateFinancialPerformance
from geophires_x_client import GeophiresXResult, GeophiresXClient, GeophiresInputParameters
from tests.base_test_case import BaseTestCase


Expand Down Expand Up @@ -115,3 +118,24 @@ def _new_model(self) -> Model:
os.chdir(stash_cwd)

return m

def test_peaking_boiler_cost(self):
def _get_result(peaking_boiler_cost_: int) -> GeophiresXResult:
return GeophiresXClient().get_geophires_result(
GeophiresInputParameters(
from_file_path=self._get_test_file_path('../examples/example12_DH.txt'),
params={
'Peaking Boiler Cost per KW': peaking_boiler_cost_,
},
)
)

def _lcoh_pbc(r: GeophiresXResult) -> tuple[float, float]:
return (
r.result['SUMMARY OF RESULTS']['Direct-Use heat breakeven price (LCOH)']['value'],
r.result['CAPITAL COSTS (M$)']['of which Peaking Boiler Cost']['value'],
)

lcoh, peaking_boiler_cost = _lcoh_pbc(_get_result(0))
self.assertLess(lcoh, 13.19)
self.assertEqual(0, peaking_boiler_cost)