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,20 +724,10 @@ public:
|
|||||||
if (fluidState.saturation(gasPhaseIdx) > 0.0
|
if (fluidState.saturation(gasPhaseIdx) > 0.0
|
||||||
&& Rs >= (1.0 - 1e-10)*oilPvt_->saturatedGasDissolutionFactor(regionIdx, Opm::scalarValue(T), Opm::scalarValue(p)))
|
&& 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);
|
return oilPvt_->saturatedInverseFormationVolumeFactor(regionIdx, T, p);
|
||||||
|
} else {
|
||||||
|
return oilPvt_->inverseFormationVolumeFactor(regionIdx, T, p, Rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
return oilPvt_->inverseFormationVolumeFactor(regionIdx, T, p, Rs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const LhsEval Rs(0.0);
|
const LhsEval Rs(0.0);
|
||||||
@ -749,20 +739,10 @@ public:
|
|||||||
if (fluidState.saturation(oilPhaseIdx) > 0.0
|
if (fluidState.saturation(oilPhaseIdx) > 0.0
|
||||||
&& Rv >= (1.0 - 1e-10)*gasPvt_->saturatedOilVaporizationFactor(regionIdx, Opm::scalarValue(T), Opm::scalarValue(p)))
|
&& 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);
|
return gasPvt_->saturatedInverseFormationVolumeFactor(regionIdx, T, p);
|
||||||
|
} else {
|
||||||
|
return gasPvt_->inverseFormationVolumeFactor(regionIdx, T, p, Rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
return gasPvt_->inverseFormationVolumeFactor(regionIdx, T, p, Rv);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const LhsEval Rv(0.0);
|
const LhsEval Rv(0.0);
|
||||||
@ -941,20 +921,10 @@ public:
|
|||||||
if (fluidState.saturation(gasPhaseIdx) > 0.0
|
if (fluidState.saturation(gasPhaseIdx) > 0.0
|
||||||
&& Rs >= (1.0 - 1e-10)*oilPvt_->saturatedGasDissolutionFactor(regionIdx, Opm::scalarValue(T), Opm::scalarValue(p)))
|
&& 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);
|
return oilPvt_->saturatedViscosity(regionIdx, T, p);
|
||||||
|
} else {
|
||||||
|
return oilPvt_->viscosity(regionIdx, T, p, Rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
return oilPvt_->viscosity(regionIdx, T, p, Rs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const LhsEval Rs(0.0);
|
const LhsEval Rs(0.0);
|
||||||
@ -967,20 +937,10 @@ public:
|
|||||||
if (fluidState.saturation(oilPhaseIdx) > 0.0
|
if (fluidState.saturation(oilPhaseIdx) > 0.0
|
||||||
&& Rv >= (1.0 - 1e-10)*gasPvt_->saturatedOilVaporizationFactor(regionIdx, Opm::scalarValue(T), Opm::scalarValue(p)))
|
&& 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);
|
return gasPvt_->saturatedViscosity(regionIdx, T, p);
|
||||||
|
} else {
|
||||||
|
return gasPvt_->viscosity(regionIdx, T, p, Rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
return gasPvt_->viscosity(regionIdx, T, p, Rv);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const LhsEval Rv(0.0);
|
const LhsEval Rv(0.0);
|
||||||
|
Loading…
Reference in New Issue
Block a user