EclStone2MaterialParams.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) 2015 by Andreas Lauser
5 
6  This file is part of the Open Porous Media project (OPM).
7 
8  OPM is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 2 of the License, or
11  (at your option) any later version.
12 
13  OPM is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with OPM. If not, see <http://www.gnu.org/licenses/>.
20 */
25 #ifndef OPM_ECL_STONE2_MATERIAL_PARAMS_HPP
26 #define OPM_ECL_STONE2_MATERIAL_PARAMS_HPP
27 
28 #include <type_traits>
29 #include <cassert>
30 #include <memory>
31 
32 namespace Opm {
33 
42 template<class Traits, class GasOilParamsT, class OilWaterParamsT>
44 {
45  typedef typename Traits::Scalar Scalar;
46  enum { numPhases = 3 };
47 public:
48  typedef GasOilParamsT GasOilParams;
49  typedef OilWaterParamsT OilWaterParams;
50 
55  {
56 #ifndef NDEBUG
57  finalized_ = false;
58 #endif
59  }
60 
64  void finalize()
65  {
66 #ifndef NDEBUG
67  finalized_ = true;
68 #endif
69  }
70 
74  const GasOilParams& gasOilParams() const
75  { assertFinalized_(); return *gasOilParams_; }
76 
80  GasOilParams& gasOilParams()
81  { assertFinalized_(); return *gasOilParams_; }
82 
86  void setGasOilParams(std::shared_ptr<GasOilParams> val)
87  { gasOilParams_ = val; }
88 
92  const OilWaterParams& oilWaterParams() const
93  { assertFinalized_(); return *oilWaterParams_; }
94 
98  OilWaterParams& oilWaterParams()
99  { assertFinalized_(); return *oilWaterParams_; }
100 
104  void setOilWaterParams(std::shared_ptr<OilWaterParams> val)
105  { oilWaterParams_ = val; }
106 
118  void setSwl(Scalar val)
119  { Swl_ = val; }
120 
124  Scalar Swl() const
125  { assertFinalized_(); return Swl_; }
126 
127 private:
128 #ifndef NDEBUG
129  void assertFinalized_() const
130  { assert(finalized_); }
131 
132  bool finalized_;
133 #else
134  void assertFinalized_() const
135  { }
136 #endif
137 
138  std::shared_ptr<GasOilParams> gasOilParams_;
139  std::shared_ptr<OilWaterParams> oilWaterParams_;
140 
141  Scalar Swl_;
142 };
143 } // namespace Opm
144 
145 #endif
OilWaterParamsT OilWaterParams
Definition: EclStone2MaterialParams.hpp:49
Definition: Air_Mesitylene.hpp:31
const OilWaterParams & oilWaterParams() const
The parameter object for the oil-water twophase law.
Definition: EclStone2MaterialParams.hpp:92
void setGasOilParams(std::shared_ptr< GasOilParams > val)
Set the parameter object for the gas-oil twophase law.
Definition: EclStone2MaterialParams.hpp:86
void setSwl(Scalar val)
Set the saturation of "connate" water.
Definition: EclStone2MaterialParams.hpp:118
const GasOilParams & gasOilParams() const
The parameter object for the gas-oil twophase law.
Definition: EclStone2MaterialParams.hpp:74
OilWaterParams & oilWaterParams()
The parameter object for the oil-water twophase law.
Definition: EclStone2MaterialParams.hpp:98
GasOilParams & gasOilParams()
The parameter object for the gas-oil twophase law.
Definition: EclStone2MaterialParams.hpp:80
GasOilParamsT GasOilParams
Definition: EclStone2MaterialParams.hpp:48
EclStone2MaterialParams()
The default constructor.
Definition: EclStone2MaterialParams.hpp:54
Scalar Swl() const
Return the saturation of "connate" water.
Definition: EclStone2MaterialParams.hpp:124
void setOilWaterParams(std::shared_ptr< OilWaterParams > val)
Set the parameter object for the oil-water twophase law.
Definition: EclStone2MaterialParams.hpp:104
Default implementation for the parameters required by the three-phase capillary pressure/relperm Ston...
Definition: EclStone2MaterialParams.hpp:43
void finalize()
Finish the initialization of the parameter object.
Definition: EclStone2MaterialParams.hpp:64