Commit d1a7c762 authored by Kilian Weishaupt's avatar Kilian Weishaupt
Browse files

[fix] Change dsw to dswe for 2p

Most of the partial derivatives in the material laws are
with respect to the effective saturation swe.
This is fixed for 2p.
parent ecb1105a
......@@ -111,7 +111,7 @@ public:
* is constructed accordingly. Afterwards the values are set there, too.
* \return Partial derivative of \f$\mathrm{[p_c]}\f$ w.r.t. effective saturation according to Brooks & Corey.
*/
static Scalar dpc_dsw(const Params &params, Scalar swe)
static Scalar dpc_dswe(const Params &params, Scalar swe)
{
assert(0 <= swe && swe <= 1);
......@@ -128,7 +128,7 @@ public:
* is constructed accordingly. Afterwards the values are set there, too.
* \return Partial derivative of effective saturation w.r.t. \f$\mathrm{[p_c]}\f$ according to Brooks & Corey.
*/
static Scalar dsw_dpc(const Params &params, Scalar pc)
static Scalar dswe_dpc(const Params &params, Scalar pc)
{
assert(pc >= 0);
......@@ -165,7 +165,7 @@ public:
* \return Derivative of the relative permeability of the wetting phase w.r.t. effective wetting phase
* saturation calculated as implied by Brooks & Corey.
*/
static Scalar dkrw_dsw(const Params &params, Scalar swe)
static Scalar dkrw_dswe(const Params &params, Scalar swe)
{
assert(0 <= swe && swe <= 1);
......@@ -205,7 +205,7 @@ public:
* \return Derivative of the relative permeability of the non-wetting phase w.r.t. effective wetting phase
* saturation calculated as implied by Brooks & Corey.
*/
static Scalar dkrn_dsw(const Params &params, Scalar swe)
static Scalar dkrn_dswe(const Params &params, Scalar swe)
{
assert(0 <= swe && swe <= 1);
......
......@@ -119,7 +119,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_dswe(params, swToSwe(params, sw) )*dswe_dsw_(params);
}
/*!
......@@ -142,7 +142,7 @@ public:
*/
static Scalar dsw_dpc(const Params &params, Scalar pc)
{
return EffLaw::dsw_dpc(params, pc)*dsw_dswe_(params);
return EffLaw::dswe_dpc(params, pc)*dsw_dswe_(params);
}
/*!
......@@ -172,7 +172,7 @@ public:
*/
static Scalar dkrw_dsw(const Params &params, Scalar sw)
{
return EffLaw::dkrw_dsw(params, swToSwe(params, sw));
return EffLaw::dkrw_dswe(params, swToSwe(params, sw));
}
/*!
......@@ -201,7 +201,7 @@ public:
*/
static Scalar dkrn_dsw(const Params &params, Scalar sw)
{
return EffLaw::dkrn_dsw(params, swToSwe(params, sw));
return EffLaw::dkrn_dswe(params, swToSwe(params, sw));
}
/*!
......
......@@ -104,7 +104,7 @@ public:
* is constructed accordingly. Afterwards the values are set there, too.
* \return Partial derivative of \f$\mathrm{[p_c]}\f$ w.r.t. effective saturation according to linear material relation.
*/
static Scalar dpc_dsw(const Params &params, Scalar swe)
static Scalar dpc_dswe(const Params &params, Scalar swe)
{
return - (params.maxPc() - params.entryPc());
}
......
......@@ -92,12 +92,12 @@ public:
// saturation moving to the right direction if it
// temporarily is in an 'illegal' range.
if (swe <= sThres) {
Scalar m = BrooksCorey::dpc_dsw(params, sThres);
Scalar m = BrooksCorey::dpc_dswe(params, sThres);
Scalar pcsweLow = BrooksCorey::pc(params, sThres);
return pcsweLow + m*(swe - sThres);
}
else if (swe > 1.0) {
Scalar m = BrooksCorey::dpc_dsw(params, 1.0);
Scalar m = BrooksCorey::dpc_dswe(params, 1.0);
Scalar pcsweHigh = BrooksCorey::pc(params, 1.0);
return pcsweHigh + m*(swe - 1.0);
}
......@@ -138,12 +138,12 @@ public:
// temporarily is in an 'illegal' range.
if (swe <= sThres) {
// invert the low saturation regularization of pc()
Scalar m = BrooksCorey::dpc_dsw(params, sThres);
Scalar m = BrooksCorey::dpc_dswe(params, sThres);
Scalar pcsweLow = BrooksCorey::pc(params, sThres);
return sThres + (pc - pcsweLow)/m;
}
else if (swe > 1.0) {
Scalar m = BrooksCorey::dpc_dsw(params, 1.0);
Scalar m = BrooksCorey::dpc_dswe(params, 1.0);
Scalar pcsweHigh = BrooksCorey::pc(params, 1.0);
return 1.0 + (pc - pcsweHigh)/m;
}
......@@ -163,25 +163,25 @@ public:
*
* For the non-regularized part:
*
* \copydetails BrooksCorey::dpc_dsw()
* \copydetails BrooksCorey::dpc_dswe()
*/
static Scalar dpc_dsw(const Params &params, Scalar swe)
static Scalar dpc_dswe(const Params &params, Scalar swe)
{
const Scalar sThres = params.thresholdSw();
// derivative of the regualarization
if (swe <= sThres) {
// calculate the slope of the straight line used in pc()
Scalar m = BrooksCorey::dpc_dsw(params, sThres);
Scalar m = BrooksCorey::dpc_dswe(params, sThres);
return m;
}
else if (swe > 1.0) {
// calculate the slope of the straight line used in pc()
Scalar m = BrooksCorey::dpc_dsw(params, 1.0);
Scalar m = BrooksCorey::dpc_dswe(params, 1.0);
return m;
}
return BrooksCorey::dpc_dsw(params, swe);
return BrooksCorey::dpc_dswe(params, swe);
}
/*!
......@@ -196,9 +196,9 @@ public:
*
* For the non-regularized part:
*
* \copydetails BrooksCorey::dsw_dpc()
* \copydetails BrooksCorey::dswe_dpc()
*/
static Scalar dsw_dpc(const Params &params, Scalar pc)
static Scalar dswe_dpc(const Params &params, Scalar pc)
{
const Scalar sThres = params.thresholdSw();
......@@ -220,15 +220,15 @@ public:
// derivative of the regularization
if (swe <= sThres) {
// calculate the slope of the straight line used in pc()
Scalar m = BrooksCorey::dpc_dsw(params, sThres);
Scalar m = BrooksCorey::dpc_dswe(params, sThres);
return 1/m;
}
else if (swe > 1.0) {
// calculate the slope of the straight line used in pc()
Scalar m = BrooksCorey::dpc_dsw(params, 1.0);
Scalar m = BrooksCorey::dpc_dswe(params, 1.0);
return 1/m;
}
return 1.0/BrooksCorey::dpc_dsw(params, swe);
return 1.0/BrooksCorey::dpc_dswe(params, swe);
}
/*!
......
......@@ -116,9 +116,9 @@ public:
* Therefore, in the (problem specific) spatialParameters first, the material law is chosen, and then the params container
* is constructed accordingly. Afterwards the values are set there, too.
*/
static Scalar dpc_dsw(const Params &params, Scalar swe)
static Scalar dpc_dswe(const Params &params, Scalar swe)
{
return LinearMaterial::dpc_dsw(params, swe);
return LinearMaterial::dpc_dswe(params, swe);
}
/*!
......@@ -130,9 +130,9 @@ public:
* Therefore, in the (problem specific) spatialParameters first, the material law is chosen, and then the params container
* is constructed accordingly. Afterwards the values are set there, too.
*/
static Scalar dsw_dpc(const Params &params, Scalar pc)
static Scalar dswe_dpc(const Params &params, Scalar pc)
{
return LinearMaterial::dsw_dpc(params, pc);
return LinearMaterial::dswe_dpc(params, pc);
}
/*!
......
......@@ -112,7 +112,7 @@ public:
if (swe < 1.0) {
// use spline between threshold swe and 1.0
Scalar mTh = VanGenuchten::dpc_dsw(params, swThHigh);
Scalar mTh = VanGenuchten::dpc_dswe(params, swThHigh);
Spline<Scalar> sp(swThHigh, 1.0, // x0, x1
yTh, 0, // y0, y1
mTh, m1); // m0, m1
......@@ -176,7 +176,7 @@ public:
Scalar m1 = (0.0 - yTh)/(1.0 - swThHigh)*2;
// invert spline between threshold swe and 1.0
Scalar mTh = VanGenuchten::dpc_dsw(params, swThHigh);
Scalar mTh = VanGenuchten::dpc_dswe(params, swThHigh);
Spline<Scalar> sp(swThHigh, 1.0, // x0, x1
yTh, 0, // m0, m1
mTh, m1); // m0, m1
......@@ -199,10 +199,10 @@ public:
*
* For not-regularized part:
*
\copydetails VanGenuchten::dpc_dsw()
\copydetails VanGenuchten::dpc_dswe()
*
*/
static Scalar dpc_dsw(const Params &params, Scalar swe)
static Scalar dpc_dswe(const Params &params, Scalar swe)
{
// derivative of the regualarization
if (swe < params.pcLowSw()) {
......@@ -214,7 +214,7 @@ public:
return mHigh_(params);
}
return VanGenuchten::dpc_dsw(params, swe);
return VanGenuchten::dpc_dswe(params, swe);
}
/*!
......@@ -228,9 +228,9 @@ public:
* by a straight line and use that slope (yes, there is a kink :-( ).
*
* For not-regularized part:
\copydetails VanGenuchten::dsw_dpc()
\copydetails VanGenuchten::dswe_dpc()
*/
static Scalar dsw_dpc(const Params &params, Scalar pc)
static Scalar dswe_dpc(const Params &params, Scalar pc)
{
// calculate the saturation which corrosponds to the
// saturation in the non-regularized verision of van
......@@ -243,15 +243,15 @@ public:
// derivative of the regularization
if (sw < params.pcLowSw()) {
// same as in dpc_dsw() but inverted
// same as in dpc_dswe() but inverted
return 1/mLow_(params);
}
if (sw > params.pcHighSw()) {
// same as in dpc_dsw() but inverted
// same as in dpc_dswe() but inverted
return 1/mHigh_(params);
}
return VanGenuchten::dsw_dpc(params, pc);
return VanGenuchten::dswe_dpc(params, pc);
}
/*!
......@@ -283,7 +283,7 @@ public:
typedef Dumux::Spline<Scalar> Spline;
Spline sp(swThHigh, 1.0, // x1, x2
VanGenuchten::krw(params, swThHigh), 1.0, // y1, y2
VanGenuchten::dkrw_dsw(params, swThHigh), 0); // m1, m2
VanGenuchten::dkrw_dswe(params, swThHigh), 0); // m1, m2
return sp.eval(swe);
}
......@@ -319,7 +319,7 @@ public:
typedef Dumux::Spline<Scalar> Spline;
Spline sp(0.0, swThLow, // x1, x2
1.0, VanGenuchten::krn(params, swThLow), // y1, y2
0.0, VanGenuchten::dkrn_dsw(params, swThLow)); // m1, m2
0.0, VanGenuchten::dkrn_dswe(params, swThLow)); // m1, m2
return sp.eval(swe);
}
......@@ -342,7 +342,7 @@ private:
{
const Scalar swThLow = params.pcLowSw();
return VanGenuchten::dpc_dsw(params, swThLow);
return VanGenuchten::dpc_dswe(params, swThLow);
}
/*!
......
......@@ -108,7 +108,7 @@ public:
* Therefore, in the (problem specific) spatialParameters first, the material law is chosen, and then the params container
* is constructed accordingly. Afterwards the values are set there, too.
*/
static Scalar dpc_dsw(const Params &params, Scalar swe)
static Scalar dpc_dswe(const Params &params, Scalar swe)
{
assert(0 <= swe && swe <= 1);
......@@ -126,7 +126,7 @@ public:
* Therefore, in the (problem specific) spatialParameters first, the material law is chosen, and then the params container
* is constructed accordingly. Afterwards the values are set there, too.
*/
static Scalar dsw_dpc(const Params &params, Scalar pc)
static Scalar dswe_dpc(const Params &params, Scalar pc)
{
assert(pc >= 0);
......@@ -162,7 +162,7 @@ public:
* Therefore, in the (problem specific) spatialParameters first, the material law is chosen, and then the params container
* is constructed accordingly. Afterwards the values are set there, too.
*/
static Scalar dkrw_dsw(const Params &params, Scalar swe)
static Scalar dkrw_dswe(const Params &params, Scalar swe)
{
assert(0 <= swe && swe <= 1);
......@@ -201,7 +201,7 @@ public:
* Therefore, in the (problem specific) spatialParameters first, the material law is chosen, and then the params container
* is constructed accordingly. Afterwards the values are set there, too.
*/
static Scalar dkrn_dsw(const Params &params, Scalar swe)
static Scalar dkrn_dswe(const Params &params, Scalar swe)
{
assert(0 <= swe && swe <= 1);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment