SaturationPropsFromDeck.hpp
1 /*
2  Copyright 2010, 2011, 2012 SINTEF ICT, Applied Mathematics.
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_SATURATIONPROPSFROMDECK_HEADER_INCLUDED
21 #define OPM_SATURATIONPROPSFROMDECK_HEADER_INCLUDED
22 
23 #include <opm/core/props/satfunc/SaturationPropsInterface.hpp>
24 #include <opm/core/utility/parameters/ParameterGroup.hpp>
25 #include <opm/core/props/BlackoilPhases.hpp>
26 #include <opm/core/props/phaseUsageFromDeck.hpp>
27 #include <opm/core/grid.h>
28 
29 #include <opm/parser/eclipse/Deck/Deck.hpp>
30 #include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
31 
32 #include <vector>
33 
34 struct UnstructuredGrid;
35 
36 namespace Opm
37 {
38 
39  // Forward declaring the EclMaterialLawManager template.
40  template <class ScalarT, int wettingPhaseIdxV, int nonWettingasPhaseIdxV, int gasPhaseIdxV>
42  template <class Traits>
44 
45 
48  {
49  public:
50  typedef Opm::ThreePhaseMaterialTraits<double,
51  /*wettingPhaseIdx=*/BlackoilPhases::Aqua,
52  /*nonWettingPhaseIdx=*/BlackoilPhases::Liquid,
53  /*gasPhaseIdx=*/BlackoilPhases::Vapour> MaterialTraits;
55 
58 
62  void init(const PhaseUsage& phaseUsage,
63  std::shared_ptr<MaterialLawManager> materialLawManager);
64 
65 
69  void init(const Opm::Deck& deck,
70  std::shared_ptr<MaterialLawManager> materialLawManager)
71  {
72  init(Opm::phaseUsageFromDeck(deck), materialLawManager);
73  }
74 
76  int numPhases() const;
77 
87  void relperm(const int n,
88  const double* s,
89  const int* cells,
90  double* kr,
91  double* dkrds) const;
92 
102  void capPress(const int n,
103  const double* s,
104  const int* cells,
105  double* pc,
106  double* dpcds) const;
107 
112  void satRange(const int n,
113  const int* cells,
114  double* smin,
115  double* smax) const;
116 
120  void updateSatHyst(const int n,
121  const int* cells,
122  const double* s);
123 
128  void setGasOilHystParams(const int n,
129  const int* cells,
130  const double* pcswmdc,
131  const double* krnswdc);
132 
137  void getGasOilHystParams(const int n,
138  const int* cells,
139  double* pcswmdc,
140  double* krnswdc) const;
141 
146  void setOilWaterHystParams(const int n,
147  const int* cells,
148  const double* pcswmdc,
149  const double* krnswdc);
150 
155  void getOilWaterHystParams(const int n,
156  const int* cells,
157  double* pcswmdc,
158  double* krnswdc) const;
159 
164  void swatInitScaling(const int cell,
165  const double pcow,
166  double & swat);
167 
169  const MaterialLawManager& materialLawManager() const { return *materialLawManager_; }
170 
171 
172  private:
173  std::shared_ptr<MaterialLawManager> materialLawManager_;
174  PhaseUsage phaseUsage_;
175  };
176 
177 
178 
179 } // namespace Opm
180 
181 #endif // OPM_SATURATIONPROPSFROMDECK_HEADER_INCLUDED
void setGasOilHystParams(const int n, const int *cells, const double *pcswmdc, const double *krnswdc)
Set hysteresis parameters for gas-oil.
Definition: SaturationPropsFromDeck.cpp:278
void satRange(const int n, const int *cells, double *smin, double *smax) const
Obtain the range of allowable saturation values.
Definition: SaturationPropsFromDeck.cpp:212
void init(const Opm::Deck &deck, std::shared_ptr< MaterialLawManager > materialLawManager)
Initialize from deck and MaterialLawManager.
Definition: SaturationPropsFromDeck.hpp:69
Definition: SaturationPropsFromDeck.hpp:41
int numPhases() const
Definition: SaturationPropsFromDeck.cpp:56
void getOilWaterHystParams(const int n, const int *cells, double *pcswmdc, double *krnswdc) const
Get hysteresis parameters for oil-water.
Definition: SaturationPropsFromDeck.cpp:339
SaturationPropsFromDeck()
Default constructor.
Definition: SaturationPropsFromDeck.cpp:43
void setOilWaterHystParams(const int n, const int *cells, const double *pcswmdc, const double *krnswdc)
Set hysteresis parameters for oil-water.
Definition: SaturationPropsFromDeck.cpp:321
Definition: AnisotropicEikonal.cpp:446
Interface to saturation functions from deck.
Definition: SaturationPropsFromDeck.hpp:47
void relperm(const int n, const double *s, const int *cells, double *kr, double *dkrds) const
Relative permeability.
Definition: SaturationPropsFromDeck.cpp:74
void init(const PhaseUsage &phaseUsage, std::shared_ptr< MaterialLawManager > materialLawManager)
Initialize from a MaterialLawManager object.
Definition: SaturationPropsFromDeck.cpp:48
Definition: BlackoilPhases.hpp:36
void getGasOilHystParams(const int n, const int *cells, double *pcswmdc, double *krnswdc) const
Get hysteresis parameters for gas-oil.
Definition: SaturationPropsFromDeck.cpp:296
Definition: SaturationPropsInterface.hpp:29
void capPress(const int n, const double *s, const int *cells, double *pc, double *dpcds) const
Capillary pressure.
Definition: SaturationPropsFromDeck.cpp:133
void updateSatHyst(const int n, const int *cells, const double *s)
Update saturation state for the hysteresis tracking.
Definition: SaturationPropsFromDeck.cpp:255
void swatInitScaling(const int cell, const double pcow, double &swat)
Update capillary pressure scaling according to pressure diff.
Definition: SaturationPropsFromDeck.cpp:365
const MaterialLawManager & materialLawManager() const
Returns a reference to the MaterialLawManager.
Definition: SaturationPropsFromDeck.hpp:169
Definition: SaturationPropsFromDeck.hpp:43