OpenCAEPoro  0.2.0 Sep/22/2022
A simulator for multicomponent porous media flow
MixtureBO.hpp
Go to the documentation of this file.
1 
12 #ifndef __BOMIXTURE_HEADER__
13 #define __BOMIXTURE_HEADER__
14 
15 #include <cmath>
16 
17 // OpenCAEPoro header files
18 #include "Mixture.hpp"
19 #include "OCPTable.hpp"
20 
22 class BOMixture : public Mixture
23 {
24 public:
25  BOMixture() = default;
26  void BOMixtureInit(const ParamReservoir& rs_param);
27 
28  // return gamma
29  virtual OCP_DBL GammaPhaseO(const OCP_DBL& Pin, const OCP_DBL& Pbbin) override { OCP_ABORT("Should not be used here!"); return 0; };
30  virtual OCP_DBL GammaPhaseG(const OCP_DBL& Pin) override { OCP_ABORT("Should not be used here!"); return 0; };
31  virtual OCP_DBL GammaPhaseW(const OCP_DBL& Pin) override { OCP_ABORT("Should not be used here!"); return 0; };
32  OCP_DBL GammaPhaseOG(const OCP_DBL& Pin, const OCP_DBL& Tin,
33  const OCP_DBL* Ziin) override
34  {
35  OCP_ABORT("Should not be used in Black Oil mode!"); return 0;
36  };
37 
38  // usless in BLKOIL
39  USI GetFtype() override { OCP_ABORT("Should not be used in Black Oil mode!"); return 100; }
40  OCP_SIN GetMinEigenSkip() override { OCP_ABORT("Should not be used in Black Oil mode!"); return 0; }
41  bool GetFlagSkip() override { OCP_ABORT("Should not be used in Black Oil mode!"); return false; }
42  OCP_DBL GetSurTen() override { OCP_ABORT("Should not be used in Black Oil mode!"); return 0; }
43  OCP_DBL GetErrorPEC() override { OCP_ABORT("Should not be used in Black Oil mode!"); return 0; }
44  OCP_ULL GetSSMSTAiters() override { OCP_ABORT("Should not be used in Black Oil mode!"); return 0;
45  }
46  OCP_ULL GetNRSTAiters() override { OCP_ABORT("Should not be used in Black Oil mode!"); return 0;
47  }
48  OCP_ULL GetSSMSPiters() override { OCP_ABORT("Should not be used in Black Oil mode!"); return 0;
49  }
50  OCP_ULL GetNRSPiters() override { OCP_ABORT("Should not be used in Black Oil mode!"); return 0;
51  }
52  OCP_ULL GetRRiters() override { OCP_ABORT("Should not be used in Black Oil mode!"); return 0;
53  }
54  OCP_ULL GetSSMSTAcounts() override {
55  OCP_ABORT("Should not be used in Black Oil mode!"); return 0;
56  }
57  OCP_ULL GetNRSTAcounts() override {
58  OCP_ABORT("Should not be used in Black Oil mode!"); return 0;
59  }
60  OCP_ULL GetSSMSPcounts() override {
61  OCP_ABORT("Should not be used in Black Oil mode!"); return 0;
62  }
63  OCP_ULL GetNRSPcounts() override {
64  OCP_ABORT("Should not be used in Black Oil mode!"); return 0;
65  }
66  OCP_ULL GetRRcounts() override {
67  OCP_ABORT("Should not be used in Black Oil mode!"); return 0;
68  }
69 
70 protected:
71  // USI mixtureType; ///< indicates the type of mixture, black oil or compositional or
73  // std_Gamma* = std_Rho* * GRAVITY_FACTOR.
74  // only one of rho and gamma is needed, the other will be calculated from it.
81 };
82 
84 // BOMixture_W
86 
87 class BOMixture_W : public BOMixture
88 {
89 public:
90 
91  BOMixture_W() = default;
92  BOMixture_W(const ParamReservoir& rs_param, const USI& i) { OCP_ABORT("Not Completed!"); };
93 
94  void InitFlash(const OCP_DBL& Pin, const OCP_DBL& Pbbin, const OCP_DBL& Tin,
95  const OCP_DBL* Sjin, const OCP_DBL& Vpore,
96  const OCP_DBL* Ziin) override {
97  OCP_ABORT("Not Completed!");
98  };
99  void InitFlashDer(const OCP_DBL& Pin, const OCP_DBL& Pbbin, const OCP_DBL& Tin,
100  const OCP_DBL* Sjin, const OCP_DBL& Vpore,
101  const OCP_DBL* Ziin) override
102  {
103  OCP_ABORT("Not Used!");
104  };
105  void InitFlashDer_n(const OCP_DBL& Pin, const OCP_DBL& Pbbin,
106  const OCP_DBL& Tin, const OCP_DBL* Sjin, const OCP_DBL& Vpore,
107  const OCP_DBL* Ziin) override
108  {
109  OCP_ABORT("Not Completed!");
110  };
111 
112  void Flash(const OCP_DBL& Pin, const OCP_DBL& Tin, const OCP_DBL* Niin, const USI& ftype, const USI& lastNP,
113  const OCP_DBL* lastKs) override {
114  OCP_ABORT("Not Completed!");
115  };
116  void FlashDeriv(const OCP_DBL& Pin, const OCP_DBL& Tin,
117  const OCP_DBL* Niin, const USI& ftype, const USI& lastNP,
118  const OCP_DBL* lastKs) override {
119  OCP_ABORT("Not Completed!");
120  };
121  void FlashDeriv_n(const OCP_DBL& Pin, const OCP_DBL& Tin,
122  const OCP_DBL* Niin, const OCP_DBL* Sjin, const OCP_DBL* xijin,
123  const OCP_DBL* njin, const USI& ftype, const USI* phaseExistin,
124  const USI& lastNP, const OCP_DBL* lastKs) override {
125  OCP_ABORT("Not Completed!");
126  }
127  OCP_DBL XiPhase(const OCP_DBL& Pin, const OCP_DBL& Tin, const OCP_DBL* Ziin) override { OCP_ABORT("Not Completed!"); return 0; };
128  OCP_DBL RhoPhase(const OCP_DBL& Pin, const OCP_DBL& Tin, const OCP_DBL* Ziin) override { OCP_ABORT("Not Completed!"); return 0; };
129  OCP_DBL GammaPhaseW(const OCP_DBL& Pin) override { OCP_ABORT("Not Completed!"); return 0; };
130 
131 private:
132  OCPTable PVTW;
133 };
134 
136 // BOMixture_OW
138 
139 class BOMixture_OW : public BOMixture
140 {
141 public:
142  BOMixture_OW() = default;
143  BOMixture_OW(const ParamReservoir& rs_param, const USI& i);
144 
145  void InitFlash(const OCP_DBL& Pin, const OCP_DBL& Pbbin, const OCP_DBL& Tin,
146  const OCP_DBL* Sjin, const OCP_DBL& Vpore,
147  const OCP_DBL* Ziin) override;
148  void InitFlashDer(const OCP_DBL& Pin, const OCP_DBL& Pbbin, const OCP_DBL& Tin,
149  const OCP_DBL* Sjin, const OCP_DBL& Vpore,
150  const OCP_DBL* Ziin) override
151  {
152  OCP_ABORT("Not Used!");
153  };
154  void InitFlashDer_n(const OCP_DBL& Pin, const OCP_DBL& Pbbin, const OCP_DBL& Tin,
155  const OCP_DBL* Sjin, const OCP_DBL& Vpore,
156  const OCP_DBL* Ziin) override
157  {
158  OCP_ABORT("Not Completed!");
159  };
160  void Flash(const OCP_DBL& Pin, const OCP_DBL& Tin, const OCP_DBL* Niin, const USI& ftype, const USI& lastNP,
161  const OCP_DBL* lastKs) override;
162  void FlashDeriv(const OCP_DBL& Pin, const OCP_DBL& Tin,
163  const OCP_DBL* Niin, const USI& ftype, const USI& lastNP,
164  const OCP_DBL* lastKs) override;
165  void FlashDeriv_n(const OCP_DBL& Pin, const OCP_DBL& Tin,
166  const OCP_DBL* Niin, const OCP_DBL* Sjin, const OCP_DBL* xijin,
167  const OCP_DBL* njin, const USI& ftype, const USI* phaseExistin,
168  const USI& lastNP, const OCP_DBL* lastKs) override {
169  OCP_ABORT("Not Completed!");
170  }
171  OCP_DBL XiPhase(const OCP_DBL& Pin, const OCP_DBL& Tin, const OCP_DBL* Ziin) override;
172  OCP_DBL RhoPhase(const OCP_DBL& Pin, const OCP_DBL& Tin, const OCP_DBL* Ziin) override;
173  OCP_DBL GammaPhaseO(const OCP_DBL& Pin, const OCP_DBL& Pbbin) override;
174  OCP_DBL GammaPhaseW(const OCP_DBL& Pin) override;
175 
176 private:
177  OCPTable PVDO;
178  OCPTable PVTW;
179  vector<OCP_DBL> data;
181  vector<OCP_DBL> cdata;
183 
184 };
185 
187 // BOMixture_ODGW
189 
190 class BOMixture_ODGW : public BOMixture
191 {
192 public:
193  BOMixture_ODGW() = default;
194  BOMixture_ODGW(const ParamReservoir& rs_param, const USI& i);
195 
196  void InitFlash(const OCP_DBL& Pin, const OCP_DBL& Pbbin, const OCP_DBL& Tin,
197  const OCP_DBL* Sjin, const OCP_DBL& Vpore,
198  const OCP_DBL* Ziin) override;
199  void InitFlashDer(const OCP_DBL& Pin, const OCP_DBL& Pbbin, const OCP_DBL& Tin,
200  const OCP_DBL* Sjin, const OCP_DBL& Vpore,
201  const OCP_DBL* Ziin) override
202  {
203  OCP_ABORT("Not Used!");
204  }
205  void InitFlashDer_n(const OCP_DBL& Pin, const OCP_DBL& Pbbin, const OCP_DBL& Tin,
206  const OCP_DBL* Sjin, const OCP_DBL& Vpore,
207  const OCP_DBL* Ziin) override
208  {
209  OCP_ABORT("Not Completed!");
210  };
211  void Flash(const OCP_DBL& Pin, const OCP_DBL& Tin, const OCP_DBL* Niin, const USI& ftype, const USI& lastNP,
212  const OCP_DBL* lastKs) override;
213  void FlashDeriv(const OCP_DBL& Pin, const OCP_DBL& Tin,
214  const OCP_DBL* Niin, const USI& ftype, const USI& lastNP,
215  const OCP_DBL* lastKs) override;
216  void FlashDeriv_n(const OCP_DBL& Pin, const OCP_DBL& Tin,
217  const OCP_DBL* Niin, const OCP_DBL* Sjin, const OCP_DBL* xijin,
218  const OCP_DBL* njin, const USI& ftype, const USI* phaseExistin,
219  const USI& lastNP, const OCP_DBL* lastKs) override {
220  OCP_ABORT("Not Completed!");
221  }
222  OCP_DBL XiPhase(const OCP_DBL& Pin, const OCP_DBL& Tin, const OCP_DBL* Ziin) override;
223  OCP_DBL RhoPhase(const OCP_DBL& Pin, const OCP_DBL& Tin, const OCP_DBL* Ziin) override;
224  OCP_DBL GammaPhaseO(const OCP_DBL& Pin, const OCP_DBL& Pbbin) override;
225  OCP_DBL GammaPhaseG(const OCP_DBL& Pin) override;
226  OCP_DBL GammaPhaseW(const OCP_DBL& Pin) override;
227 
228 private:
229  OCPTable PVCO;
230  OCPTable PVDG;
231  OCPTable PVTW;
232  vector<OCP_DBL> data;
234  vector<OCP_DBL> cdata;
236 };
237 
238 
239 #endif /* end if __BOMIXTURE_HEADER__ */
240 
241 /*----------------------------------------------------------------------------*/
242 /* Brief Change History of This File */
243 /*----------------------------------------------------------------------------*/
244 /* Author Date Actions */
245 /*----------------------------------------------------------------------------*/
246 /* Shizhe Li Oct/01/2021 Create file */
247 /* Chensong Zhang Oct/15/2021 Format file */
248 /*----------------------------------------------------------------------------*/
Mixture class declaration.
unsigned int USI
Generic unsigned integer.
Definition: OCPConst.hpp:22
double OCP_DBL
Double precision.
Definition: OCPConst.hpp:26
float OCP_SIN
Single precision.
Definition: OCPConst.hpp:27
unsigned long long OCP_ULL
Long long unsigned integer.
Definition: OCPConst.hpp:23
OCPTable class declaration.
#define OCP_ABORT(msg)
Abort if critical error happens.
Definition: UtilError.hpp:47
void InitFlash(const OCP_DBL &Pin, const OCP_DBL &Pbbin, const OCP_DBL &Tin, const OCP_DBL *Sjin, const OCP_DBL &Vpore, const OCP_DBL *Ziin) override
flash calculation with saturation of phases.
OCP_DBL GammaPhaseG(const OCP_DBL &Pin) override
return gamma of gas phase, gamma equals to mass density times gravity factor.
OCP_DBL XiPhase(const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Ziin) override
void Flash(const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Niin, const USI &ftype, const USI &lastNP, const OCP_DBL *lastKs) override
Flash calculation with moles of components.
void FlashDeriv(const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Niin, const USI &ftype, const USI &lastNP, const OCP_DBL *lastKs) override
Flash calculation with moles of components and Calculate the derivative.
OCP_DBL GammaPhaseW(const OCP_DBL &Pin) override
return gamma of water phase, gamma equals to mass density times gravity factor.
OCP_DBL RhoPhase(const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Ziin) override
return mass density of phase.
OCP_DBL GammaPhaseO(const OCP_DBL &Pin, const OCP_DBL &Pbbin) override
return gamma of oil phase, gamma equals to mass density times gravity factor.
void InitFlash(const OCP_DBL &Pin, const OCP_DBL &Pbbin, const OCP_DBL &Tin, const OCP_DBL *Sjin, const OCP_DBL &Vpore, const OCP_DBL *Ziin) override
flash calculation with saturation of phases.
OCP_DBL XiPhase(const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Ziin) override
OCP_DBL GammaPhaseW(const OCP_DBL &Pin) override
return gamma of water phase, gamma equals to mass density times gravity factor.
OCP_DBL RhoPhase(const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Ziin) override
return mass density of phase.
OCP_DBL GammaPhaseO(const OCP_DBL &Pin, const OCP_DBL &Pbbin) override
return gamma of oil phase, gamma equals to mass density times gravity factor.
void Flash(const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Niin, const USI &ftype, const USI &lastNP, const OCP_DBL *lastKs) override
Flash calculation with moles of components.
void FlashDeriv(const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Niin, const USI &ftype, const USI &lastNP, const OCP_DBL *lastKs) override
Flash calculation with moles of components and Calculate the derivative.
OCP_DBL XiPhase(const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Ziin) override
Definition: MixtureBO.hpp:127
OCP_DBL RhoPhase(const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Ziin) override
return mass density of phase.
Definition: MixtureBO.hpp:128
void InitFlash(const OCP_DBL &Pin, const OCP_DBL &Pbbin, const OCP_DBL &Tin, const OCP_DBL *Sjin, const OCP_DBL &Vpore, const OCP_DBL *Ziin) override
flash calculation with saturation of phases.
Definition: MixtureBO.hpp:94
OCP_DBL GammaPhaseW(const OCP_DBL &Pin) override
return gamma of water phase, gamma equals to mass density times gravity factor.
Definition: MixtureBO.hpp:129
void FlashDeriv(const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Niin, const USI &ftype, const USI &lastNP, const OCP_DBL *lastKs) override
Flash calculation with moles of components and Calculate the derivative.
Definition: MixtureBO.hpp:116
void Flash(const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Niin, const USI &ftype, const USI &lastNP, const OCP_DBL *lastKs) override
Flash calculation with moles of components.
Definition: MixtureBO.hpp:112
BOMixture is inherited class of Mixture, it's used for black oil model.
Definition: MixtureBO.hpp:23
OCP_DBL std_GammaO
std_RhoO * gravity factor.
Definition: MixtureBO.hpp:76
virtual OCP_DBL GammaPhaseW(const OCP_DBL &Pin) override
return gamma of water phase, gamma equals to mass density times gravity factor.
Definition: MixtureBO.hpp:31
OCP_DBL std_RhoW
mass density of water phase in standard condition.
Definition: MixtureBO.hpp:79
OCP_DBL GammaPhaseOG(const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Ziin) override
Definition: MixtureBO.hpp:32
OCP_DBL std_RhoG
mass density of gas phase in standard condition.
Definition: MixtureBO.hpp:77
OCP_DBL std_RhoO
< others.
Definition: MixtureBO.hpp:75
OCP_DBL std_GammaW
std_RhoW * gravity factor.
Definition: MixtureBO.hpp:80
OCP_DBL std_GammaG
std_RhoG * gravity factor.
Definition: MixtureBO.hpp:78
virtual OCP_DBL GammaPhaseO(const OCP_DBL &Pin, const OCP_DBL &Pbbin) override
return gamma of oil phase, gamma equals to mass density times gravity factor.
Definition: MixtureBO.hpp:29
virtual OCP_DBL GammaPhaseG(const OCP_DBL &Pin) override
return gamma of gas phase, gamma equals to mass density times gravity factor.
Definition: MixtureBO.hpp:30