79 for (
USI j = 0; j < np; j++) {
89 if (wl.IsOpen() && wl.WellType() ==
PROD) {
90 for (
USI p = 0; p < wl.PerfNum(); p++) {
91 if (wl.PerfState(p) ==
OPEN) {
92 const OCP_USI k = wl.PerfLocation(p);
94 for (
USI j = 0; j < np; j++) {
95 bulk.
cfl[k * np + j] += fabs(wl.PerfProdQj_ft3(p, j)) * dt;
104 for (
OCP_USI n = 0; n < len; n++) {
119 void Reservoir::PrintSolFIM(
const string& outfile)
const
121 ofstream outu(outfile);
122 if (!outu.is_open()) cout <<
"Can not open " << outfile << endl;
126 for (
OCP_USI n = 0; n < nb; n++) {
128 outu <<
bulk.
P[n] <<
"\n";
130 for (
USI i = 0; i < nc; i++) {
131 outu <<
bulk.
Ni[n * nc + i] <<
"\n";
unsigned int USI
Generic unsigned integer.
double OCP_DBL
Double precision.
const OCP_BOOL OPEN
Well type = open.
unsigned int OCP_USI
Long unsigned integer.
const USI PROD
Well type = producer.
Reservoir class declaration.
#define OCP_FUNCNAME
Print Function Name.
#define OCP_ABORT(msg)
Abort if critical error happens.
void InputParam(const ParamWell ¶mWell, const ParamOutput &output_param)
Input param from ParamWell.
vector< Well > wells
well set.
OCP_DBL GetWBHP(const USI &w) const
Return the BHP of wth well.
void ApplyControl(const USI &i)
Apply the operation mode at the ith critical time.
void CalIPRT(const Bulk &myBulk, OCP_DBL dt)
Calculate Injection rate, total Injection, Production rate, total Production.
void SetupWellGroup(const Bulk &myBulk)
Setup information of wellGroup.
void Setup(const Grid &myGrid, const Bulk &myBulk)
Setup wells.
void CalReInjFluid(const Bulk &myBulk)
Calculate Reinjection fluid.
OCP_USI numConn
Number of connections between bulks.
vector< OCP_USI > upblock
Index of upwinding bulk of connections : numConn * numPhase.
vector< OCP_DBL > upblock_Velocity
void SetupIsoT(const Grid &myGrid, const Bulk &myBulk)
Setup active connections.
void SetupOptionalFeatures(const Grid &myGrid, OptionalFeatures &optFeatures)
Setup optional features.
USI numPhase
Number of phase.
OCP_DBL maxCFL
max CFL number
vector< OCP_DBL > Ni
Moles of component: numCom*numBulk.
void CalMaxChange()
Calculate max change of indicator variables.
void InputParam(const ParamReservoir &rs_param)
Input param from internal data structure ParamReservoir.
vector< OCP_BOOL > phaseExist
Existence of phase: numPhase*numBulk.
void SetupIsoT(const Grid &myGrid)
Allocate memory for fluid grid for isothermal model.
vector< OCP_DBL > vj
Volume of phase: numPhase*numBulk.
void SetupT(const Grid &myGrid)
Allocate memory for fluid grid for ifThermal model.
OCP_USI numBulk
Number of bulks (active grids).
vector< OCP_DBL > P
Pressure: numBulk.
vector< OCP_DBL > cfl
CFL number for each bulk.
USI numCom
Number of component.
void InputParam(const ParamReservoir &rs_param, const ParamOutput &output_param)
Input parameters from the internal param structure.
void SetupT()
Setup for thermal model.
void SetupIsoT()
Setup for Isothermal model.
Pre-processing unit for OpenCAEPoro for reading params from input files.
ParamOutput paramOutput
Read the output params.
ParamWell paramWell
Read the well params.
ParamReservoir paramRs
Read the reservoir params.
void SetupT()
Setup static information for reservoir with input params for Thermal model.
BulkConn conn
Bulk's connection info.
OptionalFeatures optFeatures
optional features.
void InputParam(ParamRead ¶m)
OCP_DBL CalCFL(const OCP_DBL &dt) const
Calculate the CFL number, including bulks and wells for IMPEC.
void CalMaxChange()
Calculate Maximum Change of some reference variables for IMPEC.
void ApplyControl(const USI &i)
Apply the control of ith critical time point.
Bulk bulk
Active grid info.
AllWells allWells
Wells class info.
void SetupIsoT()
Setup static information for reservoir with input params for Isothermal model.
void CalIPRT(const OCP_DBL &dt)
Calculate num of Injection, Production.