mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
rename "pcwn" to "pcnw" and "pcng" to "pcgn"
because it is p_n - p_w and p_g - p_n instead of the other way round.
This commit is contained in:
@@ -91,7 +91,7 @@ public:
|
||||
static void capillaryPressures(Container &values, const Params ¶ms, const FluidState &fs)
|
||||
{
|
||||
values[Traits::wPhaseIdx] = 0.0; // reference phase
|
||||
values[Traits::nPhaseIdx] = pcwn(params, fs);
|
||||
values[Traits::nPhaseIdx] = pcnw(params, fs);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
values[Traits::wPhaseIdx] = 0;
|
||||
values[Traits::nPhaseIdx] = 0;
|
||||
if (satPhaseIdx == Traits::wPhaseIdx)
|
||||
values[Traits::nPhaseIdx] = dpcwn_dSw(params, state);
|
||||
values[Traits::nPhaseIdx] = dPcnw_dSw(params, state);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -263,13 +263,13 @@ public:
|
||||
* (for Brooks-Corey: Entry pressure and shape factor)
|
||||
*/
|
||||
template <class FluidState>
|
||||
static Scalar pcwn(const Params ¶ms, const FluidState &fs)
|
||||
static Scalar pcnw(const Params ¶ms, const FluidState &fs)
|
||||
{
|
||||
Scalar Sw = fs.saturation(Traits::wPhaseIdx);
|
||||
return twoPhaseSatPcwn(params, Sw);
|
||||
return twoPhaseSatPcnw(params, Sw);
|
||||
}
|
||||
|
||||
static Scalar twoPhaseSatPcwn(const Params ¶ms, Scalar Sw)
|
||||
static Scalar twoPhaseSatPcnw(const Params ¶ms, Scalar Sw)
|
||||
{
|
||||
assert(0 <= Sw && Sw <= 1);
|
||||
|
||||
@@ -329,13 +329,13 @@ public:
|
||||
* (for Brooks-Corey: Entry pressure and shape factor)
|
||||
*/
|
||||
template <class FluidState>
|
||||
static Scalar dpcwn_dSw(const Params ¶ms, const FluidState &fs)
|
||||
static Scalar dPcnw_dSw(const Params ¶ms, const FluidState &fs)
|
||||
{
|
||||
Scalar Sw = fs.saturation(Traits::wPhaseIdx);
|
||||
return twoPhaseSatDpcwn_dSw(params, Sw);
|
||||
return twoPhaseSatDPcnw_dSw(params, Sw);
|
||||
}
|
||||
|
||||
static Scalar twoPhaseSatDpcwn_dSw(const Params ¶ms, Scalar Sw)
|
||||
static Scalar twoPhaseSatDPcnw_dSw(const Params ¶ms, Scalar Sw)
|
||||
{
|
||||
assert(0 <= Sw && Sw <= 1);
|
||||
return - params.entryPressure()/params.lambda() * std::pow(Sw, -1/params.lambda() - 1);
|
||||
@@ -346,21 +346,21 @@ public:
|
||||
* regard to the capillary pressure according to Brooks and
|
||||
* Corey.
|
||||
*
|
||||
* \param pcwn Capillary pressure \f$[Pa]\f$
|
||||
* \param pcnw Capillary pressure \f$[Pa]\f$
|
||||
* \param params The parameters of the capillary pressure curve
|
||||
* (for Brooks-Corey: Entry pressure and shape factor)
|
||||
*/
|
||||
template <class FluidState>
|
||||
static Scalar dSw_dpcwn(const Params ¶ms, const FluidState &fs)
|
||||
static Scalar dSw_dpcnw(const Params ¶ms, const FluidState &fs)
|
||||
{
|
||||
Scalar Sw = fs.saturation(Traits::wPhaseIdx);
|
||||
return twoPhaseSatDSw_dpcwn(params, Sw);
|
||||
return twoPhaseSatDSw_dpcnw(params, Sw);
|
||||
}
|
||||
|
||||
static Scalar twoPhaseSatDSw_dpcwn(const Params ¶ms, Scalar Sw)
|
||||
static Scalar twoPhaseSatDSw_dpcnw(const Params ¶ms, Scalar Sw)
|
||||
{
|
||||
assert(pcwn > 0); // required for std::pow
|
||||
return -params.lambda()/params.entryPressure() * std::pow(pcwn/params.entryPressure(), - params.lambda() - 1);
|
||||
assert(pcnw > 0); // required for std::pow
|
||||
return -params.lambda()/params.entryPressure() * std::pow(pcnw/params.entryPressure(), - params.lambda() - 1);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -290,7 +290,7 @@ public:
|
||||
* Genuchten, linear...)
|
||||
*/
|
||||
template <class FluidState>
|
||||
static Scalar pcwn(const Params ¶ms, const FluidState &fs)
|
||||
static Scalar pcnw(const Params ¶ms, const FluidState &fs)
|
||||
{
|
||||
typedef Opm::SaturationOverlayFluidState<Scalar, FluidState> OverlayFluidState;
|
||||
|
||||
@@ -306,16 +306,16 @@ public:
|
||||
phaseIdx));
|
||||
}
|
||||
|
||||
return EffLaw::pcwn(params, overlayFs);
|
||||
return EffLaw::pcnw(params, overlayFs);
|
||||
}
|
||||
|
||||
template <class ScalarT = Scalar>
|
||||
static typename std::enable_if<implementsTwoPhaseSatApi, ScalarT>::type
|
||||
twoPhaseSatPcwn(const Params ¶ms, Scalar SwAbs)
|
||||
twoPhaseSatPcnw(const Params ¶ms, Scalar SwAbs)
|
||||
{
|
||||
Scalar SwEff = effectiveSaturation(params, SwAbs, Traits::wPhaseIdx);
|
||||
|
||||
return EffLaw::twoPhaseSatPcwn(params, SwEff);
|
||||
return EffLaw::twoPhaseSatPcnw(params, SwEff);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -266,7 +266,7 @@ public:
|
||||
* \brief The difference between the pressures of the non-wetting and wetting phase.
|
||||
*/
|
||||
template <class FluidState>
|
||||
static Scalar pcwn(const Params ¶ms, const FluidState &fs)
|
||||
static Scalar pcnw(const Params ¶ms, const FluidState &fs)
|
||||
{
|
||||
Scalar S = fs.saturation(Traits::wPhaseIdx);
|
||||
Valgrind::CheckDefined(S);
|
||||
@@ -288,7 +288,7 @@ public:
|
||||
|
||||
template <class ScalarT = Scalar>
|
||||
static typename std::enable_if<Traits::numPhases == 2, ScalarT>::type
|
||||
twoPhaseSatPcwn(const Params ¶ms, Scalar Sw)
|
||||
twoPhaseSatPcnw(const Params ¶ms, Scalar Sw)
|
||||
{
|
||||
Scalar wPhasePressure =
|
||||
Sw*params.pcMaxSat(Traits::wPhaseIdx) +
|
||||
@@ -379,7 +379,7 @@ public:
|
||||
*/
|
||||
template <class FluidState, class ScalarT=Scalar>
|
||||
static typename std::enable_if< (Traits::numPhases > 2), ScalarT>::type
|
||||
pcng(const Params ¶ms, const FluidState &fs)
|
||||
pcgn(const Params ¶ms, const FluidState &fs)
|
||||
{
|
||||
Scalar S = fs.saturation(Traits::nPhaseIdx);
|
||||
Valgrind::CheckDefined(S);
|
||||
|
||||
@@ -245,12 +245,12 @@ public:
|
||||
*/
|
||||
template <class FluidState, class ScalarT = Scalar>
|
||||
static typename std::enable_if<(numPhases > 1), ScalarT>::type
|
||||
pcwn(const Params ¶ms, const FluidState &fs)
|
||||
pcnw(const Params ¶ms, const FluidState &fs)
|
||||
{ return 0; }
|
||||
|
||||
template <class ScalarT = Scalar>
|
||||
static typename std::enable_if<numPhases == 2, ScalarT>::type
|
||||
twoPhaseSatPcwn(const Params ¶ms, Scalar Sw)
|
||||
twoPhaseSatPcnw(const Params ¶ms, Scalar Sw)
|
||||
{ return 0; }
|
||||
|
||||
/*!
|
||||
@@ -263,7 +263,7 @@ public:
|
||||
|
||||
template <class ScalarT = Scalar>
|
||||
static typename std::enable_if<numPhases == 2, ScalarT>::type
|
||||
twoPhaseSatSw(const Params ¶ms, Scalar pcwn)
|
||||
twoPhaseSatSw(const Params ¶ms, Scalar pcnw)
|
||||
{ OPM_THROW(std::logic_error, "Not defined: twoPhaseSatSw()"); }
|
||||
|
||||
/*!
|
||||
@@ -276,7 +276,7 @@ public:
|
||||
|
||||
template <class ScalarT = Scalar>
|
||||
static typename std::enable_if<numPhases == 2, ScalarT>::type
|
||||
twoPhaseSatSn(const Params ¶ms, Scalar pcwn)
|
||||
twoPhaseSatSn(const Params ¶ms, Scalar pcnw)
|
||||
{ OPM_THROW(std::logic_error, "Not defined: twoPhaseSatSn()"); }
|
||||
|
||||
/*!
|
||||
@@ -333,7 +333,7 @@ public:
|
||||
*/
|
||||
template <class FluidState, class ScalarT=Scalar>
|
||||
static typename std::enable_if< (Traits::numPhases > 2), ScalarT>::type
|
||||
pcng(const Params ¶ms, const FluidState &fs)
|
||||
pcgn(const Params ¶ms, const FluidState &fs)
|
||||
{ return 0; }
|
||||
};
|
||||
} // namespace Opm
|
||||
|
||||
@@ -58,13 +58,13 @@ public:
|
||||
this, // next
|
||||
-1, // loop number
|
||||
Swr, // Sw
|
||||
1e12, // pcwn
|
||||
1e12, // pcnw
|
||||
Swr, // SwMic
|
||||
Swr); // SwMdc
|
||||
next_ = NULL;
|
||||
|
||||
Sw_ = 1.0;
|
||||
pcwn_ = 0.0;
|
||||
pcnw_ = 0.0;
|
||||
SwMic_ = 1.0;
|
||||
SwMdc_ = 1.0;
|
||||
}
|
||||
@@ -74,7 +74,7 @@ protected:
|
||||
PLScanningCurve *next,
|
||||
int loopN,
|
||||
Scalar Sw,
|
||||
Scalar pcwn,
|
||||
Scalar pcnw,
|
||||
Scalar SwMic,
|
||||
Scalar SwMdc)
|
||||
{
|
||||
@@ -82,7 +82,7 @@ protected:
|
||||
next_ = next;
|
||||
loopNum_ = loopN;
|
||||
Sw_ = Sw;
|
||||
pcwn_ = pcwn;
|
||||
pcnw_ = pcnw;
|
||||
SwMic_ = SwMic;
|
||||
SwMdc_ = SwMdc;
|
||||
}
|
||||
@@ -124,7 +124,7 @@ public:
|
||||
* deleted and thus forgotten.
|
||||
*/
|
||||
void setNext(Scalar Sw,
|
||||
Scalar pcwn,
|
||||
Scalar pcnw,
|
||||
Scalar SwMic,
|
||||
Scalar SwMdc)
|
||||
{
|
||||
@@ -136,7 +136,7 @@ public:
|
||||
NULL, // next
|
||||
loopNum() + 1,
|
||||
Sw,
|
||||
pcwn,
|
||||
pcnw,
|
||||
SwMic,
|
||||
SwMdc);
|
||||
}
|
||||
@@ -195,8 +195,8 @@ public:
|
||||
/*!
|
||||
* \brief Capillary pressure at the last reversal point.
|
||||
*/
|
||||
Scalar pcwn() const
|
||||
{ return pcwn_; }
|
||||
Scalar pcnw() const
|
||||
{ return pcnw_; }
|
||||
|
||||
/*!
|
||||
* \brief Apparent saturation of the last reversal point on
|
||||
@@ -219,7 +219,7 @@ private:
|
||||
int loopNum_;
|
||||
|
||||
Scalar Sw_;
|
||||
Scalar pcwn_;
|
||||
Scalar pcnw_;
|
||||
|
||||
Scalar SwMdc_;
|
||||
Scalar SwMic_;
|
||||
@@ -314,7 +314,7 @@ public:
|
||||
// calculate the apparent saturation on the MIC and MDC
|
||||
// which yield the same capillary pressure as the
|
||||
// Sw at the current scanning curve
|
||||
Scalar pc = pcwn(params, fs);
|
||||
Scalar pc = pcnw(params, fs);
|
||||
Scalar Sw_mic = VanGenuchten::twoPhaseSatSw(params.micParams(), pc);
|
||||
Scalar Sw_mdc = VanGenuchten::twoPhaseSatSw(params.mdcParams(), pc);
|
||||
|
||||
@@ -339,7 +339,7 @@ public:
|
||||
static void capillaryPressures(Container &values, const Params ¶ms, const FluidState &fs)
|
||||
{
|
||||
values[Traits::wPhaseIdx] = 0.0; // reference phase
|
||||
values[Traits::nPhaseIdx] = pcwn(params, fs);
|
||||
values[Traits::nPhaseIdx] = pcnw(params, fs);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -374,7 +374,7 @@ public:
|
||||
values[Traits::wPhaseIdx] = 0;
|
||||
values[Traits::nPhaseIdx] = 0;
|
||||
if (satPhaseIdx == Traits::wPhaseIdx)
|
||||
values[Traits::nPhaseIdx] = twoPhaseSatDpcwn_dSw(params, state.saturation(Traits::wPhaseIdx));
|
||||
values[Traits::nPhaseIdx] = twoPhaseSatDPcnw_dSw(params, state.saturation(Traits::wPhaseIdx));
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -492,10 +492,10 @@ public:
|
||||
* the phase saturations.
|
||||
*/
|
||||
template <class FluidState>
|
||||
static Scalar pcwn(const Params ¶ms, const FluidState &fs)
|
||||
{ return twoPhaseSatPcwn(params, fs.saturation(Traits::wPhaseIdx)); }
|
||||
static Scalar pcnw(const Params ¶ms, const FluidState &fs)
|
||||
{ return twoPhaseSatPcnw(params, fs.saturation(Traits::wPhaseIdx)); }
|
||||
|
||||
static Scalar twoPhaseSatPcwn(const Params ¶ms, Scalar Sw)
|
||||
static Scalar twoPhaseSatPcnw(const Params ¶ms, Scalar Sw)
|
||||
{
|
||||
// calculate the current apparent saturation
|
||||
ScanningCurve *sc = findScanningCurve_(params, Sw);
|
||||
@@ -506,7 +506,7 @@ public:
|
||||
// if the apparent saturation exceeds the 'legal' limits,
|
||||
// we also the underlying material law decide what to do.
|
||||
if (Sw_app > 1) {
|
||||
return 0.0; // VanGenuchten::pcwn(params.mdcParams(), Sw_app);
|
||||
return 0.0; // VanGenuchten::pcnw(params.mdcParams(), Sw_app);
|
||||
}
|
||||
|
||||
// put the apparent saturation into the main imbibition or
|
||||
@@ -518,18 +518,18 @@ public:
|
||||
Scalar SwMic =
|
||||
pos * (sc->prev()->SwMic() - sc->SwMic()) + sc->SwMic();
|
||||
|
||||
return VanGenuchten::twoPhaseSatPcwn(params.micParams(), SwMic);
|
||||
return VanGenuchten::twoPhaseSatPcnw(params.micParams(), SwMic);
|
||||
}
|
||||
else { // sc->isDrain()
|
||||
Scalar SwMdc =
|
||||
pos*(sc->prev()->SwMdc() - sc->SwMdc()) + sc->SwMdc();
|
||||
|
||||
return VanGenuchten::twoPhaseSatPcwn(params.mdcParams(), SwMdc);
|
||||
return VanGenuchten::twoPhaseSatPcnw(params.mdcParams(), SwMdc);
|
||||
}
|
||||
}
|
||||
|
||||
static Scalar twoPhaseSatDpcwn_dSw(const Params ¶ms, Scalar Sw)
|
||||
{ OPM_THROW(std::logic_error, "Not implemented: twoPhaseSatDpcwn_dSw()"); }
|
||||
static Scalar twoPhaseSatDPcnw_dSw(const Params ¶ms, Scalar Sw)
|
||||
{ OPM_THROW(std::logic_error, "Not implemented: twoPhaseSatDPcnw_dSw()"); }
|
||||
|
||||
/*!
|
||||
* \brief Calculate the wetting phase saturations depending on
|
||||
|
||||
@@ -116,7 +116,7 @@ public:
|
||||
static void capillaryPressures(Container &values, const Params ¶ms, const FluidState &fs)
|
||||
{
|
||||
values[Traits::wPhaseIdx] = 0.0; // reference phase
|
||||
values[Traits::nPhaseIdx] = pcwn(params, fs);
|
||||
values[Traits::nPhaseIdx] = pcnw(params, fs);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -160,7 +160,7 @@ public:
|
||||
values[Traits::wPhaseIdx] = 0;
|
||||
values[Traits::nPhaseIdx] = 0;
|
||||
if (satPhaseIdx == Traits::wPhaseIdx)
|
||||
values[Traits::nPhaseIdx] = twoPhaseSatDpcwn_dSw(params, state.saturation(Traits::wPhaseIdx));
|
||||
values[Traits::nPhaseIdx] = twoPhaseSatDPcnw_dSw(params, state.saturation(Traits::wPhaseIdx));
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -295,13 +295,13 @@ public:
|
||||
* slope of the unregularized Brooks-Corey curve at \f$S_w =
|
||||
* 1\f$
|
||||
*
|
||||
* \sa BrooksCorey::pcwn
|
||||
* \sa BrooksCorey::pcnw
|
||||
*/
|
||||
template <class FluidState>
|
||||
static Scalar pcwn(const Params ¶ms, const FluidState &fs)
|
||||
{ return twoPhaseSatPcwn(params, fs.saturation(Traits::wPhaseIdx)); }
|
||||
static Scalar pcnw(const Params ¶ms, const FluidState &fs)
|
||||
{ return twoPhaseSatPcnw(params, fs.saturation(Traits::wPhaseIdx)); }
|
||||
|
||||
static Scalar twoPhaseSatPcwn(const Params ¶ms, Scalar Sw)
|
||||
static Scalar twoPhaseSatPcnw(const Params ¶ms, Scalar Sw)
|
||||
{
|
||||
const Scalar Sthres = params.thresholdSw();
|
||||
|
||||
@@ -312,35 +312,35 @@ public:
|
||||
// saturation moving to the right direction if it
|
||||
// temporarily is in an 'illegal' range.
|
||||
if (Sw <= Sthres) {
|
||||
Scalar m = BrooksCorey::twoPhaseSatDpcwn_dSw(params, Sthres);
|
||||
Scalar pcwn_SwLow = BrooksCorey::twoPhaseSatPcwn(params, Sthres);
|
||||
return pcwn_SwLow + m*(Sw - Sthres);
|
||||
Scalar m = BrooksCorey::twoPhaseSatDPcnw_dSw(params, Sthres);
|
||||
Scalar pcnw_SwLow = BrooksCorey::twoPhaseSatPcnw(params, Sthres);
|
||||
return pcnw_SwLow + m*(Sw - Sthres);
|
||||
}
|
||||
else if (Sw > 1.0) {
|
||||
Scalar m = BrooksCorey::twoPhaseSatDpcwn_dSw(params, 1.0);
|
||||
Scalar pcwn_SwHigh = params.entryPressure();
|
||||
return pcwn_SwHigh + m*(Sw - 1.0);
|
||||
Scalar m = BrooksCorey::twoPhaseSatDPcnw_dSw(params, 1.0);
|
||||
Scalar pcnw_SwHigh = params.entryPressure();
|
||||
return pcnw_SwHigh + m*(Sw - 1.0);
|
||||
}
|
||||
|
||||
// if the effective saturation is in an 'reasonable'
|
||||
// range, we use the real Brooks-Corey law...
|
||||
return BrooksCorey::twoPhaseSatPcwn(params, Sw);
|
||||
return BrooksCorey::twoPhaseSatPcnw(params, Sw);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief A regularized Brooks-Corey saturation-capillary pressure
|
||||
* curve.
|
||||
*
|
||||
* This is the inverse of the pcwn() method.
|
||||
* This is the inverse of the pcnw() method.
|
||||
*/
|
||||
template <class FluidState>
|
||||
static Scalar Sw(const Params ¶ms, const FluidState &fs)
|
||||
{
|
||||
Scalar pcwn = fs.pressure(Traits::nPhaseIdx) - fs.pressure(Traits::wPhaseIdx);
|
||||
return twoPhaseSatSw(params, pcwn);
|
||||
Scalar pcnw = fs.pressure(Traits::nPhaseIdx) - fs.pressure(Traits::wPhaseIdx);
|
||||
return twoPhaseSatSw(params, pcnw);
|
||||
}
|
||||
|
||||
static Scalar twoPhaseSatSw(const Params ¶ms, Scalar pcwn)
|
||||
static Scalar twoPhaseSatSw(const Params ¶ms, Scalar pcnw)
|
||||
{
|
||||
const Scalar Sthres = params.thresholdSw();
|
||||
|
||||
@@ -350,8 +350,8 @@ public:
|
||||
// smaller than the entry pressure, make sure that we will
|
||||
// regularize.
|
||||
Scalar Sw = 1.5;
|
||||
if (pcwn >= params.entryPressure())
|
||||
Sw = BrooksCorey::twoPhaseSatSw(params, pcwn);
|
||||
if (pcnw >= params.entryPressure())
|
||||
Sw = BrooksCorey::twoPhaseSatSw(params, pcnw);
|
||||
|
||||
// make sure that the capilary pressure observes a
|
||||
// derivative != 0 for 'illegal' saturations. This is
|
||||
@@ -360,18 +360,18 @@ public:
|
||||
// saturation moving to the right direction if it
|
||||
// temporarily is in an 'illegal' range.
|
||||
if (Sw <= Sthres) {
|
||||
// invert the low saturation regularization of pcwn()
|
||||
Scalar m = BrooksCorey::twoPhaseSatDpcwn_dSw(params, Sthres);
|
||||
Scalar pcwn_SwLow = BrooksCorey::twoPhaseSatPcwn(params, Sthres);
|
||||
return Sthres + (pcwn - pcwn_SwLow)/m;
|
||||
// invert the low saturation regularization of pcnw()
|
||||
Scalar m = BrooksCorey::twoPhaseSatDPcnw_dSw(params, Sthres);
|
||||
Scalar pcnw_SwLow = BrooksCorey::twoPhaseSatPcnw(params, Sthres);
|
||||
return Sthres + (pcnw - pcnw_SwLow)/m;
|
||||
}
|
||||
else if (Sw > 1.0) {
|
||||
Scalar m = BrooksCorey::twoPhaseSatDpcwn_dSw(params, 1.0);
|
||||
Scalar pcwn_SwHigh = BrooksCorey::twoPhaseSatPcwn(params, 1.0);
|
||||
return 1.0 + (pcwn - pcwn_SwHigh)/m;;
|
||||
Scalar m = BrooksCorey::twoPhaseSatDPcnw_dSw(params, 1.0);
|
||||
Scalar pcnw_SwHigh = BrooksCorey::twoPhaseSatPcnw(params, 1.0);
|
||||
return 1.0 + (pcnw - pcnw_SwHigh)/m;;
|
||||
}
|
||||
|
||||
return BrooksCorey::twoPhaseSatSw(params, pcwn);
|
||||
return BrooksCorey::twoPhaseSatSw(params, pcnw);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -382,37 +382,37 @@ public:
|
||||
static Scalar Sn(const Params ¶ms, const FluidState &fs)
|
||||
{ return 1 - Sw(params, fs); }
|
||||
|
||||
static Scalar twoPhaseSatSn(const Params ¶ms, Scalar pcwn)
|
||||
{ return 1 - twoPhaseSatSw(params, pcwn); }
|
||||
static Scalar twoPhaseSatSn(const Params ¶ms, Scalar pcnw)
|
||||
{ return 1 - twoPhaseSatSw(params, pcnw); }
|
||||
|
||||
/*!
|
||||
* \brief The derivative of the regularized Brooks-Corey capillary
|
||||
* pressure-saturation curve.
|
||||
*/
|
||||
static Scalar twoPhaseSatDpcwn_dSw(const Params ¶ms, Scalar Sw)
|
||||
static Scalar twoPhaseSatDPcnw_dSw(const Params ¶ms, Scalar Sw)
|
||||
{
|
||||
const Scalar Sthres = params.thresholdSw();
|
||||
|
||||
// derivative of the regualarization
|
||||
if (Sw <= Sthres) {
|
||||
// calculate the slope of the straight line used in pcwn()
|
||||
Scalar m = BrooksCorey::twoPhaseSatDpcwn_dSw(params, Sthres);
|
||||
// calculate the slope of the straight line used in pcnw()
|
||||
Scalar m = BrooksCorey::twoPhaseSatDPcnw_dSw(params, Sthres);
|
||||
return m;
|
||||
}
|
||||
else if (Sw > 1.0) {
|
||||
// calculate the slope of the straight line used in pcwn()
|
||||
Scalar m = BrooksCorey::twoPhaseSatDpcwn_dSw(params, 1.0);
|
||||
// calculate the slope of the straight line used in pcnw()
|
||||
Scalar m = BrooksCorey::twoPhaseSatDPcnw_dSw(params, 1.0);
|
||||
return m;
|
||||
}
|
||||
|
||||
return BrooksCorey::twoPhaseSatDpcwn_dSw(params, Sw);
|
||||
return BrooksCorey::twoPhaseSatDPcnw_dSw(params, Sw);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief The derivative of the regularized Brooks-Corey
|
||||
* saturation-capillary pressure curve.
|
||||
*/
|
||||
static Scalar twoPhaseSatDSw_dpcwn(const Params ¶ms, Scalar pcwn)
|
||||
static Scalar twoPhaseSatDSw_dpcnw(const Params ¶ms, Scalar pcnw)
|
||||
{
|
||||
const Scalar Sthres = params.thresholdSw();
|
||||
|
||||
@@ -420,23 +420,23 @@ public:
|
||||
// saturation in the non-regularized version of the
|
||||
// Brooks-Corey law
|
||||
Scalar Sw;
|
||||
if (pcwn < params.entryPressure())
|
||||
if (pcnw < params.entryPressure())
|
||||
Sw = 1.5; // make sure we regularize (see below)
|
||||
else
|
||||
Sw = BrooksCorey::Sw(params, pcwn);
|
||||
Sw = BrooksCorey::Sw(params, pcnw);
|
||||
|
||||
// derivative of the regularization
|
||||
if (Sw <= Sthres) {
|
||||
// calculate the slope of the straight line used in pcwn()
|
||||
Scalar m = BrooksCorey::dpcwn_dSw(params, Sthres);
|
||||
// calculate the slope of the straight line used in pcnw()
|
||||
Scalar m = BrooksCorey::dPcnw_dSw(params, Sthres);
|
||||
return 1/m;
|
||||
}
|
||||
else if (Sw > 1.0) {
|
||||
// calculate the slope of the straight line used in pcwn()
|
||||
Scalar m = BrooksCorey::dpcwn_dSw(params, 1.0);
|
||||
// calculate the slope of the straight line used in pcnw()
|
||||
Scalar m = BrooksCorey::dPcnw_dSw(params, 1.0);
|
||||
return 1/m;
|
||||
}
|
||||
return 1.0/BrooksCorey::dpcwn_dSw(params, Sw);
|
||||
return 1.0/BrooksCorey::dPcnw_dSw(params, Sw);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
static void capillaryPressures(Container &values, const Params ¶ms, const FluidState &fs)
|
||||
{
|
||||
values[Traits::wPhaseIdx] = 0.0; // reference phase
|
||||
values[Traits::nPhaseIdx] = pcwn(params, fs);
|
||||
values[Traits::nPhaseIdx] = pcnw(params, fs);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -153,7 +153,7 @@ public:
|
||||
values[Traits::wPhaseIdx] = 0;
|
||||
values[Traits::nPhaseIdx] = 0;
|
||||
if (satPhaseIdx == Traits::wPhaseIdx)
|
||||
values[Traits::nPhaseIdx] = twoPhaseSatDpcwn_dSw(params, state.saturation(Traits::wPhaseIdx));
|
||||
values[Traits::nPhaseIdx] = twoPhaseSatDPcnw_dSw(params, state.saturation(Traits::wPhaseIdx));
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -279,15 +279,15 @@ public:
|
||||
* \copydetails VanGenuchten::pC()
|
||||
*/
|
||||
template <class FluidState>
|
||||
static Scalar pcwn(const Params ¶ms, const FluidState &fs)
|
||||
{ return twoPhaseSatPcwn(params, fs.saturation(Traits::wPhaseIdx)); }
|
||||
static Scalar pcnw(const Params ¶ms, const FluidState &fs)
|
||||
{ return twoPhaseSatPcnw(params, fs.saturation(Traits::wPhaseIdx)); }
|
||||
|
||||
static Scalar twoPhaseSatPcwn(const Params ¶ms, Scalar Sw)
|
||||
static Scalar twoPhaseSatPcnw(const Params ¶ms, Scalar Sw)
|
||||
{
|
||||
// retrieve the low and the high threshold saturations for the
|
||||
// unregularized capillary pressure curve from the parameters
|
||||
const Scalar SwThLow = params.pcwnLowSw();
|
||||
const Scalar SwThHigh = params.pcwnHighSw();
|
||||
const Scalar SwThLow = params.pcnwLowSw();
|
||||
const Scalar SwThHigh = params.pcnwHighSw();
|
||||
|
||||
// make sure that the capillary pressure observes a derivative
|
||||
// != 0 for 'illegal' saturations. This is favourable for the
|
||||
@@ -295,16 +295,16 @@ public:
|
||||
// in order to get the saturation moving to the right
|
||||
// direction if it temporarily is in an 'illegal' range.
|
||||
if (Sw < SwThLow) {
|
||||
return params.pcwnLow() + params.pcwnSlopeLow()*(Sw - SwThLow);
|
||||
return params.pcnwLow() + params.pcnwSlopeLow()*(Sw - SwThLow);
|
||||
}
|
||||
else if (Sw > SwThHigh)
|
||||
{
|
||||
Scalar yTh = params.pcwnHigh();
|
||||
Scalar yTh = params.pcnwHigh();
|
||||
Scalar m1 = (0.0 - yTh)/(1.0 - SwThHigh)*2;
|
||||
|
||||
if (Sw < 1.0) {
|
||||
// use spline between threshold Sw and 1.0
|
||||
const Spline<Scalar> &sp = params.pcwnHighSpline();
|
||||
const Spline<Scalar> &sp = params.pcnwHighSpline();
|
||||
|
||||
return sp.eval(Sw);
|
||||
}
|
||||
@@ -316,7 +316,7 @@ public:
|
||||
|
||||
// if the effective saturation is in an 'reasonable'
|
||||
// range, we use the real van genuchten law...
|
||||
return VanGenuchten::twoPhaseSatPcwn(params, Sw);
|
||||
return VanGenuchten::twoPhaseSatPcnw(params, Sw);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -344,8 +344,8 @@ public:
|
||||
{
|
||||
// retrieve the low and the high threshold saturations for the
|
||||
// unregularized capillary pressure curve from the parameters
|
||||
const Scalar SwThLow = params.pcwnLowSw();
|
||||
const Scalar SwThHigh = params.pcwnHighSw();
|
||||
const Scalar SwThLow = params.pcnwLowSw();
|
||||
const Scalar SwThHigh = params.pcnwHighSw();
|
||||
|
||||
// calculate the saturation which corrosponds to the
|
||||
// saturation in the non-regularized verision of van
|
||||
@@ -353,7 +353,7 @@ public:
|
||||
Scalar Sw;
|
||||
if (pC <= 0) {
|
||||
// invert straight line for Sw > 1.0
|
||||
Scalar m1 = params.pcwnSlopeHigh();
|
||||
Scalar m1 = params.pcnwSlopeHigh();
|
||||
return pC/m1 + 1.0;
|
||||
}
|
||||
else
|
||||
@@ -362,13 +362,13 @@ public:
|
||||
// invert the regularization if necessary
|
||||
if (Sw <= SwThLow) {
|
||||
// invert the low saturation regularization of pC()
|
||||
Scalar pC_SwLow = VanGenuchten::twoPhaseSatPcwn(params, SwThLow);
|
||||
return (pC - pC_SwLow)/params.pcwnSlopeLow() + SwThLow;
|
||||
Scalar pC_SwLow = VanGenuchten::twoPhaseSatPcnw(params, SwThLow);
|
||||
return (pC - pC_SwLow)/params.pcnwSlopeLow() + SwThLow;
|
||||
}
|
||||
else if (SwThHigh < Sw /* && Sw < 1.0*/)
|
||||
{
|
||||
// invert spline between threshold saturation and 1.0
|
||||
const Spline<Scalar>& spline = params.pcwnHighSpline();
|
||||
const Spline<Scalar>& spline = params.pcnwHighSpline();
|
||||
|
||||
return spline.intersectInterval(/*x0=*/SwThHigh, /*x1=*/1.0,
|
||||
/*a=*/0, /*b=*/0, /*c=*/0, /*d=*/pC);
|
||||
@@ -403,26 +403,26 @@ public:
|
||||
*
|
||||
*/
|
||||
template <class FluidState>
|
||||
static Scalar dpcwn_dSw(const Params ¶ms, const FluidState &fs)
|
||||
{ return twoPhaseSatDpcwn_dSw(params, fs.saturation(Traits::wPhaseIdx)); }
|
||||
static Scalar dPcnw_dSw(const Params ¶ms, const FluidState &fs)
|
||||
{ return twoPhaseSatDPcnw_dSw(params, fs.saturation(Traits::wPhaseIdx)); }
|
||||
|
||||
static Scalar twoPhaseSatDpcwn_dSw(const Params ¶ms, Scalar Sw)
|
||||
static Scalar twoPhaseSatDPcnw_dSw(const Params ¶ms, Scalar Sw)
|
||||
{
|
||||
// derivative of the regualarization
|
||||
if (Sw < params.pcwnLowSw()) {
|
||||
if (Sw < params.pcnwLowSw()) {
|
||||
// the slope of the straight line used in pC()
|
||||
return params.pcwnSlopeLow();
|
||||
return params.pcnwSlopeLow();
|
||||
}
|
||||
else if (params.pcwnHighSw() <= Sw) {
|
||||
else if (params.pcnwHighSw() <= Sw) {
|
||||
if (Sw < 1)
|
||||
return params.pcwnHighSpline().evalDerivative(Sw);
|
||||
return params.pcnwHighSpline().evalDerivative(Sw);
|
||||
else
|
||||
// the slope of the straight line used for the right
|
||||
// side of the capillary pressure function
|
||||
return params.pcwnSlopeHigh();
|
||||
return params.pcnwSlopeHigh();
|
||||
}
|
||||
|
||||
return VanGenuchten::twoPhaseSatDpcwn_dSw(params, Sw);
|
||||
return VanGenuchten::twoPhaseSatDPcnw_dSw(params, Sw);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -452,16 +452,16 @@ public:
|
||||
Sw = VanGenuchten::Sw_raw(params, pC);
|
||||
|
||||
// derivative of the regularization
|
||||
if (Sw < params.pcwnLowSw()) {
|
||||
if (Sw < params.pcnwLowSw()) {
|
||||
// same as in dpC_dSw() but inverted
|
||||
return 1/params.pcwnSlopeLow();
|
||||
return 1/params.pcnwSlopeLow();
|
||||
}
|
||||
if (Sw > params.pcwnHighSw()) {
|
||||
if (Sw > params.pcnwHighSw()) {
|
||||
if (Sw < 1)
|
||||
return 1/params.pcwnHighSpline().evalDerivative(Sw);
|
||||
return 1/params.pcnwHighSpline().evalDerivative(Sw);
|
||||
|
||||
// same as in dpC_dSw() but inverted
|
||||
return 1/params.pcwnSlopHigh();
|
||||
return 1/params.pcnwSlopHigh();
|
||||
}
|
||||
|
||||
return VanGenuchten::dSw_dpnw(params, fs);
|
||||
|
||||
@@ -46,14 +46,14 @@ public:
|
||||
typedef TraitsT Traits;
|
||||
|
||||
RegularizedVanGenuchtenParams()
|
||||
: pcwnLowSw_(0.01)
|
||||
, pcwnHighSw_(0.99)
|
||||
: pcnwLowSw_(0.01)
|
||||
, pcnwHighSw_(0.99)
|
||||
{}
|
||||
|
||||
RegularizedVanGenuchtenParams(Scalar vgAlpha, Scalar vgN)
|
||||
: Parent(vgAlpha, vgN)
|
||||
, pcwnLowSw_(0.01)
|
||||
, pcwnHighSw_(0.99)
|
||||
, pcnwLowSw_(0.01)
|
||||
, pcnwHighSw_(0.99)
|
||||
{}
|
||||
|
||||
/*!
|
||||
@@ -64,16 +64,16 @@ public:
|
||||
{
|
||||
Parent::finalize();
|
||||
|
||||
pcwnLow_ = VanGenuchten::twoPhaseSatPcwn(*this, pcwnLowSw_);
|
||||
pcwnSlopeLow_ = VanGenuchten::twoPhaseSatDpcwn_dSw(*this, pcwnLowSw_);
|
||||
pcwnHigh_ = VanGenuchten::twoPhaseSatPcwn(*this, pcwnHighSw_);
|
||||
pcwnSlopeHigh_ = 2*(0.0 - pcwnHigh_)/(1.0 - pcwnHighSw_);
|
||||
pcnwLow_ = VanGenuchten::twoPhaseSatPcnw(*this, pcnwLowSw_);
|
||||
pcnwSlopeLow_ = VanGenuchten::twoPhaseSatDPcnw_dSw(*this, pcnwLowSw_);
|
||||
pcnwHigh_ = VanGenuchten::twoPhaseSatPcnw(*this, pcnwHighSw_);
|
||||
pcnwSlopeHigh_ = 2*(0.0 - pcnwHigh_)/(1.0 - pcnwHighSw_);
|
||||
|
||||
Scalar mThreshold = VanGenuchten::twoPhaseSatDpcwn_dSw(*this, pcwnHighSw_);
|
||||
Scalar mThreshold = VanGenuchten::twoPhaseSatDPcnw_dSw(*this, pcnwHighSw_);
|
||||
|
||||
pcwnHighSpline_.set(pcwnHighSw_, 1.0, // x0, x1
|
||||
pcwnHigh_, 0, // y0, y1
|
||||
mThreshold, pcwnSlopeHigh_); // m0, m1
|
||||
pcnwHighSpline_.set(pcnwHighSw_, 1.0, // x0, x1
|
||||
pcnwHigh_, 0, // y0, y1
|
||||
mThreshold, pcnwSlopeHigh_); // m0, m1
|
||||
|
||||
}
|
||||
|
||||
@@ -81,15 +81,15 @@ public:
|
||||
* \brief Return the threshold saturation below which the
|
||||
* capillary pressure is regularized.
|
||||
*/
|
||||
Scalar pcwnLowSw() const
|
||||
{ return pcwnLowSw_; }
|
||||
Scalar pcnwLowSw() const
|
||||
{ return pcnwLowSw_; }
|
||||
|
||||
/*!
|
||||
* \brief Return the capillary pressure at the low threshold
|
||||
* saturation of the wetting phase.
|
||||
*/
|
||||
Scalar pcwnLow() const
|
||||
{ return pcwnLow_; }
|
||||
Scalar pcnwLow() const
|
||||
{ return pcnwLow_; }
|
||||
|
||||
/*!
|
||||
* \brief Return the slope capillary pressure curve if Sw is
|
||||
@@ -97,36 +97,36 @@ public:
|
||||
*
|
||||
* For this case, we extrapolate the curve using a straight line.
|
||||
*/
|
||||
Scalar pcwnSlopeLow() const
|
||||
{ return pcwnSlopeLow_; }
|
||||
Scalar pcnwSlopeLow() const
|
||||
{ return pcnwSlopeLow_; }
|
||||
|
||||
/*!
|
||||
* \brief Set the threshold saturation below which the capillary
|
||||
* pressure is regularized.
|
||||
*/
|
||||
void setPCLowSw(Scalar value)
|
||||
{ pcwnLowSw_ = value; }
|
||||
{ pcnwLowSw_ = value; }
|
||||
|
||||
/*!
|
||||
* \brief Return the threshold saturation below which the
|
||||
* capillary pressure is regularized.
|
||||
*/
|
||||
Scalar pcwnHighSw() const
|
||||
{ return pcwnHighSw_; }
|
||||
Scalar pcnwHighSw() const
|
||||
{ return pcnwHighSw_; }
|
||||
|
||||
/*!
|
||||
* \brief Return the capillary pressure at the high threshold
|
||||
* saturation of the wetting phase.
|
||||
*/
|
||||
Scalar pcwnHigh() const
|
||||
{ return pcwnHigh_; }
|
||||
Scalar pcnwHigh() const
|
||||
{ return pcnwHigh_; }
|
||||
|
||||
/*!
|
||||
* \brief Return the spline curve which ought to be used between
|
||||
* the upper threshold saturation and 1.
|
||||
*/
|
||||
const Spline<Scalar> &pcwnHighSpline() const
|
||||
{ return pcwnHighSpline_; }
|
||||
const Spline<Scalar> &pcnwHighSpline() const
|
||||
{ return pcnwHighSpline_; }
|
||||
|
||||
/*!
|
||||
* \brief Return the slope capillary pressure curve if Sw is
|
||||
@@ -134,27 +134,27 @@ public:
|
||||
*
|
||||
* For this case, we extrapolate the curve using a straight line.
|
||||
*/
|
||||
Scalar pcwnSlopeHigh() const
|
||||
{ return pcwnSlopeHigh_; }
|
||||
Scalar pcnwSlopeHigh() const
|
||||
{ return pcnwSlopeHigh_; }
|
||||
|
||||
/*!
|
||||
* \brief Set the threshold saturation below which the capillary
|
||||
* pressure is regularized.
|
||||
*/
|
||||
void setPCHighSw(Scalar value)
|
||||
{ pcwnHighSw_ = value; }
|
||||
{ pcnwHighSw_ = value; }
|
||||
|
||||
private:
|
||||
Scalar pcwnLowSw_;
|
||||
Scalar pcwnHighSw_;
|
||||
Scalar pcnwLowSw_;
|
||||
Scalar pcnwHighSw_;
|
||||
|
||||
Scalar pcwnLow_;
|
||||
Scalar pcwnHigh_;
|
||||
Scalar pcnwLow_;
|
||||
Scalar pcnwHigh_;
|
||||
|
||||
Scalar pcwnSlopeLow_;
|
||||
Scalar pcwnSlopeHigh_;
|
||||
Scalar pcnwSlopeLow_;
|
||||
Scalar pcnwSlopeHigh_;
|
||||
|
||||
Spline<Scalar> pcwnHighSpline_;
|
||||
Spline<Scalar> pcnwHighSpline_;
|
||||
};
|
||||
} // namespace Opm
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ public:
|
||||
static void capillaryPressures(Container &values, const Params ¶ms, const FluidState &fs)
|
||||
{
|
||||
values[Traits::wPhaseIdx] = 0.0; // reference phase
|
||||
values[Traits::nPhaseIdx] = pcwn(params, fs);
|
||||
values[Traits::nPhaseIdx] = pcnw(params, fs);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -155,7 +155,7 @@ public:
|
||||
values[Traits::wPhaseIdx] = 0;
|
||||
values[Traits::nPhaseIdx] = 0;
|
||||
if (satPhaseIdx == Traits::wPhaseIdx)
|
||||
values[Traits::nPhaseIdx] = dpcwn_dSw(params, state);
|
||||
values[Traits::nPhaseIdx] = dPcnw_dSw(params, state);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -283,12 +283,12 @@ public:
|
||||
* ought to be calculated
|
||||
*/
|
||||
template <class FluidState>
|
||||
static Scalar pcwn(const Params ¶ms, const FluidState &fs)
|
||||
static Scalar pcnw(const Params ¶ms, const FluidState &fs)
|
||||
{
|
||||
Scalar Sw = fs.saturation(Traits::wPhaseIdx);
|
||||
assert(0 <= Sw && Sw <= 1);
|
||||
|
||||
return twoPhaseSatPcwn(params, Sw);
|
||||
return twoPhaseSatPcnw(params, Sw);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -305,7 +305,7 @@ public:
|
||||
* required by the van Genuchten law.
|
||||
* \param Sw The effective wetting phase saturation
|
||||
*/
|
||||
static Scalar twoPhaseSatPcwn(const Params ¶ms, Scalar Sw)
|
||||
static Scalar twoPhaseSatPcnw(const Params ¶ms, Scalar Sw)
|
||||
{ return std::pow(std::pow(Sw, -1.0/params.vgM()) - 1, 1.0/params.vgN())/params.vgAlpha(); }
|
||||
|
||||
/*!
|
||||
@@ -360,10 +360,10 @@ public:
|
||||
* \param fs The fluid state containing valid saturations
|
||||
*/
|
||||
template <class FluidState>
|
||||
static Scalar dpcwn_dSw(const Params ¶ms, const FluidState &fs)
|
||||
{ return twoPhaseSatDpcwn_dSw(params, fs.saturation(Traits::wPhaseIdx)); }
|
||||
static Scalar dPcnw_dSw(const Params ¶ms, const FluidState &fs)
|
||||
{ return twoPhaseSatDPcnw_dSw(params, fs.saturation(Traits::wPhaseIdx)); }
|
||||
|
||||
static Scalar twoPhaseSatDpcwn_dSw(const Params ¶ms, Scalar Sw)
|
||||
static Scalar twoPhaseSatDPcnw_dSw(const Params ¶ms, Scalar Sw)
|
||||
{
|
||||
assert(0 < Sw && Sw < 1);
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ void testTwoPhaseApi()
|
||||
const typename MaterialLaw::Params params;
|
||||
|
||||
Scalar v;
|
||||
v = MaterialLaw::pcwn(params, fs);
|
||||
v = MaterialLaw::pcnw(params, fs);
|
||||
v = MaterialLaw::Sw(params, fs);
|
||||
v = MaterialLaw::Sn(params, fs);
|
||||
v = MaterialLaw::krw(params, fs);
|
||||
@@ -188,7 +188,7 @@ void testTwoPhaseSatApi()
|
||||
|
||||
Scalar Sw;
|
||||
Scalar v;
|
||||
v = MaterialLaw::twoPhaseSatPcwn(params, Sw);
|
||||
v = MaterialLaw::twoPhaseSatPcnw(params, Sw);
|
||||
v = MaterialLaw::twoPhaseSatSw(params, Sw);
|
||||
v = MaterialLaw::twoPhaseSatSn(params, Sw);
|
||||
v = MaterialLaw::twoPhaseSatKrw(params, Sw);
|
||||
@@ -216,7 +216,7 @@ void testThreePhaseApi()
|
||||
const typename MaterialLaw::Params params;
|
||||
|
||||
Scalar v;
|
||||
v = MaterialLaw::pcwn(params, fs);
|
||||
v = MaterialLaw::pcnw(params, fs);
|
||||
v = MaterialLaw::Sw(params, fs);
|
||||
v = MaterialLaw::Sn(params, fs);
|
||||
v = MaterialLaw::krw(params, fs);
|
||||
|
||||
Reference in New Issue
Block a user