From ab83edc74d44269bd2335b080ebf21d21194d139 Mon Sep 17 00:00:00 2001 From: softwareengineerprogrammer <4056124+softwareengineerprogrammer@users.noreply.github.com> Date: Tue, 14 Jan 2025 08:42:08 -0800 Subject: [PATCH] Change 'Well depth (or total length if not vertical)' output to 'Well depth' - claim of total length if not vertical is not accurate. https://github.com/NREL/GEOPHIRES-X/issues/321 --- src/geophires_x/Outputs.py | 14 ++++++++++---- src/geophires_x/SUTRAOutputs.py | 2 +- src/geophires_x_client/geophires_x_result.py | 5 +++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/geophires_x/Outputs.py b/src/geophires_x/Outputs.py index 26a423ab..a8e9fe60 100644 --- a/src/geophires_x/Outputs.py +++ b/src/geophires_x/Outputs.py @@ -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 = {} @@ -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)) @@ -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), @@ -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) @@ -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) @@ -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))}' diff --git a/src/geophires_x/SUTRAOutputs.py b/src/geophires_x/SUTRAOutputs.py index ef7113e6..58a047c1 100644 --- a/src/geophires_x/SUTRAOutputs.py +++ b/src/geophires_x/SUTRAOutputs.py @@ -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}' diff --git a/src/geophires_x_client/geophires_x_result.py b/src/geophires_x_client/geophires_x_result.py index d33df1e3..7d494d90 100644 --- a/src/geophires_x_client/geophires_x_result.py +++ b/src/geophires_x_client/geophires_x_result.py @@ -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', @@ -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',