EclEpsScalingPoints.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  Copyright (C) 2015 by Andreas Lauser
5  Copyright (C) 2015 by IRIS AS
6 
7  This file is part of the Open Porous Media project (OPM).
8 
9  OPM is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 2 of the License, or
12  (at your option) any later version.
13 
14  OPM is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with OPM. If not, see <http://www.gnu.org/licenses/>.
21 */
26 #ifndef OPM_ECL_EPS_SCALING_POINTS_HPP
27 #define OPM_ECL_EPS_SCALING_POINTS_HPP
28 
29 #include "EclEpsConfig.hpp"
30 
31 #if HAVE_OPM_PARSER
32 #include <opm/parser/eclipse/Deck/Deck.hpp>
33 #include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
34 #endif
35 
36 #include <array>
37 #include <string>
38 #include <iostream>
39 #include <cassert>
40 #include <algorithm>
41 
42 namespace Opm {
50 {
51  typedef std::vector<int> IntData;
52  typedef std::vector<double> DoubleData;
53 
54 public:
55 #if HAVE_OPM_PARSER
56  void initFromDeck(Opm::DeckConstPtr /* deck */,
57  Opm::EclipseStateConstPtr eclState,
58  bool useImbibition)
59  {
60  std::string kwPrefix = useImbibition?"I":"";
61 
62  if (useImbibition)
63  satnum = &eclState->getIntGridProperty("IMBNUM")->getData();
64  else
65  satnum = &eclState->getIntGridProperty("SATNUM")->getData();
66 
67  retrieveGridPropertyData_(&swl, eclState, kwPrefix+"SWL");
68  retrieveGridPropertyData_(&sgl, eclState, kwPrefix+"SGL");
69  retrieveGridPropertyData_(&swcr, eclState, kwPrefix+"SWCR");
70  retrieveGridPropertyData_(&sgcr, eclState, kwPrefix+"SGCR");
71  retrieveGridPropertyData_(&sowcr, eclState, kwPrefix+"SOWCR");
72  retrieveGridPropertyData_(&sogcr, eclState, kwPrefix+"SOGCR");
73  retrieveGridPropertyData_(&swu, eclState, kwPrefix+"SWU");
74  retrieveGridPropertyData_(&sgu, eclState, kwPrefix+"SGU");
75  retrieveGridPropertyData_(&pcw, eclState, kwPrefix+"PCW");
76  retrieveGridPropertyData_(&pcg, eclState, kwPrefix+"PCG");
77  retrieveGridPropertyData_(&krw, eclState, kwPrefix+"KRW");
78  retrieveGridPropertyData_(&kro, eclState, kwPrefix+"KRO");
79  retrieveGridPropertyData_(&krg, eclState, kwPrefix+"KRG");
80  }
81 #endif
82 
83  const IntData* satnum;
84 
85  const DoubleData* swl;
86  const DoubleData* sgl;
87  const DoubleData* swcr;
88  const DoubleData* sgcr;
89  const DoubleData* sowcr;
90  const DoubleData* sogcr;
91  const DoubleData* swu;
92  const DoubleData* sgu;
93  const DoubleData* pcw;
94  const DoubleData* pcg;
95  const DoubleData* krw;
96  const DoubleData* kro;
97  const DoubleData* krg;
98 
99 private:
100 #if HAVE_OPM_PARSER
101  // this method makes sure that a grid property is not created if it is not explicitly
102  // mentioned in the deck. (saves memory.)
103  void retrieveGridPropertyData_(const DoubleData **data,
104  Opm::EclipseStateConstPtr eclState,
105  const std::string& properyName)
106  {
107  (*data) = 0;
108  if (eclState->hasDoubleGridProperty(properyName))
109  (*data) = &eclState->getDoubleGridProperty(properyName)->getData();
110  }
111 #endif
112 };
113 
121 template <class Scalar>
123 {
124  // connate saturations
125  Scalar Swl; // oil
126  Scalar Sgl; // gas
127  Scalar Sowl; // oil for the oil-water system
128  Scalar Sogl; // oil for the gas-oil system
129 
130  // critical water and gas saturations
131  Scalar Swcr; // oil
132  Scalar Sgcr; // gas
133  Scalar Sowcr; // oil for the oil-water system
134  Scalar Sogcr; // oil for the gas-oil system
135 
136  // maximum saturations
137  Scalar Swu; // oil
138  Scalar Sgu; // gas
139  Scalar Sowu; // oil for the oil-water system
140  Scalar Sogu; // oil for the gas-oil system
141 
142  // maximum capillary pressures
143  Scalar maxPcow; // maximum capillary pressure of the oil-water system
144  Scalar maxPcgo; // maximum capillary pressure of the gas-oil system
145 
146  // maximum relative permabilities
147  Scalar maxKrw; // maximum relative permability of water
148  Scalar maxKrow; // maximum relative permability of oil in the oil-water system
149  Scalar maxKrog; // maximum relative permability of oil in the gas-oil system
150  Scalar maxKrg; // maximum relative permability of gas
151 
152  void print() const
153  {
154  std::cout << " Swl: " << Swl << "\n"
155  << " Sgl: " << Sgl << "\n"
156  << " Sowl: " << Sowl << "\n"
157  << " Sogl: " << Sogl << "\n"
158  << " Swcr: " << Swcr << "\n"
159  << " Sgcr: " << Sgcr << "\n"
160  << " Sowcr: " << Sowcr << "\n"
161  << " Sogcr: " << Sogcr << "\n"
162  << " Swu: " << Swu << "\n"
163  << " Sgu: " << Sgu << "\n"
164  << " Sowu: " << Sowu << "\n"
165  << " Sogu: " << Sogu << "\n"
166  << " maxPcow: " << maxPcow << "\n"
167  << " maxPcgo: " << maxPcgo << "\n"
168  << " maxKrw: " << maxKrw << "\n"
169  << " maxKrg: " << maxKrg << "\n"
170  << " maxKrow: " << maxKrow << "\n"
171  << " maxKrog: " << maxKrog << "\n";
172  }
173 
174 #if HAVE_OPM_PARSER
175 
181  void extractUnscaled(Opm::DeckConstPtr deck,
182  Opm::EclipseStateConstPtr eclState,
183  unsigned satRegionIdx)
184  {
185  // TODO: support for the SOF2/SOF3 keyword family
186  auto tables = eclState->getTableManager();
187  const TableContainer& swofTables = tables->getSwofTables();
188  const TableContainer& sgofTables = tables->getSgofTables();
189  const TableContainer& slgofTables = tables->getSlgofTables();
190  const TableContainer& swfnTables = tables->getSwfnTables();
191  const TableContainer& sgfnTables = tables->getSgfnTables();
192  const TableContainer& sof3Tables = tables->getSof3Tables();
193 
194  bool hasWater = deck->hasKeyword("WATER");
195  bool hasGas = deck->hasKeyword("GAS");
196  bool hasOil = deck->hasKeyword("OIL");
197 
198  if (!hasWater) {
199  Swl = 0.0;
200  Swu = 0.0;
201  Swcr = 0.0;
202  if (!sgofTables.empty())
203  extractUnscaledSgof_(sgofTables.getTable<SgofTable>(satRegionIdx));
204  else {
205  assert(!slgofTables.empty());
206  extractUnscaledSlgof_(slgofTables.getTable<SlgofTable>(satRegionIdx));
207  }
208  return;
209  }
210  else if (!hasGas) {
211  assert(!swofTables.empty());
212  Sgl = 0.0;
213  Sgu = 0.0;
214  Sgcr = 0.0;
215  extractUnscaledSwof_(swofTables.getTable<SwofTable>(satRegionIdx));
216  return;
217  }
218 
219  // so far, only water-oil and oil-gas simulations are supported, i.e.,
220  // there's no gas-water yet.
221  if (!hasWater || !hasGas || !hasOil)
222  throw std::domain_error("The specified phase configuration is not suppored");
223 
224  bool family1 = (!sgofTables.empty() || !slgofTables.empty()) && !swofTables.empty();
225  bool family2 = !swfnTables.empty() && !sgfnTables.empty() && !sof3Tables.empty();
226 
227  if (family1) {
228  extractUnscaledSwof_(swofTables.getTable<SwofTable>(satRegionIdx));
229 
230  if (!sgofTables.empty()) {
231  // gas-oil parameters are specified using the SGOF keyword
232  extractUnscaledSgof_(sgofTables.getTable<SgofTable>(satRegionIdx));
233  }
234  else {
235  // gas-oil parameters are specified using the SLGOF keyword
236  assert(!slgofTables.empty());
237 
238  extractUnscaledSlgof_(slgofTables.getTable<SlgofTable>(satRegionIdx));
239  }
240  }
241  else if (family2) {
242  extractUnscaledSwfn_(swfnTables.getTable<SwfnTable>(satRegionIdx));
243  extractUnscaledSgfn_(sgfnTables.getTable<SgfnTable>(satRegionIdx));
244  extractUnscaledSof3_(sof3Tables.getTable<Sof3Table>(satRegionIdx));
245 
246  // some consistency requirement mandated by the ECL documentation
247  assert(std::abs(Sowu - (1 - swfnTables.getTable<SwfnTable>(satRegionIdx).getSwColumn().front())) < 1e-30);
248  }
249  else {
250  throw std::domain_error("No valid saturation keyword family specified");
251  }
252 
253  }
254 #endif
255 
261  void extractScaled(const EclEpsGridProperties& epsProperties, unsigned cartesianCellIdx)
262  {
263  // overwrite the unscaled values with the values for the cell if it is
264  // explicitly specified by the corresponding keyword.
265  extractGridPropertyValue_(Swl, epsProperties.swl, cartesianCellIdx);
266  extractGridPropertyValue_(Sgl, epsProperties.sgl, cartesianCellIdx);
267  extractGridPropertyValue_(Swcr, epsProperties.swcr, cartesianCellIdx);
268  extractGridPropertyValue_(Sgcr, epsProperties.sgcr, cartesianCellIdx);
269  extractGridPropertyValue_(Sowcr, epsProperties.sowcr, cartesianCellIdx);
270  extractGridPropertyValue_(Sogcr, epsProperties.sogcr, cartesianCellIdx);
271  extractGridPropertyValue_(Swu, epsProperties.swu, cartesianCellIdx);
272  extractGridPropertyValue_(Sgu, epsProperties.sgu, cartesianCellIdx);
273 
274  extractGridPropertyValue_(maxPcow, epsProperties.pcw, cartesianCellIdx);
275  extractGridPropertyValue_(maxPcgo, epsProperties.pcg, cartesianCellIdx);
276 
277  extractGridPropertyValue_(maxKrw, epsProperties.krw, cartesianCellIdx);
278  extractGridPropertyValue_(maxKrg, epsProperties.krg, cartesianCellIdx);
279 
280  // quite likely that's wrong!
281  extractGridPropertyValue_(maxKrow, epsProperties.kro, cartesianCellIdx);
282  extractGridPropertyValue_(maxKrog, epsProperties.kro, cartesianCellIdx);
283  }
284 
285 private:
286 #if HAVE_OPM_PARSER
287  void extractUnscaledSgof_(const Opm::SgofTable& sgofTable)
288  {
289  // minimum gas and oil-in-gas-oil saturation
290  Sgl = sgofTable.getSgColumn().front();
291  Sogl = 1.0 - sgofTable.getSgColumn().back();
292 
293  // maximum gas and oil-in-gas-oil saturation
294  Sgu = sgofTable.getSgColumn().back();
295  Sogu = 1.0 - sgofTable.getSgColumn().front();
296 
297  // critical gas saturation
298  for (unsigned rowIdx = 0; rowIdx < sgofTable.numRows(); ++ rowIdx) {
299  if (sgofTable.getKrgColumn()[rowIdx] > 0) {
300  assert(rowIdx > 0);
301  Sgcr = sgofTable.getSgColumn()[rowIdx - 1];
302  break;
303  };
304  }
305 
306  // critical oil saturation of gas-oil system
307  for (int rowIdx = static_cast<int>(sgofTable.numRows()) - 1; rowIdx >= 0; -- rowIdx) {
308  if (sgofTable.getKrogColumn()[static_cast<size_t>(rowIdx)] > 0) {
309  assert(rowIdx < static_cast<int>(sgofTable.numRows()) - 1);
310  Sogcr = 1.0 - sgofTable.getSgColumn()[static_cast<unsigned>(rowIdx) + 1];
311  break;
312  };
313  }
314 
315  // maximum gas-oil capillary pressure
316  maxPcgo = sgofTable.getPcogColumn().back();
317 
318  // maximum gas-* relperms
319  maxKrg = sgofTable.getKrgColumn().back();
320  maxKrog = sgofTable.getKrogColumn().front();
321  }
322 
323  void extractUnscaledSlgof_(const Opm::SlgofTable& slgofTable)
324  {
325  // minimum gas and oil-in-gas-oil saturation
326  Sgl = 1.0 - slgofTable.getSlColumn().back();
327  Sogl = slgofTable.getSlColumn().front();
328 
329  assert(std::abs(Sgl) < 1e-10); // this is required in the documentation for SLGOF
330 
331  // maximum gas and oil-in-gas-oil saturation
332  Sgu = 1.0 - slgofTable.getSlColumn().front();
333  Sogu = slgofTable.getSlColumn().back();
334 
335  // critical gas saturation
336  for (int rowIdx = static_cast<int>(slgofTable.numRows()) - 1; rowIdx >= 0; -- rowIdx) {
337  if (slgofTable.getKrgColumn()[static_cast<size_t>(rowIdx)] > 0) {
338  assert(rowIdx < static_cast<int>(slgofTable.numRows()) - 1);
339  Sgcr = 1 - slgofTable.getSlColumn()[static_cast<unsigned>(rowIdx) + 1];
340  break;
341  };
342  }
343 
344  // critical oil saturation of gas-oil system
345  for (size_t rowIdx = 0; rowIdx < slgofTable.numRows(); ++ rowIdx) {
346  if (slgofTable.getKrogColumn()[rowIdx] > 0) {
347  assert(rowIdx > 0);
348  Sogcr = slgofTable.getSlColumn()[rowIdx - 1];
349  break;
350  };
351  }
352 
353  // maximum gas-oil capillary pressure
354  maxPcgo = slgofTable.getPcogColumn().front();
355 
356  // maximum gas-* relperms
357  maxKrg = slgofTable.getKrgColumn().front();
358  maxKrog = slgofTable.getKrogColumn().back();
359  }
360 
361  void extractUnscaledSwof_(const Opm::SwofTable& swofTable)
362  {
363  // connate saturations
364  Swl = swofTable.getSwColumn().front();
365  Sowl = 1.0 - swofTable.getSwColumn().back();
366 
367  // maximum water and oil-in-oil-water saturations
368  Swu = swofTable.getSwColumn().back();
369  Sowu = 1.0 - swofTable.getSwColumn().front();
370 
371  // critical water saturation
372  for (size_t rowIdx = 0; rowIdx < swofTable.numRows(); ++ rowIdx) {
373  if (swofTable.getKrwColumn()[rowIdx] > 0) {
374  assert(rowIdx > 0);
375  Swcr = swofTable.getSwColumn()[rowIdx - 1];
376  break;
377  };
378  }
379 
380  // critical oil saturation of oil-water system
381  for (int rowIdx = static_cast<int>(swofTable.numRows()) - 1; rowIdx >= 0; -- rowIdx) {
382  if (swofTable.getKrowColumn()[static_cast<size_t>(rowIdx)] > 0) {
383  assert(rowIdx < static_cast<int>(swofTable.numRows()) - 1);
384  Sowcr = 1.0 - swofTable.getSwColumn()[static_cast<unsigned>(rowIdx) + 1];
385  break;
386  };
387  }
388 
389  // maximum oil-water capillary pressures
390  maxPcow = swofTable.getPcowColumn().front();
391 
392  // maximum water-* relative permeabilities
393  maxKrw = swofTable.getKrwColumn().back();
394  maxKrow = swofTable.getKrowColumn().front();
395  }
396 
397  void extractUnscaledSwfn_(const Opm::SwfnTable& swfnTable)
398  {
399  // connate water saturation
400  Swl = swfnTable.getSwColumn().front();
401 
402  // maximum water saturation
403  Swu = swfnTable.getSwColumn().back();
404 
405  // critical water saturation
406  for (unsigned rowIdx = 0; rowIdx < swfnTable.numRows(); ++ rowIdx) {
407  if (swfnTable.getKrwColumn()[rowIdx] > 0) {
408  assert(rowIdx > 0);
409  Swcr = swfnTable.getSwColumn()[rowIdx - 1];
410  break;
411  };
412  }
413 
414  // maximum oil-water capillary pressure
415  maxPcow = swfnTable.getPcowColumn().front();
416 
417  // maximum water relative permeability
418  maxKrw = swfnTable.getKrwColumn().back();
419  }
420 
421  void extractUnscaledSgfn_(const Opm::SgfnTable& sgfnTable)
422  {
423  // connate gas saturation
424  Sgl = sgfnTable.getSgColumn().front();
425 
426  // maximum gas saturations
427  Sgu = sgfnTable.getSgColumn().back();
428  Sogu = 1 - sgfnTable.getSgColumn().front();
429 
430  // critical gas saturation
431  for (unsigned rowIdx = 0; rowIdx < sgfnTable.numRows(); ++ rowIdx) {
432  if (sgfnTable.getKrgColumn()[rowIdx] > 0) {
433  assert(rowIdx > 0);
434  Sgcr = sgfnTable.getSgColumn()[rowIdx - 1];
435  break;
436  };
437  }
438 
439  // maximum capillary pressure
440  maxPcgo = sgfnTable.getPcogColumn().back();
441 
442  // maximum relative gas permeability
443  maxKrg = sgfnTable.getKrgColumn().back();
444  }
445 
446  void extractUnscaledSof3_(const Opm::Sof3Table& sof3Table)
447  {
448  // connate oil saturations
449  Sowl = sof3Table.getSoColumn().front() + Sgl;
450  Sogl = sof3Table.getSoColumn().front() + Swl;
451 
452  // maximum oil saturations
453  Sowu = sof3Table.getSoColumn().back();
454 
455  // critical oil saturation of oil-water system
456  for (size_t rowIdx = 0 ; rowIdx < sof3Table.numRows(); ++ rowIdx) {
457  if (sof3Table.getKrowColumn()[rowIdx] > 0) {
458  assert(rowIdx > 0);
459  Sowcr = sof3Table.getSoColumn()[rowIdx - 1];
460  break;
461  };
462  }
463 
464  // critical oil saturation of gas-oil system
465  for (size_t rowIdx = 0 ; rowIdx < sof3Table.numRows(); ++ rowIdx) {
466  if (sof3Table.getKrogColumn()[rowIdx] > 0) {
467  assert(rowIdx > 0);
468  Sogcr = sof3Table.getSoColumn()[rowIdx - 1];
469  break;
470  };
471  }
472 
473  // maximum relative oil permeabilities
474  maxKrow = sof3Table.getKrowColumn().back();
475  maxKrog = sof3Table.getKrogColumn().back();
476  }
477 #endif // HAVE_OPM_PARSER
478 
479  void extractGridPropertyValue_(Scalar& targetValue,
480  const std::vector<double>* propData,
481  unsigned cartesianCellIdx)
482  {
483  if (!propData)
484  return;
485 
486  targetValue = (*propData)[cartesianCellIdx];
487  }
488 };
489 
496 template <class Scalar>
498 {
499 public:
504  const EclEpsConfig& config,
505  EclTwoPhaseSystemType epsSystemType)
506  {
507  if (epsSystemType == EclOilWaterSystem) {
508  // saturation scaling for capillary pressure
509  saturationPcPoints_[0] = epsInfo.Swl;
510  saturationPcPoints_[1] = epsInfo.Swu;
511 
512  // krw saturation scaling endpoints
513  if (config.enableThreePointKrSatScaling()) {
514  saturationKrwPoints_[0] = epsInfo.Swcr;
515  saturationKrwPoints_[1] = 1.0 - epsInfo.Sowcr - epsInfo.Sgl;
516  saturationKrwPoints_[2] = epsInfo.Swu;
517  }
518  else {
519  saturationKrwPoints_[0] = epsInfo.Swcr;
520  saturationKrwPoints_[1] = epsInfo.Swu;
521  }
522 
523  // krn saturation scaling endpoints (with the non-wetting phase being oil).
524  // because opm-material specifies non-wetting phase relperms in terms of the
525  // wetting phase saturations, the code here uses 1 minus the values specified
526  // by the Eclipse TD and the order of the scaling points is reversed
527  if (config.enableThreePointKrSatScaling()) {
528  saturationKrnPoints_[2] = 1.0 - epsInfo.Sowcr;
529  saturationKrnPoints_[1] = epsInfo.Swcr + epsInfo.Sgl;
530  saturationKrnPoints_[0] = epsInfo.Swl + epsInfo.Sgl;
531  }
532  else {
533  saturationKrnPoints_[1] = 1 - epsInfo.Sowcr;
534  saturationKrnPoints_[0] = epsInfo.Swl + epsInfo.Sgl;
535  }
536 
537  maxPcnw_ = epsInfo.maxPcow;
538  maxKrw_ = epsInfo.maxKrw;
539  maxKrn_ = epsInfo.maxKrow;
540  }
541  else {
542  assert(epsSystemType == EclGasOilSystem);
543 
544  // saturation scaling for capillary pressure
545  saturationPcPoints_[0] = 1.0 - epsInfo.Sgu;
546  saturationPcPoints_[1] = 1.0 - epsInfo.Sgl;
547 
548  // krw saturation scaling endpoints
549  if (config.enableThreePointKrSatScaling()) {
550  saturationKrwPoints_[0] = epsInfo.Sogcr;
551  saturationKrwPoints_[1] = 1 - epsInfo.Sgcr - epsInfo.Swl;
552  saturationKrwPoints_[2] = 1 - epsInfo.Swl - epsInfo.Sgl;
553  }
554  else {
555  saturationKrwPoints_[0] = epsInfo.Sogcr;
556  saturationKrwPoints_[1] = 1 - epsInfo.Swl - epsInfo.Sgl;
557  }
558 
559  // krn saturation scaling endpoints (with the non-wetting phase being gas).
560  // because opm-material specifies non-wetting phase relperms in terms of the
561  // wetting phase saturations, the code here uses 1 minus the values specified
562  // by the Eclipse TD and the order of the scaling points is reversed
563  if (config.enableThreePointKrSatScaling()) {
564  saturationKrnPoints_[2] = 1.0 - epsInfo.Sgcr;
565  saturationKrnPoints_[1] = epsInfo.Sogcr + epsInfo.Swl;
566  saturationKrnPoints_[0] = 1.0 - epsInfo.Sgu;
567  }
568  else {
569  saturationKrnPoints_[1] = 1.0 - epsInfo.Sgcr;
570  saturationKrnPoints_[0] = 1.0 - epsInfo.Sgu;
571  }
572 
573  maxPcnw_ = epsInfo.maxPcgo;
574  maxKrw_ = epsInfo.maxKrog;
575  maxKrn_ = epsInfo.maxKrg;
576  }
577  }
578 
582  void setSaturationPcPoint(unsigned pointIdx, Scalar value)
583  { saturationPcPoints_[pointIdx] = value; }
584 
588  const std::array<Scalar, 2>& saturationPcPoints() const
589  { return saturationPcPoints_; }
590 
594  void setSaturationKrwPoint(unsigned pointIdx, Scalar value)
595  { saturationKrwPoints_[pointIdx] = value; }
596 
600  const std::array<Scalar, 3>& saturationKrwPoints() const
601  { return saturationKrwPoints_; }
602 
606  void setSaturationKrnPoint(unsigned pointIdx, Scalar value)
607  { saturationKrnPoints_[pointIdx] = value; }
608 
612  const std::array<Scalar, 3>& saturationKrnPoints() const
613  { return saturationKrnPoints_; }
614 
618  void setMaxPcnw(Scalar value)
619  { maxPcnw_ = value; }
620 
624  Scalar maxPcnw() const
625  { return maxPcnw_; }
626 
630  void setMaxKrw(Scalar value)
631  { maxKrw_ = value; }
632 
636  Scalar maxKrw() const
637  { return maxKrw_; }
638 
642  void setMaxKrn(Scalar value)
643  { maxKrn_ = value; }
644 
648  Scalar maxKrn() const
649  { return maxKrn_; }
650 
651  void print() const
652  {
653  std::cout << " saturationKrnPoints_[0]: " << saturationKrnPoints_[0] << "\n"
654  << " saturationKrnPoints_[1]: " << saturationKrnPoints_[1] << "\n"
655  << " saturationKrnPoints_[2]: " << saturationKrnPoints_[2] << "\n";
656  }
657 
658 private:
659  // The the points used for the "y-axis" scaling of capillary pressure
660  Scalar maxPcnw_;
661 
662  // The the points used for the "y-axis" scaling of wetting phase relative permability
663  Scalar maxKrw_;
664 
665  // The the points used for the "y-axis" scaling of non-wetting phase relative permability
666  Scalar maxKrn_;
667 
668  // The the points used for saturation ("x-axis") scaling of capillary pressure
669  std::array<Scalar, 2> saturationPcPoints_;
670 
671  // The the points used for saturation ("x-axis") scaling of wetting phase relative permeability
672  std::array<Scalar, 3> saturationKrwPoints_;
673 
674  // The the points used for saturation ("x-axis") scaling of non-wetting phase relative permeability
675  std::array<Scalar, 3> saturationKrnPoints_;
676 };
677 
678 } // namespace Opm
679 
680 #endif
Scalar Sowl
Definition: EclEpsScalingPoints.hpp:127
void init(const EclEpsScalingPointsInfo< Scalar > &epsInfo, const EclEpsConfig &config, EclTwoPhaseSystemType epsSystemType)
Assigns the scaling points which actually ought to be used.
Definition: EclEpsScalingPoints.hpp:503
void setSaturationPcPoint(unsigned pointIdx, Scalar value)
Sets an saturation value for capillary pressure saturation scaling.
Definition: EclEpsScalingPoints.hpp:582
void setMaxKrw(Scalar value)
Sets the maximum wetting phase relative permeability.
Definition: EclEpsScalingPoints.hpp:630
Scalar Sgcr
Definition: EclEpsScalingPoints.hpp:132
EclTwoPhaseSystemType
Specified which fluids are involved in a given twophase material law for endpoint scaling...
Definition: EclEpsConfig.hpp:42
const DoubleData * sogcr
Definition: EclEpsScalingPoints.hpp:90
void setMaxPcnw(Scalar value)
Sets the maximum capillary pressure.
Definition: EclEpsScalingPoints.hpp:618
const DoubleData * swu
Definition: EclEpsScalingPoints.hpp:91
Scalar maxKrw() const
Returns the maximum wetting phase relative permeability.
Definition: EclEpsScalingPoints.hpp:636
const IntData * satnum
Definition: EclEpsScalingPoints.hpp:83
Definition: Air_Mesitylene.hpp:31
const DoubleData * sgl
Definition: EclEpsScalingPoints.hpp:86
Collects all grid properties which are relevant for end point scaling.
Definition: EclEpsScalingPoints.hpp:49
Scalar Sgu
Definition: EclEpsScalingPoints.hpp:138
Scalar Sogl
Definition: EclEpsScalingPoints.hpp:128
const DoubleData * krw
Definition: EclEpsScalingPoints.hpp:95
Scalar Swl
Definition: EclEpsScalingPoints.hpp:125
Represents the points on the X and Y axis to be scaled if endpoint scaling is used.
Definition: EclEpsScalingPoints.hpp:497
Scalar maxKrw
Definition: EclEpsScalingPoints.hpp:147
const DoubleData * kro
Definition: EclEpsScalingPoints.hpp:96
Scalar maxPcgo
Definition: EclEpsScalingPoints.hpp:144
const DoubleData * swl
Definition: EclEpsScalingPoints.hpp:85
const std::array< Scalar, 2 > & saturationPcPoints() const
Returns the points used for capillary pressure saturation scaling.
Definition: EclEpsScalingPoints.hpp:588
Scalar maxPcow
Definition: EclEpsScalingPoints.hpp:143
Scalar maxKrow
Definition: EclEpsScalingPoints.hpp:148
Scalar maxKrog
Definition: EclEpsScalingPoints.hpp:149
const DoubleData * sowcr
Definition: EclEpsScalingPoints.hpp:89
This structure represents all values which can be possibly used as scaling points in the endpoint sca...
Definition: EclEpsScalingPoints.hpp:122
Scalar maxKrg
Definition: EclEpsScalingPoints.hpp:150
Scalar Sowcr
Definition: EclEpsScalingPoints.hpp:133
void print() const
Definition: EclEpsScalingPoints.hpp:651
Scalar maxPcnw() const
Returns the maximum capillary pressure.
Definition: EclEpsScalingPoints.hpp:624
Scalar Swcr
Definition: EclEpsScalingPoints.hpp:131
Scalar Sogcr
Definition: EclEpsScalingPoints.hpp:134
const DoubleData * pcw
Definition: EclEpsScalingPoints.hpp:93
Evaluation< Scalar, VarSetTag, numVars > abs(const Evaluation< Scalar, VarSetTag, numVars > &)
Definition: Math.hpp:41
Definition: EclEpsConfig.hpp:44
void setSaturationKrnPoint(unsigned pointIdx, Scalar value)
Sets an saturation value for non-wetting phase relperm saturation scaling.
Definition: EclEpsScalingPoints.hpp:606
const DoubleData * sgu
Definition: EclEpsScalingPoints.hpp:92
bool enableThreePointKrSatScaling() const
Returns whether three point saturation scaling is enabled for the relative permeabilities.
Definition: EclEpsConfig.hpp:90
void setSaturationKrwPoint(unsigned pointIdx, Scalar value)
Sets an saturation value for wetting-phase relperm saturation scaling.
Definition: EclEpsScalingPoints.hpp:594
const std::array< Scalar, 3 > & saturationKrnPoints() const
Returns the points used for non-wetting phase relperm saturation scaling.
Definition: EclEpsScalingPoints.hpp:612
const DoubleData * pcg
Definition: EclEpsScalingPoints.hpp:94
Scalar Sowu
Definition: EclEpsScalingPoints.hpp:139
Specifies the configuration used by the endpoint scaling code.
Definition: EclEpsConfig.hpp:54
Scalar maxKrn() const
Returns the maximum wetting phase relative permeability.
Definition: EclEpsScalingPoints.hpp:648
const DoubleData * swcr
Definition: EclEpsScalingPoints.hpp:87
void setMaxKrn(Scalar value)
Sets the maximum wetting phase relative permeability.
Definition: EclEpsScalingPoints.hpp:642
Scalar Sogu
Definition: EclEpsScalingPoints.hpp:140
Specifies the configuration used by the endpoint scaling code.
const DoubleData * krg
Definition: EclEpsScalingPoints.hpp:97
Scalar Swu
Definition: EclEpsScalingPoints.hpp:137
Definition: EclEpsConfig.hpp:43
void extractScaled(const EclEpsGridProperties &epsProperties, unsigned cartesianCellIdx)
Extract the values of the scaled scaling parameters.
Definition: EclEpsScalingPoints.hpp:261
const DoubleData * sgcr
Definition: EclEpsScalingPoints.hpp:88
void print() const
Definition: EclEpsScalingPoints.hpp:152
const std::array< Scalar, 3 > & saturationKrwPoints() const
Returns the points used for wetting phase relperm saturation scaling.
Definition: EclEpsScalingPoints.hpp:600
Scalar Sgl
Definition: EclEpsScalingPoints.hpp:126