OpenCAEPoro  v0.5.0
A simulator for multicomponent porous media flow
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Mixture Class Referenceabstract

#include <Mixture.hpp>

Inheritance diagram for Mixture:
BOMixture MixtureComp MixtureThermal BOMixture_ODGW BOMixture_OW BOMixture_W MixtureThermal_K01

Public Member Functions

void Allocate ()
 Allocate memory for common variables for basic class.
 
virtual void SetupOptionalFeatures (OptionalFeatures &optFeatures, const OCP_USI &numBulk)=0
 
USI GetMixtureType () const
 return type of mixture.
 
virtual void Flash (const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Niin)=0
 flash calculation with saturation of phases.
 
virtual void InitFlashIMPEC (const OCP_DBL &Pin, const OCP_DBL &Pbbin, const OCP_DBL &Tin, const OCP_DBL *Sjin, const OCP_DBL &Vpore, const OCP_DBL *Ziin, const OCP_USI &bId)=0
 
virtual void InitFlashFIM (const OCP_DBL &Pin, const OCP_DBL &Pbbin, const OCP_DBL &Tin, const OCP_DBL *Sjin, const OCP_DBL &Vpore, const OCP_DBL *Ziin, const OCP_USI &bId)=0
 
virtual void InitFlashFIMn (const OCP_DBL &Pin, const OCP_DBL &Pbbin, const OCP_DBL &Tin, const OCP_DBL *Sjin, const OCP_DBL &Vpore, const OCP_DBL *Ziin, const OCP_USI &bId)=0
 
virtual 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)=0
 Flash calculation with moles of components.
 
virtual 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)=0
 Flash calculation with moles of components and Calculate the derivative.
 
virtual void FlashFIMn (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 *phaseExistin, const USI &lastNP, const OCP_USI &bId)=0
 
virtual OCP_DBL XiPhase (const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Ziin, const USI &tarPhase)=0
 return mass density of phase
 
virtual OCP_DBL RhoPhase (const OCP_DBL &Pin, const OCP_DBL &Pbb, const OCP_DBL &Tin, const OCP_DBL *Ziin, const USI &tarPhase)=0
 return mass density of phase
 
virtual void SetupWellOpt (WellOpt &opt, const vector< SolventINJ > &sols, const OCP_DBL &Psurf, const OCP_DBL &Tsurf)=0
 
virtual void CalProdWeight (const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Niin, const vector< OCP_DBL > &prodPhase, vector< OCP_DBL > &prodWeight)=0
 Calculate ProdWeight for PROD well.
 
virtual void CalProdRate (const OCP_DBL &Pin, const OCP_DBL &Tin, const OCP_DBL *Niin, vector< OCP_DBL > &prodRate)=0
 Calculate Production rate for PROD well.
 
virtual OCP_DBL CalInjWellEnthalpy (const OCP_DBL &Tin, const OCP_DBL *Ziin)=0
 
void CheckNi (const OCP_DBL *Ni)
 
virtual OCP_DBL GetErrorPEC ()=0
 
virtual void OutMixtureIters () const =0
 
const OCP_DBLGetNt () const
 
const OCP_DBLGetNi (const USI &i) const
 
const OCP_DBLGetVf () const
 
const OCP_BOOLGetPhaseExist (const USI &j) const
 
const OCP_DBLGetS (const USI &j) const
 
const OCP_DBLGetVj (const USI &j) const
 
const OCP_DBLGetNj (const USI &j) const
 
const OCP_DBLGetXij (const USI &j, const USI &i) const
 
const OCP_DBLGetRho (const USI &j) const
 
const OCP_DBLGetXi (const USI &j) const
 
const OCP_DBLGetMu (const USI &j) const
 
const OCP_DBLGetVfP () const
 
const OCP_DBLGetVfT () const
 
const OCP_DBLGetVfi (const USI &i) const
 
const OCP_DBLGetRhoP (const USI &j) const
 
const OCP_DBLGetRhoT (const USI &j) const
 
const OCP_DBLGetXiP (const USI &j) const
 
const OCP_DBLGetXiT (const USI &j) const
 
const OCP_DBLGetMuP (const USI &j) const
 
const OCP_DBLGetMuT (const USI &j) const
 
const OCP_DBLGetRhoX (const USI &j, const USI &i) const
 
const OCP_DBLGetXiX (const USI &j, const USI &i) const
 
const OCP_DBLGetMuX (const USI &j, const USI &i) const
 
const OCP_BOOLGetPSderExist (const USI &j) const
 
const USIGetPVnumCom (const USI &j) const
 
const vector< OCP_DBL > & GetDXsDXp () const
 
const vector< OCP_DBL > & GetRes () const
 
const OCP_DBL GetResPc () const
 
const OCP_DBL GetUf () const
 
const OCP_DBL GetUfP () const
 
const OCP_DBL GetUfT () const
 
const OCP_DBL GetUfi (const USI &i) const
 
const OCP_DBL GetH (const USI &j) const
 
const OCP_DBL GetHT (const USI &j) const
 
const OCP_DBLGetHx (const USI &j, const USI &i) const
 

Protected Member Functions

void SetBulkId (const OCP_USI &n)
 

Protected Attributes

USI mixtureType
 
OCP_USI bulkId
 index of current bulk
 
USI numPhase
 num of phases.
 
USI numCom
 num of components.
 
OCP_DBL P
 pressure when flash calculation.
 
OCP_DBL T
 temperature when flash calculation.
 
OCP_DBL vf
 volume of total fluids.
 
OCP_DBL Nt
 Total moles of Components.
 
vector< OCP_DBLNi
 moles of component: numCom
 
vector< OCP_BOOLphaseExist
 existence of phase: numPhase
 
vector< OCP_DBLS
 saturation of phase: numPhase
 
vector< OCP_DBLvj
 volume of phase: numPhase;
 
vector< OCP_DBLnj
 mole number of phase j
 
vector< OCP_DBLxij
 Nij / nj: numPhase*numCom.
 
vector< OCP_DBLrho
 mass density of phase: numPhase
 
vector< OCP_DBLxi
 molar density of phase: numPhase
 
vector< OCP_DBLmu
 viscosity of phase: numPhase
 
OCP_DBL vfP
 
OCP_DBL vfT
 d vf / dT
 
vector< OCP_DBLvfi
 
vector< OCP_DBLrhoP
 d rho / dP: numphase
 
vector< OCP_DBLrhoT
 d rho j / dT: numPhase
 
vector< OCP_DBLrhox
 d rho[j] / d x[i][j]: numphase * numCom
 
vector< OCP_DBLxiP
 d xi / dP: numphase
 
vector< OCP_DBLxiT
 d xi j / dT: numPhase
 
vector< OCP_DBLxix
 d xi[j] / d x[i][j]: numphase * numCom
 
vector< OCP_DBLmuP
 d mu / dP: numPhase
 
vector< OCP_DBLmuT
 d mu j / dT: numPhase
 
vector< OCP_DBLmux
 d mu[j] / d x[i][j]: numphase * numCom
 
vector< OCP_DBLdXsdXp
 derivatives of second variables wrt. primary variables
 
OCP_DBL Uf
 Internal energy of fluid.
 
OCP_DBL UfP
 dUf / dP
 
OCP_DBL UfT
 dUf / dT
 
vector< OCP_DBLUfi
 dUf / dNi
 
vector< OCP_DBLH
 Enthalpy.
 
vector< OCP_DBLHT
 d Hj / d T
 
vector< OCP_DBLHx
 d Hj / d xij
 
vector< OCP_BOOLpSderExist
 Existence of derivative of phase saturation.
 
vector< USIpVnumCom
 num of variable components in the phase
 
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 30 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 166 of file Mixture.hpp.

167  {
168  OCP_BOOL flag = OCP_TRUE;
169  for (USI i = 0; i < numCom; i++) {
170  if (Ni[i] < 0) {
171  cout << "Ni[" << i << "] = " << Ni[i] << endl;
172  flag = OCP_FALSE;
173  break; // skip the rest checks
174  }
175  }
176  if (!flag) OCP_ABORT("Ni is negative!");
177  }
unsigned int USI
Generic unsigned integer.
Definition: OCPConst.hpp:23
unsigned int OCP_BOOL
OCP_BOOL in OCP.
Definition: OCPConst.hpp:29
#define OCP_ABORT(msg)
Abort if critical error happens.
Definition: UtilError.hpp:47
USI numCom
num of components.
Definition: Mixture.hpp:242
vector< OCP_DBL > Ni
moles of component: numCom
Definition: Mixture.hpp:248

◆ SetupWellOpt()

virtual void Mixture::SetupWellOpt ( WellOpt opt,
const vector< SolventINJ > &  sols,
const OCP_DBL Psurf,
const OCP_DBL Tsurf 
)
pure virtual

Setup injZi, injProdPhase and factorINJ for INJ well Setup prodPhaseWeight for PROD well

Implemented in MixtureThermal_K01, 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 238 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 262 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 259 of file Mixture.hpp.


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