OpenCAEPoro  v0.5.0
A simulator for multicomponent porous media flow
OCPStructure.hpp
Go to the documentation of this file.
1 
12 #ifndef __OCPSTRUCTURE_HEADER__
13 #define __OCPSTRUCTURE_HEADER__
14 
15 // Standard header files
16 #include <vector>
17 
18 // OpenCAEPoro header files
19 #include "OCPConst.hpp"
20 
21 using namespace std;
22 
23 class OCPRes
24 {
25 public:
26  void Setup_IsoT(const OCP_USI& nb, const OCP_USI& nw, const OCP_USI& nc)
27  {
28  OCP_USI reslen = (nb + nw) * (nc + 1);
29  resAbs.resize(reslen);
30  resRelV.resize(nb);
31  resRelN.resize(nb);
32  }
33  void SetupT(const OCP_USI& nb, const OCP_USI& nw, const OCP_USI& nc)
34  {
35  OCP_USI reslen = (nb + nw) * (nc + 2);
36  resAbs.resize(reslen);
37  resRelV.resize(nb);
38  resRelN.resize(nb);
39  resRelE.resize(nb);
40  }
41  void SetZero()
42  {
43  fill(resAbs.begin(), resAbs.end(), 0);
44  fill(resRelV.begin(), resRelV.end(), 0);
45  fill(resRelN.begin(), resRelN.end(), 0);
46  fill(resRelE.begin(), resRelE.end(), 0);
47  maxRelRes_V = 0;
48  maxRelRes_N = 0;
49  maxRelRes_E = 0;
50  maxWellRelRes_mol = 0;
51  maxId_V = 0;
52  maxId_N = 0;
53  maxId_E = 0;
54  }
55  void SetInitRes() { maxRelRes0_V = maxRelRes_V; }
56 
57  vector<OCP_DBL> resAbs;
58  vector<OCP_DBL> resRelV;
60  vector<OCP_DBL> resRelN;
62  vector<OCP_DBL> resRelE;
70  OCP_DBL
72 
73  // use negative number to represent well number (ToDo)
77 };
78 
79 #endif
Definition of build-in datatypes and consts.
double OCP_DBL
Double precision.
Definition: OCPConst.hpp:27
unsigned int OCP_USI
Long unsigned integer.
Definition: OCPConst.hpp:25
int OCP_INT
Long integer.
Definition: OCPConst.hpp:26
vector< OCP_DBL > resRelE
OCP_INT maxId_E
index of bulk who has maxRelRes_E
OCP_DBL maxRelRes_E
maximum relative residual wrt. total energy for each bulk
OCP_DBL maxWellRelRes_mol
maximum relative residual wrt. total moles for each well
OCP_INT maxId_N
index of bulk who has maxRelRes_N
OCP_DBL maxRelRes_V
OCP_INT maxId_V
index of bulk who has maxRelRes_V
vector< OCP_DBL > resRelN
OCP_DBL maxRelRes0_V
vector< OCP_DBL > resRelV
vector< OCP_DBL > resAbs
residual for all equations for each bulk
OCP_DBL maxRelRes_N
maximum relative residual wrt. total moles for each bulk