My Project
ParkerLenhardParams.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 OPM_PARKER_LENHARD_PARAMS_HPP
28 #define OPM_PARKER_LENHARD_PARAMS_HPP
29 
32 
33 #include <cassert>
34 
35 namespace Opm
36 {
37 // forward declaration
38 template <class ScalarT>
39 class PLScanningCurve;
40 
45 template <class TraitsT>
47 {
48 public:
50 
51  typedef typename TraitsT::Scalar Scalar;
53  typedef typename VanGenuchten::Params VanGenuchtenParams;
55 
57  {
58  currentSnr_ = 0;
59  mdc_ = new ScanningCurve(/*Swr=*/0);
60  pisc_ = csc_ = NULL;
61  }
62 
64  : EnsureFinalized( p )
65  {
66  currentSnr_ = 0;
67  SwrPc_ = p.SwrPc_;
68  mdc_ = new ScanningCurve(SwrPc_);
69  pisc_ = csc_ = NULL;
70  }
71 
73  { delete mdc_; }
74 
79  const VanGenuchtenParams& micParams() const
80  { EnsureFinalized::check(); return *micParams_; }
81 
86  void setMicParams(const VanGenuchtenParams* val)
87  { micParams_ = val; }
88 
93  const VanGenuchtenParams& mdcParams() const
94  { EnsureFinalized::check(); return *mdcParams_; }
95 
100  void setMdcParams(const VanGenuchtenParams* val)
101  { mdcParams_ = val; }
102 
106  Scalar Snr() const
107  { EnsureFinalized::check(); return Snr_; }
108 
112  void setSnr(Scalar val)
113  { Snr_ = val; }
114 
118  Scalar SwrPc() const
119  { EnsureFinalized::check(); return SwrPc_; }
120 
124  Scalar SwrKr() const
125  { EnsureFinalized::check(); return SwrKr_; }
126 
131  void setSwr(Scalar pcSwr, Scalar krSwr = -1)
132  {
133  SwrPc_ = pcSwr;
134  if (krSwr < 0)
135  SwrKr_ = pcSwr;
136  else
137  SwrKr_ = krSwr;
138  }
139 
143  Scalar currentSnr() const
144  { EnsureFinalized::check(); return currentSnr_; }
145 
149  void setCurrentSnr(Scalar val)
150  { currentSnr_ = val; }
151 
156  { EnsureFinalized::check(); return mdc_; }
157 
162  { mdc_ = val; }
163 
168  { EnsureFinalized::check(); return pisc_; }
169 
174  { pisc_ = val; }
175 
180  { EnsureFinalized::check(); return csc_; }
181 
186  { csc_ = val; }
187 
188 private:
189  const VanGenuchtenParams* micParams_;
190  const VanGenuchtenParams* mdcParams_;
191  Scalar SwrPc_;
192  Scalar SwrKr_;
193  Scalar Snr_;
194  Scalar currentSnr_;
195  mutable ScanningCurve* mdc_;
196  mutable ScanningCurve* pisc_;
197  mutable ScanningCurve* csc_;
198 };
199 } // namespace Opm
200 
201 #endif
Default implementation for asserting finalization of parameter objects.
Implementation of the regularized van Genuchten's capillary pressure / relative permeability <-> satu...
Default implementation for asserting finalization of parameter objects.
Definition: EnsureFinalized.hpp:47
void finalize()
Mark the object as finalized.
Definition: EnsureFinalized.hpp:75
EnsureFinalized()
The default constructor.
Definition: EnsureFinalized.hpp:56
Represents a scanning curve in the Parker-Lenhard hysteresis model.
Definition: ParkerLenhard.hpp:48
Default parameter class for the Parker-Lenhard hysteresis model.
Definition: ParkerLenhardParams.hpp:47
Scalar SwrPc() const
Returns wetting phase residual saturation for the capillary pressure curve.
Definition: ParkerLenhardParams.hpp:118
ScanningCurve * pisc() const
Returns the primary imbibition scanning curve.
Definition: ParkerLenhardParams.hpp:167
void setSwr(Scalar pcSwr, Scalar krSwr=-1)
Set the wetting phase residual saturation for the capillary pressure and the relative permeabilities.
Definition: ParkerLenhardParams.hpp:131
const VanGenuchtenParams & micParams() const
Returns the parameters of the main imbibition curve (which uses the van Genuchten capillary pressure ...
Definition: ParkerLenhardParams.hpp:79
void setSnr(Scalar val)
Set the non-wetting phase residual saturation.
Definition: ParkerLenhardParams.hpp:112
ScanningCurve * mdc() const
Returns the main drainage curve.
Definition: ParkerLenhardParams.hpp:155
const VanGenuchtenParams & mdcParams() const
Returns the parameters of the main drainage curve (which uses the van Genuchten capillary pressure mo...
Definition: ParkerLenhardParams.hpp:93
void setPisc(ScanningCurve *val)
Set the primary imbibition scanning curve.
Definition: ParkerLenhardParams.hpp:173
ScanningCurve * csc() const
Returns the current scanning curve.
Definition: ParkerLenhardParams.hpp:179
void setMicParams(const VanGenuchtenParams *val)
Sets the parameters of the main imbibition curve (which uses the van Genuchten capillary pressure mod...
Definition: ParkerLenhardParams.hpp:86
void setCsc(ScanningCurve *val)
Set the current scanning curve.
Definition: ParkerLenhardParams.hpp:185
Scalar currentSnr() const
Returns the current effective residual saturation.
Definition: ParkerLenhardParams.hpp:143
Scalar Snr() const
Returns non-wetting phase residual saturation.
Definition: ParkerLenhardParams.hpp:106
void setMdcParams(const VanGenuchtenParams *val)
Sets the parameters of the main drainage curve (which uses the van Genuchten capillary pressure model...
Definition: ParkerLenhardParams.hpp:100
Scalar SwrKr() const
Returns wetting phase residual saturation for the residual saturation curves.
Definition: ParkerLenhardParams.hpp:124
void setCurrentSnr(Scalar val)
Set the current effective residual saturation.
Definition: ParkerLenhardParams.hpp:149
void setMdc(ScanningCurve *val)
Set the main drainage curve.
Definition: ParkerLenhardParams.hpp:161
Implementation of the regularized van Genuchten's capillary pressure / relative permeability <-> satu...
Definition: RegularizedVanGenuchten.hpp:72
Specification of the material parameters for the van Genuchten constitutive relations.
Definition: VanGenuchtenParams.hpp:45