VanGenuchtenParams.hpp
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 This file is part of the Open Porous Media project (OPM).
5
6 OPM 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 2 of the License, or
9 (at your option) any later version.
10
11 OPM 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 OPM. If not, see <http://www.gnu.org/licenses/>.
18
19 Consult the COPYING file in the top-level source directory of this
20 module for the precise wording of the license and the list of
21 copyright holders.
22*/
27#ifndef VAN_GENUCHTEN_PARAMS_HPP
28#define VAN_GENUCHTEN_PARAMS_HPP
29
31
32namespace Opm {
43template<class TraitsT>
45{
46 typedef typename TraitsT::Scalar Scalar;
47
48public:
50
51 typedef TraitsT Traits;
52
54 {
55 }
56
57 VanGenuchtenParams(Scalar alphaParam, Scalar nParam)
58 {
59 setVgAlpha(alphaParam);
60 setVgN(nParam);
61 finalize();
62 }
63
68 Scalar vgAlpha() const
69 { EnsureFinalized::check(); return vgAlpha_; }
70
75 void setVgAlpha(Scalar v)
76 { vgAlpha_ = v; }
77
82 Scalar vgM() const
83 { EnsureFinalized::check(); return vgM_; }
84
91 void setVgM(Scalar m)
92 { vgM_ = m; vgN_ = 1/(1 - vgM_); }
93
98 Scalar vgN() const
99 { EnsureFinalized::check(); return vgN_; }
100
107 void setVgN(Scalar n)
108 { vgN_ = n; vgM_ = 1 - 1/vgN_; }
109
110private:
111 Scalar vgAlpha_;
112 Scalar vgM_;
113 Scalar vgN_;
114};
115} // namespace Opm
116
117#endif
Default implementation for asserting finalization of parameter objects.
Definition: EnsureFinalized.hpp:47
void finalize()
Mark the object as finalized.
Definition: EnsureFinalized.hpp:75
void check() const
Definition: EnsureFinalized.hpp:63
Specification of the material parameters for the van Genuchten constitutive relations.
Definition: VanGenuchtenParams.hpp:45
void setVgN(Scalar n)
Set the shape parameter of van Genuchten's curve.
Definition: VanGenuchtenParams.hpp:107
VanGenuchtenParams(Scalar alphaParam, Scalar nParam)
Definition: VanGenuchtenParams.hpp:57
TraitsT Traits
Definition: VanGenuchtenParams.hpp:51
Scalar vgM() const
Return the shape parameter of van Genuchten's curve.
Definition: VanGenuchtenParams.hpp:82
Scalar vgN() const
Return the shape parameter of van Genuchten's curve.
Definition: VanGenuchtenParams.hpp:98
VanGenuchtenParams()
Definition: VanGenuchtenParams.hpp:53
Scalar vgAlpha() const
Return the shape parameter of van Genuchten's curve.
Definition: VanGenuchtenParams.hpp:68
void setVgM(Scalar m)
Set the shape parameter of van Genuchten's curve.
Definition: VanGenuchtenParams.hpp:91
void setVgAlpha(Scalar v)
Set the shape parameter of van Genuchten's curve.
Definition: VanGenuchtenParams.hpp:75
Definition: Air_Mesitylene.hpp:34