3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
vangenuchtenparams.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3/*****************************************************************************
4 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
25#ifndef VAN_GENUCHTEN_PARAMS_HH
26#define VAN_GENUCHTEN_PARAMS_HH
27
28#include <dune/common/float_cmp.hh>
29
30namespace Dumux {
31
40template<class ScalarT>
42{
43public:
44 using Scalar = ScalarT;
45
47 {}
48
50 {
52 setVgn(vgn);
53 }
54
58 template<class OtherParams>
59 bool operator== (const OtherParams& otherParams) const
60 {
61 return Dune::FloatCmp::eq(vgAlpha_, otherParams.vgAlpha(), /*eps*/1e-6*vgAlpha_)
62 && Dune::FloatCmp::eq(vgn_, otherParams.vgn(), /*eps*/1e-6*vgn_);
63 }
64
70 { return vgAlpha_; }
71
77 { vgAlpha_ = v; }
78
83 Scalar vgm() const
84 { return vgm_; }
85
92 void setVgm(Scalar m)
93 { vgm_ = m; vgn_ = 1/(1 - vgm_); }
94
99 Scalar vgn() const
100 { return vgn_; }
101
109 { vgn_ = n; vgm_ = 1 - 1/vgn_; }
110
111private:
112 Scalar vgAlpha_;
113 Scalar vgm_;
114 Scalar vgn_;
115};
116} // namespace Dumux
117
118#endif
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
Specification of the material parameters for the van Genuchten constitutive relations.
Definition: vangenuchtenparams.hh:42
Scalar vgAlpha() const
Return the shape parameter of van Genuchten's curve.
Definition: vangenuchtenparams.hh:69
VanGenuchtenParams()
Definition: vangenuchtenparams.hh:46
void setVgAlpha(Scalar v)
Set the shape parameter of van Genuchten's curve.
Definition: vangenuchtenparams.hh:76
VanGenuchtenParams(Scalar vgAlpha, Scalar vgn)
Definition: vangenuchtenparams.hh:49
bool operator==(const OtherParams &otherParams) const
Equality comparison with another set of params.
Definition: vangenuchtenparams.hh:59
void setVgm(Scalar m)
Set the shape parameter of van Genuchten's curve.
Definition: vangenuchtenparams.hh:92
Scalar vgn() const
Return the shape parameter of van Genuchten's curve.
Definition: vangenuchtenparams.hh:99
Scalar vgm() const
Return the shape parameter of van Genuchten's curve.
Definition: vangenuchtenparams.hh:83
void setVgn(Scalar n)
Set the shape parameter of van Genuchten's curve.
Definition: vangenuchtenparams.hh:108
ScalarT Scalar
Definition: vangenuchtenparams.hh:44