My Project
Loading...
Searching...
No Matches
EclTwoPhaseMaterialParams.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_TWO_PHASE_MATERIAL_PARAMS_HPP
28#define OPM_ECL_TWO_PHASE_MATERIAL_PARAMS_HPP
29
30#include <memory>
31
33
34namespace Opm {
35
36enum class EclTwoPhaseApproach {
37 GasOil,
38 OilWater,
39 GasWater
40};
41
49template<class Traits, class GasOilParamsT, class OilWaterParamsT, class GasWaterParamsT>
51{
52 using Scalar = typename Traits::Scalar;
53 enum { numPhases = 3 };
54public:
56
57 using GasOilParams = GasOilParamsT;
58 using OilWaterParams = OilWaterParamsT;
59 using GasWaterParams = GasWaterParamsT;
60
67
68 void setApproach(EclTwoPhaseApproach newApproach)
69 { approach_ = newApproach; }
70
71 EclTwoPhaseApproach approach() const
72 { return approach_; }
73
77 const GasOilParams& gasOilParams() const
78 { EnsureFinalized::check(); return *gasOilParams_; }
79
83 GasOilParams& gasOilParams()
84 { EnsureFinalized::check(); return *gasOilParams_; }
85
89 void setGasOilParams(std::shared_ptr<GasOilParams> val)
90 { gasOilParams_ = val; }
91
95 const OilWaterParams& oilWaterParams() const
96 { EnsureFinalized::check(); return *oilWaterParams_; }
97
101 OilWaterParams& oilWaterParams()
102 { EnsureFinalized::check(); return *oilWaterParams_; }
103
107 void setOilWaterParams(std::shared_ptr<OilWaterParams> val)
108 { oilWaterParams_ = val; }
109
113 const GasWaterParams& gasWaterParams() const
114 { EnsureFinalized::check(); return *gasWaterParams_; }
115
119 GasWaterParams& gasWaterParams()
120 { EnsureFinalized::check(); return *gasWaterParams_; }
121
125 void setGasWaterParams(std::shared_ptr<GasWaterParams> val)
126 { gasWaterParams_ = val; }
127
128 template<class Serializer>
129 void serializeOp(Serializer& serializer)
130 {
131 // This is for restart serialization.
132 // Only dynamic state in the parameters need to be stored.
133 serializer(*gasOilParams_);
134 serializer(*oilWaterParams_);
135 serializer(*gasWaterParams_);
136 }
137
138 void setSwl(Scalar) {}
139
140private:
141 EclTwoPhaseApproach approach_;
142
143 std::shared_ptr<GasOilParams> gasOilParams_;
144 std::shared_ptr<OilWaterParams> oilWaterParams_;
145 std::shared_ptr<GasWaterParams> gasWaterParams_;
146};
147
148} // namespace Opm
149
150#endif
Default implementation for asserting finalization of parameter objects.
Implementation for the parameters required by the material law for two-phase simulations.
Definition EclTwoPhaseMaterialParams.hpp:51
void setGasWaterParams(std::shared_ptr< GasWaterParams > val)
Set the parameter object for the gas-water twophase law.
Definition EclTwoPhaseMaterialParams.hpp:125
void setGasOilParams(std::shared_ptr< GasOilParams > val)
Set the parameter object for the gas-oil twophase law.
Definition EclTwoPhaseMaterialParams.hpp:89
const GasWaterParams & gasWaterParams() const
The parameter object for the gas-water twophase law.
Definition EclTwoPhaseMaterialParams.hpp:113
const GasOilParams & gasOilParams() const
The parameter object for the gas-oil twophase law.
Definition EclTwoPhaseMaterialParams.hpp:77
OilWaterParams & oilWaterParams()
The parameter object for the oil-water twophase law.
Definition EclTwoPhaseMaterialParams.hpp:101
GasWaterParams & gasWaterParams()
The parameter object for the gas-water twophase law.
Definition EclTwoPhaseMaterialParams.hpp:119
void setOilWaterParams(std::shared_ptr< OilWaterParams > val)
Set the parameter object for the oil-water twophase law.
Definition EclTwoPhaseMaterialParams.hpp:107
EclTwoPhaseMaterialParams()
The default constructor.
Definition EclTwoPhaseMaterialParams.hpp:64
const OilWaterParams & oilWaterParams() const
The parameter object for the oil-water twophase law.
Definition EclTwoPhaseMaterialParams.hpp:95
GasOilParams & gasOilParams()
The parameter object for the gas-oil twophase law.
Definition EclTwoPhaseMaterialParams.hpp:83
Default implementation for asserting finalization of parameter objects.
Definition EnsureFinalized.hpp:47
void finalize()
Mark the object as finalized.
Definition EnsureFinalized.hpp:75
Class for (de-)serializing.
Definition Serializer.hpp:84
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30