12 #ifndef __MIXTURE_HEADER__
13 #define __MIXTURE_HEADER__
41 phaseExist.resize(numPhase);
46 xij.resize(numPhase * numCom);
54 vjp.resize(numPhase, 0);
56 rhoP.resize(numPhase);
59 rhoN.resize(numPhase * numCom);
60 xiN.resize(numPhase * numCom);
61 muN.resize(numPhase * numCom);
62 rhox.resize(numPhase * numCom);
63 xix.resize(numPhase * numCom);
64 mux.resize(numPhase * numCom);
65 dXsdXp.resize((numCom + 1) * (numPhase + numPhase * numCom));
66 pEnumCom.resize(numPhase);
67 res.resize(numPhase + numPhase * numCom + 1);
69 keyDer.resize((numCom + 1) * ((numPhase - 1) * (numCom - 1) + 1));
72 virtual void SetPVTW(){};
81 virtual void InitFlashDer(
const OCP_DBL& Pin,
const OCP_DBL& Pbbin,
84 virtual void InitFlashDer_n(
const OCP_DBL& Pin,
const OCP_DBL& Pbbin,
97 const OCP_DBL* njin,
const USI& ftype,
const USI* phaseExistin,
125 for (
USI i = 0; i < numCom; i++) {
127 cout <<
"Ni[" << i <<
"] = " << Ni[i] << endl;
135 virtual USI GetFtype() = 0;
136 virtual OCP_SIN GetMinEigenSkip() = 0;
137 virtual bool GetFlagSkip() = 0;
138 virtual OCP_DBL GetSurTen() = 0;
140 virtual OCP_DBL GetErrorPEC() = 0;
141 virtual OCP_ULL GetSSMSTAiters() = 0;
142 virtual OCP_ULL GetNRSTAiters() = 0;
143 virtual OCP_ULL GetSSMSPiters() = 0;
144 virtual OCP_ULL GetNRSPiters() = 0;
145 virtual OCP_ULL GetRRiters() = 0;
146 virtual OCP_ULL GetSSMSTAcounts() = 0;
147 virtual OCP_ULL GetNRSTAcounts() = 0;
148 virtual OCP_ULL GetSSMSPcounts() = 0;
149 virtual OCP_ULL GetNRSPcounts() = 0;
150 virtual OCP_ULL GetRRcounts() = 0;
177 vector<vector<OCP_DBL>>
vji;
Definition of build-in datatypes and consts.
unsigned int USI
Generic unsigned integer.
double OCP_DBL
Double precision.
float OCP_SIN
Single precision.
unsigned long long OCP_ULL
Long long unsigned integer.
ParamReservoir class declaration.
#define OCP_ABORT(msg)
Abort if critical error happens.
Physical information of each active reservoir bulk.
virtual OCP_DBL GammaPhaseW(const OCP_DBL &Pin)=0
return gamma of water phase, gamma equals to mass density times gravity factor.
OCP_DBL resPc
a precalculated value
vector< OCP_DBL > rhoP
d rho / dP: numphase
vector< USI > pEnumCom
see pEnumCom in bulk
USI numCom
num of components.
vector< OCP_DBL > dXsdXp
the derivates of second variables wrt. primary variables
vector< OCP_DBL > rho
mass density of phase: numPhase
vector< OCP_DBL > mu
viscosity of phase: numPhase
vector< bool > phaseExist
existence of phase: numPhase
OCP_DBL P
pressure when flash calculation.
vector< OCP_DBL > vjp
dvj / dp, used in 2 hydrocarbon phase in EOS
USI numPhase
num of phases.
vector< OCP_DBL > xiN
d xi[j] / d N[i]: numphase * numCom
virtual void InitFlash(const OCP_DBL &Pin, const OCP_DBL &Pbbin, const OCP_DBL &Tin, const OCP_DBL *Sjin, const OCP_DBL &Vpore, const OCP_DBL *Ziin)=0
flash calculation with saturation of phases.
virtual void Flash(const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Niin, const USI &ftype, const USI &lastNP, const OCP_DBL *lastKs)=0
Flash calculation with moles of components.
vector< vector< OCP_DBL > > vji
dvj / dNi, used in 2 hydrocarbon phase in EOS; or dvj / dnij
vector< OCP_DBL > xix
d xi[j] / d x[i][j]: numphase * numCom
virtual OCP_DBL GammaPhaseOG(const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Ziin)=0
virtual OCP_DBL GammaPhaseO(const OCP_DBL &Pin, const OCP_DBL &Pbbin)=0
return gamma of oil phase, gamma equals to mass density times gravity factor.
vector< OCP_DBL > rhox
d rho[j] / d x[i][j]: numphase * numCom
OCP_DBL T
temperature when flash calculation.
vector< OCP_DBL > v
volume of phase: numPhase;
vector< OCP_DBL > S
saturation of phase: numPhase
vector< OCP_DBL > muN
d mu[j] / d N[i]: numphase * numCom
virtual void FlashDeriv(const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Niin, const USI &ftype, const USI &lastNP, const OCP_DBL *lastKs)=0
Flash calculation with moles of components and Calculate the derivative.
OCP_DBL Nt
Total moles of Components.
virtual OCP_DBL GammaPhaseG(const OCP_DBL &Pin)=0
return gamma of gas phase, gamma equals to mass density times gravity factor.
vector< OCP_DBL > nj
mole number of phase j
vector< OCP_DBL > Ni
moles of component: numCom
void CheckNi(const OCP_DBL *Ni)
virtual OCP_DBL XiPhase(const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Ziin)=0
virtual bool IsEmpty_PVDG() const
Check whether Table PVDG is empty, it will only be used in black oil model.
vector< OCP_DBL > keyDer
d (xij*xi/mu) / dP or dNk
vector< OCP_DBL > xiP
d xi / dP: numphase
OCP_DBL vf
volume of total fluids.
vector< OCP_DBL > rhoN
d rho[j] / d N[i]: numphase * numCom
USI GetType() const
return type of mixture.
virtual OCP_DBL RhoPhase(const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Ziin)=0
return mass density of phase.
vector< OCP_DBL > muP
d mu / dP: numPhase
vector< OCP_DBL > mux
d mu[j] / d x[i][j]: numphase * numCom
vector< OCP_DBL > res
residual of a set of equations
void Allocate()
Allocate memory for common variables for basic class.
vector< OCP_DBL > xi
molar density of phase: numPhase