opm-simulators
ThreePointHorizontalConsistencyChecks.hpp
1 /*
2  Copyright 2024 Equinor AS
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 3 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 
20 #ifndef THREE_POINT_HORIZONTAL_CONSISTENCY_CHECKS_HPP_INCLUDED
21 #define THREE_POINT_HORIZONTAL_CONSISTENCY_CHECKS_HPP_INCLUDED
22 
23 #include <opm/simulators/utils/satfunc/PhaseCheckBase.hpp>
24 #include <opm/simulators/utils/satfunc/SatfuncConsistencyChecks.hpp>
25 
26 #include <cstddef>
27 #include <string>
28 
30 
37  template <typename Scalar>
38  class DisplacingOil_GO : public PhaseCheckBase<Scalar>
39  {
40  public:
42  std::size_t numExportedCheckValues() const override { return 5; };
43 
48  void exportCheckValues(Scalar* exportedCheckValues) const override
49  {
50  exportedCheckValues[0] = this->swl_;
51  exportedCheckValues[1] = this->sogcr_;
52  exportedCheckValues[2] = this->sgcr_;
53  exportedCheckValues[3] = Scalar{1} - (this->sogcr_ + this->swl_);
54  exportedCheckValues[4] = this->sgu_;
55  }
56 
58  std::string description() const override
59  {
60  return { "Mobile displacing oil in three point "
61  "horizontally scaled gas/oil system" };
62  }
63 
65  std::string condition() const override
66  {
67  return { "SGCR < 1-SOGCR-SWL <= SGU" };
68  }
69 
74  void columnNames(std::string* headers) const override
75  {
76  headers[0] = "SWL";
77  headers[1] = "SOGCR";
78  headers[2] = "SGCR";
79  headers[3] = "1-SOGCR-SWL";
80  headers[4] = "SGU";
81  }
82 
83  private:
85  Scalar swl_{};
86 
88  Scalar sogcr_{};
89 
91  Scalar sgcr_{};
92 
94  Scalar sgu_{};
95 
103  void testImpl(const EclEpsScalingPointsInfo<Scalar>& endPoints) override;
104  };
105 
112  template <typename Scalar>
113  class DisplacingOil_OW : public PhaseCheckBase<Scalar>
114  {
115  public:
117  std::size_t numExportedCheckValues() const override { return 5; };
118 
123  void exportCheckValues(Scalar* exportedCheckValues) const override
124  {
125  exportedCheckValues[0] = this->sgl_;
126  exportedCheckValues[1] = this->sowcr_;
127  exportedCheckValues[2] = this->swcr_;
128  exportedCheckValues[3] = Scalar{1} - (this->sowcr_ + this->sgl_);
129  exportedCheckValues[4] = this->swu_;
130  }
131 
133  std::string description() const override
134  {
135  return { "Mobile displacing oil in three point "
136  "horizontally scaled oil/water system" };
137  }
138 
140  std::string condition() const override
141  {
142  return { "SWCR < 1-SOWCR-SGL <= SWU" };
143  }
144 
149  void columnNames(std::string* headers) const override
150  {
151  headers[0] = "SGL";
152  headers[1] = "SOWCR";
153  headers[2] = "SWCR";
154  headers[3] = "1-SOWCR-SGL";
155  headers[4] = "SWU";
156  }
157 
158  private:
160  Scalar sgl_{};
161 
163  Scalar sowcr_{};
164 
166  Scalar swcr_{};
167 
169  Scalar swu_{};
170 
178  void testImpl(const EclEpsScalingPointsInfo<Scalar>& endPoints) override;
179  };
180 
181 } // namespace Opm::Satfunc::PhaseChecks::ThreePointHorizontal
182 
183 #endif // THREE_POINT_HORIZONTAL_CONSISTENCY_CHECKS_HPP_INCLUDED
Verify that critical saturation of displacing phase (oil) is strictly between critical and maximum wa...
Definition: ThreePointHorizontalConsistencyChecks.hpp:113
void columnNames(std::string *headers) const override
Retrieve names of the exported check values.
Definition: ThreePointHorizontalConsistencyChecks.hpp:149
Base class for all phase saturation function consistency checks.
Definition: PhaseCheckBase.hpp:34
std::string description() const override
Descriptive textual summary of this check.
Definition: ThreePointHorizontalConsistencyChecks.hpp:58
std::size_t numExportedCheckValues() const override
Number of Scalar values involved in the check.
Definition: ThreePointHorizontalConsistencyChecks.hpp:117
std::string condition() const override
Textual representation of the consistency condition.
Definition: ThreePointHorizontalConsistencyChecks.hpp:65
void exportCheckValues(Scalar *exportedCheckValues) const override
Get a linearised copy of the Scalar values involved in the check.
Definition: ThreePointHorizontalConsistencyChecks.hpp:123
Definition: ThreePointHorizontalConsistencyChecks.hpp:29
std::string condition() const override
Textual representation of the consistency condition.
Definition: ThreePointHorizontalConsistencyChecks.hpp:140
void exportCheckValues(Scalar *exportedCheckValues) const override
Get a linearised copy of the Scalar values involved in the check.
Definition: ThreePointHorizontalConsistencyChecks.hpp:48
std::size_t numExportedCheckValues() const override
Number of Scalar values involved in the check.
Definition: ThreePointHorizontalConsistencyChecks.hpp:42
void columnNames(std::string *headers) const override
Retrieve names of the exported check values.
Definition: ThreePointHorizontalConsistencyChecks.hpp:74
std::string description() const override
Descriptive textual summary of this check.
Definition: ThreePointHorizontalConsistencyChecks.hpp:133
Verify that critical saturation of displacing phase (oil/liquid) is strictly between critical and max...
Definition: ThreePointHorizontalConsistencyChecks.hpp:38