OpenCAEPoro  v0.5.0
A simulator for multicomponent porous media flow
Rock.cpp
Go to the documentation of this file.
1 
12 // OpenCAEPoro header files
13 #include "Rock.hpp"
14 
16 // Rock_Linear
18 
19 void Rock_Linear::CalPoro(const OCP_DBL& P,
20  const OCP_DBL& poroInit,
21  OCP_DBL& poro,
22  OCP_DBL& dPorodP) const
23 {
24  OCP_DBL dP = (P - Pref);
25  poro = poroInit * (1 + (cp1 + cp2 / 2 * dP) * dP);
26  dPorodP = poroInit * (cp1 + cp2 * dP);
27 }
28 
30 // RockT
32 
33 void RockT::CalRockHT(const OCP_DBL& T, OCP_DBL& Hr, OCP_DBL& dHrdT) const
34 {
35  const OCP_DBL Ta = T + CONV5;
36  const OCP_DBL Tra = Tref + CONV5;
37  Hr = hcp1 * (Ta - Tra) + 0.5 * hcp2 * (Ta * Ta - Tra * Tra);
38  dHrdT = hcp1 + hcp2 * Ta;
39 }
40 
42 // RockT_Linear
44 
45 void RockT_Linear ::CalPoroT(const OCP_DBL& P,
46  const OCP_DBL& T,
47  const OCP_DBL& poroInit,
48  OCP_DBL& poro,
49  OCP_DBL& dPorodP,
50  OCP_DBL& dPorodT,
51  OCP_DBL& RockV,
52  OCP_DBL& dRockVdP,
53  OCP_DBL& dRockVdT) const
54 {
55  const OCP_DBL dP = P - Pref;
56  const OCP_DBL dT = T - Tref;
57  poro = poroInit * (1 + (cp * dP - ct * dT + cpt * dP * dT));
58  dPorodP = poroInit * (cp + cpt * dT);
59  dPorodT = poroInit * (-ct + cpt * dP);
60 
61  if (ConstRock) {
62  RockV = 1 - poroInit;
63  dRockVdP = 0.0;
64  dRockVdT = 0.0;
65  } else {
66  RockV = 1 - poro;
67  dRockVdP = -dPorodP;
68  dRockVdT = -dPorodT;
69  }
70 }
71 
73 // RockT_Exp
75 
76 void RockT_Exp::CalPoroT(const OCP_DBL& P,
77  const OCP_DBL& T,
78  const OCP_DBL& poroInit,
79  OCP_DBL& poro,
80  OCP_DBL& dPorodP,
81  OCP_DBL& dPorodT,
82  OCP_DBL& RockV,
83  OCP_DBL& dRockVdP,
84  OCP_DBL& dRockVdT) const
85 {
86  const OCP_DBL dP = P - Pref;
87  const OCP_DBL dT = T - Tref;
88  poro = poroInit * exp(cp * dP - ct * dT + cpt * dP * dT);
89 
90  dPorodP = poro * (cp + cpt * dT);
91  dPorodT = poro * (-ct + cpt * dP);
92  if (ConstRock) {
93  RockV = 1 - poroInit;
94  dRockVdP = 0.0;
95  dRockVdT = 0.0;
96  } else {
97  RockV = 1 - poro;
98  dRockVdP = -dPorodP;
99  dRockVdT = -dPorodT;
100  }
101 }
102 
103 /*----------------------------------------------------------------------------*/
104 /* Brief Change History of This File */
105 /*----------------------------------------------------------------------------*/
106 /* Author Date Actions */
107 /*----------------------------------------------------------------------------*/
108 /* Shizhe Li Nov/15/2022 Create file */
109 /*----------------------------------------------------------------------------*/
double OCP_DBL
Double precision.
Definition: OCPConst.hpp:27
const OCP_DBL CONV5
0 F = CONV5 R
Definition: OCPConst.hpp:67
Rock class declaration.
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