opm-common
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  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_DEFAULT_MATERIAL_PARAMS_HPP
28 #define OPM_ECL_DEFAULT_MATERIAL_PARAMS_HPP
29 
30 #include <memory>
31 
32 #include <opm/common/utility/gpuDecorators.hpp>
34 
35 namespace Opm {
36 
45 template<class Traits, class GasOilParamsT, class OilWaterParamsT>
47 {
48  using Scalar = typename Traits::Scalar;
49  enum { numPhases = 3 };
50 public:
52 
53  using GasOilParams = GasOilParamsT;
54  using OilWaterParams = OilWaterParamsT;
55 
59  OPM_HOST_DEVICE EclDefaultMaterialParams()
60  {
61  }
62 
66  OPM_HOST_DEVICE const GasOilParams& gasOilParams() const
67  { EnsureFinalized::check(); return gasOilParams_; }
68 
72  OPM_HOST_DEVICE GasOilParams& gasOilParams()
73  { EnsureFinalized::check(); return gasOilParams_; }
74 
78  void setGasOilParams(std::shared_ptr<GasOilParams> val)
79  { gasOilParams_ = *val; }
80 
84  OPM_HOST_DEVICE const OilWaterParams& oilWaterParams() const
85  { EnsureFinalized::check(); return oilWaterParams_; }
86 
90  OPM_HOST_DEVICE OilWaterParams& oilWaterParams()
91  { EnsureFinalized::check(); return oilWaterParams_; }
92 
96  void setOilWaterParams(std::shared_ptr<OilWaterParams> val)
97  { oilWaterParams_ = *val; }
98 
110  void setSwl(Scalar val)
111  { Swl_ = val; }
112 
116  OPM_HOST_DEVICE Scalar Swl() const
117  { EnsureFinalized::check(); return Swl_; }
118 
129  { return true; }
130 
131  template<class Serializer>
132  void serializeOp(Serializer& serializer)
133  {
134  // This is for restart serialization.
135  // Only dynamic state in the parameters need to be stored.
136  serializer(gasOilParams_);
137  serializer(oilWaterParams_);
138  }
139 
140 private:
141  GasOilParams gasOilParams_;
142  OilWaterParams oilWaterParams_;
143  Scalar Swl_;
144 };
145 } // namespace Opm
146 
147 #endif
OPM_HOST_DEVICE OilWaterParams & oilWaterParams()
The parameter object for the oil-water twophase law.
Definition: EclDefaultMaterialParams.hpp:90
OPM_HOST_DEVICE EclDefaultMaterialParams()
The default constructor.
Definition: EclDefaultMaterialParams.hpp:59
OPM_HOST_DEVICE GasOilParams & gasOilParams()
The parameter object for the gas-oil twophase law.
Definition: EclDefaultMaterialParams.hpp:72
bool inconsistentHysteresisUpdate() const
Specify whether inconsistent saturations should be used to update the hysteresis parameters.
Definition: EclDefaultMaterialParams.hpp:128
Default implementation for the parameters required by the default three-phase capillary pressure mode...
Definition: EclDefaultMaterialParams.hpp:46
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Default implementation for asserting finalization of parameter objects.
OPM_HOST_DEVICE const OilWaterParams & oilWaterParams() const
The parameter object for the oil-water twophase law.
Definition: EclDefaultMaterialParams.hpp:84
void setGasOilParams(std::shared_ptr< GasOilParams > val)
Set the parameter object for the gas-oil twophase law.
Definition: EclDefaultMaterialParams.hpp:78
OPM_HOST_DEVICE void finalize()
Mark the object as finalized.
Definition: EnsureFinalized.hpp:82
OPM_HOST_DEVICE const GasOilParams & gasOilParams() const
The parameter object for the gas-oil twophase law.
Definition: EclDefaultMaterialParams.hpp:66
void setSwl(Scalar val)
Set the saturation of "connate" water.
Definition: EclDefaultMaterialParams.hpp:110
Default implementation for asserting finalization of parameter objects.
Definition: EnsureFinalized.hpp:48
void setOilWaterParams(std::shared_ptr< OilWaterParams > val)
Set the parameter object for the oil-water twophase law.
Definition: EclDefaultMaterialParams.hpp:96
Class for (de-)serializing.
Definition: Serializer.hpp:95
OPM_HOST_DEVICE Scalar Swl() const
Return the saturation of "connate" water.
Definition: EclDefaultMaterialParams.hpp:116