Should now be in sync with cfs_tpfa_residual C interface. Simple well
gravity model implemented.
More flexibility in well gravity models would be a natural future extension.
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 user will legitimately want to run models that do not specify wells
(e.g., using boundary conditions). While we do not yet fully support
that configuration (no wells), we absolutely must not crash by
dereferencing null pointers or generating pointers into ::empty()
std::vector<>s.
This commit installs the required guards needed to avoid said failure
mode.
Bhp is now initialized to bhp target for bhp-controlled wells.
Mobilities and pvt properties are now calculated from
well perforation pressure and injection specifications for
injectors, producers still use cell properties as before.
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.
Also added computeStaticData() helper called by both constructors.
It is still possible to use the other constructor for an incompressible case,
by passing a null pointer for the rock_comp argument.
Most significant changes:
- Single solve() call used for all cases (with or without gravity,
with or without rock compressibility). This is intentionally
similar to CompressibleTpfa::solve().
- Constructor take a property object and computation of necessary total
mobilities etc. moved inside class.
- Optional constructor args for rock compressibility, gravity, wells,
boundary conditions (null pointer accepted) and source terms (empty
vector accepted).
- Nonlinear iterations for the compressible rock case now handled inside
IncompTpfa. This part intentionally made similar to CompressibleTpfa.