ThreePhaseParkerVanGenuchtenParams.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  Copyright (C) 2009-2013 by Andreas Lauser
5  Copyright (C) 2012 by Holger Class
6 
7  This file is part of the Open Porous Media project (OPM).
8 
9  OPM is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 2 of the License, or
12  (at your option) any later version.
13 
14  OPM is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with OPM. If not, see <http://www.gnu.org/licenses/>.
21 */
26 #ifndef OPM_THREE_PHASE_PARKER_VAN_GENUCHTEN_PARAMS_HPP
27 #define OPM_THREE_PHASE_PARKER_VAN_GENUCHTEN_PARAMS_HPP
28 
29 #include <dune/common/fvector.hh>
30 
32 
33 #include <opm/common/ErrorMacros.hpp>
34 #include <opm/common/Exceptions.hpp>
35 
36 #include <cassert>
37 
38 namespace Opm {
49 template<class TraitsT>
51 {
52 public:
53  typedef TraitsT Traits;
54  typedef typename Traits::Scalar Scalar;
55 
57  {
58  betaNW_ = 1.0;
59  betaGN_ = 1.0;
60 
61 #ifndef NDEBUG
62  finalized_ = false;
63 #endif
64  }
65 
69  void finalize()
70  {
71 #ifndef NDEBUG
72  finalized_ = true;
73 #endif
74  }
75 
80  Scalar vgAlpha() const
81  { assertFinalized_(); return vgAlpha_; }
82 
87  void setVgAlpha(Scalar v)
88  { vgAlpha_ = v; }
89 
94  Scalar vgM() const
95  { assertFinalized_(); return vgM_; }
96 
103  void setVgM(Scalar m)
104  { vgM_ = m; vgN_ = 1/(1 - vgM_); }
105 
110  Scalar vgN() const
111  { assertFinalized_(); return vgN_; }
112 
119  void setVgN(Scalar n)
120  { vgN_ = n; vgM_ = 1 - 1/vgN_; }
121 
125  Scalar Swr() const
126  { assertFinalized_(); return Swr_; }
127 
131  void setSwr(Scalar input)
132  { Swr_ = input; }
133 
137  Scalar Snr() const
138  { assertFinalized_(); return Snr_; }
139 
143  void setSnr(Scalar input)
144  { Snr_ = input; }
145 
149  Scalar Sgr() const
150  { assertFinalized_(); return Sgr_; }
151 
155  void setSgr(Scalar input)
156  { Sgr_ = input; }
157 
158  Scalar Swrx() const
159  { assertFinalized_(); return Swrx_; }
160 
164  void setSwrx(Scalar input)
165  { Swrx_ = input; }
166 
170  void setBetaNW(Scalar input)
171  { betaNW_ = input; }
172 
173  void setBetaGN(Scalar input)
174  { betaGN_ = input; }
175 
179  Scalar betaNW() const
180  { assertFinalized_(); return betaNW_; }
181 
182  Scalar betaGN() const
183  { assertFinalized_(); return betaGN_; }
184 
188  void setkrRegardsSnr(bool input)
189  { krRegardsSnr_ = input; }
193  bool krRegardsSnr() const
194  { assertFinalized_(); return krRegardsSnr_; }
195 
196  void checkDefined() const
197  {
198  Valgrind::CheckDefined(vgAlpha_);
204  Valgrind::CheckDefined(Swrx_);
205  Valgrind::CheckDefined(betaNW_);
206  Valgrind::CheckDefined(betaGN_);
207  Valgrind::CheckDefined(krRegardsSnr_);
208  }
209 
210 private:
211 #ifndef NDEBUG
212  void assertFinalized_() const
213  { assert(finalized_); }
214 
215  bool finalized_;
216 #else
217  void assertFinalized_() const
218  { }
219 #endif
220 
221  Scalar vgAlpha_;
222  Scalar vgM_;
223  Scalar vgN_;
224  Scalar Swr_;
225  Scalar Snr_;
226  Scalar Sgr_;
227  Scalar Swrx_; // Swr + Snr
228 
229  Scalar betaNW_;
230  Scalar betaGN_;
231 
232  bool krRegardsSnr_ ;
233 };
234 } // namespace Opm
235 
236 #endif
ThreePhaseParkerVanGenuchtenParams()
Definition: ThreePhaseParkerVanGenuchtenParams.hpp:56
void setkrRegardsSnr(bool input)
defines if residual n-phase saturation should be regarded in its relative permeability.
Definition: ThreePhaseParkerVanGenuchtenParams.hpp:188
void setSwrx(Scalar input)
Set the residual gas saturation.
Definition: ThreePhaseParkerVanGenuchtenParams.hpp:164
bool CheckDefined(const T &value OPM_UNUSED)
Make valgrind complain if any of the memory occupied by an object is undefined.
Definition: Valgrind.hpp:74
Specification of the material params for the three-phase van Genuchten capillary pressure model...
Definition: ThreePhaseParkerVanGenuchtenParams.hpp:50
Definition: Air_Mesitylene.hpp:31
void setBetaNW(Scalar input)
defines the scaling parameters of capillary pressure between the phases (=1 for Gas-Water) ...
Definition: ThreePhaseParkerVanGenuchtenParams.hpp:170
void setSnr(Scalar input)
Set the residual non-wetting saturation.
Definition: ThreePhaseParkerVanGenuchtenParams.hpp:143
Some templates to wrap the valgrind client request macros.
void setVgAlpha(Scalar v)
Set the shape parameter of van Genuchten's curve.
Definition: ThreePhaseParkerVanGenuchtenParams.hpp:87
Scalar Sgr() const
Return the residual gas saturation.
Definition: ThreePhaseParkerVanGenuchtenParams.hpp:149
Scalar betaGN() const
Definition: ThreePhaseParkerVanGenuchtenParams.hpp:182
Scalar Swrx() const
Definition: ThreePhaseParkerVanGenuchtenParams.hpp:158
bool krRegardsSnr() const
Calls if residual n-phase saturation should be regarded in its relative permeability.
Definition: ThreePhaseParkerVanGenuchtenParams.hpp:193
Scalar vgAlpha() const
Return the shape parameter of van Genuchten's curve.
Definition: ThreePhaseParkerVanGenuchtenParams.hpp:80
void setVgM(Scalar m)
Set the shape parameter of van Genuchten's curve.
Definition: ThreePhaseParkerVanGenuchtenParams.hpp:103
void setVgN(Scalar n)
Set the shape parameter of van Genuchten's curve.
Definition: ThreePhaseParkerVanGenuchtenParams.hpp:119
void setBetaGN(Scalar input)
Definition: ThreePhaseParkerVanGenuchtenParams.hpp:173
Scalar vgN() const
Return the shape parameter of van Genuchten's curve.
Definition: ThreePhaseParkerVanGenuchtenParams.hpp:110
Traits::Scalar Scalar
Definition: ThreePhaseParkerVanGenuchtenParams.hpp:54
Scalar Snr() const
Return the residual non-wetting saturation.
Definition: ThreePhaseParkerVanGenuchtenParams.hpp:137
Scalar vgM() const
Return the shape parameter of van Genuchten's curve.
Definition: ThreePhaseParkerVanGenuchtenParams.hpp:94
void checkDefined() const
Definition: ThreePhaseParkerVanGenuchtenParams.hpp:196
Scalar betaNW() const
Return the values for the beta scaling parameters of capillary pressure between the phases...
Definition: ThreePhaseParkerVanGenuchtenParams.hpp:179
Scalar Swr() const
Return the residual wetting saturation.
Definition: ThreePhaseParkerVanGenuchtenParams.hpp:125
TraitsT Traits
Definition: ThreePhaseParkerVanGenuchtenParams.hpp:53
void finalize()
Finish the initialization of the parameter object.
Definition: ThreePhaseParkerVanGenuchtenParams.hpp:69
void setSgr(Scalar input)
Set the residual gas saturation.
Definition: ThreePhaseParkerVanGenuchtenParams.hpp:155
void setSwr(Scalar input)
Set the residual wetting saturation.
Definition: ThreePhaseParkerVanGenuchtenParams.hpp:131