OpenCAEPoro  v0.5.0
A simulator for multicomponent porous media flow
AcceleratePVT.hpp
Go to the documentation of this file.
1 
12 #ifndef __ACCELERATEPVT_HEADER__
13 #define __ACCELERATEPVT_HEADER__
14 
15 #include "DenseMat.hpp"
16 #include "OCPConst.hpp"
17 #include <vector>
18 
19 using namespace std;
20 
22 // Skip Stability Analysis
24 
26 {
27 
28 public:
30  void SetUseSkip(const OCP_BOOL& flag) { ifUseSkip = flag; }
32  OCP_BOOL IfUseSkip() const { return ifUseSkip; }
34  void Setup(const OCP_USI& numBulk, const USI& np, const USI& nc);
36  void SetFlagSkip(const OCP_USI& n, const OCP_BOOL& flagSkip) { flag[n] = flagSkip; }
38  void AssignValue(const OCP_USI& n,
39  const OCP_DBL& minEigenSkip,
40  const OCP_DBL& PSkip,
41  const OCP_DBL& TSkip,
42  const vector<OCP_DBL>& ziSkip);
44  OCP_BOOL IfSkip(const OCP_DBL& Pin,
45  const OCP_DBL& Tin,
46  const OCP_DBL& Ntin,
47  const vector<OCP_DBL>& Niin,
48  const OCP_USI& n) const;
50  USI CalFtypeIMPEC(const OCP_DBL& Pin,
51  const OCP_DBL& Tin,
52  const OCP_DBL& Ntin,
53  const vector<OCP_DBL>& Niin,
54  const OCP_USI& n);
56  USI CalFtypeFIM(const OCP_DBL& Pin,
57  const OCP_DBL& Tin,
58  const OCP_DBL& Ntin,
59  const vector<OCP_DBL>& Niin,
60  const OCP_DBL* S,
61  const USI& np,
62  const OCP_USI& n) const;
64  void ResetToLastTimeStep();
66  void UpdateLastTimeStep();
67 
68 protected:
69  OCP_BOOL ifSetup{OCP_FALSE};
70 
71  OCP_BOOL ifUseSkip{OCP_TRUE};
74 
75  vector<OCP_BOOL> flag;
76  vector<OCP_DBL> minEigen;
77  vector<OCP_DBL> P;
78  vector<OCP_DBL> T;
79  vector<OCP_DBL> zi;
80 
81  vector<OCP_BOOL> lflag;
82  vector<OCP_DBL> lminEigen;
83  vector<OCP_DBL> lP;
84  vector<OCP_DBL> lT;
85  vector<OCP_DBL> lzi;
86 };
87 
88 #endif /* end if __ACCELERATEPVT_HEADER__ */
89 
90 /*----------------------------------------------------------------------------*/
91 /* Brief Change History of This File */
92 /*----------------------------------------------------------------------------*/
93 /* Author Date Actions */
94 /*----------------------------------------------------------------------------*/
95 /* Shizhe Li Dec/25/2022 Create file */
96 /*----------------------------------------------------------------------------*/
Operations about small dense mat.
Definition of build-in datatypes and consts.
unsigned int USI
Generic unsigned integer.
Definition: OCPConst.hpp:23
double OCP_DBL
Double precision.
Definition: OCPConst.hpp:27
unsigned int OCP_USI
Long unsigned integer.
Definition: OCPConst.hpp:25
unsigned int OCP_BOOL
OCP_BOOL in OCP.
Definition: OCPConst.hpp:29
OCP_BOOL IfUseSkip() const
Return ifUseSkip.
vector< OCP_DBL > lminEigen
Last min eigenvalue.
void SetUseSkip(const OCP_BOOL &flag)
Set ifUseSkip to true or false.
USI numCom
Num of components used in phase equilibrium calculation.
vector< OCP_DBL > P
Pressure at last step.
vector< OCP_DBL > lT
Last T.
vector< OCP_BOOL > lflag
Last flag.
vector< OCP_BOOL > flag
If true, skip will be test.
vector< OCP_DBL > zi
Mole fraction of components(for test) at last step.
vector< OCP_DBL > minEigen
minimum eigenvalue used for testing skipping
USI numPhase
Num of phase used in phase equilibrium calculation.
vector< OCP_DBL > lP
Last P.
void SetFlagSkip(const OCP_USI &n, const OCP_BOOL &flagSkip)
Set flag for skipping.
vector< OCP_DBL > lzi
Last zi.
vector< OCP_DBL > T
Temperature at last step.