EclDefaultMaterial: allow the parameters to decide if consistent or inconsistent hysteresis are used
This commit is contained in:
parent
893538c9f3
commit
a8aaa168e2
@ -181,10 +181,7 @@ public:
|
|||||||
typedef MathToolbox<typename FluidState::Scalar> FsToolbox;
|
typedef MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||||
|
|
||||||
const auto& Sw = FsToolbox::template toLhs<Evaluation>(fs.saturation(waterPhaseIdx));
|
const auto& Sw = FsToolbox::template toLhs<Evaluation>(fs.saturation(waterPhaseIdx));
|
||||||
Valgrind::CheckDefined(Sw);
|
return OilWaterMaterialLaw::twoPhaseSatPcnw(params.oilWaterParams(), Sw);
|
||||||
const auto& result = OilWaterMaterialLaw::twoPhaseSatPcnw(params.oilWaterParams(), Sw);
|
|
||||||
Valgrind::CheckDefined(result);
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -327,11 +324,13 @@ public:
|
|||||||
{
|
{
|
||||||
typedef MathToolbox<typename FluidState::Scalar> FsToolbox;
|
typedef MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||||
|
|
||||||
|
Scalar Sw = FsToolbox::value(fluidState.saturation(waterPhaseIdx));
|
||||||
Scalar So = FsToolbox::value(fluidState.saturation(oilPhaseIdx));
|
Scalar So = FsToolbox::value(fluidState.saturation(oilPhaseIdx));
|
||||||
Scalar Sg = FsToolbox::value(fluidState.saturation(gasPhaseIdx));
|
Scalar Sg = FsToolbox::value(fluidState.saturation(gasPhaseIdx));
|
||||||
Sg = std::min(1.0, std::max(0.0, Sg));
|
|
||||||
|
|
||||||
// FIXME: the saturations which are passed to update the hysteresis curves are
|
if (params.inconsistentHysteresisUpdate()) {
|
||||||
|
Sg = std::min(1.0, std::max(0.0, Sg));
|
||||||
|
// NOTE: the saturations which are passed to update the hysteresis curves are
|
||||||
// inconsistent with the ones used to calculate the relative permabilities. We do
|
// inconsistent with the ones used to calculate the relative permabilities. We do
|
||||||
// it like this anyway because (a) the saturation functions of opm-core do it
|
// it like this anyway because (a) the saturation functions of opm-core do it
|
||||||
// this way (b) the simulations seem to converge better (which is not too much
|
// this way (b) the simulations seem to converge better (which is not too much
|
||||||
@ -343,6 +342,18 @@ public:
|
|||||||
params.oilWaterParams().update(/*pcSw=*/1 - So, /*krwSw=*/1 - So, /*krn_Sw=*/1 - So);
|
params.oilWaterParams().update(/*pcSw=*/1 - So, /*krwSw=*/1 - So, /*krn_Sw=*/1 - So);
|
||||||
params.gasOilParams().update(/*pcSw=*/1 - Sg, /*krwSw=*/1 - Sg, /*krn_Sw=*/1 - Sg);
|
params.gasOilParams().update(/*pcSw=*/1 - Sg, /*krwSw=*/1 - Sg, /*krn_Sw=*/1 - Sg);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
Scalar Swco = params.Swl();
|
||||||
|
Sw = std::min(1.0, std::max(0.0, Sw));
|
||||||
|
Sg = std::min(1.0, std::max(0.0, Sg));
|
||||||
|
|
||||||
|
Scalar Sw_ow = Sg + std::max(Swco, Sw);
|
||||||
|
Scalar So_go = 1 + Swco - Sw_ow;
|
||||||
|
|
||||||
|
params.oilWaterParams().update(/*pcSw=*/Sw, /*krwSw=*/1 - Sg, /*krnSw=*/Sw_ow);
|
||||||
|
params.gasOilParams().update(/*pcSw=*/1 - Sg, /*krwSw=*/So_go, /*krnSw=*/1 - Sg);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
} // namespace Opm
|
} // namespace Opm
|
||||||
|
|
||||||
|
@ -124,6 +124,18 @@ public:
|
|||||||
Scalar Swl() const
|
Scalar Swl() const
|
||||||
{ assertFinalized_(); return Swl_; }
|
{ assertFinalized_(); return Swl_; }
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Specify whether inconsistent saturations should be used to update the
|
||||||
|
* hysteresis parameters.
|
||||||
|
*
|
||||||
|
* Returning 'true' is wrong from a physical point of view because the saturations
|
||||||
|
* which are used to update the hysteresis parameters are calculated differently than
|
||||||
|
* the ones used to calculate the relperms and capillary pressures. Since Eclipse
|
||||||
|
* E100 probably uses inconsistent saturations, we return true here anyway.
|
||||||
|
*/
|
||||||
|
bool inconsistentHysteresisUpdate() const
|
||||||
|
{ return true; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
void assertFinalized_() const
|
void assertFinalized_() const
|
||||||
|
Loading…
Reference in New Issue
Block a user