23 BOMixtureInit(rs_param);
45 void BOMixture_OW::InitFlashIMPEC(
const OCP_DBL& Pin,
60 OCP_DBL bw = bw0 * (1 - cbw * (
P - Pw0));
67 Ni[1] = Vpore *
S[1] *
xi[1];
77 Ni[0] = Vpore * (1 -
S[1]) *
xi[0];
89 void BOMixture_OW::InitFlashFIM(
const OCP_DBL& Pin,
104 OCP_DBL bw = bw0 * (1 - cbw * (
P - Pw0));
106 Ni[1] = Vpore *
S[1] *
xi[1];
113 Ni[0] = Vpore * (1 -
S[1]) *
xi[0];
135 OCP_DBL bw = bw0 * (1 - cbw * (
P - Pw0));
183 OCP_DBL bw = bw0 * (1 - cbw * (
P - Pw0));
204 xiP[0] = -
xi[0] * bop / bo;
230 if (tarPhase ==
WATER) {
236 OCP_DBL bw = bw0 * (1 - cbw * (Pin - Pw0));
250 if (tarPhase ==
OIL) {
253 }
else if (tarPhase ==
WATER) {
258 OCP_DBL bw = bw0 * (1 - cbw * (Pin - Pw0));
266 const vector<SolventINJ>& sols,
270 const USI wellType = opt.WellType();
271 if (wellType ==
INJ) {
272 const string fluidName = opt.InjFluidType();
273 opt.SetInjFactor(1.0);
275 if (fluidName ==
"WAT") {
276 vector<OCP_DBL> tmpZi({0, 1});
278 opt.SetInjProdPhase(
WATER);
282 }
else if (wellType ==
PROD) {
283 vector<OCP_DBL> tmpWght(2, 0);
284 switch (opt.OptMode()) {
294 tmpWght[0] = tmpWght[1] = 1;
300 opt.SetProdPhaseWeight(tmpWght);
MixtureBO class declaration.
unsigned int USI
Generic unsigned integer.
double OCP_DBL
Double precision.
const OCP_DBL CONV1
1 bbl = CONV1 ft3
const USI LRATE_MODE
Well option = fixed fluid rate???
const USI WRATE_MODE
Well option = fixed water rate.
const USI WATER
Fluid type = water.
const USI BLKOIL_OW
black oil model with oil and water
const USI ORATE_MODE
Well option = fixed oil rate.
const USI OIL
Fluid type = oil.
unsigned int OCP_USI
Long unsigned integer.
const USI PROD
Well type = producer.
const USI INJ
Well type = injector.
const USI BHP_MODE
Well option = fixed bottom-hole-pressure.
#define OCP_ABORT(msg)
Abort if critical error happens.
OCP_DBL RhoPhase(const OCP_DBL &Pin, const OCP_DBL &Pbb, const OCP_DBL &Tin, const OCP_DBL *Ziin, const USI &tarPhase) override
return mass density of phase
OCP_DBL XiPhase(const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Ziin, const USI &tarPhase) override
return mass density of phase
void FlashFIM(const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Niin, const OCP_DBL *Sjin, const USI &lastNP, const OCP_DBL *xijin, const OCP_USI &bId) override
Flash calculation with moles of components and Calculate the derivative.
void Flash(const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Niin) override
flash calculation with saturation of phases.
void FlashIMPEC(const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Niin, const USI &lastNP, const OCP_DBL *xijin, const OCP_USI &bId) override
Flash calculation with moles of components.
void SetupWellOpt(WellOpt &opt, const vector< SolventINJ > &sols, const OCP_DBL &Psurf, const OCP_DBL &Tsurf) override
OCP_DBL std_RhoW
The density of water at surface conditions : lb/ft3.
OCP_DBL std_RhoO
< others.
vector< OCP_DBL > rhoP
d rho / dP: numphase
USI numCom
num of components.
vector< OCP_DBL > dXsdXp
derivatives of second variables wrt. primary variables
vector< OCP_DBL > rho
mass density of phase: numPhase
vector< OCP_DBL > mu
viscosity of phase: numPhase
OCP_DBL P
pressure when flash calculation.
vector< OCP_BOOL > pSderExist
Existence of derivative of phase saturation.
USI numPhase
num of phases.
vector< OCP_DBL > vj
volume of phase: numPhase;
vector< OCP_DBL > S
saturation of phase: numPhase
vector< OCP_DBL > xij
Nij / nj: numPhase*numCom.
OCP_DBL Nt
Total moles of Components.
vector< OCP_DBL > Ni
moles of component: numCom
vector< OCP_BOOL > phaseExist
existence of phase: numPhase
vector< OCP_DBL > xiP
d xi / dP: numphase
OCP_DBL vf
volume of total fluids.
vector< USI > pVnumCom
num of variable components in the phase
vector< OCP_DBL > muP
d mu / dP: numPhase
vector< OCP_DBL > xi
molar density of phase: numPhase
USI Eval_All(const USI &j, const OCP_DBL &val, vector< OCP_DBL > &outdata, vector< OCP_DBL > &slope)
Careful: the memory outdata and slope have not be allocated before.
void Setup(const vector< vector< OCP_DBL >> &src)
Setup tables from existing data of table.
OCP_DBL Eval(const USI &j, const OCP_DBL &val, const USI &destj)
TableSet PVDO_T
Table set of PVDO.
TableSet PVTW_T
Table set of PVTW.
vector< vector< vector< OCP_DBL > > > data
All table with the same name.