Skip to content

Commit ba452ab

Browse files
Merge pull request NREL#227 from kfbeckers/main
fixes vapor pressure error above critical temperature NREL#214
2 parents b926e63 + 49a03fc commit ba452ab

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

src/geophires_x/WellBores.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,10 @@ def ProdPressureDropAndPumpingPowerUsingIndexes(
436436
Pexcess_kPa = 344.7 # = 50 psi
437437

438438
# Minimum production pump inlet pressure and minimum wellhead pressure
439-
Pminimum_kPa = vapor_pressure_water_kPa(Trock_degC) + Pexcess_kPa
439+
if Trock_degC < 373.9:
440+
Pminimum_kPa = vapor_pressure_water_kPa(Trock_degC) + Pexcess_kPa
441+
else: #above the critical water temperature, vapor no longer occurs and vapor pressure can no longer be calculated. A "dummy" vapor pressure can be assumed as the fluid phase no longer impacts the pump depth.
442+
Pminimum_kPa = 100 #setting artificially to 1 bar = 100 kPa
440443

441444
if usebuiltinppwellheadcorrelation:
442445
Pprodwellhead = Pminimum_kPa # production wellhead pressure [kPa]
@@ -557,8 +560,10 @@ def InjPressureDropAndPumpingPowerUsingIndexes(
557560
Pexcess_kPa = 344.7 # = 50 psi
558561

559562
# Minimum production pump inlet pressure and minimum wellhead pressure
560-
Pminimum_kPa = vapor_pressure_water_kPa(Trock_degC) + Pexcess_kPa
561-
563+
if Trock_degC < 373.9:
564+
Pminimum_kPa = vapor_pressure_water_kPa(Trock_degC) + Pexcess_kPa
565+
else: #above the critical water temperature, vapor no longer occurs and vapor pressure can no longer be calculated. A "dummy" vapor pressure can be assumed as the fluid phase no longer impacts the pump depth.
566+
Pminimum_kPa = 100 #setting artificially to 1 bar = 100 kPa
562567
if usebuiltinppwellheadcorrelation:
563568
Pprodwellhead = Pminimum_kPa # production wellhead pressure [kPa]
564569
else:

tests/test_geophires_x.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,3 +345,22 @@ def get_fcr_lcoe(fcr: float) -> float:
345345
self.assertAlmostEqual(9.61, get_fcr_lcoe(0.05), places=1)
346346
self.assertAlmostEqual(3.33, get_fcr_lcoe(0.0001), places=1)
347347
self.assertAlmostEqual(104.34, get_fcr_lcoe(0.8), places=0)
348+
349+
def test_vapor_pressure_above_critical_temperature(self):
350+
"""https://github.com/NREL/GEOPHIRES-X/issues/214"""
351+
352+
input_params = GeophiresInputParameters(
353+
{
354+
'End-Use Option': 2,
355+
'Reservoir Depth': 6,
356+
'Gradient 1': 75,
357+
'Reservoir Model': 1,
358+
'Time steps per year': 1,
359+
'Maximum Temperature': 500,
360+
'Print Output to Console': 0,
361+
}
362+
)
363+
364+
result = GeophiresXClient().get_geophires_result(input_params)
365+
self.assertIsNotNone(result)
366+
self.assertIn('SUMMARY OF RESULTS', result.result)

0 commit comments

Comments
 (0)