本文整理汇总了C++中FluidState::saturation方法的典型用法代码示例。如果您正苦于以下问题:C++ FluidState::saturation方法的具体用法?C++ FluidState::saturation怎么用?C++ FluidState::saturation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FluidState
的用法示例。
在下文中一共展示了FluidState::saturation方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assign
void assign(const FluidState& fs)
{
typedef typename FluidState::Scalar FsScalar;
typedef Opm::MathToolbox<FsScalar> FsToolbox;
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
saturation_[phaseIdx] = FsToolbox::template decay<Scalar>(fs.saturation(phaseIdx));
}
}
示例2: krg
static Evaluation krg(const Params ¶ms,
const FluidState &fluidState)
{
typedef MathToolbox<typename FluidState::Scalar> FsToolbox;
const Evaluation& Sw = 1 - FsToolbox::template decay<Evaluation>(fluidState.saturation(gasPhaseIdx));
return GasOilMaterialLaw::twoPhaseSatKrn(params.gasOilParams(), Sw);
}
示例3: pcnw
static Evaluation pcnw(const Params ¶ms,
const FluidState &fs)
{
typedef MathToolbox<typename FluidState::Scalar> FsToolbox;
const auto& Sw = FsToolbox::template toLhs<Evaluation>(fs.saturation(waterPhaseIdx));
return OilWaterMaterialLaw::twoPhaseSatPcnw(params.oilWaterParams(), Sw);
}
示例4: krw
static Evaluation krw(const Params ¶ms,
const FluidState &fluidState)
{
typedef MathToolbox<typename FluidState::Scalar> FsToolbox;
const Evaluation& Sw = FsToolbox::template decay<Evaluation>(fluidState.saturation(waterPhaseIdx));
return OilWaterMaterialLaw::twoPhaseSatKrw(params.oilWaterParams(), Sw);
}
示例5: krn
static Evaluation krn(const Params ¶ms, const FluidState &fs)
{
typedef MathToolbox<typename FluidState::Scalar> FsToolbox;
const Evaluation& Sw =
1.0 - FsToolbox::template toLhs<Evaluation>(fs.saturation(Traits::nonWettingPhaseIdx));
return twoPhaseSatKrn(params, Sw);
}
示例6: pcgn
static Evaluation pcgn(const Params ¶ms,
const FluidState &fs)
{
typedef MathToolbox<typename FluidState::Scalar> FsToolbox;
const auto& Sw = 1.0 - FsToolbox::template decay<Evaluation>(fs.saturation(gasPhaseIdx));
return GasOilMaterialLaw::twoPhaseSatPcnw(params.gasOilParams(), Sw);
}
示例7: pcgn
static Evaluation pcgn(const Params ¶ms, const FluidState &fluidState)
{
typedef MathToolbox<typename FluidState::Scalar> FsToolbox;
typedef MathToolbox<Evaluation> Toolbox;
Scalar PC_VG_REG = 0.01;
// sum of liquid saturations
const auto& St =
FsToolbox::template toLhs<Evaluation>(fluidState.saturation(wettingPhaseIdx))
+ FsToolbox::template toLhs<Evaluation>(fluidState.saturation(nonWettingPhaseIdx));
Evaluation Se = (St - params.Swrx())/(1. - params.Swrx());
// regularization
if (Se < 0.0)
Se=0.0;
if (Se > 1.0)
Se=1.0;
if (Se>PC_VG_REG && Se<1-PC_VG_REG)
{
const Evaluation& x = Toolbox::pow(Se,-1/params.vgM()) - 1;
return Toolbox::pow(x, 1.0 - params.vgM())/params.vgAlpha();
}
// value and derivative at regularization point
Scalar Se_regu;
if (Se<=PC_VG_REG)
Se_regu = PC_VG_REG;
else
Se_regu = 1-PC_VG_REG;
const Evaluation& x = std::pow(Se_regu,-1/params.vgM())-1;
const Evaluation& pc = Toolbox::pow(x, 1.0/params.vgN())/params.vgAlpha();
const Evaluation& pc_prime =
Toolbox::pow(x, 1/params.vgN()-1)
* std::pow(Se_regu,-1/params.vgM()-1)
/ (-params.vgM())
/ params.vgAlpha()
/ (1 - params.Sgr() - params.Swrx())
/ params.vgN();
// evaluate tangential
return ((Se-Se_regu)*pc_prime + pc)/params.betaGN();
}
示例8: pcnw
static Scalar pcnw(const Params ¶ms, const FluidState &fs)
{
Scalar S = fs.saturation(Traits::wPhaseIdx);
Valgrind::CheckDefined(S);
Scalar wPhasePressure =
S*params.pcMaxSat(Traits::wPhaseIdx) +
(1.0 - S)*params.pcMinSat(Traits::wPhaseIdx);
S = fs.saturation(Traits::nPhaseIdx);
Valgrind::CheckDefined(S);
Scalar nPhasePressure =
S*params.pcMaxSat(Traits::nPhaseIdx) +
(1.0 - S)*params.pcMinSat(Traits::nPhaseIdx);
return nPhasePressure - wPhasePressure;
}
示例9: pcnw
static Evaluation pcnw(const Params& params, const FluidState& fs)
{
const Evaluation& Sw =
Opm::decay<Evaluation>(fs.saturation(Traits::wettingPhaseIdx));
assert(0.0 <= Sw && Sw <= 1.0);
return twoPhaseSatPcnw(params, Sw);
}
示例10: pcnw
static Evaluation pcnw(const Params ¶ms, const FluidState &fluidState)
{
typedef MathToolbox<typename FluidState::Scalar> FsToolbox;
const Evaluation& Sw =
FsToolbox::template toLhs<Evaluation>(fluidState.saturation(Traits::wettingPhaseIdx));
return twoPhaseSatPcnw(params, Sw);
}
示例11: pcgn
static typename std::enable_if< (Traits::numPhases > 2), ScalarT>::type
pcgn(const Params ¶ms, const FluidState &fs)
{
Scalar S = fs.saturation(Traits::nPhaseIdx);
Valgrind::CheckDefined(S);
Scalar nPhasePressure =
S*params.pcMaxSat(Traits::nPhaseIdx) +
(1.0 - S)*params.pcMinSat(Traits::nPhaseIdx);
S = fs.saturation(Traits::gPhaseIdx);
Valgrind::CheckDefined(S);
Scalar gPhasePressure =
S*params.pcMaxSat(Traits::gPhaseIdx) +
(1.0 - S)*params.pcMinSat(Traits::gPhaseIdx);
return gPhasePressure - nPhasePressure;
}
示例12: relativePermeabilities
static void relativePermeabilities(ContainerT &values,
const Params ¶ms,
const FluidState &state)
{
for (int phaseIdx = 0; phaseIdx < Traits::numPhases; ++phaseIdx) {
Scalar S = state.saturation(phaseIdx);
Valgrind::CheckDefined(S);
values[phaseIdx] = std::max(std::min(S,1.0),0.0);
}
}
示例13: krn
static Evaluation krn(const Params ¶ms,
const FluidState &fluidState)
{
typedef MathToolbox<Evaluation> Toolbox;
typedef MathToolbox<typename FluidState::Scalar> FsToolbox;
// the Eclipse docu is inconsistent here: In some places the connate water
// saturation is represented by "Swl", in others "Swco" is used.
Scalar Swco = params.Swl();
Scalar Sowcr = params.Sowcr();
Scalar Sogcr = params.Sogcr();
Scalar Som = std::min(Sowcr, Sogcr); // minimum residual oil saturation
Scalar eta = params.eta(); // exponent of the beta term
const Evaluation& Sw = FsToolbox::template toLhs<Evaluation>(fluidState.saturation(waterPhaseIdx));
const Evaluation& So = FsToolbox::template toLhs<Evaluation>(fluidState.saturation(oilPhaseIdx));
const Evaluation& Sg = FsToolbox::template toLhs<Evaluation>(fluidState.saturation(gasPhaseIdx));
Evaluation SSw;
if (Sw > Swco)
SSw = (Sw - Swco)/(1 - Swco - Som);
else
SSw = 0.0;
Evaluation SSo;
if (So > Som)
SSo = (So - Som)/(1 - Swco - Som);
else
SSo = 0.0;
Evaluation SSg = Sg/(1 - Swco - Som);
Scalar krocw = OilWaterMaterialLaw::twoPhaseSatKrn(params.oilWaterParams(), Swco);
Evaluation krow = OilWaterMaterialLaw::twoPhaseSatKrn(params.oilWaterParams(), Sw);
Evaluation krog = GasOilMaterialLaw::twoPhaseSatKrw(params.gasOilParams(), 1 - Sg);
Evaluation beta = Toolbox::pow(SSo/((1 - SSw)*(1 - SSg)), eta);
return beta*krow*krog/krocw;
}
示例14: capillaryPressures
static void capillaryPressures(ContainerT &values,
const Params ¶ms,
const FluidState &fluidState)
{
Scalar p_cgw = ThreePLaw::pCGW(params, fluidState.saturation(wPhaseIdx));
Scalar p_cnw = ThreePLaw::pCNW(params, fluidState.saturation(wPhaseIdx));
Scalar p_cgn = ThreePLaw::pCGN(params,
fluidState.saturation(wPhaseIdx)
+ fluidState.saturation(nPhaseIdx));
Scalar p_cAlpha = ThreePLaw::pCAlpha(params,
fluidState.saturation(nPhaseIdx));
Scalar p_cnw1 = 0.0;
Valgrind::CheckDefined(p_cgw);
Valgrind::CheckDefined(p_cnw);
Valgrind::CheckDefined(p_cgn);
Valgrind::CheckDefined(p_cAlpha);
values[gPhaseIdx] = 0;
values[nPhaseIdx] = - (p_cAlpha*p_cgn + (1 - p_cAlpha)*(p_cgw - p_cnw1));
values[wPhaseIdx] = values[nPhaseIdx] - (p_cAlpha*p_cnw + (1 - p_cAlpha)*p_cnw1);
}
示例15: capillaryPressures
static void capillaryPressures(ContainerT &values,
const Params ¶ms,
const FluidState &fluidState)
{
typedef typename std::remove_reference<decltype(values[0])>::type Evaluation;
typedef MathToolbox<typename FluidState::Scalar> FsToolbox;
switch (params.approach()) {
case EclTwoPhaseGasOil: {
const Evaluation& So =
FsToolbox::template decay<Evaluation>(fluidState.saturation(oilPhaseIdx));
values[oilPhaseIdx] = 0.0;
values[gasPhaseIdx] = GasOilMaterialLaw::twoPhaseSatPcnw(params.gasOilParams(), So);
break;
}
case EclTwoPhaseOilWater: {
const Evaluation& Sw =
FsToolbox::template decay<Evaluation>(fluidState.saturation(waterPhaseIdx));
values[waterPhaseIdx] = 0.0;
values[oilPhaseIdx] = OilWaterMaterialLaw::twoPhaseSatPcnw(params.oilWaterParams(), Sw);
break;
}
case EclTwoPhaseGasWater: {
const Evaluation& Sw =
FsToolbox::template decay<Evaluation>(fluidState.saturation(waterPhaseIdx));
values[waterPhaseIdx] = 0.0;
values[gasPhaseIdx] =
OilWaterMaterialLaw::twoPhaseSatPcnw(params.oilWaterParams(), Sw)
+ GasOilMaterialLaw::twoPhaseSatPcnw(params.gasOilParams(), 0.0);
break;
}
}
}