The WellsManager class handles INJECTORS by assigning a phase
distribution (W->ctrls[i]->distr) that coincides with the injected
fluid for the corresponding well (e.g., {1,0,0} for WATER injectors in
a three-phase WATER/OIL/GAS simulation). This, however, meshes poorly
with the restriction that all phase components must be ONE in the case
of wells constrained by total reservoir volume flow targets (RESV)
that was introduced in commit b7d1634.
This change-set limits the restriction on phase distributions to
PRODUCERs only and is a tentative solution to GitHub PR #360.
We previously ignored effects of gravity in the calculation of the well
connection fluxes (i.e., perforation fluxes). This commit includes
those effects where appropriate.
The CompressibleTpfa class always passes a non-null `forces->wells'
object to the constructor, assembly, and reconstruction routines but
uses ``forces->wells->W == 0'' to signify a simulation model without
wells. This is, arguably, an error in the CompressibleTpfa class but
one that does not require a lot of work to support in the
cfs_tpfa_residual module.
Insert the extra tests in an effort to honour the ``liberal in what you
accept, strict in what you produce'' principle.
The singularity flag is true if there are no pressure conditions and no
compressibility (so the absolute values of the pressure solution will be
arbitrary).
Notably:
* Replace all remaining <tab>s with (8) spaces.
* Use post-increment for all counters.
* Insert a number of blank lines to highlight important groups.
Failing to do this operation resulted in incorrect matrices in cases
with anisotropic tensors and/or non-cube cells. The error has been
present since the inception of this implementation.
This was done using the convention that for a well w in W,
W.ctrls[w]->current < 0
means that it should be treated as shut. This allows us to keep the matrix
structure related to wells constant, without needing to remake it when wells
shut or open.
Contingent upon passing non-NULL well_press and well_flux pointers in
the solution structure. The forces must be the same as the ones used
in assembling the system of linear equations.