frank1010111/pywaterflood

Account for producer shutins

Opened this issue · 0 comments

Is your feature request related to a problem? Please describe.
When producers are shut in and not producing, their production is still predicted. Those lengths of time should not factor into the residuals for finding connectivity between the shut in producers and the active injectors.

Describe the solution you'd like
There should be a flag that, when set, changes the behavior so that when production is zero, the residual for a fit should be set to zero.

class CRM:
    ...
    def __init__(
        self,
        primary: bool = True,
        tau_selection: str = "per-pair",
        constraints: str = "positive",
        producer_shutins: bool = False,
    ):

Describe alternatives you've considered
A mask could be applied. This effect can be ignored (but maybe shouldn't).

Additional context
The function of interest is at

def residual(x, production):
return sum(
(production - self._calculate_qhat(x, production, injection, time)) ** 2
)