Merge pull request #859 from totto82/nodispgas

ignore dispersion in gas phase
This commit is contained in:
Atgeirr Flø Rasmussen 2024-01-23 09:25:33 +01:00 committed by GitHub
commit ec8f84429e

View File

@ -65,6 +65,13 @@ class BlackOilDispersionModule<TypeTag, /*enableDispersion=*/false>
public:
using ExtensiveQuantities = BlackOilDispersionExtensiveQuantities<TypeTag,false>;
#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<TypeTag, /*enableDispersion=*/true>
public:
using ExtensiveQuantities = BlackOilDispersionExtensiveQuantities<TypeTag,true>;
#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);