|
1 | 1 | import math
|
2 | 2 | import sys
|
3 |
| -import os |
4 | 3 | import numpy as np
|
5 | 4 | import numpy_financial as npf
|
6 | 5 | import geophires_x.Model as Model
|
7 | 6 | from geophires_x.OptionList import Configuration, WellDrillingCostCorrelation, EconomicModel, EndUseOptions, PlantType
|
8 | 7 | from geophires_x.Parameter import intParameter, floatParameter, OutputParameter, ReadParameter, boolParameter, \
|
9 | 8 | coerce_int_params_to_enum_values
|
10 | 9 | 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 |
54 | 11 |
|
55 | 12 |
|
56 | 13 | 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:
|
2230 | 2187 | model.wellbores.injection_reservoir_depth.value = input_vert_depth_km
|
2231 | 2188 |
|
2232 | 2189 | 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) |
2239 | 2196 |
|
2240 | 2197 | else:
|
2241 | 2198 | tot_m = tot_vert_m = model.reserv.depth.quantity().to('km').magnitude
|
|
0 commit comments