Skip to content

Commit

Permalink
Merge pull request #329 from softwareengineerprogrammer/main
Browse files Browse the repository at this point in the history
Output field updates: Well depth, non-vertical sections, transmission, annualized capex [3.7.0]
  • Loading branch information
softwareengineerprogrammer authored Jan 21, 2025
2 parents f4e34f5 + 5586099 commit 81caf47
Show file tree
Hide file tree
Showing 44 changed files with 245 additions and 201 deletions.
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.6.7
current_version = 3.7.0
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.6.7
version: 3.7.0
version_manager: "bump2version"
website: "https://github.com/NREL"
year_from: "2023"
Expand Down
10 changes: 9 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@
Changelog
=========

GEOPHIRES-X (2023-2024)
GEOPHIRES-X (2023-2025)
------------------------

3.7
^^^

`release <https://github.com/NREL/GEOPHIRES-X/releases/tag/v3.7.0>`__ | `diff <https://github.com/NREL/GEOPHIRES-X/compare/v3.6.0...v3.7.0>`__

"Well depth (or total length, if not vertical)" output field renamed to "Well depth" per https://github.com/NREL/GEOPHIRES-X/issues/321


3.6
^^^

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.6.7.svg
.. |commits-since| image:: https://img.shields.io/github/commits-since/softwareengineerprogrammer/GEOPHIRES-X/v3.7.0.svg
:alt: Commits since latest release
:target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.6.7...main
:target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.7.0...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 = '2024'
author = 'NREL'
copyright = f'{year}, {author}'
version = release = '3.6.7'
version = release = '3.7.0'

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.6.7',
version='3.7.0',
license='MIT',
description='GEOPHIRES is a free and open-source geothermal techno-economic simulator.',
long_description='{}\n{}'.format(
Expand Down
18 changes: 12 additions & 6 deletions src/geophires_x/Outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,8 @@ class Outputs:
This class handles all the outputs for the GEOPHIRESv3 model.
"""

VERTICAL_WELL_DEPTH_OUTPUT_NAME = 'Well depth'

def __init__(self, model:Model, output_file:str ='HDR.out'):
model.logger.info(f'Init {__class__!s}: {__name__}')
self.ParameterDict = {}
Expand Down Expand Up @@ -860,7 +862,7 @@ def PrintOutputs(self, model: Model):
summary.append(OutputTableItem('Number of injection wells', '{0:10.0f}'.format(model.wellbores.ninj.value)))
summary.append(OutputTableItem('Flowrate per production well', '{0:10.1f}'.format(model.wellbores.prodwellflowrate.value),
model.wellbores.prodwellflowrate.CurrentUnits.value))
summary.append(OutputTableItem('Well depth (or total length, if not vertical)',
summary.append(OutputTableItem(Outputs.VERTICAL_WELL_DEPTH_OUTPUT_NAME,
'{0:10.1f}'.format(model.reserv.depth.value),
model.reserv.depth.CurrentUnits.value))

Expand Down Expand Up @@ -926,7 +928,7 @@ def PrintOutputs(self, model: Model):

engineering_parameters.append(OutputTableItem('Number of Production Wells', '{0:10.0f}'.format(model.wellbores.nprod.value)))
engineering_parameters.append(OutputTableItem('Number of Injection Wells', '{0:10.0f}'.format(model.wellbores.ninj.value)))
engineering_parameters.append(OutputTableItem('Well depth (or total length, if not vertical)',
engineering_parameters.append(OutputTableItem(Outputs.VERTICAL_WELL_DEPTH_OUTPUT_NAME,
'{0:10.1f}'.format(model.reserv.depth.value),
model.reserv.depth.CurrentUnits.value))
engineering_parameters.append(OutputTableItem('Water loss rate', '{0:10.1f}'.format(model.reserv.waterloss.value * 100),
Expand Down Expand Up @@ -1613,7 +1615,7 @@ def PrintOutputs(self, model: Model):
f.write(f' Number of production wells: {model.wellbores.nprod.value:10.0f}'+NL)
f.write(f' Number of injection wells: {model.wellbores.ninj.value:10.0f}'+NL)
f.write(f' Flowrate per production well: {model.wellbores.prodwellflowrate.value:10.1f} ' + model.wellbores.prodwellflowrate.CurrentUnits.value + NL)
f.write(f' Well depth (or total length, if not vertical): {model.reserv.depth.value:10.1f} ' +model.reserv.depth.CurrentUnits.value + NL)
f.write(f' {Outputs._field_label(Outputs.VERTICAL_WELL_DEPTH_OUTPUT_NAME, 49)}{model.reserv.depth.value:10.1f} ' + model.reserv.depth.CurrentUnits.value + NL)

if model.reserv.numseg.value == 1:
f.write(f' Geothermal gradient: {model.reserv.gradient.value[0]:10.4g} ' + model.reserv.gradient.CurrentUnits.value + NL)
Expand Down Expand Up @@ -1669,7 +1671,7 @@ def PrintOutputs(self, model: Model):
f.write(NL)
f.write(f' Number of Production Wells: {model.wellbores.nprod.value:10.0f}' + NL)
f.write(f' Number of Injection Wells: {model.wellbores.ninj.value:10.0f}' + NL)
f.write(f' Well depth (or total length, if not vertical): {model.reserv.depth.value:10.1f} ' + model.reserv.depth.CurrentUnits.value + NL)
f.write(f' {Outputs._field_label(Outputs.VERTICAL_WELL_DEPTH_OUTPUT_NAME, 49)}{model.reserv.depth.value:10.1f} ' + model.reserv.depth.CurrentUnits.value + NL)
f.write(f' Water loss rate: {model.reserv.waterloss.value*100:10.1f} ' + model.reserv.waterloss.CurrentUnits.value + NL)
f.write(f' Pump efficiency: {model.surfaceplant.pump_efficiency.value:10.1f} ' + model.surfaceplant.pump_efficiency.CurrentUnits.value + NL)
f.write(f' Injection temperature: {model.wellbores.Tinj.value:10.1f} ' + model.wellbores.Tinj.CurrentUnits.value + NL)
Expand Down Expand Up @@ -1809,7 +1811,7 @@ def PrintOutputs(self, model: Model):
elif econ.cost_lateral_section.value > 0.0:
f.write(f' Drilling and completion costs per vertical production well: {econ.cost_one_production_well.value:10.2f} ' + econ.cost_one_production_well.CurrentUnits.value + NL)
f.write(f' Drilling and completion costs per vertical injection well: {econ.cost_one_injection_well.value:10.2f} ' + econ.cost_one_injection_well.CurrentUnits.value + NL)
f.write(f' Drilling and completion costs per non-vertical sections: {econ.cost_lateral_section.value:10.2f} ' + econ.cost_lateral_section.CurrentUnits.value + NL)
f.write(f' Drilling and completion costs per non-vertical section: {econ.cost_lateral_section.value:10.2f} ' + econ.cost_lateral_section.CurrentUnits.value + NL)
else:
f.write(f' Drilling and completion costs per well: {model.economics.Cwell.value/(model.wellbores.nprod.value+model.wellbores.ninj.value):10.2f} ' + model.economics.Cwell.CurrentUnits.value + NL)
f.write(f' Stimulation costs: {model.economics.Cstim.value:10.2f} ' + model.economics.Cstim.CurrentUnits.value + NL)
Expand All @@ -1822,7 +1824,7 @@ def PrintOutputs(self, model: Model):
f.write(f' of which Peaking Boiler Cost: {model.economics.peakingboilercost.value:10.2f} ' + model.economics.peakingboilercost.CurrentUnits.value + NL)
f.write(f' Field gathering system costs: {model.economics.Cgath.value:10.2f} ' + model.economics.Cgath.CurrentUnits.value + NL)
if model.surfaceplant.piping_length.value > 0:
f.write(f' Transmission pipeline cost {model.economics.Cpiping.value:10.2f} ' + model.economics.Cpiping.CurrentUnits.value + NL)
f.write(f' Transmission pipeline cost: {model.economics.Cpiping.value:10.2f} ' + model.economics.Cpiping.CurrentUnits.value + NL)
if model.surfaceplant.plant_type.value == PlantType.DISTRICT_HEATING:
f.write(f' District Heating System Cost: {model.economics.dhdistrictcost.value:10.2f} ' + model.economics.dhdistrictcost.CurrentUnits.value + NL)
f.write(f' Total surface equipment costs: {(model.economics.Cplant.value+model.economics.Cgath.value):10.2f} ' + model.economics.Cplant.CurrentUnits.value + NL)
Expand Down Expand Up @@ -2163,3 +2165,7 @@ def o(output_param: OutputParameter):


model.logger.info(f'Complete {__class__!s}: {sys._getframe().f_code.co_name}')

@staticmethod
def _field_label(field_name:str, print_width_before_value: int) -> str:
return f'{field_name}:{" " * (print_width_before_value - len(field_name) - 1)}'
2 changes: 1 addition & 1 deletion src/geophires_x/SUTRAOutputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def PrintOutputs(self, model: Model):
f.write(NL)
f.write(f" Number of Production Wells: {model.wellbores.nprod.value:10.0f}" + NL)
f.write(f" Number of Injection Wells: {model.wellbores.ninj.value:10.0f}" + NL)
f.write(f" Well Depth: {model.reserv.depth.value:10.1f} " + model.reserv.depth.CurrentUnits.value + NL)
f.write(f" Well depth: {model.reserv.depth.value:10.1f} " + model.reserv.depth.CurrentUnits.value + NL)

pump_efficiency_display_unit = model.surfaceplant.pump_efficiency.CurrentUnits.value
pump_efficiency_display = f'{model.surfaceplant.pump_efficiency.value:10.1f} {pump_efficiency_display_unit}'
Expand Down
2 changes: 1 addition & 1 deletion src/geophires_x/SurfacePlant.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def __init__(self, model: Model):
UnitType=Units.LENGTH,
PreferredUnits=LengthUnit.KILOMETERS,
CurrentUnits=LengthUnit.KILOMETERS,
ErrMessage="assume default piping length (5km)"
ErrMessage="assume default piping length (0km)"
)
self.plant_outlet_pressure = self.ParameterDict[self.plant_outlet_pressure.Name] = floatParameter(
"Plant Outlet Pressure",
Expand Down
2 changes: 1 addition & 1 deletion src/geophires_x/SurfacePlantDoubleFlash.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def Calculate(self, model: Model) -> None:
model.wellbores.Tinj.value, ReinjTemp, self.T_chp_bottom.value,
self.enduse_efficiency_factor.value, self.chp_fraction.value)

# subtract pumping power for net electricity and calculate first law efficiency
# subtract pumping power for net electricity and calculate first law efficiency
self.NetElectricityProduced.value = self.ElectricityProduced.value - model.wellbores.PumpingPower.value
self.FirstLawEfficiency.value = self.NetElectricityProduced.value/HeatExtractedTowardsElectricity

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.6.7'
__version__ = '3.7.0'
12 changes: 9 additions & 3 deletions src/geophires_x_client/geophires_x_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class GeophiresXResult:
'Number of injection wells',
'Flowrate per production well',
'Well depth',
'Well depth (or total length, if not vertical)',
'Well depth (or total length, if not vertical)', # deprecated
'Geothermal gradient',
'Segment 1 Geothermal gradient',
'Segment 1 Thickness',
Expand Down Expand Up @@ -101,7 +101,8 @@ class GeophiresXResult:
'ENGINEERING PARAMETERS': [
'Number of Production Wells',
'Number of Injection Wells',
'Well depth (or total length, if not vertical)',
'Well depth',
'Well depth (or total length, if not vertical)', # deprecated
'Water loss rate', # %
'Pump efficiency', # %
'Injection temperature',
Expand Down Expand Up @@ -195,18 +196,23 @@ class GeophiresXResult:
'Drilling and completion costs per injection well',
'Drilling and completion costs per vertical production well',
'Drilling and completion costs per vertical injection well',
'Drilling and completion costs per non - vertical sections',
'Drilling and completion costs per non-vertical section',
'Drilling and completion costs (for redrilling)',
'Drilling and completion costs per redrilled well',
'Stimulation costs',
'Stimulation costs (for redrilling)',
'Surface power plant costs',
'of which Absorption Chiller Cost',
'of which Heat Pump Cost',
'of which Peaking Boiler Cost',
'Transmission pipeline cost',
'District Heating System Cost',
'Field gathering system costs',
'Total surface equipment costs',
'Exploration costs',
'Investment Tax Credit',
'Total capital costs',
'Annualized capital costs',
# AGS/CLGS
'Total CAPEX',
'Drilling Cost',
Expand Down
7 changes: 4 additions & 3 deletions tests/example1_addons.csv
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SUMMARY OF RESULTS,Electricity breakeven price,,1.74,cents/kWh
SUMMARY OF RESULTS,Number of production wells,,2,count
SUMMARY OF RESULTS,Number of injection wells,,2,count
SUMMARY OF RESULTS,Flowrate per production well,,55.0,kg/sec
SUMMARY OF RESULTS,"Well depth (or total length\, if not vertical)",,3.0,kilometer
SUMMARY OF RESULTS,Well depth,,3.0,kilometer
SUMMARY OF RESULTS,Geothermal gradient,,50,degC/km
SUMMARY OF RESULTS,Total Avoided Carbon Emissions,,472.02,kilotonne
ECONOMIC PARAMETERS,Economic Model,,Fixed Charge Rate (FCR),
Expand Down Expand Up @@ -35,7 +35,7 @@ EXTENDED ECONOMICS,Total Add-on Profit,,2.84,MUSD/yr
EXTENDED ECONOMICS,AddOns Payback Period,,0.0,yr
ENGINEERING PARAMETERS,Number of Production Wells,,2,count
ENGINEERING PARAMETERS,Number of Injection Wells,,2,count
ENGINEERING PARAMETERS,"Well depth (or total length\, if not vertical)",,3.0,kilometer
ENGINEERING PARAMETERS,Well depth,,3.0,kilometer
ENGINEERING PARAMETERS,Water loss rate,,2.0,
ENGINEERING PARAMETERS,Pump efficiency,,80.0,%
ENGINEERING PARAMETERS,Injection temperature,,50.0,degC
Expand Down Expand Up @@ -80,6 +80,7 @@ CAPITAL COSTS (M$),Field gathering system costs,,2.3,MUSD
CAPITAL COSTS (M$),Total surface equipment costs,,23.1,MUSD
CAPITAL COSTS (M$),Exploration costs,,5.33,MUSD
CAPITAL COSTS (M$),Total capital costs,,31.07,MUSD
CAPITAL COSTS (M$),Annualized capital costs,,1.55,MUSD
OPERATING AND MAINTENANCE COSTS (M$/yr),Wellfield maintenance costs,,0.44,MUSD/yr
OPERATING AND MAINTENANCE COSTS (M$/yr),Power plant maintenance costs,,0.9,MUSD/yr
OPERATING AND MAINTENANCE COSTS (M$/yr),Water costs,,0.06,MUSD/yr
Expand All @@ -97,7 +98,7 @@ SURFACE EQUIPMENT SIMULATION RESULTS,Average Annual Total Electricity Generation
SURFACE EQUIPMENT SIMULATION RESULTS,Average Annual Net Electricity Generation,,42.3,GWh
SURFACE EQUIPMENT SIMULATION RESULTS,Average Pumping Power,,0.2,MW
SURFACE EQUIPMENT SIMULATION RESULTS,Initial pumping power/net installed power,,3.82,%
Simulation Metadata,GEOPHIRES Version,,3.6.3,
Simulation Metadata,GEOPHIRES Version,,3.7.0,
POWER GENERATION PROFILE,THERMAL DRAWDOWN,1,1.0,
POWER GENERATION PROFILE,THERMAL DRAWDOWN,2,1.0056,
POWER GENERATION PROFILE,THERMAL DRAWDOWN,3,1.0073,
Expand Down
14 changes: 7 additions & 7 deletions tests/examples/Fervo_Norbeck_Latimer_2023.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

Simulation Metadata
----------------------
GEOPHIRES Version: 3.6.6
Simulation Date: 2024-11-21
Simulation Time: 10:38
Calculation Time: 0.439 sec
GEOPHIRES Version: 3.7.0
Simulation Date: 2025-01-20
Simulation Time: 10:49
Calculation Time: 0.454 sec

***SUMMARY OF RESULTS***

Expand All @@ -17,7 +17,7 @@ Simulation Metadata
Number of production wells: 1
Number of injection wells: 1
Flowrate per production well: 41.0 kg/sec
Well depth (or total length, if not vertical): 2.3 kilometer
Well depth: 2.3 kilometer
Geothermal gradient: 74 degC/km


Expand All @@ -38,7 +38,7 @@ Simulation Metadata

Number of Production Wells: 1
Number of Injection Wells: 1
Well depth (or total length, if not vertical): 2.3 kilometer
Well depth: 2.3 kilometer
Water loss rate: 10.0
Pump efficiency: 80.0 %
Injection temperature: 41.0 degC
Expand Down Expand Up @@ -97,7 +97,7 @@ Simulation Metadata
Drilling and completion costs: 10.13 MUSD
Drilling and completion costs per vertical production well: 3.02 MUSD
Drilling and completion costs per vertical injection well: 3.02 MUSD
Drilling and completion costs per non-vertical sections: 3.61 MUSD
Drilling and completion costs per non-vertical section: 3.61 MUSD
Stimulation costs: 1.51 MUSD
Surface power plant costs: 11.34 MUSD
Field gathering system costs: 1.52 MUSD
Expand Down
12 changes: 6 additions & 6 deletions tests/examples/Fervo_Project_Cape-2.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

Simulation Metadata
----------------------
GEOPHIRES Version: 3.6.3
Simulation Date: 2024-11-18
Simulation Time: 16:56
Calculation Time: 2.730 sec
GEOPHIRES Version: 3.7.0
Simulation Date: 2025-01-20
Simulation Time: 10:49
Calculation Time: 0.685 sec

***SUMMARY OF RESULTS***

Expand All @@ -17,7 +17,7 @@ Simulation Metadata
Number of production wells: 1
Number of injection wells: 2
Flowrate per production well: 93.0 kg/sec
Well depth (or total length, if not vertical): 2.6 kilometer
Well depth: 2.6 kilometer
Geothermal gradient: 74 degC/km


Expand All @@ -38,7 +38,7 @@ Simulation Metadata

Number of Production Wells: 1
Number of Injection Wells: 2
Well depth (or total length, if not vertical): 2.6 kilometer
Well depth: 2.6 kilometer
Water loss rate: 2.0
Pump efficiency: 80.0 %
Injection temperature: 56.7 degC
Expand Down
Loading

0 comments on commit 81caf47

Please sign in to comment.