Skip to content

Commit 9fd91d9

Browse files
Dedicated output parameters for Injection/production well casing IDs
1 parent b806da0 commit 9fd91d9

File tree

3 files changed

+44
-9
lines changed

3 files changed

+44
-9
lines changed

src/geophires_x/Outputs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,8 @@ def PrintOutputs(self, model: Model):
327327
f.write(' User-provided production well temperature drop\n')
328328
f.write(f' Constant production well temperature drop: {model.wellbores.tempdropprod.value:10.1f} ' + model.wellbores.tempdropprod.PreferredUnits.value + NL)
329329
f.write(f' Flowrate per production well: {model.wellbores.prodwellflowrate.value:10.1f} ' + model.wellbores.prodwellflowrate.CurrentUnits.value + NL)
330-
f.write(f' Injection well casing ID: {model.wellbores.injwelldiam.value:10.3f} ' + model.wellbores.injwelldiam.CurrentUnits.value + NL)
331-
f.write(f' Production well casing ID: {model.wellbores.prodwelldiam.value:10.3f} ' + model.wellbores.prodwelldiam.CurrentUnits.value + NL)
330+
f.write(f' {model.wellbores.injection_well_casing_inner_diameter.display_name}: {model.wellbores.injection_well_casing_inner_diameter.value:10.3f} {model.wellbores.injection_well_casing_inner_diameter.CurrentUnits.value}\n')
331+
f.write(f' {model.wellbores.production_well_casing_inner_diameter.display_name}: {model.wellbores.prodwelldiam.value:10.3f} {model.wellbores.prodwelldiam.CurrentUnits.value}\n')
332332
f.write(f' {model.wellbores.redrill.display_name}: {model.wellbores.redrill.value:10.0f}\n')
333333
if model.surfaceplant.enduse_option.value in [EndUseOptions.ELECTRICITY, EndUseOptions.COGENERATION_TOPPING_EXTRA_HEAT, EndUseOptions.COGENERATION_TOPPING_EXTRA_ELECTRICITY, EndUseOptions.COGENERATION_BOTTOMING_EXTRA_ELECTRICITY, EndUseOptions.COGENERATION_BOTTOMING_EXTRA_HEAT, EndUseOptions.COGENERATION_PARALLEL_EXTRA_HEAT, EndUseOptions.COGENERATION_PARALLEL_EXTRA_ELECTRICITY]:
334334
f.write(' Power plant type: ' + str(model.surfaceplant.plant_type.value.value) + NL)

src/geophires_x/WellBores.py

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from pint.facets.plain import PlainQuantity
44

55
from .Parameter import floatParameter, intParameter, boolParameter, OutputParameter, ReadParameter, \
6-
coerce_int_params_to_enum_values
6+
coerce_int_params_to_enum_values, Parameter
77
from geophires_x.GeoPHIRESUtils import vapor_pressure_water_kPa, quantity, static_pressure_MPa
88
from geophires_x.GeoPHIRESUtils import density_water_kg_per_m3
99
from geophires_x.GeoPHIRESUtils import viscosity_water_Pa_sec
@@ -738,6 +738,7 @@ def __init__(self, model: Model):
738738
"same value."
739739
)
740740

741+
# noinspection SpellCheckingInspection
741742
self.prodwelldiam = self.ParameterDict[self.prodwelldiam.Name] = floatParameter(
742743
"Production Well Diameter",
743744
DefaultValue=8.0,
@@ -748,9 +749,10 @@ def __init__(self, model: Model):
748749
CurrentUnits=LengthUnit.INCHES,
749750
Required=True,
750751
ErrMessage="assume default production well diameter (8 inch)",
751-
ToolTipText="Inner diameter of production wellbore (assumed constant along the wellbore) to calculate \
752-
frictional pressure drop and wellbore heat transmission with Rameys model"
752+
ToolTipText='Inner diameter of production wellbore (assumed constant along the wellbore) to calculate '
753+
'frictional pressure drop and wellbore heat transmission with Rameys model'
753754
)
755+
# noinspection SpellCheckingInspection
754756
self.injwelldiam = self.ParameterDict[self.injwelldiam.Name] = floatParameter(
755757
"Injection Well Diameter",
756758
DefaultValue=8.0,
@@ -761,8 +763,8 @@ def __init__(self, model: Model):
761763
CurrentUnits=LengthUnit.INCHES,
762764
Required=True,
763765
ErrMessage="assume default injection well diameter (8 inch)",
764-
ToolTipText="Inner diameter of production wellbore (assumed constant along the wellbore) to calculate "
765-
"frictional pressure drop and wellbore heat transmission with Rameys model"
766+
ToolTipText='Inner diameter of production wellbore (assumed constant along the wellbore) to calculate '
767+
'frictional pressure drop and wellbore heat transmission with Rameys model'
766768
)
767769
self.rameyoptionprod = self.ParameterDict[self.rameyoptionprod.Name] = boolParameter(
768770
"Ramey Production Wellbore Model",
@@ -1097,6 +1099,21 @@ def __init__(self, model: Model):
10971099
self.MyPath = __file__
10981100

10991101
# Results - used by other objects or printed in output downstream
1102+
1103+
self.injection_well_casing_inner_diameter = self.OutputParameterDict[self.injection_well_casing_inner_diameter.Name] = OutputParameter(
1104+
Name='Injection well casing ID',
1105+
UnitType=self.injwelldiam.UnitType,
1106+
PreferredUnits=self.injwelldiam.PreferredUnits,
1107+
CurrentUnits=self.injwelldiam.CurrentUnits,
1108+
ToolTipText=self.injwelldiam.ToolTipText,
1109+
)
1110+
self.production_well_casing_inner_diameter = self.OutputParameterDict[self.production_well_casing_inner_diameter.Name] = OutputParameter(
1111+
Name='Production well casing ID',
1112+
UnitType=self.prodwelldiam.UnitType,
1113+
PreferredUnits=self.prodwelldiam.PreferredUnits,
1114+
CurrentUnits=self.prodwelldiam.CurrentUnits,
1115+
ToolTipText=self.prodwelldiam.ToolTipText,
1116+
)
11001117
self.production_reservoir_pressure = self.OutputParameterDict[self.production_reservoir_pressure.Name] = OutputParameter(
11011118
Name="Calculated Reservoir Pressure",
11021119
value=self.Phydrostatic.value,
@@ -1537,4 +1554,14 @@ def Calculate(self, model: Model) -> None:
15371554
# negative pumping power values become zero (b/c we are not generating electricity)
15381555
self.PumpingPower.value = [0. if x < 0. else x for x in self.PumpingPower.value]
15391556

1557+
# Injection/production well casing ID have same value as inputs but exist as separate output parameters due to
1558+
# having a different display name.
1559+
self._set_output_param_from_input_param(self.injwelldiam, self.injection_well_casing_inner_diameter)
1560+
self._set_output_param_from_input_param(self.prodwelldiam, self.production_well_casing_inner_diameter)
1561+
15401562
model.logger.info(f'complete {self.__class__.__name__}: {__name__}')
1563+
1564+
# noinspection PyMethodMayBeStatic
1565+
def _set_output_param_from_input_param(self, input_param: Parameter, output_param: OutputParameter) -> None:
1566+
output_param.value = input_param.value
1567+
output_param.CurrentUnits = input_param.CurrentUnits

src/geophires_x_schema_generator/geophires-result.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,16 @@
212212
},
213213
"Average production well temperature drop": {},
214214
"Flowrate per production well": {},
215-
"Injection well casing ID": {},
216-
"Production well casing ID": {},
215+
"Injection well casing ID": {
216+
"type": "number",
217+
"description": "Inner diameter of production wellbore (assumed constant along the wellbore) to calculate frictional pressure drop and wellbore heat transmission with Rameys model",
218+
"units": "in"
219+
},
220+
"Production well casing ID": {
221+
"type": "number",
222+
"description": "Inner diameter of production wellbore (assumed constant along the wellbore) to calculate frictional pressure drop and wellbore heat transmission with Rameys model",
223+
"units": "in"
224+
},
217225
"Number of times redrilling": {
218226
"type": "number",
219227
"description": "redrill",

0 commit comments

Comments
 (0)