and add a dedicated header.
this way we don't need to pull in FlowMain.hpp for the prototypes,
avoiding pulling in the entire simulator machinery just to build
some simple utility functions.
with multi-segments, the segment pressure can be lower than the bhp, so
it is not desirable to use spres_lower_limit to limit the segment
pressure. We only use spres_lower_limit to limit the bhp, which is still
valid until we begin using bhp limit lower than 1 bar.
This commit calculates the block-level depth-corrected phase
pressures BPPO, BPPG, and BPPW. We use the simulation
configuration's DatumDepth feature to extract the reference depths
for the FIPNUM region set per cell and accumulate average phase
densities per PVT regions using the RegionPhasePoreVolAverage
utility. To that end, add a new optional<> data member of this type
to the generic output module and initialise this if the input model
requests such summary output.
In particular, output the per-cell oil, gas, and water fluid in
place vectors using compatible array names and surface condition
unit conversion tags.
While here, also relax certain parallel and restart case regression
test tolerances to make the tests pass once we generate the arrays.
The initial use case is calculating the phase-filled pore-volume
weighted average of the fluid mass densities per PVT region. This
value goes into calculating depth-corrected per-cell phase pressure
values such as the BPPO and BPPG summary vectors.
This class manages a single linear array which separately tracks the
averages' numerators and denominators as running sums per region and
region set. We pick this data structure to simplify the cross-rank
reduction needed in MPI parallel runs. Client code is expected to
add individual per-cell and per-phase contributions using the
addCell() member function and then call the accumulateParallel()
member to affect the cross-rank reduction. The averages will then
be available through the fieldValue() and value() member functions.
As a further view towards the initial use case, we track two
different types of average per phase--one for the phase-filled
volume and one for the pore-volume filled volume. The latter is the
average we would get for the case of the phase saturation being one
throughout the region. This alternative value is the fallback
option for the case of the phase saturation being identically zero
throughout the region.