Commit 4568962d authored by Bernd Flemisch's avatar Bernd Flemisch
Browse files

Partially implements FS#180 - Inconsistent naming - special status of

saturation. In particular, it deals with the capitalized "S"-function in
the material laws:
Sgr -> sgr
Snr -> snr
SnToSne -> snToSne
Sreg -> sreg
Sw -> sw
SwToSwe -> swToSwe
SweToSw_ -> sweToSw_
Swr -> swr
Swrx -> swrx

Reviewed by Christoph. 



git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@10757 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 6c61aa2c
...@@ -232,8 +232,8 @@ private: ...@@ -232,8 +232,8 @@ private:
template<class TypeTag> template<class TypeTag>
typename EvalCflFluxDefault<TypeTag>::Scalar EvalCflFluxDefault<TypeTag>::getCFLFluxFunction(const Element& element) typename EvalCflFluxDefault<TypeTag>::Scalar EvalCflFluxDefault<TypeTag>::getCFLFluxFunction(const Element& element)
{ {
Scalar residualSatW = problem_.spatialParams().materialLawParams(element).Swr(); Scalar residualSatW = problem_.spatialParams().materialLawParams(element).swr();
Scalar residualSatNW = problem_.spatialParams().materialLawParams(element).Snr(); Scalar residualSatNW = problem_.spatialParams().materialLawParams(element).snr();
// compute dt restriction // compute dt restriction
Scalar volumeCorrectionFactor = 1 - residualSatW - residualSatNW; Scalar volumeCorrectionFactor = 1 - residualSatW - residualSatNW;
......
...@@ -402,10 +402,10 @@ void FVTransport2P2C<TypeTag>::getFlux(Dune::FieldVector<Scalar, 2>& fluxEntries ...@@ -402,10 +402,10 @@ void FVTransport2P2C<TypeTag>::getFlux(Dune::FieldVector<Scalar, 2>& fluxEntries
PhaseVector SmobI(0.); PhaseVector SmobI(0.);
SmobI[wPhaseIdx] = std::max((cellDataI.saturation(wPhaseIdx) SmobI[wPhaseIdx] = std::max((cellDataI.saturation(wPhaseIdx)
- problem().spatialParams().materialLawParams(*elementPtrI).Swr()) - problem().spatialParams().materialLawParams(*elementPtrI).swr())
, 1e-2); , 1e-2);
SmobI[nPhaseIdx] = std::max((cellDataI.saturation(nPhaseIdx) SmobI[nPhaseIdx] = std::max((cellDataI.saturation(nPhaseIdx)
- problem().spatialParams().materialLawParams(*elementPtrI).Snr()) - problem().spatialParams().materialLawParams(*elementPtrI).snr())
, 1e-2); , 1e-2);
Scalar densityWI (0.), densityNWI(0.); Scalar densityWI (0.), densityNWI(0.);
...@@ -649,10 +649,10 @@ void FVTransport2P2C<TypeTag>::getFluxOnBoundary(Dune::FieldVector<Scalar, 2>& f ...@@ -649,10 +649,10 @@ void FVTransport2P2C<TypeTag>::getFluxOnBoundary(Dune::FieldVector<Scalar, 2>& f
DimMatrix K_I(problem().spatialParams().intrinsicPermeability(*elementPtrI)); DimMatrix K_I(problem().spatialParams().intrinsicPermeability(*elementPtrI));
Scalar SwmobI = std::max((cellDataI.saturation(wPhaseIdx) Scalar SwmobI = std::max((cellDataI.saturation(wPhaseIdx)
- problem().spatialParams().materialLawParams(*elementPtrI).Swr()) - problem().spatialParams().materialLawParams(*elementPtrI).swr())
, 1e-2); , 1e-2);
Scalar SnmobI = std::max((cellDataI.saturation(nPhaseIdx) Scalar SnmobI = std::max((cellDataI.saturation(nPhaseIdx)
- problem().spatialParams().materialLawParams(*elementPtrI).Snr()) - problem().spatialParams().materialLawParams(*elementPtrI).snr())
, 1e-2); , 1e-2);
Scalar densityWI (0.), densityNWI(0.); Scalar densityWI (0.), densityNWI(0.);
......
...@@ -316,10 +316,10 @@ void FVTransport2P2CAdaptive<TypeTag>::getMpfaFlux(Dune::FieldVector<Scalar, 2>& ...@@ -316,10 +316,10 @@ void FVTransport2P2CAdaptive<TypeTag>::getMpfaFlux(Dune::FieldVector<Scalar, 2>&
PhaseVector SmobI(0.); PhaseVector SmobI(0.);
SmobI[wPhaseIdx] = std::max((cellDataI.saturation(wPhaseIdx) SmobI[wPhaseIdx] = std::max((cellDataI.saturation(wPhaseIdx)
- problem().spatialParams().materialLawParams(*elementI).Swr()) - problem().spatialParams().materialLawParams(*elementI).swr())
, 1e-2); , 1e-2);
SmobI[nPhaseIdx] = std::max((cellDataI.saturation(nPhaseIdx) SmobI[nPhaseIdx] = std::max((cellDataI.saturation(nPhaseIdx)
- problem().spatialParams().materialLawParams(*elementI).Snr()) - problem().spatialParams().materialLawParams(*elementI).snr())
, 1e-2); , 1e-2);
Scalar densityWI (0.), densityNWI(0.); Scalar densityWI (0.), densityNWI(0.);
......
...@@ -244,7 +244,7 @@ public: ...@@ -244,7 +244,7 @@ public:
/* /*
* Inverse capillary pressure function SwM = pcM^(-1)(pcF(SwF)) * Inverse capillary pressure function SwM = pcM^(-1)(pcF(SwF))
*/ */
satWMatrix_ = MaterialLaw::Sw(materialParamsMatrix, pCFracture_); satWMatrix_ = MaterialLaw::sw(materialParamsMatrix, pCFracture_);
satNMatrix_ = 1 - satWMatrix_; satNMatrix_ = 1 - satWMatrix_;
} }
} }
......
...@@ -107,7 +107,7 @@ public: ...@@ -107,7 +107,7 @@ public:
Scalar pN = std::max(this->problem_().referencePressure(*elemIt, fvGeometry, scvIdx), Scalar pN = std::max(this->problem_().referencePressure(*elemIt, fvGeometry, scvIdx),
pW + pcMin); pW + pcMin);
Scalar pcOld = pN - pW; Scalar pcOld = pN - pW;
Scalar SwOld = std::max<Scalar>(0.0, MaterialLaw::Sw(mp, pcOld)); Scalar SwOld = std::max<Scalar>(0.0, MaterialLaw::sw(mp, pcOld));
// convert into minimum and maximum wetting phase // convert into minimum and maximum wetting phase
// pressures // pressures
......
...@@ -128,7 +128,7 @@ public: ...@@ -128,7 +128,7 @@ public:
fluidState.setPressure(nPhaseIdx, std::max(pnRef, priVars[pwIdx] + minPc)); fluidState.setPressure(nPhaseIdx, std::max(pnRef, priVars[pwIdx] + minPc));
// saturations // saturations
Scalar Sw = MaterialLaw::Sw(matParams, fluidState.pressure(nPhaseIdx) - fluidState.pressure(wPhaseIdx)); Scalar Sw = MaterialLaw::sw(matParams, fluidState.pressure(nPhaseIdx) - fluidState.pressure(wPhaseIdx));
fluidState.setSaturation(wPhaseIdx, Sw); fluidState.setSaturation(wPhaseIdx, Sw);
fluidState.setSaturation(nPhaseIdx, 1 - Sw); fluidState.setSaturation(nPhaseIdx, 1 - Sw);
......
...@@ -88,7 +88,7 @@ public: ...@@ -88,7 +88,7 @@ public:
* is constructed accordingly. Afterwards the values are set there, too. * is constructed accordingly. Afterwards the values are set there, too.
* \return Effective wetting phase saturation calculated as inverse of BrooksCorey constitutive relation. * \return Effective wetting phase saturation calculated as inverse of BrooksCorey constitutive relation.
*/ */
static Scalar Sw(const Params &params, Scalar pC) static Scalar sw(const Params &params, Scalar pC)
{ {
assert(pC >= 0); assert(pC >= 0);
...@@ -96,6 +96,12 @@ public: ...@@ -96,6 +96,12 @@ public:
return std::min(std::max(tmp, Scalar(0.0)), Scalar(1.0)); return std::min(std::max(tmp, Scalar(0.0)), Scalar(1.0));
} }
DUNE_DEPRECATED_MSG("use sw() (uncapitalized 's') instead")
static Scalar Sw(const Params &params, Scalar pC)
{
return sw(params, pC);
}
/*! /*!
* \brief The partial derivative of the capillary * \brief The partial derivative of the capillary
* pressure w.r.t. the effective saturation according to Brooks & Corey. * pressure w.r.t. the effective saturation according to Brooks & Corey.
......
...@@ -80,7 +80,7 @@ public: ...@@ -80,7 +80,7 @@ public:
*/ */
static Scalar pC(const Params &params, Scalar Sw) static Scalar pC(const Params &params, Scalar Sw)
{ {
return EffLaw::pC(params, SwToSwe(params, Sw)); return EffLaw::pC(params, swToSwe(params, Sw));
} }
/*! /*!
...@@ -94,9 +94,15 @@ public: ...@@ -94,9 +94,15 @@ public:
* *
* \return The absolute saturation of the wetting phase \f$S_w\f$ * \return The absolute saturation of the wetting phase \f$S_w\f$
*/ */
static Scalar sw(const Params &params, Scalar pC)
{
return sweToSw_(params, EffLaw::sw(params, pC));
}
DUNE_DEPRECATED_MSG("use sw() (uncapitalized 's') instead")
static Scalar Sw(const Params &params, Scalar pC) static Scalar Sw(const Params &params, Scalar pC)
{ {
return SweToSw_(params, EffLaw::Sw(params, pC)); return sw(params, pC);
} }
/*! /*!
...@@ -116,7 +122,7 @@ public: ...@@ -116,7 +122,7 @@ public:
*/ */
static Scalar dpC_dSw(const Params &params, Scalar Sw) static Scalar dpC_dSw(const Params &params, Scalar Sw)
{ {
return EffLaw::dpC_dSw(params, SwToSwe(params, Sw) )*dSwe_dSw_(params); return EffLaw::dpC_dSw(params, swToSwe(params, Sw) )*dSwe_dSw_(params);
} }
/*! /*!
...@@ -154,7 +160,7 @@ public: ...@@ -154,7 +160,7 @@ public:
*/ */
static Scalar krw(const Params &params, Scalar Sw) static Scalar krw(const Params &params, Scalar Sw)
{ {
return EffLaw::krw(params, SwToSwe(params, Sw)); return EffLaw::krw(params, swToSwe(params, Sw));
}; };
/*! /*!
...@@ -169,7 +175,7 @@ public: ...@@ -169,7 +175,7 @@ public:
*/ */
static Scalar krn(const Params &params, Scalar Sw) static Scalar krn(const Params &params, Scalar Sw)
{ {
return EffLaw::krn(params, SwToSwe(params, Sw)); return EffLaw::krn(params, swToSwe(params, Sw));
} }
/*! /*!
...@@ -181,9 +187,15 @@ public: ...@@ -181,9 +187,15 @@ public:
* is constructed accordingly. Afterwards the values are set there, too. * is constructed accordingly. Afterwards the values are set there, too.
* \return Effective saturation of the wetting phase. * \return Effective saturation of the wetting phase.
*/ */
static Scalar swToSwe(const Params &params, Scalar Sw)
{
return (Sw - params.swr())/(1 - params.swr() - params.snr());
}
DUNE_DEPRECATED_MSG("use swToSwe() (uncapitalized 's') instead")
static Scalar SwToSwe(const Params &params, Scalar Sw) static Scalar SwToSwe(const Params &params, Scalar Sw)
{ {
return (Sw - params.Swr())/(1 - params.Swr() - params.Snr()); return swToSwe(params, Sw);
} }
/*! /*!
...@@ -195,9 +207,15 @@ public: ...@@ -195,9 +207,15 @@ public:
* is constructed accordingly. Afterwards the values are set there, too. * is constructed accordingly. Afterwards the values are set there, too.
* \return Effective saturation of the non-wetting phase. * \return Effective saturation of the non-wetting phase.
*/ */
static Scalar snToSne(const Params &params, Scalar Sn)
{
return (Sn - params.snr())/(1 - params.swr() - params.snr());
}
DUNE_DEPRECATED_MSG("use snToSne() (uncapitalized 's') instead")
static Scalar SnToSne(const Params &params, Scalar Sn) static Scalar SnToSne(const Params &params, Scalar Sn)
{ {
return (Sn - params.Snr())/(1 - params.Swr() - params.Snr()); return snToSne(params, Sn);
} }
private: private:
...@@ -210,9 +228,9 @@ private: ...@@ -210,9 +228,9 @@ private:
* is constructed accordingly. Afterwards the values are set there, too. * is constructed accordingly. Afterwards the values are set there, too.
* \return Absolute saturation of the non-wetting phase. * \return Absolute saturation of the non-wetting phase.
*/ */
static Scalar SweToSw_(const Params &params, Scalar Swe) static Scalar sweToSw_(const Params &params, Scalar Swe)
{ {
return Swe*(1 - params.Swr() - params.Snr()) + params.Swr(); return Swe*(1 - params.swr() - params.snr()) + params.swr();
} }
/*! /*!
...@@ -224,7 +242,7 @@ private: ...@@ -224,7 +242,7 @@ private:
* \return Derivative of the effective saturation w.r.t. the absolute saturation. * \return Derivative of the effective saturation w.r.t. the absolute saturation.
*/ */
static Scalar dSwe_dSw_(const Params &params) static Scalar dSwe_dSw_(const Params &params)
{ return 1.0/(1 - params.Swr() - params.Snr()); } { return 1.0/(1 - params.swr() - params.snr()); }
/*! /*!
* \brief Derivative of the absolute saturation w.r.t. the effective saturation. * \brief Derivative of the absolute saturation w.r.t. the effective saturation.
...@@ -235,7 +253,7 @@ private: ...@@ -235,7 +253,7 @@ private:
* \return Derivative of the absolute saturation w.r.t. the effective saturation. * \return Derivative of the absolute saturation w.r.t. the effective saturation.
*/ */
static Scalar dSw_dSwe_(const Params &params) static Scalar dSw_dSwe_(const Params &params)
{ return 1 - params.Swr() - params.Snr(); } { return 1 - params.swr() - params.snr(); }
}; };
} }
......
...@@ -44,35 +44,43 @@ public: ...@@ -44,35 +44,43 @@ public:
EffToAbsLawParams() EffToAbsLawParams()
: EffLawParams() : EffLawParams()
{ Swr_ = Snr_ = 0; } { swr_ = snr_ = 0; }
/*! /*!
* \brief Return the residual wetting saturation. * \brief Return the residual wetting saturation.
*/ */
Scalar swr() const
{ return swr_; }
DUNE_DEPRECATED_MSG("use swr() (uncapitalized 's') instead")
Scalar Swr() const Scalar Swr() const
{ return Swr_; } { return swr(); }
/*! /*!
* \brief Set the residual wetting saturation. * \brief Set the residual wetting saturation.
*/ */
void setSwr(Scalar v) void setSwr(Scalar v)
{ Swr_ = v; } { swr_ = v; }
/*! /*!
* \brief Return the residual non-wetting saturation. * \brief Return the residual non-wetting saturation.
*/ */
Scalar snr() const
{ return snr_; }
DUNE_DEPRECATED_MSG("use snr() (uncapitalized 's') instead")
Scalar Snr() const Scalar Snr() const
{ return Snr_; } { return snr(); }
/*! /*!
* \brief Set the residual non-wetting saturation. * \brief Set the residual non-wetting saturation.
*/ */
void setSnr(Scalar v) void setSnr(Scalar v)
{ Snr_ = v; } { snr_ = v; }
private: private:
Scalar Swr_; Scalar swr_;
Scalar Snr_; Scalar snr_;
}; };
} }
......
...@@ -84,11 +84,17 @@ public: ...@@ -84,11 +84,17 @@ public:
* is constructed accordingly. Afterwards the values are set there, too. * is constructed accordingly. Afterwards the values are set there, too.
* \return Effective wetting phase saturation calculated as inverse of the linear constitutive relation. * \return Effective wetting phase saturation calculated as inverse of the linear constitutive relation.
*/ */
static Scalar Sw(const Params &params, Scalar pC) static Scalar sw(const Params &params, Scalar pC)
{ {
return 1 - (pC - params.entryPC())/(params.maxPC() - params.entryPC()); return 1 - (pC - params.entryPC())/(params.maxPC() - params.entryPC());
} }
DUNE_DEPRECATED_MSG("use sw() (uncapitalized 's') instead")
static Scalar Sw(const Params &params, Scalar pC)
{
return sw(params, pC);
}
/*! /*!
* \brief Returns the partial derivative of the capillary * \brief Returns the partial derivative of the capillary
* pressure w.r.t. the effective saturation. * pressure w.r.t. the effective saturation.
......
...@@ -117,16 +117,16 @@ public: ...@@ -117,16 +117,16 @@ public:
* *
* For the non-regularized part: * For the non-regularized part:
* *
* \copydetails BrooksCorey::Sw() * \copydetails BrooksCorey::sw()
*/ */
static Scalar Sw(const Params &params, Scalar pC) static Scalar sw(const Params &params, Scalar pC)
{ {
const Scalar Sthres = params.thresholdSw(); const Scalar Sthres = params.thresholdSw();
// calculate the saturation which corrosponds to the // calculate the saturation which corrosponds to the
// saturation in the non-regularized version of // saturation in the non-regularized version of
// the Brooks-Corey law // the Brooks-Corey law
Scalar Swe = BrooksCorey::Sw(params, pC); Scalar Swe = BrooksCorey::sw(params, pC);
// make sure that the capilary pressure observes a // make sure that the capilary pressure observes a
// derivative != 0 for 'illegal' saturations. This is // derivative != 0 for 'illegal' saturations. This is
...@@ -146,7 +146,13 @@ public: ...@@ -146,7 +146,13 @@ public:
return 1.0 + (pC - pC_SweHigh)/m;; return 1.0 + (pC - pC_SweHigh)/m;;
} }
return BrooksCorey::Sw(params, pC); return BrooksCorey::sw(params, pC);
}
DUNE_DEPRECATED_MSG("use sw() (uncapitalized 's') instead")
static Scalar Sw(const Params &params, Scalar pC)
{
return sw(params, pC);
} }
/*! /*!
...@@ -211,7 +217,7 @@ public: ...@@ -211,7 +217,7 @@ public:
if (pC < 0) if (pC < 0)
Swe = 1.5; // make sure we regularize below Swe = 1.5; // make sure we regularize below
else else
Swe = BrooksCorey::Sw(params, pC); Swe = BrooksCorey::sw(params, pC);
// derivative of the regularization // derivative of the regularization
if (Swe <= Sthres) { if (Swe <= Sthres) {
......
...@@ -97,9 +97,15 @@ public: ...@@ -97,9 +97,15 @@ public:
* is constructed accordingly. Afterwards the values are set there, too. * is constructed accordingly. Afterwards the values are set there, too.
* \return The effective saturation of the wetting phase \f$\overline{S}_w\f$ * \return The effective saturation of the wetting phase \f$\overline{S}_w\f$
*/ */
static Scalar sw(const Params &params, Scalar pC)
{
return LinearMaterial::sw(params, pC);
}
DUNE_DEPRECATED_MSG("use sw() (uncapitalized 's') instead")
static Scalar Sw(const Params &params, Scalar pC) static Scalar Sw(const Params &params, Scalar pC)
{ {
return LinearMaterial::Sw(params, pC); return sw(params, pC);
} }
/*! /*!
......
...@@ -139,10 +139,10 @@ public: ...@@ -139,10 +139,10 @@ public:
* *
* For not-regularized part: * For not-regularized part:
* *
\copydetails VanGenuchten::Sw() \copydetails VanGenuchten::sw()
* *
*/ */
static Scalar Sw(const Params &params, Scalar pC) static Scalar sw(const Params &params, Scalar pC)
{ {
// retrieve the low and the high threshold saturations for the // retrieve the low and the high threshold saturations for the
// unregularized capillary pressure curve from the parameters // unregularized capillary pressure curve from the parameters
...@@ -160,7 +160,7 @@ public: ...@@ -160,7 +160,7 @@ public:
return pC/m1 + 1.0; return pC/m1 + 1.0;
} }
else else
Sw = VanGenuchten::Sw(params, pC); Sw = VanGenuchten::sw(params, pC);
// invert the regularization if necessary // invert the regularization if necessary
if (Sw <= SwThLow) { if (Sw <= SwThLow) {
...@@ -185,6 +185,12 @@ public: ...@@ -185,6 +185,12 @@ public:
return Sw; return Sw;
} }
DUNE_DEPRECATED_MSG("use sw() (uncapitalized 's') instead")
static Scalar Sw(const Params &params, Scalar pC)
{
return sw(params, pC);
}
/*! /*!
* \brief A regularized version of the partial derivative * \brief A regularized version of the partial derivative
* of the \f$p_c(\overline S_w)\f$ w.r.t. effective saturation * of the \f$p_c(\overline S_w)\f$ w.r.t. effective saturation
...@@ -235,7 +241,7 @@ public: ...@@ -235,7 +241,7 @@ public:
if (pC < 0) if (pC < 0)
Sw = 1.5; // make sure we regularize below Sw = 1.5; // make sure we regularize below
else else
Sw = VanGenuchten::Sw(params, pC); Sw = VanGenuchten::sw(params, pC);
// derivative of the regularization // derivative of the regularization
if (Sw < params.pCLowSw()) { if (Sw < params.pCLowSw()) {
......
...@@ -85,13 +85,19 @@ public: ...@@ -85,13 +85,19 @@ public:
* is constructed accordingly. Afterwards the values are set there, too. * is constructed accordingly. Afterwards the values are set there, too.
* \return The effective saturation of the wetting phase \f$\overline{S}_w\f$ * \return The effective saturation of the wetting phase \f$\overline{S}_w\f$
*/ */
static Scalar Sw(const Params &params, Scalar pC) static Scalar sw(const Params &params, Scalar pC)
{ {
assert(pC >= 0);