This is arguably a hack. The default implementation in terms of
Simulator<>::episodeWillBeOver() is known to have non-trivial false
negatives in certain regression tests. These are in turn possibly
related to using the simulation start time point (often a large
number of seconds) and subtracting values of similar size. The
custom implementation in FlowProblemBlackoil<> uses a floating-point
comparison involving Schedule::seconds() instead, thereby reducing
the size of the numbers involved. We're still vulnerable to
"catastrophic cancellation" errors, but potentially less so.
A complete fix for the problem may involve switching to representing
the simulated time variable as an integer instead of a
floating-point type.
We currently do not support saturation function end-point scaling
in LGRs, so there's no need to try. Therefore, limit the checks
to the main grid--levelGridView(0)--only.
the pointer is allocated in the ctor, so the fact that it is a unique_ptr
can be kept as an implementation detail. furthermore, the previous
accessor did not properly enforce constness, as a const unique_ptr<EclWriter>
only applies const to the pointer class, not the data the pointer points to.
This commit splits the action processing of member function
FlowProblemBlackoil::endTimeStep()
out into a separate member function
void FlowProblemBlackoil::endStepApplyAction()
for use by client code. The initial use case is to have an
action-like operation that supports adding new connections to wells
in parts of the formation undergoing hydraulic fracturing.
The functions no longer use the 'episeodeIdx' or Schedule
parameters. Update callers accordingly.
While here, split some long lines and remove unneeded local objects.
so the FlowProblemComp can output ecl style output.
it duplicates the OutputBlackoilModule and GenericOutputBlackoilModule
for compositional related output for now.
The new parameter CheckSatfuncConsistency, command line option
--check-satfunc-consistency, allows users to opt into running the
checks. The option currently defaults to 'false' to reflect the
somewhat experimental nature of the new facility.
The new parameter --num-satfunc-consistency-sample-points allows the
user to select the maximum number of reported failures for each
individual consistency check. By default, the simulator will report
at most five failures for each check.
We check the unscaled curves if the run does not activate the
end-point scaling option and the scaled curves otherwise. At
present we're limited to reversible and non-directional saturation
functions for the drainage process, but those restrictions will be
lifted in due time.