Skip to content

Commit 1d4372b

Browse files
Merge pull request NREL#185 from malcolm-dsider/main
Adding overpressure calculation
2 parents 6f12e4f + baac859 commit 1d4372b

28 files changed

+1064
-379
lines changed

src/geophires_x/AGSWellBores.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -871,12 +871,12 @@ def CalculateNonverticalPressureDrop(self, model:Model, time_operation: float, t
871871
# nonvertical wellbore fluid conditions based on current temperature
872872
rhowater = density_water_kg_per_m3(
873873
self.NonverticalProducedTemperature.value[year],
874-
pressure=model.reserv.lithostatic_pressure()
874+
pressure=model.reserv.lithostatic_pressure(model.reserv.rhorock.value, model.reserv.InputDepth.quantity().to('m').magnitude)
875875
)
876876

877877
muwater = viscosity_water_Pa_sec(
878878
self.NonverticalProducedTemperature.value[year],
879-
pressure=model.reserv.lithostatic_pressure()
879+
pressure=model.reserv.lithostatic_pressure(model.reserv.rhorock.value, model.reserv.InputDepth.quantity().to('m').magnitude)
880880
)
881881
vhoriz = self.q_circulation / rhowater / (math.pi / 4. * self.nonverticalwellborediameter.value ** 2)
882882

@@ -957,15 +957,15 @@ def Calculate(self, model: Model) -> None:
957957
# MIR figure out how to calculate year and extract Tini from reserv Tresoutput array
958958
year = math.trunc(self.time_operation.value / self.al)
959959
self.NonverticalProducedTemperature.value[year] = inverselaplace(
960-
self, 16, 0, model.reserv.lithostatic_pressure())
960+
self, 16, 0, model.reserv.lithostatic_pressure(model.reserv.rhorock.value, model.reserv.InputDepth.quantity().to('m').magnitude))
961961
# update alpha_fluid value based on next temperature of reservoir
962962

963963
self.alpha_fluid = self.WaterThermalConductivity.value / density_water_kg_per_m3(
964964
self.NonverticalProducedTemperature.value[year],
965-
pressure=model.reserv.lithostatic_pressure()
965+
pressure=model.reserv.lithostatic_pressure(model.reserv.rhorock.value, model.reserv.InputDepth.quantity().to('m').magnitude)
966966
) / heat_capacity_water_J_per_kg_per_K(
967967
self.NonverticalProducedTemperature.value[year],
968-
pressure=model.reserv.lithostatic_pressure()
968+
pressure=model.reserv.lithostatic_pressure(model.reserv.rhorock.value, model.reserv.InputDepth.quantity().to('m').magnitude)
969969
) * 24.0 * 3600.0
970970
self.time_operation.value += self.al
971971

@@ -979,7 +979,7 @@ def Calculate(self, model: Model) -> None:
979979
self.ProdTempDrop.value = self.tempdropprod.value
980980
model.reserv.cpwater.value = heat_capacity_water_J_per_kg_per_K(
981981
self.NonverticalProducedTemperature.value[0],
982-
pressure=model.reserv.lithostatic_pressure()
982+
pressure=model.reserv.lithostatic_pressure(model.reserv.rhorock.value, model.reserv.InputDepth.quantity().to('m').magnitude)
983983
)
984984
if self.rameyoptionprod.value:
985985
self.ProdTempDrop.value = RameyCalc(model.reserv.krock.value,
@@ -1002,13 +1002,13 @@ def Calculate(self, model: Model) -> None:
10021002
if self.productionwellpumping.value:
10031003
self.rhowaterinj = density_water_kg_per_m3(
10041004
model.reserv.Tsurf.value,
1005-
pressure=model.reserv.lithostatic_pressure()
1005+
pressure=model.reserv.lithostatic_pressure(model.reserv.rhorock.value, model.reserv.InputDepth.quantity().to('m').magnitude)
10061006
) * np.linspace(1, 1,
10071007
len(self.ProducedTemperature.value))
10081008

10091009
self.rhowaterprod = density_water_kg_per_m3(
10101010
model.reserv.Trock.value,
1011-
pressure=model.reserv.lithostatic_pressure()
1011+
pressure=model.reserv.lithostatic_pressure(model.reserv.rhorock.value, model.reserv.InputDepth.quantity().to('m').magnitude)
10121012
) * np.linspace(1, 1, len(self.ProducedTemperature.value))
10131013

10141014
self.DPProdWell.value, f3, vprod, self.rhowaterprod = WellPressureDrop(model,
@@ -1113,13 +1113,13 @@ def Calculate(self, model: Model) -> None:
11131113

11141114
rho_water = density_water_kg_per_m3(
11151115
self.Tout[0],
1116-
pressure = model.reserv.lithostatic_pressure(),
1116+
pressure = model.reserv.lithostatic_pressure(model.reserv.rhorock.value, model.reserv.InputDepth.quantity().to('m').magnitude),
11171117
)
11181118

11191119

11201120
model.reserv.cpwater.value = heat_capacity_water_J_per_kg_per_K(
11211121
self.Tout[0],
1122-
pressure=model.reserv.lithostatic_pressure(),
1122+
pressure=model.reserv.lithostatic_pressure(model.reserv.rhorock.value, model.reserv.InputDepth.quantity().to('m').magnitude),
11231123
) # Need this for surface plant output calculation
11241124

11251125
# set pumping power to zero for all times, assuming that the thermosphere wil always

src/geophires_x/CylindricalReservoir.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,20 +244,20 @@ def Calculate(self, model: Model) -> None:
244244
) / 1e15 # 10^15 J
245245
self.cpwater.value = heat_capacity_water_J_per_kg_per_K(
246246
model.wellbores.Tinj.value * 0.5 + (self.Trock.value * 0.9 + model.wellbores.Tinj.value * 0.1) * 0.5,
247-
pressure=model.reserv.lithostatic_pressure()
247+
pressure=self.lithostatic_pressure(model.reserv.rhorock.value, model.reserv.depth.quantity().to('m').magnitude)
248248
)
249249
self.rhowater.value = density_water_kg_per_m3(
250250
model.wellbores.Tinj.value * 0.5 + (self.Trock.value * 0.9 + model.wellbores.Tinj.value * 0.1) * 0.5,
251-
pressure=model.reserv.lithostatic_pressure()
251+
pressure=self.lithostatic_pressure(model.reserv.rhorock.value, model.reserv.depth.quantity().to('m').magnitude)
252252
)
253253

254254
model.logger.info(f'complete {str(__class__)}: {sys._getframe().f_code.co_name}')
255255

256-
def lithostatic_pressure(self) -> PlainQuantity:
256+
#def lithostatic_pressure(self) -> PlainQuantity:
257257
"""
258258
@override
259259
260260
Standard reservoir implementation uses depth but CylindricalReservoir sets depth to total drilled length
261261
"""
262-
return quantity(static_pressure_MPa(self.rhorock.quantity().to('kg/m**3').magnitude,
263-
self.InputDepth.quantity().to('m').magnitude), 'MPa')
262+
def lithostatic_pressure(self, rho_rock_kg_per_m3: float, depth_m: float) -> PlainQuantity:
263+
return quantity(static_pressure_MPa(rho_rock_kg_per_m3, depth_m), 'MPa')

0 commit comments

Comments
 (0)