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:
template<class TypeTag>
typename EvalCflFluxDefault<TypeTag>::Scalar EvalCflFluxDefault<TypeTag>::getCFLFluxFunction(const Element& element)
{
Scalar residualSatW = problem_.spatialParams().materialLawParams(element).Swr();
Scalar residualSatNW = problem_.spatialParams().materialLawParams(element).Snr();
Scalar residualSatW = problem_.spatialParams().materialLawParams(element).swr();
Scalar residualSatNW = problem_.spatialParams().materialLawParams(element).snr();
// compute dt restriction
Scalar volumeCorrectionFactor = 1 - residualSatW - residualSatNW;
......
......@@ -402,10 +402,10 @@ void FVTransport2P2C<TypeTag>::getFlux(Dune::FieldVector<Scalar, 2>& fluxEntries
PhaseVector SmobI(0.);
SmobI[wPhaseIdx] = std::max((cellDataI.saturation(wPhaseIdx)
- problem().spatialParams().materialLawParams(*elementPtrI).Swr())
- problem().spatialParams().materialLawParams(*elementPtrI).swr())
, 1e-2);
SmobI[nPhaseIdx] = std::max((cellDataI.saturation(nPhaseIdx)
- problem().spatialParams().materialLawParams(*elementPtrI).Snr())
- problem().spatialParams().materialLawParams(*elementPtrI).snr())
, 1e-2);
Scalar densityWI (0.), densityNWI(0.);
......@@ -649,10 +649,10 @@ void FVTransport2P2C<TypeTag>::getFluxOnBoundary(Dune::FieldVector<Scalar, 2>& f
DimMatrix K_I(problem().spatialParams().intrinsicPermeability(*elementPtrI));
Scalar SwmobI = std::max((cellDataI.saturation(wPhaseIdx)
- problem().spatialParams().materialLawParams(*elementPtrI).Swr())
- problem().spatialParams().materialLawParams(*elementPtrI).swr())
, 1e-2);
Scalar SnmobI = std::max((cellDataI.saturation(nPhaseIdx)
- problem().spatialParams().materialLawParams(*elementPtrI).Snr())
- problem().spatialParams().materialLawParams(*elementPtrI).snr())
, 1e-2);
Scalar densityWI (0.), densityNWI(0.);
......
......@@ -316,10 +316,10 @@ void FVTransport2P2CAdaptive<TypeTag>::getMpfaFlux(Dune::FieldVector<Scalar, 2>&
PhaseVector SmobI(0.);
SmobI[wPhaseIdx] = std::max((cellDataI.saturation(wPhaseIdx)
- problem().spatialParams().materialLawParams(*elementI).Swr())
- problem().spatialParams().materialLawParams(*elementI).swr())
, 1e-2);
SmobI[nPhaseIdx] = std::max((cellDataI.saturation(nPhaseIdx)
- problem().spatialParams().materialLawParams(*elementI).Snr())
- problem().spatialParams().materialLawParams(*elementI).snr())
, 1e-2);
Scalar densityWI (0.), densityNWI(0.);
......
......@@ -244,7 +244,7 @@ public:
/*
* Inverse capillary pressure function SwM = pcM^(-1)(pcF(SwF))
*/
satWMatrix_ = MaterialLaw::Sw(materialParamsMatrix, pCFracture_);
satWMatrix_ = MaterialLaw::sw(materialParamsMatrix, pCFracture_);
satNMatrix_ = 1 - satWMatrix_;
}
}
......
......@@ -107,7 +107,7 @@ public:
Scalar pN = std::max(this->problem_().referencePressure(*elemIt, fvGeometry, scvIdx),
pW + pcMin);
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
// pressures
......
......@@ -128,7 +128,7 @@ public:
fluidState.setPressure(nPhaseIdx, std::max(pnRef, priVars[pwIdx] + minPc));
// 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(nPhaseIdx, 1 - Sw);
......
......@@ -88,7 +88,7 @@ public:
* is constructed accordingly. Afterwards the values are set there, too.
* \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);
......@@ -96,6 +96,12 @@ public:
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
* pressure w.r.t. the effective saturation according to Brooks & Corey.
......
......@@ -80,7 +80,7 @@ public:
*/
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:
*
* \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)
{
return SweToSw_(params, EffLaw::Sw(params, pC));
return sw(params, pC);
}
/*!
......@@ -116,7 +122,7 @@ public:
*/
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:
*/
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:
*/
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:
* is constructed accordingly. Afterwards the values are set there, too.
* \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)
{
return (Sw - params.Swr())/(1 - params.Swr() - params.Snr());
return swToSwe(params, Sw);
}
/*!
......@@ -195,9 +207,15 @@ public:
* is constructed accordingly. Afterwards the values are set there, too.
* \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)
{
return (Sn - params.Snr())/(1 - params.Swr() - params.Snr());
return snToSne(params, Sn);
}
private:
......@@ -210,9 +228,9 @@ private:
* is constructed accordingly. Afterwards the values are set there, too.
* \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:
* \return Derivative of the effective saturation w.r.t. the absolute saturation.
*/
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.
......@@ -235,7 +253,7 @@ private:
* \return Derivative of the absolute saturation w.r.t. the effective saturation.
*/
static Scalar dSw_dSwe_(const Params &params)
{ return 1 - params.Swr() - params.Snr(); }
{ return 1 - params.swr() - params.snr(); }
};
}
......
......@@ -44,35 +44,43 @@ public:
EffToAbsLawParams()
: EffLawParams()
{ Swr_ = Snr_ = 0; }
{ swr_ = snr_ = 0; }
/*!
* \brief Return the residual wetting saturation.
*/
Scalar swr() const
{ return swr_; }
DUNE_DEPRECATED_MSG("use swr() (uncapitalized 's') instead")
Scalar Swr() const
{ return Swr_; }
{ return swr(); }
/*!
* \brief Set the residual wetting saturation.
*/
void setSwr(Scalar v)
{ Swr_ = v; }
{ swr_ = v; }
/*!
* \brief Return the residual non-wetting saturation.
*/
Scalar snr() const
{ return snr_; }
DUNE_DEPRECATED_MSG("use snr() (uncapitalized 's') instead")
Scalar Snr() const
{ return Snr_; }
{ return snr(); }
/*!
* \brief Set the residual non-wetting saturation.
*/
void setSnr(Scalar v)
{ Snr_ = v; }
{ snr_ = v; }
private:
Scalar Swr_;
Scalar Snr_;
Scalar swr_;
Scalar snr_;
};
}
......
......@@ -84,11 +84,17 @@ public:
* is constructed accordingly. Afterwards the values are set there, too.
* \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());
}
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
* pressure w.r.t. the effective saturation.
......
......@@ -117,16 +117,16 @@ public:
*
* 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();
// calculate the saturation which corrosponds to the
// saturation in the non-regularized version of
// the Brooks-Corey law
Scalar Swe = BrooksCorey::Sw(params, pC);
Scalar Swe = BrooksCorey::sw(params, pC);
// make sure that the capilary pressure observes a
// derivative != 0 for 'illegal' saturations. This is
......@@ -146,7 +146,13 @@ public:
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:
if (pC < 0)
Swe = 1.5; // make sure we regularize below
else
Swe = BrooksCorey::Sw(params, pC);
Swe = BrooksCorey::sw(params, pC);
// derivative of the regularization
if (Swe <= Sthres) {
......
......@@ -97,9 +97,15 @@ public:
* is constructed accordingly. Afterwards the values are set there, too.
* \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)
{
return LinearMaterial::Sw(params, pC);
return sw(params, pC);
}
/*!
......
......@@ -139,10 +139,10 @@ public:
*
* 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
// unregularized capillary pressure curve from the parameters
......@@ -160,7 +160,7 @@ public:
return pC/m1 + 1.0;
}
else
Sw = VanGenuchten::Sw(params, pC);
Sw = VanGenuchten::sw(params, pC);
// invert the regularization if necessary
if (Sw <= SwThLow) {
......@@ -185,6 +185,12 @@ public:
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
* of the \f$p_c(\overline S_w)\f$ w.r.t. effective saturation
......@@ -235,7 +241,7 @@ public:
if (pC < 0)
Sw = 1.5; // make sure we regularize below
else
Sw = VanGenuchten::Sw(params, pC);
Sw = VanGenuchten::sw(params, pC);
// derivative of the regularization
if (Sw < params.pCLowSw()) {
......
......@@ -85,13 +85,19 @@ public:
* is constructed accordingly. Afterwards the values are set there, too.
* \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);
return pow(pow(params.vgAlpha()*pC, params.vgN()) + 1, -params.vgM());
}
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
* pressure w.r.t. the effective saturation according to van Genuchten.
......
......@@ -73,7 +73,7 @@ public:
Scalar pc,pc_prime,Se_regu;
Scalar PC_VG_REG = 0.01;
Se = (Sw-params.Swr())/(1.-params.Sgr());
Se = (Sw-params.swr())/(1.-params.sgr());
/* Snr = 0.0; test version */
......@@ -96,7 +96,7 @@ public:
/* value and derivative at regularization point */
if (Se<=PC_VG_REG) Se_regu = PC_VG_REG; else Se_regu = 1-PC_VG_REG;
pc = std::pow(std::pow(Se_regu,-1/vg_m)-1,1/params.vgN())/params.vgAlpha();
pc_prime = std::pow(std::pow(Se_regu,-1/vg_m)-1,1/params.vgN()-1)*std::pow(Se_regu,-1/vg_m-1)*(-1/vg_m)/params.vgAlpha()/(1-params.Sgr()-params.Swr())/params.vgN();
pc_prime = std::pow(std::pow(Se_regu,-1/vg_m)-1,1/params.vgN()-1)*std::pow(Se_regu,-1/vg_m-1)*(-1/vg_m)/params.vgAlpha()/(1-params.sgr()-params.swr())/params.vgN();
/* evaluate tangential */
r = (Se-Se_regu)*pc_prime+pc;
......@@ -117,7 +117,7 @@ public:
Scalar pc,pc_prime,Se_regu;
Scalar PC_VG_REG = 0.01;
Se = (Sw-params.Swr())/(1.-params.Snr());
Se = (Sw-params.swr())/(1.-params.snr());
/* Snr = 0.0; test version */
......@@ -140,7 +140,7 @@ public:
/* value and derivative at regularization point */
if (Se<=PC_VG_REG) Se_regu = PC_VG_REG; else Se_regu = 1-PC_VG_REG;
pc = std::pow(std::pow(Se_regu,-1/vg_m)-1,1/params.vgN())/params.vgAlpha();
pc_prime = std::pow(std::pow(Se_regu,-1/vg_m)-1,1/params.vgN()-1)*std::pow(Se_regu,-1/vg_m-1)*(-1/vg_m)/params.vgAlpha()/(1-params.Snr()-params.Swr())/params.vgN();
pc_prime = std::pow(std::pow(Se_regu,-1/vg_m)-1,1/params.vgN()-1)*std::pow(Se_regu,-1/vg_m-1)*(-1/vg_m)/params.vgAlpha()/(1-params.snr()-params.swr())/params.vgN();
/* evaluate tangential */
r = (Se-Se_regu)*pc_prime+pc;
......@@ -160,7 +160,7 @@ public:
Scalar pc,pc_prime,Se_regu;
Scalar PC_VG_REG = 0.01;
Se = (St-params.Swrx())/(1.-params.Swrx());
Se = (St-params.swrx())/(1.-params.swrx());
/* Snr = 0.0; test version */
......@@ -183,7 +183,7 @@ public:
/* value and derivative at regularization point */
if (Se<=PC_VG_REG) Se_regu = PC_VG_REG; else Se_regu = 1-PC_VG_REG;
pc = std::pow(std::pow(Se_regu,-1/vg_m)-1,1/params.vgN())/params.vgAlpha();
pc_prime = std::pow(std::pow(Se_regu,-1/vg_m)-1,1/params.vgN()-1)*std::pow(Se_regu,-1/vg_m-1)*(-1/vg_m)/params.vgAlpha()/(1-params.Sgr()-params.Swrx())/params.vgN();
pc_prime = std::pow(std::pow(Se_regu,-1/vg_m)-1,1/params.vgN()-1)*std::pow(Se_regu,-1/vg_m-1)*(-1/vg_m)/params.vgAlpha()/(1-params.sgr()-params.swrx())/params.vgN();
/* evaluate tangential */
r = (Se-Se_regu)*pc_prime+pc;
......@@ -201,10 +201,10 @@ public:
if (Sne<=0.001) Sne=0.0;
if (Sne>=1.0) Sne=1.0;
if (Sne>params.Snr()) alpha = 1.0;
if (Sne>params.snr()) alpha = 1.0;
else
{
if (params.Snr()>=0.001) alpha = Sne/params.Snr();
if (params.snr()>=0.001) alpha = Sne/params.snr();
else alpha = 0.0;
}
return(alpha);
......@@ -214,11 +214,18 @@ public:
* \brief The saturation-capillary pressure curve.
*
*/
static Scalar Sw(const Params &params, Scalar pC)
static Scalar sw(const Params &params, Scalar pC)
{
DUNE_THROW(Dune::NotImplemented, "Sw(pc) for three phases not implemented! Do it yourself!");
}
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
* pressure to the effective saturation.
......@@ -256,7 +263,7 @@ public:
{
//transformation to effective saturation
Scalar Se = (saturation - params.Swr()) / (1-params.Swr());
Scalar Se = (saturation - params.swr()) / (1-params.swr());
/* regularization */
if(Se > 1.0) return 1.;
......@@ -286,8 +293,8 @@ public:
static Scalar krn(const Params &params, Scalar Sw, Scalar saturation, Scalar Sg)
{
Scalar Swe = std::min((Sw - params.Swr()) / (1 - params.Swr()), 1.);
Scalar Ste = std::min((Sw + saturation - params.Swr()) / (1 - params.Swr()), 1.);
Scalar Swe = std::min((Sw - params.swr()) / (1 - params.swr()), 1.);
Scalar Ste = std::min((Sw + saturation - params.swr()) / (1 - params.swr()), 1.);
// regularization
if(Swe <= 0.0) Swe = 0.;
......@@ -302,11 +309,11 @@ public:
if (params.krRegardsSnr())
{
// regard Snr in the permeability of the n-phase, see Helmig1997
Scalar resIncluded = std::max(std::min((saturation - params.Snr()/ (1-params.Swr())), 1.), 0.);
Scalar resIncluded = std::max(std::min((saturation - params.snr()/ (1-params.swr())), 1.), 0.);
krn_ *= std::sqrt(resIncluded );
}
else
krn_ *= std::sqrt(saturation / (1 - params.Swr())); // Hint: (Ste - Swe) = Sn / (1-Srw)
krn_ *= std::sqrt(saturation / (1 - params.swr())); // Hint: (Ste - Swe) = Sn / (1-Srw)
return krn_;
......@@ -331,7 +338,7 @@ public:
{
// Se = (Sw+Sn - Sgr)/(1-Sgr)
Scalar Se = std::min(((1-saturation) - params.Sgr()) / (1 - params.Sgr()), 1.);
Scalar Se = std::min(((1-saturation) - params.sgr()) / (1 - params.sgr()), 1.);
/* regularization */
......@@ -340,7 +347,7 @@ public:
Scalar scalFact = 1.;
if (saturation<=0.1)
{
scalFact = (saturation - params.Sgr())/(0.1 - params.Sgr());
scalFact = (saturation - params.sgr())/(0.1 - params.sgr());
if (scalFact < 0.) scalFact = 0.;
}
......
......@@ -114,13 +114,13 @@ public:
switch (phaseIdx)
{
case 0:
return Swr_;
return swr_;
break;
case 1:
return Snr_;
return snr_;
break;
case 2:
return Sgr_;
return sgr_;
break;
}
DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
......@@ -140,47 +140,63 @@ public:
/*!
* \brief Return the residual wetting saturation.
*/
Scalar swr() const
{ return swr_; }