NREL / GEOPHIRES-X

MIT License
26 stars 21 forks source link

T > 647.096K causes vapor pressure-related exception #214

Closed softwareengineerprogrammer closed 4 weeks ago

softwareengineerprogrammer commented 1 month ago

Example input:

End-Use Option, 2
Reservoir Depth, 6
Gradient 1, 75
Reservoir Model, 1
Time steps per year, 6
Maximum Temperature, 500

Results in exception:

  File "/src/geophires_x/GeoPHIRESUtils.py", line 391, in vapor_pressure_water_kPa
    return (quantity(CP.PropsSI('P', 'T', celsius_to_kelvin(temperature_degC), 'Q', 0, 'Water'), 'Pa')
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "CoolProp/CoolProp.pyx", line 391, in CoolProp.CoolProp.PropsSI
  File "CoolProp/CoolProp.pyx", line 471, in CoolProp.CoolProp.PropsSI
  File "CoolProp/CoolProp.pyx", line 358, in CoolProp.CoolProp.__Props_err2
ValueError: Temperature to QT_flash [738.15 K] must be in range [273.06 K, 647.096 K] : PropsSI("P","T",738.15,"Q",0,"Water")

Related to https://github.com/softwareengineerprogrammer/GEOPHIRES-X/commit/46d18a783f1134f9873e77899b39a5bb2d009817 / https://github.com/NREL/GEOPHIRES-X/issues/156#issuecomment-1989962166

Possibly relevant to https://github.com/NREL/GEOPHIRES-X/issues/195

softwareengineerprogrammer commented 1 month ago

Possible fix in https://github.com/softwareengineerprogrammer/GEOPHIRES-X/commit/f0fd30d1c9e6ead524c47a6d45e6c87ebff66f6e - need SME input on whether falling back to hydrostatic pressure is appropriate - @kfbeckers, maybe you are able to weigh in on this?

softwareengineerprogrammer commented 1 month ago

https://github.com/NREL/GEOPHIRES-X/blob/67dcdc03e6e2718c64679e2266b62ac6d1bcae2e/src/geophires_x/WellBores.py#L439