Stop interpolating between unsaturated/saturated regions.
This is possible since the new interpolation ensures continuity up to the boundary between the regions.
This commit is contained in:
parent
5399d72477
commit
215af283e2
@ -724,21 +724,11 @@ public:
|
||||
if (fluidState.saturation(gasPhaseIdx) > 0.0
|
||||
&& Rs >= (1.0 - 1e-10)*oilPvt_->saturatedGasDissolutionFactor(regionIdx, Opm::scalarValue(T), Opm::scalarValue(p)))
|
||||
{
|
||||
if (fluidState.saturation(gasPhaseIdx) < 1e-4) {
|
||||
// here comes the relatively expensive case: first calculate and then
|
||||
// interpolate between the saturated and undersaturated quantities to
|
||||
// avoid a discontinuity
|
||||
const auto& alpha = Opm::decay<LhsEval>(fluidState.saturation(gasPhaseIdx))/1e-4;
|
||||
const auto& bSat = oilPvt_->saturatedInverseFormationVolumeFactor(regionIdx, T, p);
|
||||
const auto& bUndersat = oilPvt_->inverseFormationVolumeFactor(regionIdx, T, p, Rs);
|
||||
return alpha*bSat + (1.0 - alpha)*bUndersat;
|
||||
}
|
||||
|
||||
return oilPvt_->saturatedInverseFormationVolumeFactor(regionIdx, T, p);
|
||||
}
|
||||
|
||||
} else {
|
||||
return oilPvt_->inverseFormationVolumeFactor(regionIdx, T, p, Rs);
|
||||
}
|
||||
}
|
||||
|
||||
const LhsEval Rs(0.0);
|
||||
return oilPvt_->inverseFormationVolumeFactor(regionIdx, T, p, Rs);
|
||||
@ -749,21 +739,11 @@ public:
|
||||
if (fluidState.saturation(oilPhaseIdx) > 0.0
|
||||
&& Rv >= (1.0 - 1e-10)*gasPvt_->saturatedOilVaporizationFactor(regionIdx, Opm::scalarValue(T), Opm::scalarValue(p)))
|
||||
{
|
||||
if (fluidState.saturation(oilPhaseIdx) < 1e-4) {
|
||||
// here comes the relatively expensive case: first calculate and then
|
||||
// interpolate between the saturated and undersaturated quantities to
|
||||
// avoid a discontinuity
|
||||
const auto& alpha = Opm::decay<LhsEval>(fluidState.saturation(oilPhaseIdx))/1e-4;
|
||||
const auto& bSat = gasPvt_->saturatedInverseFormationVolumeFactor(regionIdx, T, p);
|
||||
const auto& bUndersat = gasPvt_->inverseFormationVolumeFactor(regionIdx, T, p, Rv);
|
||||
return alpha*bSat + (1.0 - alpha)*bUndersat;
|
||||
}
|
||||
|
||||
return gasPvt_->saturatedInverseFormationVolumeFactor(regionIdx, T, p);
|
||||
}
|
||||
|
||||
} else {
|
||||
return gasPvt_->inverseFormationVolumeFactor(regionIdx, T, p, Rv);
|
||||
}
|
||||
}
|
||||
|
||||
const LhsEval Rv(0.0);
|
||||
return gasPvt_->inverseFormationVolumeFactor(regionIdx, T, p, Rv);
|
||||
@ -941,21 +921,11 @@ public:
|
||||
if (fluidState.saturation(gasPhaseIdx) > 0.0
|
||||
&& Rs >= (1.0 - 1e-10)*oilPvt_->saturatedGasDissolutionFactor(regionIdx, Opm::scalarValue(T), Opm::scalarValue(p)))
|
||||
{
|
||||
if (fluidState.saturation(gasPhaseIdx) < 1e-4) {
|
||||
// here comes the relatively expensive case: first calculate and then
|
||||
// interpolate between the saturated and undersaturated quantities to
|
||||
// avoid a discontinuity
|
||||
const auto& alpha = Opm::decay<LhsEval>(fluidState.saturation(gasPhaseIdx))/1e-4;
|
||||
const auto& muSat = oilPvt_->saturatedViscosity(regionIdx, T, p);
|
||||
const auto& muUndersat = oilPvt_->viscosity(regionIdx, T, p, Rs);
|
||||
return alpha*muSat + (1.0 - alpha)*muUndersat;
|
||||
}
|
||||
|
||||
return oilPvt_->saturatedViscosity(regionIdx, T, p);
|
||||
}
|
||||
|
||||
} else {
|
||||
return oilPvt_->viscosity(regionIdx, T, p, Rs);
|
||||
}
|
||||
}
|
||||
|
||||
const LhsEval Rs(0.0);
|
||||
return oilPvt_->viscosity(regionIdx, T, p, Rs);
|
||||
@ -967,21 +937,11 @@ public:
|
||||
if (fluidState.saturation(oilPhaseIdx) > 0.0
|
||||
&& Rv >= (1.0 - 1e-10)*gasPvt_->saturatedOilVaporizationFactor(regionIdx, Opm::scalarValue(T), Opm::scalarValue(p)))
|
||||
{
|
||||
if (fluidState.saturation(oilPhaseIdx) < 1e-4) {
|
||||
// here comes the relatively expensive case: first calculate and then
|
||||
// interpolate between the saturated and undersaturated quantities to
|
||||
// avoid a discontinuity
|
||||
const auto& alpha = Opm::decay<LhsEval>(fluidState.saturation(oilPhaseIdx))/1e-4;
|
||||
const auto& muSat = gasPvt_->saturatedViscosity(regionIdx, T, p);
|
||||
const auto& muUndersat = gasPvt_->viscosity(regionIdx, T, p, Rv);
|
||||
return alpha*muSat + (1.0 - alpha)*muUndersat;
|
||||
}
|
||||
|
||||
return gasPvt_->saturatedViscosity(regionIdx, T, p);
|
||||
}
|
||||
|
||||
} else {
|
||||
return gasPvt_->viscosity(regionIdx, T, p, Rv);
|
||||
}
|
||||
}
|
||||
|
||||
const LhsEval Rv(0.0);
|
||||
return gasPvt_->viscosity(regionIdx, T, p, Rv);
|
||||
|
Loading…
Reference in New Issue
Block a user