OpenCAEPoro  v0.5.0
A simulator for multicomponent porous media flow
OCPConst.hpp
Go to the documentation of this file.
1 
12 #ifndef __OPENCAEPORO_CONSTS_HEADER__
13 #define __OPENCAEPORO_CONSTS_HEADER__
14 
15 // Standard header files
16 #include <iostream>
17 #include <math.h>
18 
19 // OpenCAEPoro header files
20 #include "UtilError.hpp"
21 
22 // Build-in data type
23 typedef unsigned int USI;
24 typedef unsigned long long OCP_ULL;
25 typedef unsigned int OCP_USI;
26 typedef int OCP_INT;
27 typedef double OCP_DBL;
28 typedef float OCP_SIN;
29 typedef unsigned int OCP_BOOL;
30 
31 // General error type
32 const int OCP_SUCCESS = 0;
33 const int OCP_ERROR_NUM_INPUT = -1;
34 const int OCP_ERROR = -100;
35 
36 // General consts
37 const OCP_DBL GAS_CONSTANT = 10.73159;
38 const OCP_DBL TINY = 1E-8;
39 const OCP_DBL PI = 3.141592653;
40 const OCP_BOOL OCP_TRUE = 1;
41 const OCP_BOOL OCP_FALSE = 0;
42 
43 // Control consts
44 const OCP_DBL MAX_TIME_STEP = 365.0;
45 const OCP_DBL MIN_TIME_STEP = 0.01;
46 const OCP_DBL MIN_TIME_CURSTEP = 1E-6;
47 const OCP_DBL TIME_STEP_CUT = 0.5;
49 const OCP_DBL MAX_VOLUME_ERR = 0.01;
50 const OCP_DBL MAX_DP_LIMIT = 200;
51 const OCP_DBL MAX_DS_LIMIT = 0.1;
52 const OCP_DBL TARGET_DP = 50;
53 const OCP_DBL TARGET_DS = 0.01;
54 
55 // Physical consts
56 const OCP_DBL GRAVITY_FACTOR = 0.00694444;
57 const OCP_DBL RHOW_STD = 62.3664;
58 const OCP_DBL RHOAIR_STD = 0.076362;
59 const OCP_DBL PRESSURE_STD = 14.7;
61 
62 // Unit conversion consts
63 const OCP_DBL CONV1 = 5.61458;
64 const OCP_DBL CONV2 = 1.12712E-3;
65 const OCP_DBL CONV3 = 0.45359237;
66 const OCP_DBL CONV4 = 0.02831685;
67 const OCP_DBL CONV5 = 459.67;
68 const OCP_DBL CONV6 = 778.172448;
69 const OCP_DBL CONV7 = CONV3 / (CONV4 * 1E3);
70 
71 // Model Type
72 const USI ISOTHERMALMODEL = 1;
73 const USI THERMALMODEL = 2;
74 
75 // Grid Type
76 const USI ORTHOGONAL_GRID = 1;
77 const USI CORNER_GRID = 2;
78 const USI GENERAL_GRID = 3;
79 
80 // Solution methods
81 const USI IMPEC = 1;
82 const USI FIM = 2;
83 const USI AIMc = 3;
84 const USI FIMn = 4;
85 
86 // Linear Solver
87 const USI SCALARFASP = 1;
88 const USI VECTORFASP = 2;
89 
90 // Fluid types
91 const USI OIL = 0;
92 const USI GAS = 1;
93 const USI WATER = 2;
94 const USI SOLVENT = 3;
95 
96 // Mixture types
97 const USI BLKOIL = 10;
98 const USI BLKOIL_W = 11;
99 const USI BLKOIL_OW = 12;
100 const USI BLKOIL_OG = 13;
101 const USI BLKOIL_DOGW = 14;
102 const USI BLKOIL_ODGW = 15;
103 const USI EOS_PVTW = 20;
104 const USI THERMAL = 30;
105 
106 // EoS models
107 const USI EOS_PR = 1;
108 const USI EOS_SRK = 2;
109 
110 // Phase types
111 const USI PHASE_W = 1;
112 const USI PHASE_GW = 2;
113 const USI PHASE_OW = 3;
114 const USI PHASE_OG = 4;
115 const USI PHASE_ODGW = 5;
116 const USI PHASE_DOGW = 6;
117 const USI PHASE_ODGW01 = 51;
118 const USI PHASE_ODGW02 = 52;
120 
121 // Well params
122 const USI INJ = 1;
123 const USI PROD = 2;
124 const USI HORIZONTAL = 1;
125 const USI VERTICAL = 2;
126 const OCP_BOOL OPEN = OCP_TRUE;
127 const OCP_BOOL CLOSE = OCP_FALSE;
128 
129 // Well option params
130 const USI RATE_MODE = 1;
131 const USI ORATE_MODE = 2;
132 const USI GRATE_MODE = 3;
133 const USI WRATE_MODE = 4;
134 const USI LRATE_MODE = 5;
135 const USI BHP_MODE = 6;
136 
137 // Perforation directions
138 const USI X_DIRECTION = 1;
139 const USI Y_DIRECTION = 2;
140 const USI Z_DIRECTION = 3;
141 
142 #endif // __OPENCAEPORO_CONSTS_HEADER__
143 
144 /*----------------------------------------------------------------------------*/
145 /* Brief Change History of This File */
146 /*----------------------------------------------------------------------------*/
147 /* Author Date Actions */
148 /*----------------------------------------------------------------------------*/
149 /* Shizhe Li Oct/01/2021 Create file */
150 /* Chensong Zhang Oct/15/2021 Format file */
151 /* Chensong Zhang Oct/27/2021 Unify error check */
152 /* Chensong Zhang Jan/16/2022 Update Doxygen */
153 /* Chensong Zhang Sep/21/2022 Add error messages */
154 /*----------------------------------------------------------------------------*/
const USI X_DIRECTION
x-direction
Definition: OCPConst.hpp:138
const OCP_DBL TIME_STEP_CUT
Time stepsize cut ratio.
Definition: OCPConst.hpp:47
const USI VECTORFASP
Use vector linear solver in Fasp.
Definition: OCPConst.hpp:88
const USI CORNER_GRID
Grid type = corner-point.
Definition: OCPConst.hpp:77
const USI BLKOIL
Mixture model = black-oil.
Definition: OCPConst.hpp:97
const OCP_DBL TINY
Small constant.
Definition: OCPConst.hpp:38
const USI SOLVENT
Fluid type = solvent.
Definition: OCPConst.hpp:94
const USI PHASE_ODGW01
Phase type = oil-dry gas-water.
Definition: OCPConst.hpp:117
const OCP_DBL MAX_DS_LIMIT
Maximal saturation change.
Definition: OCPConst.hpp:51
const USI EOS_PVTW
Mixture model = equation-of-state.
Definition: OCPConst.hpp:103
unsigned int USI
Generic unsigned integer.
Definition: OCPConst.hpp:23
const USI GAS
Fluid type = gas.
Definition: OCPConst.hpp:92
double OCP_DBL
Double precision.
Definition: OCPConst.hpp:27
const USI VERTICAL
Well type = vertical.
Definition: OCPConst.hpp:125
const OCP_DBL CONV1
1 bbl = CONV1 ft3
Definition: OCPConst.hpp:63
const OCP_DBL GRAVITY_FACTOR
0.00694444 ft2 psi / lb
Definition: OCPConst.hpp:56
const USI LRATE_MODE
Well option = fixed fluid rate???
Definition: OCPConst.hpp:134
const USI WRATE_MODE
Well option = fixed water rate.
Definition: OCPConst.hpp:133
const USI BLKOIL_DOGW
black oil model with dead oil, dry gas, water
Definition: OCPConst.hpp:101
const USI WATER
Fluid type = water.
Definition: OCPConst.hpp:93
float OCP_SIN
Single precision.
Definition: OCPConst.hpp:28
const USI FIMn
Solution method = FIM.
Definition: OCPConst.hpp:84
const USI PHASE_ODGW
Phase type = oil-dry gas-water.
Definition: OCPConst.hpp:115
const int OCP_SUCCESS
Finish without trouble.
Definition: OCPConst.hpp:32
const OCP_DBL MIN_TIME_STEP
Minimal time stepsize.
Definition: OCPConst.hpp:45
const OCP_BOOL OPEN
Well type = open.
Definition: OCPConst.hpp:126
const OCP_DBL RHOW_STD
Water density at surface cond: lb/ft3.
Definition: OCPConst.hpp:57
const USI HORIZONTAL
Well type = horizontal.
Definition: OCPConst.hpp:124
const USI ORTHOGONAL_GRID
Grid type = orthogonal.
Definition: OCPConst.hpp:76
const USI PHASE_ODGW02
Phase type = oil-dry gas-water.
Definition: OCPConst.hpp:118
const USI EOS_SRK
EoS model = SRK.
Definition: OCPConst.hpp:108
const OCP_DBL TARGET_DP
Target pressure change.
Definition: OCPConst.hpp:52
const USI BLKOIL_OW
black oil model with oil and water
Definition: OCPConst.hpp:99
const USI Y_DIRECTION
y-direction
Definition: OCPConst.hpp:139
const USI ORATE_MODE
Well option = fixed oil rate.
Definition: OCPConst.hpp:131
const OCP_DBL CONV7
lbm/ft3 -> gm-M/cc
Definition: OCPConst.hpp:69
const OCP_DBL MIN_TIME_CURSTEP
Minimal time stepsize of current step ???
Definition: OCPConst.hpp:46
const USI OIL
Fluid type = oil.
Definition: OCPConst.hpp:91
const OCP_DBL CONV3
1 lb = CONV3 kg
Definition: OCPConst.hpp:65
const USI BLKOIL_OG
black oil model with oil and gas
Definition: OCPConst.hpp:100
const OCP_DBL MAX_TIME_STEP
Maximal time stepsize.
Definition: OCPConst.hpp:44
const int OCP_ERROR
Unidentified error.
Definition: OCPConst.hpp:34
const OCP_DBL TARGET_DS
Target saturation change.
Definition: OCPConst.hpp:53
const USI BLKOIL_ODGW
black oil model with live oil, dry gas, water
Definition: OCPConst.hpp:102
const USI GENERAL_GRID
Grid type = general.
Definition: OCPConst.hpp:78
const USI FIM
Solution method = FIM.
Definition: OCPConst.hpp:82
const USI PHASE_W
Phase type = water only.
Definition: OCPConst.hpp:111
const USI RATE_MODE
Well option = fixed total rate???
Definition: OCPConst.hpp:130
unsigned int OCP_USI
Long unsigned integer.
Definition: OCPConst.hpp:25
const int OCP_ERROR_NUM_INPUT
Wrong number of input param.
Definition: OCPConst.hpp:33
const OCP_DBL MAX_DP_LIMIT
Maximal pressure change.
Definition: OCPConst.hpp:50
const USI EOS_PR
EoS model = PR.
Definition: OCPConst.hpp:107
const USI PHASE_ODGW01_MISCIBLE
Phase type = oil-dry gas-water.
Definition: OCPConst.hpp:119
const USI Z_DIRECTION
z-direction
Definition: OCPConst.hpp:140
const OCP_DBL CONV5
0 F = CONV5 R
Definition: OCPConst.hpp:67
const USI PHASE_OW
Phase type = oil-water.
Definition: OCPConst.hpp:113
const USI AIMc
Adaptive implicit -— Collins.
Definition: OCPConst.hpp:83
const OCP_DBL TIME_STEP_AMPLIFY
Time stepsize amplification ratio.
Definition: OCPConst.hpp:48
const USI IMPEC
Solution method = IMPEC.
Definition: OCPConst.hpp:81
const USI PROD
Well type = producer.
Definition: OCPConst.hpp:123
const OCP_DBL TEMPERATURE_STD
Standard temperature: F.
Definition: OCPConst.hpp:60
const OCP_DBL MAX_VOLUME_ERR
Maximal volume error.
Definition: OCPConst.hpp:49
const OCP_DBL GAS_CONSTANT
Gas Constant.
Definition: OCPConst.hpp:37
const USI SCALARFASP
Use scalar linear solver in Fasp.
Definition: OCPConst.hpp:87
const USI PHASE_DOGW
Phase type = dead oil-gas-water.
Definition: OCPConst.hpp:116
const OCP_DBL PI
Pi.
Definition: OCPConst.hpp:39
int OCP_INT
Long integer.
Definition: OCPConst.hpp:26
const USI INJ
Well type = injector.
Definition: OCPConst.hpp:122
const OCP_BOOL CLOSE
Well type = closed.
Definition: OCPConst.hpp:127
const USI THERMAL
Mixture model = ifThermal.
Definition: OCPConst.hpp:104
const USI PHASE_OG
Phase type = oil-gas.
Definition: OCPConst.hpp:114
const USI BHP_MODE
Well option = fixed bottom-hole-pressure.
Definition: OCPConst.hpp:135
unsigned int OCP_BOOL
OCP_BOOL in OCP.
Definition: OCPConst.hpp:29
const OCP_DBL RHOAIR_STD
Air density at surface cond : lb/ft3.
Definition: OCPConst.hpp:58
const USI BLKOIL_W
black oil model only with water
Definition: OCPConst.hpp:98
const USI GRATE_MODE
Well option = fixed gas rate.
Definition: OCPConst.hpp:132
const OCP_DBL PRESSURE_STD
14.6959 psia = 1 atm
Definition: OCPConst.hpp:59
unsigned long long OCP_ULL
Long long unsigned integer.
Definition: OCPConst.hpp:24
const OCP_DBL CONV4
1 ft3 = CONV4 m3
Definition: OCPConst.hpp:66
const OCP_DBL CONV2
Darcy constant in field unit.
Definition: OCPConst.hpp:64
const USI PHASE_GW
Phase type = gas-water.
Definition: OCPConst.hpp:112
Logging error and warning messages.