OpenCAEPoro  0.2.0 Sep/22/2022
A simulator for multicomponent porous media flow
Public Member Functions | Protected Attributes | Friends | List of all members
Mixture Class Referenceabstract

#include <Mixture.hpp>

Inheritance diagram for Mixture:
BOMixture MixtureComp BOMixture_ODGW BOMixture_OW BOMixture_W

Public Member Functions

void Allocate ()
 Allocate memory for common variables for basic class.
 
virtual void SetPVTW ()
 
USI GetType () const
 return type of mixture.
 
virtual bool IsEmpty_PVDG () const
 Check whether Table PVDG is empty, it will only be used in black oil model.
 
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 InitFlashDer (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
 
virtual void InitFlashDer_n (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
 
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.
 
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.
 
virtual void FlashDeriv_n (const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Niin, const OCP_DBL *Sjin, const OCP_DBL *xijin, const OCP_DBL *njin, const USI &ftype, const USI *phaseExistin, const USI &lastNP, const OCP_DBL *lastKs)=0
 
virtual OCP_DBL XiPhase (const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Ziin)=0
 
virtual OCP_DBL RhoPhase (const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Ziin)=0
 return mass density of phase.
 
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.
 
virtual OCP_DBL GammaPhaseW (const OCP_DBL &Pin)=0
 return gamma of water phase, gamma equals to mass density times gravity factor.
 
virtual OCP_DBL GammaPhaseG (const OCP_DBL &Pin)=0
 return gamma of gas phase, gamma equals to mass density times gravity factor.
 
virtual OCP_DBL GammaPhaseOG (const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Ziin)=0
 
void CheckNi (const OCP_DBL *Ni)
 
virtual USI GetFtype ()=0
 
virtual OCP_SIN GetMinEigenSkip ()=0
 
virtual bool GetFlagSkip ()=0
 
virtual OCP_DBL GetSurTen ()=0
 
virtual OCP_DBL GetErrorPEC ()=0
 
virtual OCP_ULL GetSSMSTAiters ()=0
 
virtual OCP_ULL GetNRSTAiters ()=0
 
virtual OCP_ULL GetSSMSPiters ()=0
 
virtual OCP_ULL GetNRSPiters ()=0
 
virtual OCP_ULL GetRRiters ()=0
 
virtual OCP_ULL GetSSMSTAcounts ()=0
 
virtual OCP_ULL GetNRSTAcounts ()=0
 
virtual OCP_ULL GetSSMSPcounts ()=0
 
virtual OCP_ULL GetNRSPcounts ()=0
 
virtual OCP_ULL GetRRcounts ()=0
 

Protected Attributes

USI mixtureType
 
USI numPhase
 num of phases.
 
USI numCom
 num of components.
 
OCP_DBL P
 pressure when flash calculation.
 
OCP_DBL T
 temperature when flash calculation.
 
vector< OCP_DBLNi
 moles of component: numCom
 
vector< bool > phaseExist
 existence of phase: numPhase
 
vector< OCP_DBLS
 saturation of phase: numPhase
 
vector< OCP_DBLrho
 mass density of phase: numPhase
 
vector< OCP_DBLxi
 molar density of phase: numPhase
 
vector< OCP_DBLxij
 
vector< OCP_DBLnj
 mole number of phase j
 
vector< OCP_DBLmu
 viscosity of phase: numPhase
 
vector< OCP_DBLv
 volume of phase: numPhase;
 
OCP_DBL vf
 volume of total fluids.
 
OCP_DBL Nt
 Total moles of Components.
 
vector< vector< OCP_DBL > > vji
 dvj / dNi, used in 2 hydrocarbon phase in EOS; or dvj / dnij
 
vector< OCP_DBLvjp
 dvj / dp, used in 2 hydrocarbon phase in EOS
 
OCP_DBL vfp
 
vector< OCP_DBLvfi
 
vector< OCP_DBLmuP
 d mu / dP: numPhase
 
vector< OCP_DBLxiP
 d xi / dP: numphase
 
vector< OCP_DBLrhoP
 d rho / dP: numphase
 
vector< OCP_DBLmuN
 d mu[j] / d N[i]: numphase * numCom
 
vector< OCP_DBLxiN
 d xi[j] / d N[i]: numphase * numCom
 
vector< OCP_DBLrhoN
 d rho[j] / d N[i]: numphase * numCom
 
vector< OCP_DBLmux
 d mu[j] / d x[i][j]: numphase * numCom
 
vector< OCP_DBLxix
 d xi[j] / d x[i][j]: numphase * numCom
 
vector< OCP_DBLrhox
 d rho[j] / d x[i][j]: numphase * numCom
 
vector< OCP_DBLdXsdXp
 the derivates of second variables wrt. primary variables
 
vector< USIpEnumCom
 see pEnumCom in bulk
 
vector< OCP_DBLres
 residual of a set of equations
 
OCP_DBL resPc
 a precalculated value
 
vector< OCP_DBLkeyDer
 d (xij*xi/mu) / dP or dNk
 

Friends

class Bulk
 
class Well
 
class AllWells
 

Detailed Description

Mixture is an abstract class, who contains all information used for flash calculation including variables, functions. any properties of phases such as mass density can calculated by it. it has the same data structure as the ones in bulks.

Definition at line 28 of file Mixture.hpp.

Member Function Documentation

◆ CheckNi()

void Mixture::CheckNi ( const OCP_DBL Ni)
inline

check if Ni input from param is negative, it's used in debug mode to check Hidden trouble. actually, very small error in very short time may not make trouble.

Definition at line 122 of file Mixture.hpp.

123  {
124  bool flag = true;
125  for (USI i = 0; i < numCom; i++) {
126  if (Ni[i] < 0) {
127  cout << "Ni[" << i << "] = " << Ni[i] << endl;
128  flag = false;
129  break; // skip the rest checks
130  }
131  }
132  if (!flag) OCP_ABORT("Ni is negative!");
133  }
unsigned int USI
Generic unsigned integer.
Definition: OCPConst.hpp:22
#define OCP_ABORT(msg)
Abort if critical error happens.
Definition: UtilError.hpp:47
USI numCom
num of components.
Definition: Mixture.hpp:157
vector< OCP_DBL > Ni
moles of component: numCom
Definition: Mixture.hpp:161

References OCP_ABORT.

◆ GammaPhaseOG()

virtual OCP_DBL Mixture::GammaPhaseOG ( const OCP_DBL Pin,
const OCP_DBL Tin,
const OCP_DBL Ziin 
)
pure virtual

return gamma of hydrocarbon mixture, gamma equals to mass density times gravity factor.

Implemented in MixtureComp, and BOMixture.

◆ XiPhase()

virtual OCP_DBL Mixture::XiPhase ( const OCP_DBL Pin,
const OCP_DBL Tin,
const OCP_DBL Ziin 
)
pure virtual

Return molar density of phase, it's used to calculate the molar density of injection fluids in injection wells.

Implemented in MixtureComp, BOMixture_ODGW, BOMixture_OW, and BOMixture_W.

Member Data Documentation

◆ mixtureType

USI Mixture::mixtureType
protected

indicates the type of mixture, black oil or compositional or others.

Definition at line 153 of file Mixture.hpp.

◆ vfi

vector<OCP_DBL> Mixture::vfi
protected

dVf / dNi: numCom the derivative of volume of total fluids with respect to moles of components.

Definition at line 182 of file Mixture.hpp.

◆ vfp

OCP_DBL Mixture::vfp
protected

dVf / dP, the derivative of volume of total fluids with respect to pressure.

Definition at line 180 of file Mixture.hpp.

◆ xij

vector<OCP_DBL> Mixture::xij
protected

Nij / Nj: numPhase*numCom, Nij is the moles of component i in phase j, Nj is the moles of phase j.

Definition at line 166 of file Mixture.hpp.


The documentation for this class was generated from the following file: