make explicit initialization for twophase cases work

if the initial solution is explicitly given by the deck using the
PRESSURE, SWAT, etc. keywords, the specified state can be
thermodynamically impossible. To avoid inconsistencies, we use a flash
calculation to find a state that is in thermodynamic equilibrium and
exhibits the same masses as the explicitly specified solution. Since
the flash solver needs to compute quantities for all fluid phases, but
two-phase blackoil simulations usually do not specify the properties
of one phase, the flash solver crashed. This patch works around that
issue by simply not using the flash solver in the twophase case, i.e.,
the explicit initial condition must be thermodynamically consistent in
order to produce the stable results for a different choice of primary
variables.
This commit is contained in:
Andreas Lauser
2017-04-18 16:11:44 +02:00
parent 346710c5af
commit 96869b6a2f

View File

@@ -1134,8 +1134,9 @@ private:
const auto& eclState = gridManager.eclState();
// since the values specified in the deck do not need to be consistent, we use an
// initial condition that conserves the total mass specified by these values.
useMassConservativeInitialCondition_ = true;
// initial condition that conserves the total mass specified by these values, but
// for this to work all three phases must be active.
useMassConservativeInitialCondition_ = (FluidSystem::numActivePhases() == 3);
// make sure all required quantities are enables
if (FluidSystem::phaseIsActive(waterPhaseIdx) && !deck.hasKeyword("SWAT"))