OpenCAEPoro
0.2.0 Sep/22/2022
A simulator for multicomponent porous media flow
|
Physical information of each active reservoir bulk. More...
#include <Bulk.hpp>
Public Member Functions | |
void | InputParam (ParamReservoir &rs_param) |
Input param from internal data structure ParamReservoir. More... | |
void | Setup (const Grid &myGrid) |
Allocate memory for bulk data of grid. More... | |
void | InitSjPcBo (const USI &tabrow) |
Calculate initial equilibrium for blkoil model according to EQUIL. More... | |
void | InitSjPcComp (const USI &tabrow, const Grid &myGrid) |
Calculate initial equilibrium for compositional model according to EQUIL. More... | |
void | InitFlash (const bool &flag=false) |
Perform flash calculation with saturations. More... | |
void | InitFlashDer () |
Perform flash calculation with saturations and calculate derivatives. | |
void | InitFlashDer_n () |
void | Flash () |
Perform flash calculation with Ni. More... | |
void | FlashBLKOIL () |
Perform flash calculation with Ni in Black Oil Model. | |
void | FlashCOMP () |
Perform flash calculation with Ni in Compositional Model. | |
void | FlashDeriv () |
Perform flash calculation with Ni and calculate derivatives. More... | |
void | FlashDeriv_n () |
void | FlashDerivBLKOIL () |
Perform flash calculation with Ni in Black Oil Model. | |
void | FlashDerivBLKOIL_n () |
void | FlashDerivCOMP () |
Perform flash calculation with Ni in Compositional Model. | |
void | FlashDerivCOMP_n () |
USI | CalFlashType (const OCP_USI &n) const |
determine which flash type will be used | |
void | PassFlashValue (const OCP_USI &n) |
Pass values from Flash to Bulk after Flash calculation. | |
void | PassFlashValueAIMc (const OCP_USI &n) |
void | PassFlashValueDeriv (const OCP_USI &n) |
Pass derivative values from Flash to Bulk after Flash calculation. | |
void | PassFlashValueDeriv_n (const OCP_USI &n) |
void | ResetFlash () |
Reset variables in flash calculations. | |
void | CalKrPc () |
Calculate relative permeability and capillary pressure with saturation. More... | |
void | CalKrPcDeriv () |
Calculate relative permeability and capillary pressure and their derivatives. | |
void | CalVpore () |
Calculate volume of pore with pressure. | |
OCP_DBL | CalFPR () const |
Calculate average pressure in reservoir. | |
void | CalMaxChange () |
Calculate max change of some variables. | |
void | CheckSetup () const |
Check if error occurs in Setup. | |
void | CheckInitVpore () const |
Check initial pore volume. More... | |
void | CheckVpore () const |
Check pore volume. | |
bool | CheckP () const |
Check if negative P occurs, return false if so. More... | |
bool | CheckNi () |
Check if negative Ni occurs, return false if so. More... | |
bool | CheckVe (const OCP_DBL &Vlim) const |
Check if relative volume error is out of range, return false if so. More... | |
void | CheckSat () const |
Check if the sum of saturations is one. | |
void | CheckDiff () |
Check difference from last time step, for Debug and Test. | |
OCP_USI | GetBulkNum () const |
Return the number of bulks. | |
USI | GetComNum () const |
Return the number of components. | |
USI | GetPhaseNum () const |
Return the number of phases. | |
USI | GetMixMode () const |
Return the mixture mode. | |
const vector< Mixture * > & | GetMixture () const |
Return flash results (it has not been used by far). | |
OCP_DBL | GetP (const OCP_USI &n) const |
Return pressure of the n-th bulk. | |
OCP_DBL | GetSOIL (const OCP_USI &n) const |
Return oil saturation of the n-th bulk. | |
OCP_DBL | GetSGAS (const OCP_USI &n) const |
Return gas saturation of the n-th bulk. | |
OCP_DBL | GetSWAT (const OCP_USI &n) const |
Return water saturation of the n-th bulk. | |
OCP_DBL | GetdPmax () const |
Return dPmax. | |
OCP_DBL | GetdNmax () const |
Return dNmax. | |
OCP_DBL | GetdSmax () const |
Return dSmax. | |
OCP_DBL | GetdVmax () const |
Return dVmax. | |
void | ResetphaseNum () |
void | ResetminEigenSkip () |
void | ResetflagSkip () |
void | ResetziSkip () |
void | ResetPSkip () |
void | ResetKs () |
void | ResetNt () |
Reset Nt to the ones of the last time step. | |
void | ResetP () |
Reset P to the ones of the last time step. | |
void | ResetPj () |
Reset Pj to the ones of the last time step. | |
void | ResetNi () |
Reset Ni to the ones of the last time step. | |
void | ResetKr () |
Reset Kr to the ones of the last time step. | |
void | ResetVp () |
Reset Vp to the ones of the last time step. | |
void | CalSomeInfo (const Grid &myGrid) const |
void | AllocateWellBulkId (const USI &n) |
Allocate memory for WellbulkId. | |
void | ClearWellBulkId () |
OCP_DBL | CalNT () |
void | AllocateAuxIMPEC () |
Allocate memory for auxiliary variables used for IMPEC. | |
void | GetSolIMPEC (const vector< OCP_DBL > &u) |
Update P and Pj after linear system is solved. | |
void | SetCFL2Zero () const |
Initialize the CFL number. | |
OCP_DBL | CalCFL () const |
Calculate the CFL number. | |
void | UpdateLastStepIMPEC () |
Update value of last step for IMPEC. | |
void | AllocateAuxFIM () |
Allocate memory for auxiliary variables used for FIM. | |
void | GetSolFIM (const vector< OCP_DBL > &u, const OCP_DBL &dPmaxlim, const OCP_DBL &dSmaxlim) |
Get the solution for FIM after a Newton iteration. | |
void | GetSolFIM_n (const vector< OCP_DBL > &u, const OCP_DBL &dPmaxlim, const OCP_DBL &dSmaxlim) |
void | GetSol01FIM (const vector< OCP_DBL > &u) |
Get the solution for FIM after a Newton iteration??? | |
void | CalRelResFIM (ResFIM &resFIM) const |
Calculate relative resiual for FIM. | |
void | ShowRes (const vector< OCP_DBL > &res) const |
void | ResetFIM () |
Reset FIM. | |
void | UpdateLastStepFIM () |
Update values of last step for FIM. | |
OCP_DBL | CalNRdSmax (OCP_USI &index) |
Calculate some auxiliary variable, for example, dSmax. | |
OCP_DBL | GetNRdPmax () |
Return NRdPmax. | |
OCP_DBL | GetNRdSmaxP () |
Return NRdSmaxP. | |
OCP_DBL | GetNRdNmax () |
void | CorrectNi (const vector< OCP_DBL > &res) |
void | OutputInfo (const OCP_USI &n) const |
OCP_ULL | GetSSMSTAiters () const |
OCP_ULL | GetNRSTAiters () const |
OCP_ULL | GetSSMSPiters () const |
OCP_ULL | GetNRSPiters () const |
OCP_ULL | GetRRiters () const |
OCP_ULL | GetSSMSTAcounts () const |
OCP_ULL | GetNRSTAcounts () const |
OCP_ULL | GetSSMSPcounts () const |
OCP_ULL | GetNRSPcounts () const |
OCP_ULL | GetRRcounts () const |
void | AllocateAuxAIM (const OCP_DBL &ratio) |
Allocate memory for auxiliary variables used for AIMt. | |
OCP_USI | GetMaxFIMBulk () const |
void | FlashDerivAIM (const bool &IfAIMs) |
Perform flash calculation with Ni and calculate derivatives. | |
void | PassFlashValueDerivAIM (const OCP_USI &n) |
void | CalKrPcDerivAIM (const bool &IfAIMs) |
Calculate relative permeability and capillary pressure and their derivatives. | |
void | CalRelResAIMt (ResFIM &resFIM) const |
Calculate relative resiual for local FIM. | |
void | GetSolAIMt (const vector< OCP_DBL > &u, const OCP_DBL &dPmaxlim, const OCP_DBL &dSmaxlim) |
Get the solution for local FIM after a Newton iteration. | |
void | CalRelResAIMs (ResFIM &resFIM) const |
Calculate relative resiual for AIMs, parts related to FIM are considered. | |
void | GetSolAIMs (const vector< OCP_DBL > &u, const OCP_DBL &dPmaxlim, const OCP_DBL &dSmaxlim) |
void | UpdateLastStepAIM () |
void | ResetFIMBulk () |
void | ShowFIMBulk (const bool &flag=false) const |
bool | CheckNiFIMBulk () const |
Check if negative Ni occurs, return false if so. | |
void | InFIMNi () |
Ni in FIM Bulk -> FIMNi. | |
void | OutFIMNi () |
FIMNi -> Ni in FIM Bulk. | |
void | AllocateAuxAIMc () |
void | FlashAIMc () |
Perform flash calculation with Ni. | |
void | FlashBLKOILAIMc () |
Perform flash calculation with Ni in Black Oil Model. | |
void | FlashCOMPAIMc () |
Perform flash calculation with Ni in Compositional Model. | |
void | FlashAIMc01 () |
void | FlashBLKOILAIMc01 () |
void | FlashCOMPAIMc01 () |
void | FlashDerivAIMc () |
Perform flash calculation with Ni and calculate derivatives. | |
void | FlashDerivBLKOILAIMc () |
Perform flash calculation with Ni in Black Oil Model. | |
void | FlashDerivCOMPAIMc () |
Perform flash calculation with Ni in Compositional Model. | |
void | CalKrPcAIMc () |
Calculate relative permeability and capillary pressure with saturation. | |
void | CalKrPcDerivAIMc () |
Calculate relative permeability and capillary pressure and their derivatives. | |
void | GetSolAIMc (const vector< OCP_DBL > &u, const OCP_DBL &dPmaxlim, const OCP_DBL &dSmaxlim) |
void | GetSolAIMc01 (const vector< OCP_DBL > &u, const OCP_DBL &dPmaxlim, const OCP_DBL &dSmaxlim) |
void | UpdatePj () |
Friends | |
class | BulkConn |
class | Well |
class | DetailInfo |
class | OCP_IMPEC |
class | OCP_FIM |
class | Reservoir |
class | OCP_AIMt |
class | OCP_AIMc |
void Bulk::CalKrPc | ( | ) |
Calculate relative permeability and capillary pressure with saturation.
Relative permeability and capillary pressure.
Definition at line 1897 of file Bulk.cpp.
References OCP_FUNCNAME, and WATER.
void Bulk::CheckInitVpore | ( | ) | const |
bool Bulk::CheckNi | ( | ) |
Check if negative Ni occurs, return false if so.
Return true if no negative Ni and false otherwise.
Definition at line 2114 of file Bulk.cpp.
References OCP_FUNCNAME, and OCP_WARNING.
bool Bulk::CheckP | ( | ) | const |
Check if negative P occurs, return false if so.
Return true if no negative pressure and false otherwise.
Definition at line 2095 of file Bulk.cpp.
References OCP_FUNCNAME, and OCP_WARNING.
bool Bulk::CheckVe | ( | const OCP_DBL & | Vlim | ) | const |
Check if relative volume error is out of range, return false if so.
Return true if all Ve < Vlim and false otherwise.
Definition at line 2160 of file Bulk.cpp.
References OCP_FUNCNAME.
void Bulk::Flash | ( | ) |
Perform flash calculation with Ni.
Use moles of component and pressure both in blackoil and compositional model.
Definition at line 1340 of file Bulk.cpp.
References CheckSat(), FlashBLKOIL(), FlashCOMP(), and OCP_FUNCNAME.
void Bulk::FlashDeriv | ( | ) |
Perform flash calculation with Ni and calculate derivatives.
Use moles of component and pressure both in blackoil and compositional model.
Definition at line 1401 of file Bulk.cpp.
References CheckSat(), FlashDerivBLKOIL(), FlashDerivCOMP(), and OCP_FUNCNAME.
void Bulk::GetSolFIM_n | ( | const vector< OCP_DBL > & | u, |
const OCP_DBL & | dPmaxlim, | ||
const OCP_DBL & | dSmaxlim | ||
) |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Definition at line 2704 of file Bulk.cpp.
References DaAxpby(), Daxpy(), Dcopy(), Dnorm1(), OCP_FUNCNAME, and TINY.
void Bulk::InitFlash | ( | const bool & | flag = false | ) |
Perform flash calculation with saturations.
Use initial saturation in blackoil model and initial Zi in compositional model. It gives initial properties and some derivatives for IMPEC It just gives Ni for FIM
Definition at line 1280 of file Bulk.cpp.
References CheckSat(), OCP_FUNCNAME, and PassFlashValue().
void Bulk::InitSjPcBo | ( | const USI & | tabrow | ) |
Calculate initial equilibrium for blkoil model according to EQUIL.
Here tabrow is maximum number of depth nodes in table of depth vs pressure.
Definition at line 371 of file Bulk.cpp.
References OCPTable::Display(), OCPTable::Eval(), OCPTable::Eval_All(), OCPTable::GetCol(), OCPTable::IsEmpty(), OCP_ABORT, OCP_FUNCNAME, and TINY.
Calculate initial equilibrium for compositional model according to EQUIL.
Here tabrow is maximum number of depth nodes in table of depth vs pressure.
Definition at line 812 of file Bulk.cpp.
References OCPTable::Display(), OCPTable::Eval_All(), OCPTable::GetCol(), OCP_FUNCNAME, and TINY.
void Bulk::InputParam | ( | ParamReservoir & | rs_param | ) |
Input param from internal data structure ParamReservoir.
Read parameters from rs_param data structure.
Definition at line 24 of file Bulk.cpp.
References ParamReservoir::blackOil, ParamReservoir::comps, Rock::Cr, TableSet::data, ParamReservoir::disGas, ParamReservoir::EoSp, ParamReservoir::EQUIL, ParamReservoir::gas, EoSparam::miscible, ParamReservoir::NTPVT, ParamReservoir::NTSFUN, EoSparam::numCom, ParamReservoir::numCom, EoSparam::numPhase, ParamReservoir::numPhase, OCP_ABORT, OCP_FUNCNAME, ParamReservoir::oil, ParamReservoir::PBVD_T, PHASE_DOGW, PHASE_ODGW, PHASE_ODGW01, PHASE_ODGW01_MISCIBLE, PHASE_ODGW02, PHASE_OW, PHASE_W, Rock::Pref, ParamReservoir::rock, ParamReservoir::rsTemp, ParamReservoir::ScalePcow, OCPTable::Setup(), ParamReservoir::SOF3_T, ParamReservoir::water, and ParamReservoir::ZMFVD_T.
void Bulk::Setup | ( | const Grid & | myGrid | ) |
Allocate memory for bulk data of grid.
Setup bulk information.
Definition at line 183 of file Bulk.cpp.
References CheckSetup(), GAS, OCP_ABORT, OCP_FUNCNAME, OIL, PHASE_DOGW, PHASE_GW, PHASE_ODGW, PHASE_OG, PHASE_OW, PHASE_W, and WATER.