Skip to content

Commit

Permalink
Handle overpressure calculation in a more elegant manner to handle ed…
Browse files Browse the repository at this point in the history
…ge cases better and provide easier reporting. Doesn't change in base case unit testing.
  • Loading branch information
malcolm-dsider committed Apr 27, 2024
1 parent 1d4372b commit ed3127e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/geophires_x/Outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2073,7 +2073,7 @@ def o(output_param: OutputParameter):
f.write(NL)

# if we are dealing with overpressure and two different reservoirs, show a table reporting the values
if model.wellbores.overpressure_percentage.Provided and model.wellbores.injection_reservoir_depth.Provided:
if model.wellbores.overpressure_percentage.Provided:
f.write(NL)
f.write(' ***************************************\n')
f.write(' * RESERVOIR POWER REQUIRED PROFILES *\n')
Expand Down
11 changes: 9 additions & 2 deletions src/geophires_x/WellBores.py
Original file line number Diff line number Diff line change
Expand Up @@ -1104,10 +1104,17 @@ def Calculate(self, model: Model) -> None:
# and a shallower, lower pressure Injection Reservoir.
# If so, calculate the injection reservoir pressure as a function of time if overpressure is provided.
# If the injection reservoir temperature or pressure are not provided, calculate a default for them.
if self.injection_reservoir_depth.Provided: #this means they must be doing a split reservoir
if self.injection_reservoir_depth.Provided or self.injection_reservoir_inflation_rate.Provided:
# this means they must be doing a split reservoir -
# now deal give default values to whatever values they didn't set
if not self.injection_reservoir_temperature.Provided:
self.injection_reservoir_temperature.value = model.reserv.Trock.value
if not self.injection_reservoir_depth.Provided:
self.injection_reservoir_depth.value = model.reserv.depth.value
if not self.injection_reservoir_temperature.Provided:
self.injection_reservoir_temperature.value = (model.reserv.averagegradient.value * self.injection_reservoir_depth.value) + model.reserv.Tsurf.value
if self.injection_reservoir_pressure.value < 0:

if self.injection_reservoir_pressure.value < 0: # they didn't provide a pressure so assume hydrostatic.
self.injection_reservoir_pressure.value = get_hydrostatic_pressure_kPa(self.injection_reservoir_temperature.value,
model.reserv.Tsurf.value,
self.injection_reservoir_depth.value,
Expand Down

0 comments on commit ed3127e

Please sign in to comment.