Skip to content

Commit

Permalink
Don't force fallback to simple well cost correlation for depths >7km …
Browse files Browse the repository at this point in the history
…- log warning informing user correlation may be invalid consider using fixed cost or simple correlation with per-meter cost NREL#147
  • Loading branch information
softwareengineerprogrammer committed Mar 6, 2024
1 parent e8f77f8 commit 97aac4e
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 116 deletions.
43 changes: 29 additions & 14 deletions src/geophires_x/Economics.py
Original file line number Diff line number Diff line change
Expand Up @@ -1974,17 +1974,33 @@ def Calculate(self, model: Model) -> None:
self.C1well = self.ccwellfixed.value
self.Cwell.value = self.C1well * (model.wellbores.nprod.value + model.wellbores.ninj.value)
else:
# if depth is > 7000 m, we don't have a correlation for it, so we must use the SIMPLE logic
checkdepth = model.reserv.depth.quantity().to('m').magnitude
if ((checkdepth > 7000.0 or checkdepth < 500) and
not self.wellcorrelation.value == WellDrillingCostCorrelation.SIMPLE):
msg = (f'Invalid cost correlation specified for drilling depth <500 or >7000 m ({checkdepth}m), '
f'falling back to simple user-specified cost '
f'({self.Vertical_drilling_cost_per_m.value} per meter)')
model.logger.warning(msg)
# Check if well depth is out of standard bounds for cost correlation
checkdepth_m = model.reserv.depth.quantity().to('m').magnitude

correlations_min_valid_depth_m = 500.
correlations_max_valid_depth_m = 7000.

if (checkdepth_m < correlations_min_valid_depth_m
and not self.wellcorrelation.value == WellDrillingCostCorrelation.SIMPLE):

self.wellcorrelation.value = WellDrillingCostCorrelation.SIMPLE
model.logger.warning(
f'Invalid cost correlation specified ({self.wellcorrelation.value}) for drilling depth '
f'<{correlations_min_valid_depth_m}m ({checkdepth_m}m). '
f'Falling back to simple user-specified cost '
f'({self.Vertical_drilling_cost_per_m.value} per meter)'
)

if (checkdepth_m > correlations_max_valid_depth_m
and not self.wellcorrelation.value == WellDrillingCostCorrelation.SIMPLE):
model.logger.warning(
f'{self.wellcorrelation.value} may be invalid for drilling depth '
f'>{correlations_max_valid_depth_m}m ({checkdepth_m}m). '
f'Consider using {WellDrillingCostCorrelation.SIMPLE} (per-meter cost) or '
f'{self.ccwellfixed.Name} (fixed cost per well) instead.'
)


# use SIMPLE approach if user has specified it
if self.wellcorrelation.value == WellDrillingCostCorrelation.SIMPLE:
# using the "Configuration" keywords means we are doing an AGS calculation
if hasattr(model.wellbores, 'Configuration'):
Expand All @@ -2009,18 +2025,17 @@ def Calculate(self, model: Model) -> None:
'm').magnitude * 1E-6

elif self.wellcorrelation.value == WellDrillingCostCorrelation.VERTICAL_SMALL:
self.C1well = ((0.3021 * checkdepth ** 2 + 584.9112 * checkdepth + 751368.)
self.C1well = ((0.3021 * checkdepth_m ** 2 + 584.9112 * checkdepth_m + 751368.)
* 1E-6) # well drilling and completion cost in M$/well

elif self.wellcorrelation.value == WellDrillingCostCorrelation.DEVIATED_SMALL:
self.C1well = (0.2898 * checkdepth ** 2 + 822.1507 * checkdepth + 680563.) * 1E-6
self.C1well = (0.2898 * checkdepth_m ** 2 + 822.1507 * checkdepth_m + 680563.) * 1E-6

elif self.wellcorrelation.value == WellDrillingCostCorrelation.VERTICAL_LARGE:

self.C1well = (0.2818 * checkdepth ** 2 + 1275.5213 * checkdepth + 632315.) * 1E-6
self.C1well = (0.2818 * checkdepth_m ** 2 + 1275.5213 * checkdepth_m + 632315.) * 1E-6

elif self.wellcorrelation.value == WellDrillingCostCorrelation.DEVIATED_LARGE:
self.C1well = (0.2553 * checkdepth ** 2 + 1716.7157 * checkdepth + 500867.) * 1E-6
self.C1well = (0.2553 * checkdepth_m ** 2 + 1716.7157 * checkdepth_m + 500867.) * 1E-6

# account for adjustment factor
self.C1well = self.ccwelladjfactor.value * self.C1well
Expand Down
Loading

1 comment on commit 97aac4e

@softwareengineerprogrammer
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue referenced in commit is duplicate of NREL#129

Please sign in to comment.