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 
30 #include <cassert>
31 
33 
34 namespace Opm {
45 template<class TraitsT>
47 {
48  typedef typename TraitsT::Scalar Scalar;
49 
50 public:
52 
53  typedef TraitsT Traits;
54 
56  {
57  }
58 
59  VanGenuchtenParams(Scalar alphaParam, Scalar nParam)
60  {
61  setVgAlpha(alphaParam);
62  setVgN(nParam);
63  finalize();
64  }
65 
70  Scalar vgAlpha() const
71  { EnsureFinalized::check(); return vgAlpha_; }
72 
77  void setVgAlpha(Scalar v)
78  { vgAlpha_ = v; }
79 
84  Scalar vgM() const
85  { EnsureFinalized::check(); return vgM_; }
86 
93  void setVgM(Scalar m)
94  { vgM_ = m; vgN_ = 1/(1 - vgM_); }
95 
100  Scalar vgN() const
101  { EnsureFinalized::check(); return vgN_; }
102 
109  void setVgN(Scalar n)
110  { vgN_ = n; vgM_ = 1 - 1/vgN_; }
111 
112 private:
113  Scalar vgAlpha_;
114  Scalar vgM_;
115  Scalar vgN_;
116 };
117 } // namespace Opm
118 
119 #endif
Scalar vgAlpha() const
Return the shape parameter of van Genuchten&#39;s curve.
Definition: VanGenuchtenParams.hpp:70
void setVgAlpha(Scalar v)
Set the shape parameter of van Genuchten&#39;s curve.
Definition: VanGenuchtenParams.hpp:77
Scalar vgM() const
Return the shape parameter of van Genuchten&#39;s curve.
Definition: VanGenuchtenParams.hpp:84
void setVgN(Scalar n)
Set the shape parameter of van Genuchten&#39;s curve.
Definition: VanGenuchtenParams.hpp:109
Definition: Air_Mesitylene.hpp:33
Default implementation for asserting finalization of parameter objects.
Scalar vgN() const
Return the shape parameter of van Genuchten&#39;s curve.
Definition: VanGenuchtenParams.hpp:100
Specification of the material parameters for the van Genuchten constitutive relations.
Definition: VanGenuchtenParams.hpp:46
void setVgM(Scalar m)
Set the shape parameter of van Genuchten&#39;s curve.
Definition: VanGenuchtenParams.hpp:93
void finalize()
Mark the object as finalized.
Definition: EnsureFinalized.hpp:77
Default implementation for asserting finalization of parameter objects.
Definition: EnsureFinalized.hpp:46