OpenCAEPoro
0.2.0 Sep/22/2022
A simulator for multicomponent porous media flow
|
#include <Well.hpp>
Public Member Functions | |
void | InputPerfo (const WellParam &well) |
Input the param of perforations. | |
void | Setup (const Grid &myGrid, const Bulk &myBulk, const vector< SolventINJ > &sols) |
Setup the well after Grid and Bulk finish setupping. | |
void | InitBHP (const Bulk &myBulk) |
Initialize the Well BHP. | |
void | CalWI_Peaceman_Vertical (const Bulk &myBulk) |
Calculate Well Index with Peaceman model for vertical well. | |
void | CalTrans (const Bulk &myBulk) |
Calculate transmissibility for each phase in perforations. | |
void | CalFlux (const Bulk &myBulk, const bool flag=false) |
Calculate the flux for each perforations. | |
OCP_DBL | CalInjRate (const Bulk &myBulk, const bool &maxBHP) |
calculate flow rate of moles of components for injection well with maxBHP More... | |
OCP_DBL | CalProdRate (const Bulk &myBulk, const bool &minBHP) |
calculate flow rate of moles of components for production well with minBHP More... | |
void | CalInjQi (const Bulk &myBulk, const OCP_DBL &dt) |
Calculate flow rate of moles of components for injection well. | |
void | CalProdQj (const Bulk &myBulk, const OCP_DBL &dt) |
Calculate flow rate of moles of phase for production well. | |
void | CalProdQjCOMP (const Bulk &myBulk) |
Calculate flow rate of moles of phase for production well in Compositional Model. | |
void | CalProdQiBO (const Bulk &myBulk) |
void | CaldG (const Bulk &myBulk) |
Calculate pressure difference between well and perforations. More... | |
void | CalInjdG (const Bulk &myBulk) |
Calculate pressure difference between well and perforations for Injection. | |
void | CalProddG (const Bulk &myBulk) |
Calculate pressure difference between well and perforations for Prodcution. | |
void | CalProdWeight (const Bulk &myBulk) const |
Calculate the Prodweight. | |
void | CalReInjFluid (const Bulk &myBulk, vector< OCP_DBL > &myZi) |
Calculate the contribution of production well to reinjection defaulted. | |
void | SetBHP () |
Set BHP if opt mode is BHPMode. | |
void | SmoothdG () |
Try to smooth the dG by average it with dG at last time step. More... | |
void | CheckOptMode (const Bulk &myBulk) |
Check if well operation mode would be changed. More... | |
OCP_INT | CheckP (const Bulk &myBulk) |
Check if abnormal Pressure occurs. | |
OCP_INT | CheckCrossFlow (const Bulk &myBulk) |
Check if crossflow happens. | |
void | UpdatePerfP () |
Update pressure in Perforation after well pressure updates. | |
void | AllocateMat (LinearSystem &myLS) const |
Allocate memory for matrix. | |
void | SetupWellBulk (Bulk &myBulk) const |
Setup bulks which are penetrated by wells. | |
bool | WellState () const |
Return the state of the well, Open or Close. | |
USI | WellType () const |
Return the type of well, Inj or Prod. | |
OCP_DBL | GetPerfPre (const USI &p) const |
Return Pressure of Perf p. | |
void | ShowPerfStatus (const Bulk &myBulk) const |
Display operation mode of well and state of perforations. | |
void | CalCFL (const Bulk &myBulk, const OCP_DBL &dt) const |
Calculate the CFL number, only parts related to wells are considered. | |
void | MassConserveIMPEC (Bulk &myBulk, const OCP_DBL &dt) const |
Update moles of components in those bulks who connects to the well. | |
void | AssembleMatINJ_IMPEC (const Bulk &myBulk, LinearSystem &myLS, const OCP_DBL &dt) const |
Assemble matrix for IMPEC, parts related to injection well are included. | |
void | AssembleMatPROD_IMPEC (const Bulk &myBulk, LinearSystem &myLS, const OCP_DBL &dt) const |
Assemble matrix for IMPEC, parts related to production well are included. | |
void | AssembleMatReinjection_IMPEC (const Bulk &myBulk, LinearSystem &myLS, const OCP_DBL &dt, const vector< Well > &allWell, const vector< USI > &injId) const |
void | AssembleMatINJ_FIM (const Bulk &myBulk, LinearSystem &myLS, const OCP_DBL &dt) const |
Assemble matrix for FIM, parts related to Injection well are included. | |
void | AssembleMatPROD_FIM (const Bulk &myBulk, LinearSystem &myLS, const OCP_DBL &dt) const |
Assemble matrix for FIM, parts related to Production well are included. | |
void | AssembleMatReinjection_FIM (const Bulk &myBulk, LinearSystem &myLS, const OCP_DBL &dt, const vector< Well > &allWell, const vector< USI > &injId) const |
void | CalResFIM (ResFIM &resFIM, const Bulk &myBulk, const OCP_DBL &dt, const OCP_USI &wId, const vector< Well > &allWell) const |
Calculate Resiual and relative Resiual for FIM. | |
void | ShowRes (const OCP_USI &wId, const vector< OCP_DBL > &res, const Bulk &myBulk) const |
void | AssembleMatINJ_FIM_new (const Bulk &myBulk, LinearSystem &myLS, const OCP_DBL &dt) const |
Assemble matrix for FIM, parts related to Injection well are included. | |
void | AssembleMatPROD_FIM_new (const Bulk &myBulk, LinearSystem &myLS, const OCP_DBL &dt) const |
Assemble matrix for FIM, parts related to Production well are included. | |
void | AssembleMatINJ_FIM_new_n (const Bulk &myBulk, LinearSystem &myLS, const OCP_DBL &dt) const |
void | AssembleMatPROD_FIM_new_n (const Bulk &myBulk, LinearSystem &myLS, const OCP_DBL &dt) const |
void | AssembleMatINJ_AIMt (const Bulk &myBulk, LinearSystem &myLS, const OCP_DBL &dt) const |
Assemble matrix for AIMt, parts related to Injection well are included. | |
void | AssembleMatPROD_AIMt (const Bulk &myBulk, LinearSystem &myLS, const OCP_DBL &dt) const |
Assemble matrix for AIMt, parts related to Production well are included. | |
void | CalResAIMt (ResFIM &resFIM, const Bulk &myBulk, const OCP_DBL &dt, const OCP_USI &wId, const vector< Well > &allWell) const |
Calculate Resiual and relative Resiual for local FIM. | |
void | AssembleMatINJ_AIMs (const Bulk &myBulk, LinearSystem &myLS, const OCP_DBL &dt) const |
Assemble matrix for AIMs, parts related to Injection well are included. | |
void | AssembleMatPROD_AIMs (const Bulk &myBulk, LinearSystem &myLS, const OCP_DBL &dt) const |
Assemble matrix for AIMs, parts related to Production well are included. | |
Friends | |
class | AllWells |
class | DetailInfo |
Well class defines well, and any operations referred to wells are in it. Well connects to the bulks by perforations, which serve as source and sink. Due to practical difficulties in production, a good treatment for well is important, excellent treatment will make the flow rate in well more stable.
void Well::AssembleMatReinjection_FIM | ( | const Bulk & | myBulk, |
LinearSystem & | myLS, | ||
const OCP_DBL & | dt, | ||
const vector< Well > & | allWell, | ||
const vector< USI > & | injId | ||
) | const |
Assemble matrix for Reinjection Well, used in production well when injection well is under RATE control
Definition at line 1842 of file Well.cpp.
References BHP_MODE, CONV1, DaABpbC(), Daxpy(), and WellState().
void Well::AssembleMatReinjection_IMPEC | ( | const Bulk & | myBulk, |
LinearSystem & | myLS, | ||
const OCP_DBL & | dt, | ||
const vector< Well > & | allWell, | ||
const vector< USI > & | injId | ||
) | const |
Assemble matrix for Reinjection Well, used in production well when injection well is under RATE control
Definition at line 1445 of file Well.cpp.
References BHP_MODE, and WellState().
void Well::CaldG | ( | const Bulk & | myBulk | ) |
Calculate pressure difference between well and perforations.
It calculates pressure difference between perforations iteratively. This function can be used in both black oil model and compositional model. stability of this method shoule be tested.
Definition at line 577 of file Well.cpp.
References CalInjdG(), CalProddG(), INJ, and OCP_FUNCNAME.
calculate flow rate of moles of components for injection well with maxBHP
Pressure in injection well equals maximum ones in injection well, which is input by users. this function is used to check if operation mode of well shoubld be swtched.
Definition at line 460 of file Well.cpp.
References OCP_FUNCNAME.
void Well::CalProdQiBO | ( | const Bulk & | myBulk | ) |
calculate flow rate of moles of components for production well with minBHP
Pressure in production well equals minial ones in production well, which is input by users. this function is used to check if operation mode of well shoubld be swtched.
Definition at line 481 of file Well.cpp.
References OCP_FUNCNAME.
void Well::CheckOptMode | ( | const Bulk & | myBulk | ) |
Check if well operation mode would be changed.
Constant well pressure would be applied if flow rate is too large. Constant flow rate would be applied if well pressure is outranged.
Definition at line 971 of file Well.cpp.
References BHP_MODE, CalInjRate(), CalProdRate(), GAS, INJ, OCP_FUNCNAME, RATE_MODE, and WATER.
void Well::SmoothdG | ( | ) |
Try to smooth the dG by average it with dG at last time step.
It's just a test now to make dG more stable.
Definition at line 959 of file Well.cpp.
References OCP_FUNCNAME.