opm-common
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  using Scalar = typename TraitsT::Scalar;
53  using VanGenuchtenParams = typename VanGenuchten::Params;
55 
57  : currentSnr_(0)
58  , mdc_(new ScanningCurve(/*Swr=*/0))
59  {
60  }
61 
63  : EnsureFinalized( p )
64  , SwrPc_(p.SwrPc_)
65  , currentSnr_(0)
66  , mdc_(new ScanningCurve(SwrPc_))
67  {
68  }
69 
70  ParkerLenhardParams& operator=(const ParkerLenhardParams&) = delete;
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  SwrKr_ = krSwr < 0 ? pcSwr : krSwr;
135  }
136 
140  Scalar currentSnr() const
141  { EnsureFinalized::check(); return currentSnr_; }
142 
146  void setCurrentSnr(Scalar val)
147  { currentSnr_ = val; }
148 
153  { EnsureFinalized::check(); return mdc_; }
154 
159  { mdc_ = val; }
160 
165  { EnsureFinalized::check(); return pisc_; }
166 
171  { pisc_ = val; }
172 
177  { EnsureFinalized::check(); return csc_; }
178 
183  { csc_ = val; }
184 
185 private:
186  const VanGenuchtenParams* micParams_{nullptr};
187  const VanGenuchtenParams* mdcParams_{nullptr};
188  Scalar SwrPc_{};
189  Scalar SwrKr_{};
190  Scalar Snr_{};
191  Scalar currentSnr_{};
192  mutable ScanningCurve* mdc_{nullptr};
193  mutable ScanningCurve* pisc_{nullptr};
194  mutable ScanningCurve* csc_{nullptr};
195 };
196 } // namespace Opm
197 
198 #endif
void setPisc(ScanningCurve *val)
Set the primary imbibition scanning curve.
Definition: ParkerLenhardParams.hpp:170
const VanGenuchtenParams & micParams() const
Returns the parameters of the main imbibition curve (which uses the van Genuchten capillary pressure ...
Definition: ParkerLenhardParams.hpp:79
ScanningCurve * csc() const
Returns the current scanning curve.
Definition: ParkerLenhardParams.hpp:176
Default parameter class for the Parker-Lenhard hysteresis model.
Definition: ParkerLenhardParams.hpp:46
Implementation of the regularized van Genuchten&#39;s capillary pressure / relative permeability <-> satu...
Implementation of the regularized van Genuchten&#39;s capillary pressure / relative permeability <-> satu...
Definition: RegularizedVanGenuchten.hpp:71
void setCurrentSnr(Scalar val)
Set the current effective residual saturation.
Definition: ParkerLenhardParams.hpp:146
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
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:152
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
ScanningCurve * pisc() const
Returns the primary imbibition scanning curve.
Definition: ParkerLenhardParams.hpp:164
Scalar SwrKr() const
Returns wetting phase residual saturation for the residual saturation curves.
Definition: ParkerLenhardParams.hpp:124
Default implementation for asserting finalization of parameter objects.
Specification of the material parameters for the van Genuchten constitutive relations.
Definition: VanGenuchtenParams.hpp:44
void setMdc(ScanningCurve *val)
Set the main drainage curve.
Definition: ParkerLenhardParams.hpp:158
Scalar SwrPc() const
Returns wetting phase residual saturation for the capillary pressure curve.
Definition: ParkerLenhardParams.hpp:118
OPM_HOST_DEVICE EnsureFinalized()
The default constructor.
Definition: EnsureFinalized.hpp:58
Represents a scanning curve in the Parker-Lenhard hysteresis model.
Definition: ParkerLenhard.hpp:47
OPM_HOST_DEVICE void finalize()
Mark the object as finalized.
Definition: EnsureFinalized.hpp:82
void setCsc(ScanningCurve *val)
Set the current scanning curve.
Definition: ParkerLenhardParams.hpp:182
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
Default implementation for asserting finalization of parameter objects.
Definition: EnsureFinalized.hpp:48
Scalar currentSnr() const
Returns the current effective residual saturation.
Definition: ParkerLenhardParams.hpp:140
Scalar Snr() const
Returns non-wetting phase residual saturation.
Definition: ParkerLenhardParams.hpp:106
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 setMdcParams(const VanGenuchtenParams *val)
Sets the parameters of the main drainage curve (which uses the van Genuchten capillary pressure model...
Definition: ParkerLenhardParams.hpp:100