opm-simulators
OilPhaseConsistencyChecks.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 OIL_PHASE_CONSISTENCY_CHECKS_HPP_INCLUDED
21 #define OIL_PHASE_CONSISTENCY_CHECKS_HPP_INCLUDED
22 
23 #include <opm/simulators/utils/satfunc/SatfuncConsistencyChecks.hpp>
24 #include <opm/simulators/utils/satfunc/PhaseCheckBase.hpp>
25 
26 #include <cstddef>
27 #include <string>
28 
30 
34  template <typename Scalar>
35  class SOcr_GO : public PhaseCheckBase<Scalar>
36  {
37  public:
39  std::size_t numExportedCheckValues() const override { return 1; };
40 
45  void exportCheckValues(Scalar* exportedCheckValues) const override
46  {
47  exportedCheckValues[0] = this->sogcr_;
48  }
49 
51  std::string description() const override
52  {
53  return { "Non-negative critical oil saturation in G/O system" };
54  }
55 
57  std::string condition() const override
58  {
59  return { "0 <= SOGCR < 1" };
60  }
61 
66  void columnNames(std::string* headers) const override
67  {
68  headers[0] = "SOGCR";
69  }
70 
71  private:
73  Scalar sogcr_{};
74 
82  void testImpl(const EclEpsScalingPointsInfo<Scalar>& endPoints) override;
83  };
84 
88  template <typename Scalar>
89  class SOmin_GO : public PhaseCheckBase<Scalar>
90  {
91  public:
93  std::size_t numExportedCheckValues() const override { return 3; };
94 
99  void exportCheckValues(Scalar* exportedCheckValues) const override
100  {
101  exportedCheckValues[0] = this->swl_;
102  exportedCheckValues[1] = this->sgu_;
103  exportedCheckValues[2] = this->swl_ + this->sgu_;
104  }
105 
107  std::string description() const override
108  {
109  return { "Non-negative minimum oil saturation in G/O system" };
110  }
111 
113  std::string condition() const override
114  {
115  return { "SWL + SGU <= 1" };
116  }
117 
122  void columnNames(std::string* headers) const override
123  {
124  headers[0] = "SWL";
125  headers[1] = "SGU";
126  headers[2] = "SWL + SGU";
127  }
128 
129  private:
131  Scalar swl_{};
132 
134  Scalar sgu_{};
135 
143  void testImpl(const EclEpsScalingPointsInfo<Scalar>& endPoints) override;
144  };
145 
150  template <typename Scalar>
151  class MobileOil_GO_SGmin : public PhaseCheckBase<Scalar>
152  {
153  public:
155  std::size_t numExportedCheckValues() const override { return 4; };
156 
161  void exportCheckValues(Scalar* exportedCheckValues) const override
162  {
163  exportedCheckValues[0] = this->swl_;
164  exportedCheckValues[1] = this->sgl_;
165  exportedCheckValues[2] = this->sogcr_;
166  exportedCheckValues[3] = Scalar{1} - (this->swl_ + this->sgl_);
167  }
168 
170  std::string description() const override
171  {
172  return { "Mobile oil saturation in G/O system at minimum gas saturation" };
173  }
174 
176  std::string condition() const override
177  {
178  return { "SOGCR < 1 - SWL - SGL" };
179  }
180 
185  void columnNames(std::string* headers) const override
186  {
187  headers[0] = "SWL";
188  headers[1] = "SGL";
189  headers[2] = "SOGCR";
190  headers[3] = "1 - SWL - SGL";
191  }
192 
193  private:
195  Scalar swl_{};
196 
198  Scalar sgl_{};
199 
201  Scalar sogcr_{};
202 
210  void testImpl(const EclEpsScalingPointsInfo<Scalar>& endPoints) override;
211  };
212 
217  template <typename Scalar>
218  class MobileOil_GO_SGcr : public PhaseCheckBase<Scalar>
219  {
220  public:
222  std::size_t numExportedCheckValues() const override { return 4; };
223 
228  void exportCheckValues(Scalar* exportedCheckValues) const override
229  {
230  exportedCheckValues[0] = this->swl_;
231  exportedCheckValues[1] = this->sgcr_;
232  exportedCheckValues[2] = this->sogcr_;
233  exportedCheckValues[3] = Scalar{1} - (this->swl_ + this->sgcr_);
234  }
235 
237  std::string description() const override
238  {
239  return { "Mobile oil saturation in G/O system at critical gas saturation" };
240  }
241 
243  std::string condition() const override
244  {
245  return { "SOGCR < 1 - SWL - SGCR" };
246  }
247 
252  void columnNames(std::string* headers) const override
253  {
254  headers[0] = "SWL";
255  headers[1] = "SGCR";
256  headers[2] = "SOGCR";
257  headers[3] = "1 - SWL - SGCR";
258  }
259 
260  private:
262  Scalar swl_{};
263 
265  Scalar sgcr_{};
266 
268  Scalar sogcr_{};
269 
277  void testImpl(const EclEpsScalingPointsInfo<Scalar>& endPoints) override;
278  };
279 
280  // -----------------------------------------------------------------------
281 
285  template <typename Scalar>
286  class SOcr_OW : public PhaseCheckBase<Scalar>
287  {
288  public:
290  std::size_t numExportedCheckValues() const override { return 1; };
291 
296  void exportCheckValues(Scalar* exportedCheckValues) const override
297  {
298  exportedCheckValues[0] = this->sowcr_;
299  }
300 
302  std::string description() const override
303  {
304  return { "Non-negative critical oil saturation in O/W system" };
305  }
306 
308  std::string condition() const override
309  {
310  return { "0 <= SOWCR < 1" };
311  }
312 
317  void columnNames(std::string* headers) const override
318  {
319  headers[0] = "SOWCR";
320  }
321 
322  private:
324  Scalar sowcr_{};
325 
333  void testImpl(const EclEpsScalingPointsInfo<Scalar>& endPoints) override;
334  };
335 
339  template <typename Scalar>
340  class SOmin_OW : public PhaseCheckBase<Scalar>
341  {
342  public:
344  std::size_t numExportedCheckValues() const override { return 3; };
345 
350  void exportCheckValues(Scalar* exportedCheckValues) const override
351  {
352  exportedCheckValues[0] = this->sgl_;
353  exportedCheckValues[1] = this->swu_;
354  exportedCheckValues[2] = this->sgl_ + this->swu_;
355  }
356 
358  std::string description() const override
359  {
360  return { "Non-negative minimum oil saturation in G/O system" };
361  }
362 
364  std::string condition() const override
365  {
366  return { "SGL + SWU <= 1" };
367  }
368 
373  void columnNames(std::string* headers) const override
374  {
375  headers[0] = "SGL";
376  headers[1] = "SWU";
377  headers[2] = "SGL + SWU";
378  }
379 
380  private:
382  Scalar sgl_{};
383 
385  Scalar swu_{};
386 
394  void testImpl(const EclEpsScalingPointsInfo<Scalar>& endPoints) override;
395  };
396 
401  template <typename Scalar>
402  class MobileOil_OW_SWmin : public PhaseCheckBase<Scalar>
403  {
404  public:
406  std::size_t numExportedCheckValues() const override { return 4; };
407 
412  void exportCheckValues(Scalar* exportedCheckValues) const override
413  {
414  exportedCheckValues[0] = this->swl_;
415  exportedCheckValues[1] = this->sgl_;
416  exportedCheckValues[2] = this->sowcr_;
417  exportedCheckValues[3] = Scalar{1} - (this->swl_ + this->sgl_);
418  }
419 
421  std::string description() const override
422  {
423  return { "Mobile oil saturation in O/W system at minimum water saturation" };
424  }
425 
427  std::string condition() const override
428  {
429  return { "SOWCR < 1 - SWL - SGL" };
430  }
431 
436  void columnNames(std::string* headers) const override
437  {
438  headers[0] = "SWL";
439  headers[1] = "SGL";
440  headers[2] = "SOWCR";
441  headers[3] = "1 - SWL - SGL";
442  }
443 
444  private:
446  Scalar swl_{};
447 
449  Scalar sgl_{};
450 
452  Scalar sowcr_{};
453 
461  void testImpl(const EclEpsScalingPointsInfo<Scalar>& endPoints) override;
462  };
463 
468  template <typename Scalar>
469  class MobileOil_OW_SWcr : public PhaseCheckBase<Scalar>
470  {
471  public:
473  std::size_t numExportedCheckValues() const override { return 4; };
474 
479  void exportCheckValues(Scalar* exportedCheckValues) const override
480  {
481  exportedCheckValues[0] = this->sgl_;
482  exportedCheckValues[1] = this->swcr_;
483  exportedCheckValues[2] = this->sowcr_;
484  exportedCheckValues[3] = Scalar{1} - this->swcr_ - this->sgl_;
485  }
486 
488  std::string description() const override
489  {
490  return { "Mobile oil saturation in O/W system at critical water saturation" };
491  }
492 
494  std::string condition() const override
495  {
496  return { "SOWCR < 1 - SWCR - SGL" };
497  }
498 
503  void columnNames(std::string* headers) const override
504  {
505  headers[0] = "SGL";
506  headers[1] = "SWCR";
507  headers[2] = "SOWCR";
508  headers[3] = "1 - SWCR - SGL";
509  }
510 
511  private:
513  Scalar sgl_{};
514 
516  Scalar swcr_{};
517 
519  Scalar sowcr_{};
520 
528  void testImpl(const EclEpsScalingPointsInfo<Scalar>& endPoints) override;
529  };
530 
531 } // namespace Opm::Satfunc::PhaseChecks::Oil
532 
533 #endif // OIL_PHASE_CONSISTENCY_CHECKS_HPP_INCLUDED
void columnNames(std::string *headers) const override
Retrieve names of the exported check values.
Definition: OilPhaseConsistencyChecks.hpp:122
std::size_t numExportedCheckValues() const override
Number of Scalar values involved in the check.
Definition: OilPhaseConsistencyChecks.hpp:222
Verify that minimum oil saturation in gas/oil system is in valid range.
Definition: OilPhaseConsistencyChecks.hpp:89
void columnNames(std::string *headers) const override
Retrieve names of the exported check values.
Definition: OilPhaseConsistencyChecks.hpp:317
void exportCheckValues(Scalar *exportedCheckValues) const override
Get a linearised copy of the Scalar values involved in the check.
Definition: OilPhaseConsistencyChecks.hpp:479
std::string description() const override
Descriptive textual summary of this check.
Definition: OilPhaseConsistencyChecks.hpp:488
void columnNames(std::string *headers) const override
Retrieve names of the exported check values.
Definition: OilPhaseConsistencyChecks.hpp:66
void columnNames(std::string *headers) const override
Retrieve names of the exported check values.
Definition: OilPhaseConsistencyChecks.hpp:373
Base class for all phase saturation function consistency checks.
Definition: PhaseCheckBase.hpp:34
std::size_t numExportedCheckValues() const override
Number of Scalar values involved in the check.
Definition: OilPhaseConsistencyChecks.hpp:406
std::string description() const override
Descriptive textual summary of this check.
Definition: OilPhaseConsistencyChecks.hpp:302
std::size_t numExportedCheckValues() const override
Number of Scalar values involved in the check.
Definition: OilPhaseConsistencyChecks.hpp:473
std::size_t numExportedCheckValues() const override
Number of Scalar values involved in the check.
Definition: OilPhaseConsistencyChecks.hpp:290
void exportCheckValues(Scalar *exportedCheckValues) const override
Get a linearised copy of the Scalar values involved in the check.
Definition: OilPhaseConsistencyChecks.hpp:228
std::string condition() const override
Textual representation of the consistency condition.
Definition: OilPhaseConsistencyChecks.hpp:494
std::string condition() const override
Textual representation of the consistency condition.
Definition: OilPhaseConsistencyChecks.hpp:176
void exportCheckValues(Scalar *exportedCheckValues) const override
Get a linearised copy of the Scalar values involved in the check.
Definition: OilPhaseConsistencyChecks.hpp:350
Definition: SatfuncCheckPointInterface.hpp:28
std::string condition() const override
Textual representation of the consistency condition.
Definition: OilPhaseConsistencyChecks.hpp:113
std::string description() const override
Descriptive textual summary of this check.
Definition: OilPhaseConsistencyChecks.hpp:358
void columnNames(std::string *headers) const override
Retrieve names of the exported check values.
Definition: OilPhaseConsistencyChecks.hpp:436
void columnNames(std::string *headers) const override
Retrieve names of the exported check values.
Definition: OilPhaseConsistencyChecks.hpp:185
std::size_t numExportedCheckValues() const override
Number of Scalar values involved in the check.
Definition: OilPhaseConsistencyChecks.hpp:93
Verify that minimum oil saturation in oil/water system is in valid range.
Definition: OilPhaseConsistencyChecks.hpp:340
Definition: OilPhaseConsistencyChecks.hpp:29
Verify that critical oil saturation in oil/water system is in valid range.
Definition: OilPhaseConsistencyChecks.hpp:286
void exportCheckValues(Scalar *exportedCheckValues) const override
Get a linearised copy of the Scalar values involved in the check.
Definition: OilPhaseConsistencyChecks.hpp:296
std::string condition() const override
Textual representation of the consistency condition.
Definition: OilPhaseConsistencyChecks.hpp:308
std::string description() const override
Descriptive textual summary of this check.
Definition: OilPhaseConsistencyChecks.hpp:237
void exportCheckValues(Scalar *exportedCheckValues) const override
Get a linearised copy of the Scalar values involved in the check.
Definition: OilPhaseConsistencyChecks.hpp:99
std::string description() const override
Descriptive textual summary of this check.
Definition: OilPhaseConsistencyChecks.hpp:170
void exportCheckValues(Scalar *exportedCheckValues) const override
Get a linearised copy of the Scalar values involved in the check.
Definition: OilPhaseConsistencyChecks.hpp:45
std::string condition() const override
Textual representation of the consistency condition.
Definition: OilPhaseConsistencyChecks.hpp:427
std::string condition() const override
Textual representation of the consistency condition.
Definition: OilPhaseConsistencyChecks.hpp:243
std::size_t numExportedCheckValues() const override
Number of Scalar values involved in the check.
Definition: OilPhaseConsistencyChecks.hpp:155
void columnNames(std::string *headers) const override
Retrieve names of the exported check values.
Definition: OilPhaseConsistencyChecks.hpp:503
std::string description() const override
Descriptive textual summary of this check.
Definition: OilPhaseConsistencyChecks.hpp:107
std::string condition() const override
Textual representation of the consistency condition.
Definition: OilPhaseConsistencyChecks.hpp:364
std::string description() const override
Descriptive textual summary of this check.
Definition: OilPhaseConsistencyChecks.hpp:421
std::size_t numExportedCheckValues() const override
Number of Scalar values involved in the check.
Definition: OilPhaseConsistencyChecks.hpp:39
Verify that critical oil saturation in gas/oil system is strictly smaller than oil saturation at crit...
Definition: OilPhaseConsistencyChecks.hpp:218
Verify that critical oil saturation in oil/water system is strictly smaller than oil saturation at cr...
Definition: OilPhaseConsistencyChecks.hpp:469
std::string condition() const override
Textual representation of the consistency condition.
Definition: OilPhaseConsistencyChecks.hpp:57
std::string description() const override
Descriptive textual summary of this check.
Definition: OilPhaseConsistencyChecks.hpp:51
std::size_t numExportedCheckValues() const override
Number of Scalar values involved in the check.
Definition: OilPhaseConsistencyChecks.hpp:344
void exportCheckValues(Scalar *exportedCheckValues) const override
Get a linearised copy of the Scalar values involved in the check.
Definition: OilPhaseConsistencyChecks.hpp:412
Verify that critical oil saturation in oil/water system is strictly smaller than maximum oil saturati...
Definition: OilPhaseConsistencyChecks.hpp:402
Verify that critical oil saturation in gas/oil system is in valid range.
Definition: OilPhaseConsistencyChecks.hpp:35
void exportCheckValues(Scalar *exportedCheckValues) const override
Get a linearised copy of the Scalar values involved in the check.
Definition: OilPhaseConsistencyChecks.hpp:161
void columnNames(std::string *headers) const override
Retrieve names of the exported check values.
Definition: OilPhaseConsistencyChecks.hpp:252
Verify that critical oil saturation in gas/oil system is strictly smaller than maximum oil saturation...
Definition: OilPhaseConsistencyChecks.hpp:151