OpenCAEPoro  v0.5.0
A simulator for multicomponent porous media flow
Rock.hpp
Go to the documentation of this file.
1 
12 #ifndef __ROCK_HEADER__
13 #define __ROCK_HEADER__
14 
15 #include <math.h>
16 
17 // OpenCAEPoro header files
18 #include "OCPConst.hpp"
19 #include "OCPTable.hpp"
20 #include "ParamReservoir.hpp"
21 
22 class Rock
23 {
24 public:
25  Rock() = default;
26 
27  // Calculate porosity and d porosity / d P for isothermal model
28  virtual void CalPoro(const OCP_DBL& P,
29  const OCP_DBL& poroInit,
30  OCP_DBL& poro,
31  OCP_DBL& dPorodP) const = 0;
32 
33  // Calculate porosity and d porosity / d P for ifThermal model
34  virtual void CalPoroT(const OCP_DBL& P,
35  const OCP_DBL& T,
36  const OCP_DBL& poroInit,
37  OCP_DBL& poro,
38  OCP_DBL& dPorodP,
39  OCP_DBL& dPorodT,
40  OCP_DBL& RockV,
41  OCP_DBL& dRockVdP,
42  OCP_DBL& dRockVdT) const = 0;
43 
44  virtual void CalRockHT(const OCP_DBL& T, OCP_DBL& Hr, OCP_DBL& dHrdT) const = 0;
45 };
46 
47 class RockIso : public Rock
48 {
49 public:
50  RockIso() = default;
51  void CalPoroT(const OCP_DBL& P,
52  const OCP_DBL& T,
53  const OCP_DBL& poroInit,
54  OCP_DBL& poro,
55  OCP_DBL& dPorodP,
56  OCP_DBL& dPorodT,
57  OCP_DBL& RockV,
58  OCP_DBL& dRockVdP,
59  OCP_DBL& dRockVdT) const override
60  {
61  OCP_ABORT("Not Used!");
62  };
63  void CalRockHT(const OCP_DBL& T, OCP_DBL& Hr, OCP_DBL& dHrdT) const override
64  {
65  OCP_ABORT("Not Used!");
66  };
67 };
68 
69 class Rock_Linear : public RockIso
70 {
71  // poro = poroInit * (1 + phi)
72  // poro = poroInit * (1 + cp1 * (P - Pref) + cp2 / 2 * (P - Pref) * (P - Pref))
73 public:
74  Rock_Linear() = default;
75  Rock_Linear(const RockParam& param)
76  {
77  Pref = param.Pref;
78  cp1 = param.cp1;
79  cp2 = param.cp2;
80  };
81  void CalPoro(const OCP_DBL& P,
82  const OCP_DBL& poroInit,
83  OCP_DBL& poro,
84  OCP_DBL& dPorodP) const override;
85 
86 protected:
87  OCP_DBL Pref;
88  OCP_DBL cp1;
89  OCP_DBL cp2;
90 };
91 
92 class RockT : public Rock
93 {
94 public:
95  RockT() = default;
96  void Assign(const RockParam& param)
97  {
98  Pref = param.Pref;
99  Tref = param.Tref;
100  cp = param.cp1;
101  ct = param.ct;
102  cpt = param.cpt;
103  ConstRock = param.ConstRock;
104  hcp1 = param.HCP1;
105  hcp2 = param.HCP2;
106  }
107  void CalPoro(const OCP_DBL& P,
108  const OCP_DBL& poroInit,
109  OCP_DBL& poro,
110  OCP_DBL& dPorodP) const override
111  {
112  OCP_ABORT("Not Used!");
113  };
114  void CalRockHT(const OCP_DBL& T, OCP_DBL& Hr, OCP_DBL& dHrdT) const override;
115 
116 protected:
126 };
127 
128 class RockT_Linear : public RockT
129 {
130  // poro = poroInit * (1 + phi)
131  // poro = poroInit * (1 + cp*(P-Pref) - ct*(T-Tref) + cpt*(P-Pref)*(T-Tref))
132 public:
133  RockT_Linear() = default;
134  RockT_Linear(const RockParam& param) { Assign(param); };
135  void CalPoroT(const OCP_DBL& P,
136  const OCP_DBL& T,
137  const OCP_DBL& poroInit,
138  OCP_DBL& poro,
139  OCP_DBL& dPorodP,
140  OCP_DBL& dPorodT,
141  OCP_DBL& RockV,
142  OCP_DBL& dRockVdP,
143  OCP_DBL& dRockVdT) const override;
144 };
145 
146 class RockT_Exp : public RockT
147 {
148  // poro = poroInit * (1 + exp(phi))
149  // poro = poroInit * exp(cp*(P-Pref) - ct*(T-Tref) + cpt*(P-Pref)*(T-Tref))
150 public:
151  RockT_Exp() = default;
152  RockT_Exp(const RockParam& param) { Assign(param); };
153  void CalPoroT(const OCP_DBL& P,
154  const OCP_DBL& T,
155  const OCP_DBL& poroInit,
156  OCP_DBL& poro,
157  OCP_DBL& dPorodP,
158  OCP_DBL& dPorodT,
159  OCP_DBL& RockV,
160  OCP_DBL& dRockVdP,
161  OCP_DBL& dRockVdT) const override;
162 };
163 
164 #endif /* end if __ROCK_HEADER__ */
165 
166 /*----------------------------------------------------------------------------*/
167 /* Brief Change History of This File */
168 /*----------------------------------------------------------------------------*/
169 /* Author Date Actions */
170 /*----------------------------------------------------------------------------*/
171 /* Shizhe Li Nov/15/2022 Create file */
172 /*----------------------------------------------------------------------------*/
Definition of build-in datatypes and consts.
double OCP_DBL
Double precision.
Definition: OCPConst.hpp:27
unsigned int OCP_BOOL
OCP_BOOL in OCP.
Definition: OCPConst.hpp:29
OCPTable class declaration.
ParamReservoir class declaration.
#define OCP_ABORT(msg)
Abort if critical error happens.
Definition: UtilError.hpp:47
Definition: Rock.hpp:48
RockParam class contains information about the keyword ROCK.
OCP_DBL cpt
cross items, ifThermal only
OCP_DBL cp1
Compressibility factor of rock in reservoir.
OCP_DBL HCP1
coefficients of the rock enthalpy formula, Btu/ft^3 - F
OCP_DBL Pref
Reference pressure at initial porosity.
OCP_DBL HCP2
coefficients of the rock enthalpy formula, Btu/ft^3 - F
OCP_DBL ct
Expansion factor of rock in reservoir, ifThermal only.
OCP_DBL Tref
Reference temperature at initial porosity.
OCP_DBL cp2
2 order Compressibility factor of rock in reservoir.
OCP_BOOL ConstRock
Definition: Rock.hpp:93
OCP_DBL Tref
Reference temperature at initial porosity.
Definition: Rock.hpp:118
OCP_DBL hcp1
coefficients of the rock enthalpy formula, Btu/ft^3 - F
Definition: Rock.hpp:124
OCP_DBL hcp2
coefficients of the rock enthalpy formula, Btu/ft^3 - F
Definition: Rock.hpp:125
OCP_DBL Pref
Reference pressure at initial porosity.
Definition: Rock.hpp:117
OCP_BOOL ConstRock
Definition: Rock.hpp:122
OCP_DBL ct
Expansion factor of rock in reservoir, ifThermal only.
Definition: Rock.hpp:120
OCP_DBL cpt
cross items, ifThermal only
Definition: Rock.hpp:121
OCP_DBL cp
Compressibility factor of rock in reservoir.
Definition: Rock.hpp:119
Definition: Rock.hpp:23