104 kroMax = SGOF.
GetCol(2)[0];
146 if (kro < 0) kro = 0;
159 OCP_DBL kro = (Sg * krog + (Sw -
Swco) * krow) / tmp;
208 const OCP_DBL kro = CalKro_Stone2(krow, krog, krw, krg);
242 OCP_DBL dKrodSg{ 0 }, dKrodSw{ 0 }, kro{ 0 };
244 kro = CalKro_Stone2Der(krow, krog, krw, krg, dKrwdSw, dKrowdSw, dKrgdSg, dKrogdSg,
299 out_dkrodSw = dkrodSw;
300 out_dkrodSg = dkrodSg;
315 OCP_DBL kro = (Sg * krog + (Sw -
Swco) * krow) / tmp;
316 dkroSg = (krog + Sg * dkrogSg - kro) / tmp;
317 dkroSw = (krow + (Sw -
Swco) * dkrowSw - kro) / tmp;
321 void FlowUnit_ODGW01::Generate_SWPCWG()
329 for (
USI i = 0; i < n; i++) {
347 if (surTen >= surTenRef || surTen <
TINY) {
356 Fk = min(1.0, pow(surTen / surTenRef, Fkexp));
357 Fp = min(surTenPc, surTen / surTenRef);
369 OCP_DBL kro = CalKro_Stone2(krow, krog, krw, krg);
372 OCP_DBL krh = 0.5 * (krow + krgt);
375 kro = Fk * kro + (1 - Fk) * krh * So / (1 - Sw);
376 krg = Fk * krg + (1 - Fk) * krh * Sg / (1 - Sw);
397 if (surTen >= surTenRef || surTen <
TINY) {
406 Fk = min(1.0, pow(surTen / surTenRef, Fkexp));
407 Fp = min(surTenPc, surTen / surTenRef);
425 OCP_DBL dKrodSg{ 0 }, dKrodSw{ 0 }, kro{ 0 };
426 kro = CalKro_Stone2Der(krow, krog, krw, krg, dKrwdSw, dKrowdSw, dKrgdSg, dKrogdSg,
431 const OCP_DBL krh = 0.5 * (krow + krgt);
434 kro = Fk * kro + (1 - Fk) * krh * So / (1 - Sw);
435 krg = Fk * krg + (1 - Fk) * krh * Sg / (1 - Sw);
444 OCP_DBL dkrhdSw = 0.5 * (dKrowdSw - dkrgd1_Sw);
445 OCP_DBL temp = (1 - Fk) / (1 - Sw) * (krh / (1 - Sw) + dkrhdSw);
447 dkrdS[0] = (1 - Fk) * krh / (1 - Sw);
448 dkrdS[1] = Fk * dKrodSg;
449 dkrdS[2] = Fk * dKrodSw + temp * So;
451 dkrdS[4] = Fk * dKrgdSg + (1 - Fk) * krh / (1 - Sw);
452 dkrdS[5] = temp * Sg;
514 OCP_DBL kro = CalKro_Default(Sg, Sw, krog, krow);
551 OCP_DBL kro = CalKro_Stone2Der(krow, krog, krw, krg, dKrwdSw, dKrowdSo, dKrgdSg, dKrogdSo, dKroSo);
575 dPcjdS[4] = dPcgodSg;
579 dPcjdS[8] = dPcwodSw;
589 dKrodSo = dkrowdSo * (krog /
kroMax + krg) + dkrogdSo * (krow /
kroMax + krw);
595 out_dkrodSo = dKrodSo;
605 OCP_DBL kro = (Sg * krog + (Sw -
Swco) * krow) / tmp;
606 out_dkrodSo = (Sg * dkrogdSo + (Sw -
Swco) * dkrowdSo) / tmp;
615 void FlowUnit_ODGW02::Generate_SWPCWG()
620 std::vector<OCP_DBL> Sw(SWFN.
GetCol(0));
621 std::vector<OCP_DBL> Pcow(SWFN.
GetCol(2));
623 for (
USI i = 0; i < n; i++) {
FlowUnit class declaration.
const OCP_DBL TINY
Small constant.
unsigned int USI
Generic unsigned integer.
double OCP_DBL
Double precision.
Logging error and warning messages.
#define OCP_ABORT(msg)
Abort if critical error happens.
void CalKrPcDeriv(const OCP_DBL *S_in, OCP_DBL *kr_out, OCP_DBL *pc_out, OCP_DBL *dkrdS, OCP_DBL *dPcjdS, const OCP_DBL &MySurTen, OCP_DBL &MyFk, OCP_DBL &MyFp) override
Calculate derivatives of relative permeability and capillary pressure.
void CalKrPc(const OCP_DBL *S_in, OCP_DBL *kr_out, OCP_DBL *pc_out, const OCP_DBL &MySurTen, OCP_DBL &MyFk, OCP_DBL &MyFp) override
Calculate relative permeability and capillary pressure.
virtual void CalKrPcDeriv(const OCP_DBL *S_in, OCP_DBL *kr_out, OCP_DBL *pc_out, OCP_DBL *dkrdS, OCP_DBL *dPcjdS, const OCP_DBL &MySurTen, OCP_DBL &MyFk, OCP_DBL &MyFp) override
Calculate derivatives of relative permeability and capillary pressure.
OCPTable SGOF
saturation table about gas and oil.
vector< OCP_DBL > cdata
container to store the slopes of interpolation.
virtual void CalKrPc(const OCP_DBL *S_in, OCP_DBL *kr_out, OCP_DBL *pc_out, const OCP_DBL &MySurTen, OCP_DBL &MyFk, OCP_DBL &MyFp) override
Calculate relative permeability and capillary pressure.
OCPTable SWOF
saturation table about water and oil.
vector< OCP_DBL > data
container to store the values of interpolation.
void CalKrPcDeriv(const OCP_DBL *S_in, OCP_DBL *kr_out, OCP_DBL *pc_out, OCP_DBL *dkrdS, OCP_DBL *dPcjdS, const OCP_DBL &MySurTen, OCP_DBL &MyFk, OCP_DBL &MyFp) override
Calculate derivatives of relative permeability and capillary pressure.
void CalKrPc(const OCP_DBL *S_in, OCP_DBL *kr_out, OCP_DBL *pc_out, const OCP_DBL &MySurTen, OCP_DBL &MyFk, OCP_DBL &MyFp) override
Calculate relative permeability and capillary pressure.
OCP_DBL kroMax
oil relative permeability in the presence of connate water only, used in stone2
vector< OCP_DBL > Scm
critical saturation when phase becomes mobile / immobile
OCP_DBL Swco
Saturation of connate water.
void CalKrPc(const OCP_DBL *S_in, OCP_DBL *kr_out, OCP_DBL *pc_out, const OCP_DBL &MySurTen, OCP_DBL &MyFk, OCP_DBL &MyFp) override
Calculate relative permeability and capillary pressure.
void CalKrPcDeriv(const OCP_DBL *S_in, OCP_DBL *kr_out, OCP_DBL *pc_out, OCP_DBL *dkrdS, OCP_DBL *dPcjdS, const OCP_DBL &MySurTen, OCP_DBL &MyFk, OCP_DBL &MyFp) override
Calculate derivatives of relative permeability and capillary pressure.
void CalKrPcDeriv(const OCP_DBL *S_in, OCP_DBL *kr_out, OCP_DBL *pc_out, OCP_DBL *dkrdS, OCP_DBL *dPcjdS, const OCP_DBL &MySurTen, OCP_DBL &MyFk, OCP_DBL &MyFp) override
Calculate derivatives of relative permeability and capillary pressure.
void CalKrPc(const OCP_DBL *S_in, OCP_DBL *kr_out, OCP_DBL *pc_out, const OCP_DBL &MySurTen, OCP_DBL &MyFk, OCP_DBL &MyFp) override
Calculate relative permeability and capillary pressure.
void CalKrPc(const OCP_DBL *S_in, OCP_DBL *kr_out, OCP_DBL *pc_out, const OCP_DBL &MySurTen, OCP_DBL &MyFk, OCP_DBL &MyFp) override
Calculate relative permeability and capillary pressure.
void CalKrPcDeriv(const OCP_DBL *S_in, OCP_DBL *kr_out, OCP_DBL *pc_out, OCP_DBL *dkrdS, OCP_DBL *dPcjdS, const OCP_DBL &MySurTen, OCP_DBL &MyFk, OCP_DBL &MyFp) override
Calculate derivatives of relative permeability and capillary pressure.
USI Eval_All(const USI &j, const OCP_DBL &val, vector< OCP_DBL > &outdata, vector< OCP_DBL > &slope)
void SetRowCol()
Setup row nums and col nums of tables, initialize the bId.
void Setup(const vector< vector< OCP_DBL >> &src)
Setup tables from existing data of table.
vector< OCP_DBL > & GetCol(const USI &j)
return the jth column in table to modify or use.
OCP_INT GetRowZero(const USI &mycol) const
return the row index of the last zero of some colnum, which is sorted in increasing order.
bool IsEmpty() const
judge if table is empty.
OCP_DBL Eval(const USI &j, const OCP_DBL &val, const USI &destj)
void PushCol(const vector< OCP_DBL > &v)
push v into the last column of table.
TableSet SOF3_T
Table set of SOF3.
TableSet SGOF_T
Table set of SGOF.
TableSet SGFN_T
Table set of SGFN.
TableSet SWOF_T
Table set of SWOF.
TableSet SWFN_T
Table set of SWFN.
vector< vector< vector< OCP_DBL > > > data
All table with the same name.