Merge pull request #639 from totto82/fix2pboundary

Fix 2-phase blackoil boundary
This commit is contained in:
Tor Harald Sandve 2021-01-14 15:41:25 +01:00 committed by GitHub
commit 589d640f65
2 changed files with 9 additions and 7 deletions

View File

@ -106,6 +106,9 @@ public:
////////
(*this) = 0.0;
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
if (!FluidSystem::phaseIsActive(phaseIdx)) {
continue;
}
const auto& pBoundary = fluidState.pressure(phaseIdx);
const Evaluation& pInside = insideIntQuants.fluidState().pressure(phaseIdx);

View File

@ -71,7 +71,6 @@ class BlackOilRateVector
enum { enablePolymerMolarWeight = getPropValue<TypeTag, Properties::EnablePolymerMW>() };
enum { enableFoam = getPropValue<TypeTag, Properties::EnableFoam>() };
enum { enableBrine = getPropValue<TypeTag, Properties::EnableBrine>() };
using Toolbox = Opm::MathToolbox<Evaluation>;
using ParentType = Dune::FieldVector<Evaluation, numEq>;
@ -95,15 +94,15 @@ public:
// convert to "surface volume" if requested
if (getPropValue<TypeTag, Properties::BlackoilConserveSurfaceVolume>()) {
if (FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx)) {
(*this)[FluidSystem::gasCompIdx] /=
(*this)[Indices::canonicalToActiveComponentIndex(FluidSystem::gasCompIdx)] /=
FluidSystem::referenceDensity(FluidSystem::gasPhaseIdx, pvtRegionIdx);
}
if (FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx)) {
(*this)[FluidSystem::oilCompIdx] /=
(*this)[Indices::canonicalToActiveComponentIndex(FluidSystem::oilCompIdx)] /=
FluidSystem::referenceDensity(FluidSystem::oilPhaseIdx, pvtRegionIdx);
}
if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx)) {
(*this)[FluidSystem::waterCompIdx] /=
(*this)[Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx)] /=
FluidSystem::referenceDensity(FluidSystem::waterPhaseIdx, pvtRegionIdx);
}
if (enableSolvent) {
@ -148,15 +147,15 @@ public:
// convert to "surface volume" if requested
if (getPropValue<TypeTag, Properties::BlackoilConserveSurfaceVolume>()) {
if (FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx)) {
(*this)[FluidSystem::gasCompIdx] /=
(*this)[Indices::canonicalToActiveComponentIndex(FluidSystem::gasCompIdx)] /=
FluidSystem::referenceDensity(FluidSystem::gasPhaseIdx, pvtRegionIdx);
}
if (FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx)) {
(*this)[FluidSystem::oilCompIdx] /=
(*this)[Indices::canonicalToActiveComponentIndex(FluidSystem::oilCompIdx)] /=
FluidSystem::referenceDensity(FluidSystem::oilPhaseIdx, pvtRegionIdx);
}
if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx)) {
(*this)[FluidSystem::waterCompIdx] /=
(*this)[Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx)] /=
FluidSystem::referenceDensity(FluidSystem::waterPhaseIdx, pvtRegionIdx);
}
if (enableSolvent) {