This commit switches the approach introduced in commit eeb1b7e36 (PR
#3169) to using a mobility weighted average of cell level densities
for the connection level mixture densities in no-flow producing
wells. We also use the recent stoppedOrZeroRateTarget() predicate
to identify those no-flow producing wells instead of inspecting the
connection flow rates.
The mobility weighted average gives a more monotone pressure buildup
for the stopped wells and this is usually what the engineer wants.
This revised approach furthermore needs fewer cell-level dynamic
properties so simplify the computeProperties() signature by
introducing a structure for the property callback functions and
update the callers accordingly.
This commit switches computePropertiesForPressures() to return a
Properties object directly instead of populating an object
constructed in the caller. There is just a single call site for
this function so there's no benefit to using an out parameter here.
While here, also collect the property callbacks into a structure to
simplify the function signature. This also enables not filling in
the solvent properties unless solvent is active in the run. Update
caller accordingly.
In particular, split the sections of the main loop out to helper
functions
- calculatePerforationOutflow() uses the global container factory
to compute the outflow from each connection
- initialiseConnectionMixture() computes the 'mix' array depending
on the local flowing conditions of the connection. We have
renamed 'x' and 'mix' arrays to 'currentMixture' and
'previousMixture' respectively to give more descriptive names in
the process.
We've also split out the redistribution of the individual phases to
the new private helper functions reapportionGasOilMixture() and
reapportionGasWaterMixture() in order to reduce the cognitive load
of the main loop in computePropertiesForPressures(). While here,
employ pointer arithmetic to expose the underlying structure of the
assignment expressions.
In particular
* Split some long lines
* Reverse conditions to reduce nesting
* Mark potentially unused arguments as [[maybe_unused]]
* Try to remove redundant calculations
* Mark some objets 'const' where possible