opm-common
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"
31 #include "EclEpsScalingPoints.hpp"
32 
33 #include <opm/common/utility/gpuDecorators.hpp>
34 
35 #include <memory>
36 #include <cassert>
37 
39 
40 namespace Opm {
47 template <class EffLawT>
49 {
50  using EffLawParams = typename EffLawT::Params;
51  using Scalar = typename EffLawParams::Traits::Scalar;
52 
53 public:
54  using Traits = typename EffLawParams::Traits;
56 
58  {
59  }
60 
65  void finalize()
66  {
67 #ifndef NDEBUG
68  if (config_.enableSatScaling()) {
69  assert(unscaledPoints_);
70  }
71  assert(effectiveLawParams_);
72 #endif
74  }
75 
80  { config_ = value; }
81 
85  OPM_HOST_DEVICE const EclEpsConfig& config() const
86  { return config_; }
87 
91  void setUnscaledPoints(std::shared_ptr<ScalingPoints> value)
92  { unscaledPoints_ = value.get(); }
93 
97  OPM_HOST_DEVICE const ScalingPoints& unscaledPoints() const
98  { return *unscaledPoints_; }
99 
104  { scaledPoints_ = value; }
105 
109  OPM_HOST_DEVICE const ScalingPoints& scaledPoints() const
110  { return scaledPoints_; }
111 
116  { return scaledPoints_; }
117 
118  Scalar SnTrapped([[maybe_unused]] bool maximumTrapping) const
119  {
120  return 0.0;
121  }
122 
123  Scalar SnStranded([[maybe_unused]] Scalar sg, [[maybe_unused]] Scalar krg) const
124  {
125  return 0.0;
126  }
127 
128  Scalar SwTrapped() const
129  {
130  return 0.0;
131  }
132 
136  void setEffectiveLawParams(std::shared_ptr<EffLawParams> value)
137  { effectiveLawParams_ = value.get(); }
138 
142  OPM_HOST_DEVICE const EffLawParams& effectiveLawParams() const
143  { return *effectiveLawParams_; }
144 
145  template<class Serializer>
146  void serializeOp(Serializer&)
147  {
148  // Do nothing, this class has no dynamic state!
149  // It is still somewhat useful to have this function,
150  // as then we do not need to embed that knowledge in
151  // other classes that may contain this one.
152  }
153 
154 private:
155  EffLawParams* effectiveLawParams_{};
156  EclEpsConfig config_;
157  ScalingPoints* unscaledPoints_{};
158  ScalingPoints scaledPoints_;
159 };
160 
161 } // namespace Opm
162 
163 #endif
void finalize()
Calculate all dependent quantities once the independent quantities of the parameter object have been ...
Definition: EclEpsTwoPhaseLawParams.hpp:65
OPM_HOST_DEVICE const ScalingPoints & scaledPoints() const
Returns the scaling points which are seen by the physical model.
Definition: EclEpsTwoPhaseLawParams.hpp:109
A default implementation of the parameters for the material law adapter class which implements ECL en...
Definition: EclEpsTwoPhaseLawParams.hpp:48
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Specifies the configuration used by the endpoint scaling code.
Definition: EclEpsConfig.hpp:55
OPM_HOST_DEVICE const EclEpsConfig & config() const
Returns the endpoint scaling configuration object.
Definition: EclEpsTwoPhaseLawParams.hpp:85
OPM_HOST_DEVICE const EffLawParams & effectiveLawParams() const
Returns the parameter object for the effective/nested material law.
Definition: EclEpsTwoPhaseLawParams.hpp:142
Represents the points on the X and Y axis to be scaled if endpoint scaling is used.
Definition: EclEpsScalingPoints.hpp:152
Default implementation for asserting finalization of parameter objects.
Specifies the configuration used by the endpoint scaling code.
OPM_HOST_DEVICE bool enableSatScaling() const
Returns whether saturation scaling is enabled.
Definition: EclEpsConfig.hpp:67
void setConfig(const EclEpsConfig &value)
Set the endpoint scaling configuration object.
Definition: EclEpsTwoPhaseLawParams.hpp:79
OPM_HOST_DEVICE void finalize()
Mark the object as finalized.
Definition: EnsureFinalized.hpp:82
void setEffectiveLawParams(std::shared_ptr< EffLawParams > value)
Sets the parameter object for the effective/nested material law.
Definition: EclEpsTwoPhaseLawParams.hpp:136
OPM_HOST_DEVICE const ScalingPoints & unscaledPoints() const
Returns the scaling points which are seen by the nested material law.
Definition: EclEpsTwoPhaseLawParams.hpp:97
Default implementation for asserting finalization of parameter objects.
Definition: EnsureFinalized.hpp:48
ScalingPoints & scaledPoints()
Returns the scaling points which are seen by the physical model.
Definition: EclEpsTwoPhaseLawParams.hpp:115
Class for (de-)serializing.
Definition: Serializer.hpp:95
void setScaledPoints(const ScalingPoints &value)
Set the scaling points which are seen by the physical model.
Definition: EclEpsTwoPhaseLawParams.hpp:103
void setUnscaledPoints(std::shared_ptr< ScalingPoints > value)
Set the scaling points which are seen by the nested material law.
Definition: EclEpsTwoPhaseLawParams.hpp:91