OpenCAEPoro  0.2.0 Sep/22/2022
A simulator for multicomponent porous media flow
Public Member Functions | Public Attributes | List of all members
EoSparam Class Reference

EoSParam contains the params for Compositional Model and functions to read them. More...

#include <ParamReservoir.hpp>

Public Member Functions

void InitEoSparam ()
 Init Params.
 
void InputCOM (ifstream &ifs)
 Input the information of components. More...
 
void InputCOMPONENTS (ifstream &ifs, const string &keyword)
 Input the information of hydrocarbon components.
 
Type_A_r< vector< OCP_DBL > > * FindPtr (const string &varName)
 
void InputCNAMES (ifstream &ifs)
 Input the names of hydrocarbon components.
 
void InputLBCCOEF (ifstream &ifs)
 Input LBC coefficients for viscosity calculation.
 
void InputBIC (ifstream &ifs)
 Input the Binary interaction of components. More...
 
void InputSSMSTA (ifstream &ifs)
 TODO: Add Doxygen.
 
void InputNRSTA (ifstream &ifs)
 TODO: Add Doxygen.
 
void InputSSMSP (ifstream &ifs)
 TODO: Add Doxygen.
 
void InputNRSP (ifstream &ifs)
 TODO: Add Doxygen.
 
void InputRR (ifstream &ifs)
 TODO: Add Doxygen.
 

Public Attributes

USI NTPVT {1}
 num of EoS region, constant now.
 
USI numCom {0}
 num of components, water is excluded.
 
USI numPhase {2}
 num of phase, water is excluded, constant now.
 
vector< vector< string > > COM
 Components information.
 
vector< string > Cname
 Name of hydrocarbon components.
 
Type_A_r< vector< OCP_DBL > > Tc
 Critical temperature of hydrocarbon components.
 
Type_A_r< vector< OCP_DBL > > Pc
 Critical pressure of hydrocarbon components.
 
Type_A_r< vector< OCP_DBL > > Vc
 Critical volume of hydrocarbon components.
 
Type_A_r< vector< OCP_DBL > > Zc
 Critical Z-factor of hydrocarbon components.
 
Type_A_r< vector< OCP_DBL > > MW
 Molecular Weight of hydrocarbon components.
 
Type_A_r< vector< OCP_DBL > > Acf
 Acentric factor of hydrocarbon components.
 
Type_A_r< vector< OCP_DBL > > OmegaA
 OMEGA_A of hydrocarbon components.
 
Type_A_r< vector< OCP_DBL > > OmegaB
 OMEGA_B of hydrocarbon components.
 
Type_A_r< vector< OCP_DBL > > Vshift
 Volume shift of hydrocarbon components.
 
Type_A_r< vector< OCP_DBL > > Parachor
 PARACHOR of hydrocarbon components.
 
Type_A_r< vector< OCP_DBL > > Vcvis
 Critical volume used for viscosity calculations only.
 
Type_A_r< vector< OCP_DBL > > Zcvis
 Critical Z-factor used for viscosity calculations only.
 
vector< OCP_DBLLBCcoef
 LBC coefficients for viscosity calculation.
 
vector< vector< OCP_DBL > > BIC
 Binary interaction.
 
bool miscible {false}
 Miscible treatment of hydrocarbons, used in compositional Model.
 
vector< string > SSMparamSTA
 Params for Solving Phase Spliting with SSM.
 
vector< string > NRparamSTA
 Params for Solving Phase Spliting with NR.
 
vector< string > SSMparamSP
 Params for Solving Phase Spliting with SSM.
 
vector< string > NRparamSP
 Params for Solving Phase Spliting with NR.
 
vector< string > RRparam
 Params for Solving Rachford-Rice equations.
 

Detailed Description

EoSParam contains the params for Compositional Model and functions to read them.

Definition at line 65 of file ParamReservoir.hpp.

Member Function Documentation

◆ FindPtr()

Type_A_r< vector< OCP_DBL > > * EoSparam::FindPtr ( const string &  varName)

Find corresponding variable according to the name of variable. It is used for the basic properties of hydrocarbon components such as TCRIT

Definition at line 811 of file ParamReservoir.cpp.

812 {
813  Type_A_r<vector<OCP_DBL>>* myPtr = nullptr;
814 
815  switch (Map_Str2Int(&varName[0], varName.size()))
816  {
817  case Map_Str2Int("TCRIT", 5):
818  myPtr = &Tc;
819  break;
820 
821  case Map_Str2Int("PCRIT", 5):
822  myPtr = &Pc;
823  break;
824 
825  case Map_Str2Int("VCRIT", 5):
826  myPtr = &Vc;
827  break;
828 
829  case Map_Str2Int("ZCRIT", 5):
830  myPtr = &Zc;
831  break;
832 
833  case Map_Str2Int("MW", 2):
834  myPtr = &MW;
835  break;
836 
837  case Map_Str2Int("ACF", 3):
838  myPtr = &Acf;
839  break;
840 
841  case Map_Str2Int("OMEGAA", 6):
842  myPtr = &OmegaA;
843  break;
844 
845  case Map_Str2Int("OMEGAB", 6):
846  myPtr = &OmegaB;
847  break;
848 
849  case Map_Str2Int("SSHIFT", 6):
850  myPtr = &Vshift;
851  break;
852 
853  case Map_Str2Int("PARACHOR", 8):
854  myPtr = &Parachor;
855  break;
856 
857  case Map_Str2Int("VCRITVIS", 8):
858  myPtr = &Vcvis;
859  break;
860 
861  case Map_Str2Int("ZCRITVIS", 8):
862  myPtr = &Zcvis;
863  break;
864 
865  }
866 
867  return myPtr;
868 }
constexpr long long Map_Str2Int(const char *mystr, const USI &len)
Definition: UtilInput.hpp:34
Type_A_r< vector< OCP_DBL > > Zcvis
Critical Z-factor used for viscosity calculations only.
Type_A_r< vector< OCP_DBL > > Vcvis
Critical volume used for viscosity calculations only.
Type_A_r< vector< OCP_DBL > > Vshift
Volume shift of hydrocarbon components.
Type_A_r< vector< OCP_DBL > > MW
Molecular Weight of hydrocarbon components.
Type_A_r< vector< OCP_DBL > > Acf
Acentric factor of hydrocarbon components.
Type_A_r< vector< OCP_DBL > > OmegaB
OMEGA_B of hydrocarbon components.
Type_A_r< vector< OCP_DBL > > Pc
Critical pressure of hydrocarbon components.
Type_A_r< vector< OCP_DBL > > Vc
Critical volume of hydrocarbon components.
Type_A_r< vector< OCP_DBL > > OmegaA
OMEGA_A of hydrocarbon components.
Type_A_r< vector< OCP_DBL > > Tc
Critical temperature of hydrocarbon components.
Type_A_r< vector< OCP_DBL > > Parachor
PARACHOR of hydrocarbon components.
Type_A_r< vector< OCP_DBL > > Zc
Critical Z-factor of hydrocarbon components.

References Acf, Map_Str2Int(), MW, OmegaA, OmegaB, Parachor, Pc, Tc, Vc, Vcvis, Vshift, Zc, and Zcvis.

◆ InputBIC()

void EoSparam::InputBIC ( ifstream &  ifs)

Input the Binary interaction of components.

Input Binary Interaction Coefficients Matrix.

Definition at line 958 of file ParamReservoir.cpp.

959 {
960  OCP_ASSERT((numCom > 0) && (NTPVT > 0), "NCNP hasn't been input!");
961 
962  BIC.resize(NTPVT);
963 
964  vector<string> vbuf;
965  USI nReg = 0;
966  while (true) {
967  ReadLine(ifs, vbuf);
968  if (vbuf[0] == "/") {
969  nReg++;
970  if (nReg >= NTPVT)
971  break;
972  continue;
973  }
974  for (auto& v : vbuf) {
975  if (v != "/") {
976  BIC[nReg].push_back(stod(v));
977  cout << setw(10) << BIC[nReg].back();
978  }
979  }
980  cout << endl;
981  if (vbuf.back() == "/") {
982  nReg++;
983  if (nReg >= NTPVT)
984  break;
985  }
986  }
987 }
unsigned int USI
Generic unsigned integer.
Definition: OCPConst.hpp:22
#define OCP_ASSERT(cond, msg)
Assert condition and log user messages in DEBUG mode.
Definition: UtilError.hpp:58
bool ReadLine(ifstream &ifs, vector< string > &result)
Definition: UtilInput.cpp:14
USI numCom
num of components, water is excluded.
USI NTPVT
num of EoS region, constant now.
vector< vector< OCP_DBL > > BIC
Binary interaction.

References BIC, NTPVT, numCom, OCP_ASSERT, and ReadLine().

◆ InputCOM()

void EoSparam::InputCOM ( ifstream &  ifs)

Input the information of components.

TODO: Add Doxygen.

Definition at line 777 of file ParamReservoir.cpp.

778 {
779  OCP_ASSERT(numCom > 0, "Wrong NC!");
780  COM.resize(numCom);
781  USI len = 9;
782 
783  vector<string> vbuf;
784 
785  for (USI c = 0; c < numCom; c++) {
786  COM[c].resize(len);
787  ReadLine(ifs, vbuf);
788  for (USI i = 0; i < len; i++) {
789  COM[c][i] = vbuf[i];
790  }
791  }
792  OCP_FUNCNAME;
793  cout << "Name "
794  << "Pc "
795  << "Tc "
796  << "Acentric "
797  << "MW "
798  << "Vc "
799  << "OmegaA "
800  << "OmegaB "
801  << "Shift" << endl;
802  for (auto& c : COM) {
803  for (auto& item : c) {
804  cout << item << "\t";
805  }
806  cout << endl;
807  }
808  cout << endl;
809 }
#define OCP_FUNCNAME
Print Function Name.
Definition: UtilError.hpp:73
vector< vector< string > > COM
Components information.

References COM, numCom, OCP_ASSERT, OCP_FUNCNAME, and ReadLine().


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