My Project
EclHysteresisConfig.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_ECL_HYSTERESIS_CONFIG_HPP
28 #define OPM_ECL_HYSTERESIS_CONFIG_HPP
29 
30 #if HAVE_ECL_INPUT
31 #include <opm/input/eclipse/Deck/Deck.hpp>
32 #include <opm/input/eclipse/Deck/DeckKeyword.hpp>
33 #include <opm/input/eclipse/Deck/DeckRecord.hpp>
34 #include <opm/input/eclipse/Deck/DeckItem.hpp>
35 #endif
36 
37 #include <string>
38 #include <cassert>
39 #include <algorithm>
40 
41 namespace Opm {
48 {
49 public:
51  {
52  enableHysteresis_ = false;
53  pcHysteresisModel_ = 0;
54  krHysteresisModel_ = 0;
55  }
56 
60  void setEnableHysteresis(bool yesno)
61  { enableHysteresis_ = yesno; }
62 
66  bool enableHysteresis() const
67  { return enableHysteresis_; }
68 
75  void setPcHysteresisModel(int value)
76  { pcHysteresisModel_ = value; }
77 
84  int pcHysteresisModel() const
85  { return pcHysteresisModel_; }
86 
96  void setKrHysteresisModel(int value)
97  { krHysteresisModel_ = value; }
98 
105  int krHysteresisModel() const
106  { return krHysteresisModel_; }
107 
108 #if HAVE_ECL_INPUT
114  void initFromState(const Runspec& runspec)
115  {
116  enableHysteresis_ = false;
117 
118  enableHysteresis_ = runspec.hysterPar().active();
119 
120  if (!enableHysteresis_)
121  return;
122 
123  krHysteresisModel_ = runspec.hysterPar().krHysteresisModel();
124  pcHysteresisModel_ = runspec.hysterPar().pcHysteresisModel();
125  }
126 #endif
127 
128 private:
129  // enable hysteresis at all
130  bool enableHysteresis_;
131 
132  // the capillary pressure and the relperm hysteresis models to be used
133  int pcHysteresisModel_;
134  int krHysteresisModel_;
135 };
136 
137 } // namespace Opm
138 
139 #endif
Specifies the configuration used by the ECL kr/pC hysteresis code.
Definition: EclHysteresisConfig.hpp:48
int pcHysteresisModel() const
Return the type of the hysteresis model which is used for capillary pressure.
Definition: EclHysteresisConfig.hpp:84
void setPcHysteresisModel(int value)
Set the type of the hysteresis model which is used for capillary pressure.
Definition: EclHysteresisConfig.hpp:75
int krHysteresisModel() const
Return the type of the hysteresis model which is used for relative permeability.
Definition: EclHysteresisConfig.hpp:105
void setKrHysteresisModel(int value)
Set the type of the hysteresis model which is used for relative permeability.
Definition: EclHysteresisConfig.hpp:96
void setEnableHysteresis(bool yesno)
Specify whether hysteresis is enabled or not.
Definition: EclHysteresisConfig.hpp:60
bool enableHysteresis() const
Returns whether hysteresis is enabled.
Definition: EclHysteresisConfig.hpp:66