EclDefaultMaterialParams.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) 2013 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_DEFAULT_MATERIAL_PARAMS_HPP
26 #define OPM_ECL_DEFAULT_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 
137  { return true; }
138 
139 private:
140 #ifndef NDEBUG
141  void assertFinalized_() const
142  { assert(finalized_); }
143 
144  bool finalized_;
145 #else
146  void assertFinalized_() const
147  { }
148 #endif
149 
150  std::shared_ptr<GasOilParams> gasOilParams_;
151  std::shared_ptr<OilWaterParams> oilWaterParams_;
152 
153  Scalar Swl_;
154 };
155 } // namespace Opm
156 
157 #endif
const GasOilParams & gasOilParams() const
The parameter object for the gas-oil twophase law.
Definition: EclDefaultMaterialParams.hpp:74
bool inconsistentHysteresisUpdate() const
Specify whether inconsistent saturations should be used to update the hysteresis parameters.
Definition: EclDefaultMaterialParams.hpp:136
void finalize()
Finish the initialization of the parameter object.
Definition: EclDefaultMaterialParams.hpp:64
Definition: Air_Mesitylene.hpp:31
OilWaterParams & oilWaterParams()
The parameter object for the oil-water twophase law.
Definition: EclDefaultMaterialParams.hpp:98
OilWaterParamsT OilWaterParams
Definition: EclDefaultMaterialParams.hpp:49
const OilWaterParams & oilWaterParams() const
The parameter object for the oil-water twophase law.
Definition: EclDefaultMaterialParams.hpp:92
GasOilParams & gasOilParams()
The parameter object for the gas-oil twophase law.
Definition: EclDefaultMaterialParams.hpp:80
void setGasOilParams(std::shared_ptr< GasOilParams > val)
Set the parameter object for the gas-oil twophase law.
Definition: EclDefaultMaterialParams.hpp:86
void setSwl(Scalar val)
Set the saturation of "connate" water.
Definition: EclDefaultMaterialParams.hpp:118
Default implementation for the parameters required by the default three-phase capillary pressure mode...
Definition: EclDefaultMaterialParams.hpp:43
GasOilParamsT GasOilParams
Definition: EclDefaultMaterialParams.hpp:48
void setOilWaterParams(std::shared_ptr< OilWaterParams > val)
Set the parameter object for the oil-water twophase law.
Definition: EclDefaultMaterialParams.hpp:104
Scalar Swl() const
Return the saturation of "connate" water.
Definition: EclDefaultMaterialParams.hpp:124
EclDefaultMaterialParams()
The default constructor.
Definition: EclDefaultMaterialParams.hpp:54