opm-common
Loading...
Searching...
No Matches
EclEpsTwoPhaseLawParams.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_EPS_TWO_PHASE_LAW_PARAMS_HPP
28#define OPM_ECL_EPS_TWO_PHASE_LAW_PARAMS_HPP
29
30#include "EclEpsConfig.hpp"
32
33#include <memory>
34#include <cassert>
35
37
38namespace Opm {
45template <class EffLawT>
46class EclEpsTwoPhaseLawParams : public EnsureFinalized
47{
48 using EffLawParams = typename EffLawT::Params;
49 using Scalar = typename EffLawParams::Traits::Scalar;
50
51public:
52 using Traits = typename EffLawParams::Traits;
53 using ScalingPoints = EclEpsScalingPoints<Scalar>;
54
55 EclEpsTwoPhaseLawParams()
56 {
57 }
58
63 void finalize()
64 {
65#ifndef NDEBUG
66 if (config_.enableSatScaling()) {
67 assert(unscaledPoints_);
68 }
69 assert(effectiveLawParams_);
70#endif
71 EnsureFinalized :: finalize();
72 }
73
77 void setConfig(const EclEpsConfig& value)
78 { config_ = value; }
79
83 const EclEpsConfig& config() const
84 { return config_; }
85
89 void setUnscaledPoints(std::shared_ptr<ScalingPoints> value)
90 { unscaledPoints_ = value.get(); }
91
95 const ScalingPoints& unscaledPoints() const
96 { return *unscaledPoints_; }
97
101 void setScaledPoints(const ScalingPoints& value)
102 { scaledPoints_ = value; }
103
107 const ScalingPoints& scaledPoints() const
108 { return scaledPoints_; }
109
113 ScalingPoints& scaledPoints()
114 { return scaledPoints_; }
115
116 Scalar SnTrapped([[maybe_unused]] bool maximumTrapping) const
117 {
118 return 0.0;
119 }
120
121 Scalar SnStranded([[maybe_unused]] Scalar sg, [[maybe_unused]] Scalar krg) const
122 {
123 return 0.0;
124 }
125
126 Scalar SwTrapped() const
127 {
128 return 0.0;
129 }
130
134 void setEffectiveLawParams(std::shared_ptr<EffLawParams> value)
135 { effectiveLawParams_ = value.get(); }
136
140 const EffLawParams& effectiveLawParams() const
141 { return *effectiveLawParams_; }
142
143 template<class Serializer>
144 void serializeOp(Serializer&)
145 {
146 // Do nothing, this class has no dynamic state!
147 // It is still somewhat useful to have this function,
148 // as then we do not need to embed that knowledge in
149 // other classes that may contain this one.
150 }
151
152private:
153 EffLawParams* effectiveLawParams_{};
154 EclEpsConfig config_;
155 ScalingPoints* unscaledPoints_{};
156 ScalingPoints scaledPoints_;
157};
158
159} // namespace Opm
160
161#endif
Specifies the configuration used by the endpoint scaling code.
Default implementation for asserting finalization of parameter objects.
Specifies the configuration used by the endpoint scaling code.
Definition EclEpsConfig.hpp:54
Represents the points on the X and Y axis to be scaled if endpoint scaling is used.
Definition EclEpsScalingPoints.hpp:151
void finalize()
Calculate all dependent quantities once the independent quantities of the parameter object have been ...
Definition EclEpsTwoPhaseLawParams.hpp:63
const EclEpsConfig & config() const
Returns the endpoint scaling configuration object.
Definition EclEpsTwoPhaseLawParams.hpp:83
ScalingPoints & scaledPoints()
Returns the scaling points which are seen by the physical model.
Definition EclEpsTwoPhaseLawParams.hpp:113
const ScalingPoints & unscaledPoints() const
Returns the scaling points which are seen by the nested material law.
Definition EclEpsTwoPhaseLawParams.hpp:95
void setEffectiveLawParams(std::shared_ptr< EffLawParams > value)
Sets the parameter object for the effective/nested material law.
Definition EclEpsTwoPhaseLawParams.hpp:134
void setConfig(const EclEpsConfig &value)
Set the endpoint scaling configuration object.
Definition EclEpsTwoPhaseLawParams.hpp:77
const EffLawParams & effectiveLawParams() const
Returns the parameter object for the effective/nested material law.
Definition EclEpsTwoPhaseLawParams.hpp:140
void setScaledPoints(const ScalingPoints &value)
Set the scaling points which are seen by the physical model.
Definition EclEpsTwoPhaseLawParams.hpp:101
const ScalingPoints & scaledPoints() const
Returns the scaling points which are seen by the physical model.
Definition EclEpsTwoPhaseLawParams.hpp:107
void setUnscaledPoints(std::shared_ptr< ScalingPoints > value)
Set the scaling points which are seen by the nested material law.
Definition EclEpsTwoPhaseLawParams.hpp:89
OPM_HOST_DEVICE EnsureFinalized()
The default constructor.
Definition EnsureFinalized.hpp:58
Class for (de-)serializing.
Definition Serializer.hpp:94
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30