ECLEndPointScaling.hpp
Go to the documentation of this file.
1/*
2 Copyright 2017 Statoil ASA.
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 OPM_ECLENDPOINTSCALING_HEADER_INCLUDED
21#define OPM_ECLENDPOINTSCALING_HEADER_INCLUDED
22
24
25#include <functional>
26#include <memory>
27#include <string>
28#include <vector>
29
30namespace Opm {
31
32 class ECLGraph;
33 class ECLInitFileData;
34
35} // namespace Opm
36
37namespace Opm { namespace SatFunc {
38
41 {
42 public:
52 double low;
53
55 double disp;
56
58 double high;
59 };
60
64 std::vector<int>::size_type cell;
65
67 double sat;
68 };
69
71 using SaturationPoints = std::vector<SaturationAssoc>;
72
86 virtual std::vector<double>
87 eval(const TableEndPoints& tep,
88 const SaturationPoints& sp) const = 0;
89
106 virtual std::vector<double>
108 const SaturationPoints& sp) const = 0;
109
111 virtual std::unique_ptr<EPSEvalInterface> clone() const = 0;
112
115 };
116
120 {
121 public:
123 struct Point {
124 double sat;
125 double val;
126 };
127
130 };
131
134
137
151 virtual std::vector<double>
153 const SaturationPoints& sp,
154 const std::vector<double>& val) const = 0;
155
157 virtual std::unique_ptr<VerticalScalingInterface> clone() const = 0;
158
161 };
162
166 {
167 public:
177 TwoPointScaling(std::vector<double> smin,
178 std::vector<double> smax);
179
182
187
194
205
214
232 virtual std::vector<double>
234 const SaturationPoints& sp) const override;
235
254 virtual std::vector<double>
256 const SaturationPoints& sp) const override;
257
259 virtual std::unique_ptr<EPSEvalInterface> clone() const override;
260
261 private:
263 class Impl;
264
266 std::unique_ptr<Impl> pImpl_;
267 };
268
276 {
277 public:
288 explicit PureVerticalScaling(std::vector<double> fmax);
289
292
295
298
301
304
320 virtual std::vector<double>
322 const SaturationPoints& sp,
323 const std::vector<double>& val) const override;
324
326 virtual std::unique_ptr<VerticalScalingInterface>
327 clone() const override;
328
329 private:
331 class Impl;
332
334 std::unique_ptr<Impl> pImpl_;
335 };
336
340 {
341 public:
354 ThreePointScaling(std::vector<double> smin,
355 std::vector<double> sdisp,
356 std::vector<double> smax);
357
360
365
372
383
392
410 virtual std::vector<double>
412 const SaturationPoints& sp) const override;
413
432 virtual std::vector<double>
434 const SaturationPoints& sp) const override;
435
437 virtual std::unique_ptr<EPSEvalInterface> clone() const override;
438
439 private:
441 class Impl;
442
444 std::unique_ptr<Impl> pImpl_;
445 };
446
454 {
455 public:
457 explicit CritSatVerticalScaling(std::vector<double> sdisp,
458 std::vector<double> fdisp,
459 std::vector<double> smax,
460 std::vector<double> fmax);
461
464
467
470
473
476
492 virtual std::vector<double>
494 const SaturationPoints& sp,
495 const std::vector<double>& val) const override;
496
498 virtual std::unique_ptr<VerticalScalingInterface>
499 clone() const override;
500
501 private:
503 class Impl;
504
506 std::unique_ptr<Impl> pImpl_;
507 };
508
512 {
514 enum class FunctionCategory {
517 Relperm,
518
520 CapPress,
521 };
522
525 enum class SubSystem {
527 OilWater,
528
530 OilGas,
531 };
532
534 struct EPSOptions {
539
542
545
564 };
565
569 struct Connate {
572 std::vector<double> oil;
573
576 std::vector<double> gas;
577
580 std::vector<double> water;
581 };
582
586 struct Critical {
589 std::vector<double> oil_in_gas;
590
593 std::vector<double> oil_in_water;
594
597 std::vector<double> gas;
598
601 std::vector<double> water;
602 };
603
605 struct Maximum {
608 std::vector<double> oil;
609
612 std::vector<double> gas;
613
616 std::vector<double> water;
617 };
618
622
625
629 };
630
633 struct Horizontal {
652 static std::unique_ptr<EPSEvalInterface>
654 const ECLInitFileData& init,
655 const EPSOptions& opt,
656 const RawTableEndPoints& tep);
657
676 static std::vector<EPSEvalInterface::TableEndPoints>
678 const RawTableEndPoints& ep);
679 };
680
683 struct Vertical {
684 using SatFuncEvaluator = std::function<double(int, double)>;
685 using FuncValVector = std::vector<
687
714 static std::unique_ptr<VerticalScalingInterface>
716 const ECLInitFileData& init,
717 const EPSOptions& opt,
718 const RawTableEndPoints& tep,
719 const FuncValVector& fvals);
720
739 static std::vector<VerticalScalingInterface::FunctionValues>
741 const ECLInitFileData& init,
742 const RawTableEndPoints& ep,
743 const EPSOptions& opt,
744 const SatFuncEvaluator& evalSF);
745 };
746 };
747
748 std::vector<double>
750 const ECLInitFileData& init,
752
753 std::vector<double>
755 const ECLInitFileData& init,
757}} // namespace Opm::SatFunc
758
759#endif // OPM_ECLENDPOINTSCALING_HEADER_INCLUDED
Definition: ECLGraph.hpp:52
Definition: ECLResultData.hpp:177
Definition: ECLEndPointScaling.hpp:454
CritSatVerticalScaling & operator=(const CritSatVerticalScaling &rhs)
Assignment operator.
virtual std::vector< double > vertScale(const FunctionValues &f, const SaturationPoints &sp, const std::vector< double > &val) const override
virtual ~CritSatVerticalScaling()
Destructor.
virtual std::unique_ptr< VerticalScalingInterface > clone() const override
Virtual copy constructor.
CritSatVerticalScaling(const CritSatVerticalScaling &rhs)
Copy constructor.
CritSatVerticalScaling & operator=(CritSatVerticalScaling &&rhs)
Move assignment operator.
CritSatVerticalScaling(std::vector< double > sdisp, std::vector< double > fdisp, std::vector< double > smax, std::vector< double > fmax)
Constructor.
CritSatVerticalScaling(CritSatVerticalScaling &&rhs)
Move constructor.
Protocol for computing scaled saturation values.
Definition: ECLEndPointScaling.hpp:41
virtual std::unique_ptr< EPSEvalInterface > clone() const =0
Virtual copy constructor.
std::vector< SaturationAssoc > SaturationPoints
Convenience type alias.
Definition: ECLEndPointScaling.hpp:71
virtual std::vector< double > eval(const TableEndPoints &tep, const SaturationPoints &sp) const =0
virtual std::vector< double > reverse(const TableEndPoints &tep, const SaturationPoints &sp) const =0
virtual ~EPSEvalInterface()
Destructor. Must be virtual.
Definition: ECLEndPointScaling.hpp:276
virtual std::vector< double > vertScale(const FunctionValues &f, const SaturationPoints &sp, const std::vector< double > &val) const override
PureVerticalScaling & operator=(const PureVerticalScaling &rhs)
Assignment operator.
PureVerticalScaling & operator=(PureVerticalScaling &&rhs)
Move assignment operator.
PureVerticalScaling(std::vector< double > fmax)
PureVerticalScaling(PureVerticalScaling &&rhs)
Move constructor.
virtual ~PureVerticalScaling()
Destructor.
virtual std::unique_ptr< VerticalScalingInterface > clone() const override
Virtual copy constructor.
PureVerticalScaling(const PureVerticalScaling &rhs)
Copy constructor.
Definition: ECLEndPointScaling.hpp:340
virtual std::unique_ptr< EPSEvalInterface > clone() const override
Virtual copy constructor.
ThreePointScaling(ThreePointScaling &&rhs)
ThreePointScaling(std::vector< double > smin, std::vector< double > sdisp, std::vector< double > smax)
ThreePointScaling(const ThreePointScaling &rhs)
virtual std::vector< double > reverse(const TableEndPoints &tep, const SaturationPoints &sp) const override
ThreePointScaling & operator=(ThreePointScaling &&rhs)
virtual std::vector< double > eval(const TableEndPoints &tep, const SaturationPoints &sp) const override
ThreePointScaling & operator=(const ThreePointScaling &rhs)
Definition: ECLEndPointScaling.hpp:166
TwoPointScaling(TwoPointScaling &&rhs)
TwoPointScaling & operator=(const TwoPointScaling &rhs)
virtual std::unique_ptr< EPSEvalInterface > clone() const override
Virtual copy constructor.
TwoPointScaling & operator=(TwoPointScaling &&rhs)
virtual std::vector< double > reverse(const TableEndPoints &tep, const SaturationPoints &sp) const override
TwoPointScaling(std::vector< double > smin, std::vector< double > smax)
TwoPointScaling(const TwoPointScaling &rhs)
virtual std::vector< double > eval(const TableEndPoints &tep, const SaturationPoints &sp) const override
Definition: ECLEndPointScaling.hpp:120
EPSEvalInterface::SaturationPoints SaturationPoints
Convenience type alias.
Definition: ECLEndPointScaling.hpp:136
virtual std::vector< double > vertScale(const FunctionValues &f, const SaturationPoints &sp, const std::vector< double > &val) const =0
virtual ~VerticalScalingInterface()
Destructor. Must be virtual.
virtual std::unique_ptr< VerticalScalingInterface > clone() const =0
Virtual copy constructor.
std::function< double(double, double)> function
Definition: Operate.hpp:28
std::vector< double > scaledConnateGas(const ECLGraph &G, const ECLInitFileData &init, const CreateEPS::RawTableEndPoints &tep)
std::vector< double > scaledConnateWater(const ECLGraph &G, const ECLInitFileData &init, const CreateEPS::RawTableEndPoints &tep)
std::vector< double > init(const std::string &kewyord, const TableManager &tables, const Phases &phases, const std::vector< double > &cell_depth, const std::vector< int > &num, const std::vector< int > &endnum)
Definition: A.hpp:4
ECLPhaseIndex
Definition: ECLPhaseIndex.hpp:28
Set of options that uniquely define a single EPS operation.
Definition: ECLEndPointScaling.hpp:534
SubSystem subSys
Part of global fluid system for which to create an EPS.
Definition: ECLEndPointScaling.hpp:544
bool use3PtScaling
Definition: ECLEndPointScaling.hpp:538
::Opm::ECLPhaseIndex thisPh
Definition: ECLEndPointScaling.hpp:563
FunctionCategory curve
Curve-type for which to create an EPS.
Definition: ECLEndPointScaling.hpp:541
Definition: ECLEndPointScaling.hpp:633
static std::unique_ptr< EPSEvalInterface > fromECLOutput(const ECLGraph &G, const ECLInitFileData &init, const EPSOptions &opt, const RawTableEndPoints &tep)
static std::vector< EPSEvalInterface::TableEndPoints > unscaledEndPoints(const EPSOptions &opt, const RawTableEndPoints &ep)
Collection of connate (minimum) saturation end points.
Definition: ECLEndPointScaling.hpp:569
std::vector< double > gas
Definition: ECLEndPointScaling.hpp:576
std::vector< double > oil
Definition: ECLEndPointScaling.hpp:572
std::vector< double > water
Definition: ECLEndPointScaling.hpp:580
Definition: ECLEndPointScaling.hpp:586
std::vector< double > oil_in_water
Definition: ECLEndPointScaling.hpp:593
std::vector< double > oil_in_gas
Definition: ECLEndPointScaling.hpp:589
std::vector< double > water
Definition: ECLEndPointScaling.hpp:601
std::vector< double > gas
Definition: ECLEndPointScaling.hpp:597
Collection of maximum saturation end points.
Definition: ECLEndPointScaling.hpp:605
std::vector< double > oil
Definition: ECLEndPointScaling.hpp:608
std::vector< double > gas
Definition: ECLEndPointScaling.hpp:612
std::vector< double > water
Definition: ECLEndPointScaling.hpp:616
Collection of raw saturation table end points.
Definition: ECLEndPointScaling.hpp:567
Connate conn
Definition: ECLEndPointScaling.hpp:621
Maximum smax
Definition: ECLEndPointScaling.hpp:628
Critical crit
Critical saturations for all tabulated saturation functions.
Definition: ECLEndPointScaling.hpp:624
Definition: ECLEndPointScaling.hpp:683
static std::unique_ptr< VerticalScalingInterface > fromECLOutput(const ECLGraph &G, const ECLInitFileData &init, const EPSOptions &opt, const RawTableEndPoints &tep, const FuncValVector &fvals)
std::vector< VerticalScalingInterface::FunctionValues > FuncValVector
Definition: ECLEndPointScaling.hpp:686
static std::vector< VerticalScalingInterface::FunctionValues > unscaledFunctionValues(const ECLGraph &G, const ECLInitFileData &init, const RawTableEndPoints &ep, const EPSOptions &opt, const SatFuncEvaluator &evalSF)
std::function< double(int, double)> SatFuncEvaluator
Definition: ECLEndPointScaling.hpp:684
Definition: ECLEndPointScaling.hpp:512
FunctionCategory
Category of function for which to create an EPS evaluator.
Definition: ECLEndPointScaling.hpp:514
SubSystem
Definition: ECLEndPointScaling.hpp:525
Associate a saturation value to a specific cell.
Definition: ECLEndPointScaling.hpp:62
std::vector< int >::size_type cell
Cell to which to connect a saturation value.
Definition: ECLEndPointScaling.hpp:64
double sat
Saturation value.
Definition: ECLEndPointScaling.hpp:67
Definition: ECLEndPointScaling.hpp:45
double disp
Displacing saturation (3-pt option only).
Definition: ECLEndPointScaling.hpp:55
double high
Maximum (high) saturation point.
Definition: ECLEndPointScaling.hpp:58
double low
Definition: ECLEndPointScaling.hpp:52
double val
Definition: ECLEndPointScaling.hpp:125
double sat
Definition: ECLEndPointScaling.hpp:124
Definition: ECLEndPointScaling.hpp:122
Point max
Definition: ECLEndPointScaling.hpp:129
Point disp
Definition: ECLEndPointScaling.hpp:128