diff --git a/opm/models/blackoil/blackoildispersionmodule.hh b/opm/models/blackoil/blackoildispersionmodule.hh index 640102048..1ae9afde9 100644 --- a/opm/models/blackoil/blackoildispersionmodule.hh +++ b/opm/models/blackoil/blackoildispersionmodule.hh @@ -65,6 +65,13 @@ class BlackOilDispersionModule public: using ExtensiveQuantities = BlackOilDispersionExtensiveQuantities; + +#if HAVE_ECL_INPUT + static void initFromState(const EclipseState&) + { + } +#endif + /*! * \brief Adds the dispersive flux to the flux vector over a flux * integration point. @@ -112,6 +119,16 @@ class BlackOilDispersionModule public: using ExtensiveQuantities = BlackOilDispersionExtensiveQuantities; +#if HAVE_ECL_INPUT + static void initFromState(const EclipseState& eclState) + { + if (eclState.getSimulationConfig().hasVAPWAT() || eclState.getSimulationConfig().hasVAPOIL()) { + OpmLog::warning("Dispersion is activated in combination with VAPWAT/VAPOIL. \n" + "Water/oil is still allowed to vaporize, but dispersion in the " + "gas phase is ignored."); + } + } +#endif /*! * \brief Adds the mass flux due to dispersion to the flux vector over the * flux integration point. @@ -170,6 +187,13 @@ public: continue; } + // Adding dispersion in the gas phase leads to + // convergence issues and unphysical results. + // We disable dispersion in the gas phase for now + if (FluidSystem::gasPhaseIdx == phaseIdx) { + continue; + } + // no dispersion in gas for blackoil models unless gas can contain evaporated water or oil if ((!FluidSystem::enableVaporizedWater() && !FluidSystem::enableVaporizedOil()) && FluidSystem::gasPhaseIdx == phaseIdx) { continue; @@ -226,6 +250,7 @@ public: } private: + static Scalar toMassFractionGasOil (unsigned regionIdx) { Scalar rhoO = FluidSystem::referenceDensity(FluidSystem::oilPhaseIdx, regionIdx); Scalar rhoG = FluidSystem::referenceDensity(FluidSystem::gasPhaseIdx, regionIdx);