Skip to content

Commit 73f9224

Browse files
move calculat_total_drilling_lentghs from economics to wellbores in prepartion for updating it
1 parent b2477a8 commit 73f9224

File tree

3 files changed

+52
-52
lines changed

3 files changed

+52
-52
lines changed

src/geophires_x/Economics.py

Lines changed: 7 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,13 @@
11
import math
22
import sys
3-
import os
43
import numpy as np
54
import numpy_financial as npf
65
import geophires_x.Model as Model
76
from geophires_x.OptionList import Configuration, WellDrillingCostCorrelation, EconomicModel, EndUseOptions, PlantType
87
from geophires_x.Parameter import intParameter, floatParameter, OutputParameter, ReadParameter, boolParameter, \
98
coerce_int_params_to_enum_values
109
from geophires_x.Units import *
11-
12-
13-
def calculate_total_drilling_lengths_m(Configuration, numnonverticalsections: int, nonvertical_length_km: float,
14-
InputDepth_km: float, OutputDepth_km: float, nprod:int, ninj:int) -> tuple:
15-
"""
16-
returns the total length, vertical length, and non-vertical lengths, depending on the configuration
17-
:param Configuration: Configuration of the well
18-
:type Configuration: :class:`~geophires
19-
:param numnonverticalsections: number of non-vertical sections
20-
:type numnonverticalsections: int
21-
:param nonvertical_length_km: length of non-vertical sections in km
22-
:type nonvertical_length_km: float
23-
:param InputDepth_km: depth of the well in km
24-
:type InputDepth_km: float
25-
:param OutputDepth_km: depth of the output end of the well in km, if U shaped, and not horizontal
26-
:type OutputDepth_km: float
27-
:param nprod: number of production wells
28-
:type nprod: int
29-
:param ninj: number of injection wells
30-
:return: total length, vertical length, and horizontal lengths in meters
31-
:rtype: tuple
32-
"""
33-
if Configuration == Configuration.ULOOP:
34-
# Total drilling depth of both wells and laterals in U-loop [m]
35-
vertical_pipe_length_m = (nprod * InputDepth_km * 1000.0) + (ninj * OutputDepth_km * 1000.0)
36-
nonvertical_pipe_length_m = numnonverticalsections * nonvertical_length_km * 1000.0
37-
elif Configuration == Configuration.COAXIAL:
38-
# Total drilling depth of well and lateral in co-axial case [m]
39-
vertical_pipe_length_m = (nprod + ninj) * InputDepth_km * 1000.0
40-
nonvertical_pipe_length_m = numnonverticalsections * nonvertical_length_km * 1000.0
41-
elif Configuration == Configuration.VERTICAL:
42-
# Total drilling depth of well in vertical case [m]
43-
vertical_pipe_length_m = (nprod + ninj) * InputDepth_km * 1000.0
44-
nonvertical_pipe_length_m = 0.0
45-
elif Configuration == Configuration.L:
46-
# Total drilling depth of well in L case [m]
47-
vertical_pipe_length_m = (nprod + ninj) * InputDepth_km * 1000.0
48-
nonvertical_pipe_length_m = numnonverticalsections * nonvertical_length_km * 1000.0
49-
else:
50-
raise ValueError(f'Invalid Configuration: {Configuration}')
51-
52-
tot_pipe_length_m = vertical_pipe_length_m + nonvertical_pipe_length_m
53-
return tot_pipe_length_m, vertical_pipe_length_m, nonvertical_pipe_length_m
10+
from geophires_x.WellBores import calculate_total_drilling_lengths_m
5411

5512

5613
def calculate_cost_of_one_vertical_well(model: Model, depth_m: float, well_correlation: int,
@@ -2230,12 +2187,12 @@ def Calculate(self, model: Model) -> None:
22302187
model.wellbores.injection_reservoir_depth.value = input_vert_depth_km
22312188

22322189
tot_m, tot_vert_m, tot_horiz_m = calculate_total_drilling_lengths_m(model.wellbores.Configuration.value,
2233-
model.wellbores.numnonverticalsections.value,
2234-
model.wellbores.Nonvertical_length.value / 1000.0,
2235-
input_vert_depth_km,
2236-
output_vert_depth_km,
2237-
model.wellbores.nprod.value,
2238-
model.wellbores.ninj.value)
2190+
model.wellbores.numnonverticalsections.value,
2191+
model.wellbores.Nonvertical_length.value / 1000.0,
2192+
input_vert_depth_km,
2193+
output_vert_depth_km,
2194+
model.wellbores.nprod.value,
2195+
model.wellbores.ninj.value)
22392196

22402197
else:
22412198
tot_m = tot_vert_m = model.reserv.depth.quantity().to('km').magnitude

src/geophires_x/SBTWellbores.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
from pint.facets.plain import PlainQuantity
55

66
from geophires_x.WellBores import (WellBores, RameyCalc, WellPressureDrop, \
7-
ProdPressureDropsAndPumpingPowerUsingImpedenceModel, ProdPressureDropAndPumpingPowerUsingIndexes)
8-
from geophires_x.Economics import calculate_total_drilling_lengths_m
7+
ProdPressureDropsAndPumpingPowerUsingImpedenceModel,
8+
ProdPressureDropAndPumpingPowerUsingIndexes, calculate_total_drilling_lengths_m)
99
from .Parameter import floatParameter, intParameter, boolParameter, OutputParameter, ReadParameter
1010
from geophires_x.GeoPHIRESUtils import vapor_pressure_water_kPa, quantity, static_pressure_MPa, \
1111
heat_capacity_water_J_per_kg_per_K

src/geophires_x/WellBores.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,3 +1363,46 @@ def Calculate(self, model: Model) -> None:
13631363
self.PumpingPower.value = [0. if x < 0. else x for x in self.PumpingPower.value]
13641364

13651365
model.logger.info(f'complete {self.__class__.__name__}: {__name__}')
1366+
1367+
1368+
def calculate_total_drilling_lengths_m(Configuration, numnonverticalsections: int, nonvertical_length_km: float,
1369+
InputDepth_km: float, OutputDepth_km: float, nprod:int, ninj:int) -> tuple:
1370+
"""
1371+
returns the total length, vertical length, and non-vertical lengths, depending on the configuration
1372+
:param Configuration: Configuration of the well
1373+
:type Configuration: :class:`~geophires
1374+
:param numnonverticalsections: number of non-vertical sections
1375+
:type numnonverticalsections: int
1376+
:param nonvertical_length_km: length of non-vertical sections in km
1377+
:type nonvertical_length_km: float
1378+
:param InputDepth_km: depth of the well in km
1379+
:type InputDepth_km: float
1380+
:param OutputDepth_km: depth of the output end of the well in km, if U shaped, and not horizontal
1381+
:type OutputDepth_km: float
1382+
:param nprod: number of production wells
1383+
:type nprod: int
1384+
:param ninj: number of injection wells
1385+
:return: total length, vertical length, and horizontal lengths in meters
1386+
:rtype: tuple
1387+
"""
1388+
if Configuration == Configuration.ULOOP:
1389+
# Total drilling depth of both wells and laterals in U-loop [m]
1390+
vertical_pipe_length_m = (nprod * InputDepth_km * 1000.0) + (ninj * OutputDepth_km * 1000.0)
1391+
nonvertical_pipe_length_m = numnonverticalsections * nonvertical_length_km * 1000.0
1392+
elif Configuration == Configuration.COAXIAL:
1393+
# Total drilling depth of well and lateral in co-axial case [m]
1394+
vertical_pipe_length_m = (nprod + ninj) * InputDepth_km * 1000.0
1395+
nonvertical_pipe_length_m = numnonverticalsections * nonvertical_length_km * 1000.0
1396+
elif Configuration == Configuration.VERTICAL:
1397+
# Total drilling depth of well in vertical case [m]
1398+
vertical_pipe_length_m = (nprod + ninj) * InputDepth_km * 1000.0
1399+
nonvertical_pipe_length_m = 0.0
1400+
elif Configuration == Configuration.L:
1401+
# Total drilling depth of well in L case [m]
1402+
vertical_pipe_length_m = (nprod + ninj) * InputDepth_km * 1000.0
1403+
nonvertical_pipe_length_m = numnonverticalsections * nonvertical_length_km * 1000.0
1404+
else:
1405+
raise ValueError(f'Invalid Configuration: {Configuration}')
1406+
1407+
tot_pipe_length_m = vertical_pipe_length_m + nonvertical_pipe_length_m
1408+
return tot_pipe_length_m, vertical_pipe_length_m, nonvertical_pipe_length_m

0 commit comments

Comments
 (0)