mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
changed: put calculation of zFraction connection rate in separate method
This commit is contained in:
@@ -446,6 +446,12 @@ namespace Opm
|
||||
std::tuple<Eval,Eval,Eval>
|
||||
connectionRatesMICP(const std::vector<EvalWell>& cq_s,
|
||||
const IntensiveQuantities& intQuants) const;
|
||||
|
||||
std::tuple<Eval,EvalWell>
|
||||
connectionRatezFraction(double& rate,
|
||||
const double dis_gas_rate,
|
||||
const std::vector<EvalWell>& cq_s,
|
||||
const IntensiveQuantities& intQuants) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -745,20 +745,10 @@ namespace Opm
|
||||
}
|
||||
|
||||
if constexpr (has_zFraction) {
|
||||
// TODO: the application of well efficiency factor has not been tested with an example yet
|
||||
const unsigned gasCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::gasCompIdx);
|
||||
cq_s_zfrac_effective = cq_s[gasCompIdx];
|
||||
if (this->isInjector()) {
|
||||
cq_s_zfrac_effective *= this->wsolvent();
|
||||
} else if (cq_s_zfrac_effective.value() != 0.0) {
|
||||
const double dis_gas_frac = perf_rates.dis_gas / cq_s_zfrac_effective.value();
|
||||
cq_s_zfrac_effective *= this->extendEval(dis_gas_frac*intQuants.xVolume() + (1.0-dis_gas_frac)*intQuants.yVolume());
|
||||
}
|
||||
auto& perf_rate_solvent = perf_data.solvent_rates;
|
||||
perf_rate_solvent[perf] = cq_s_zfrac_effective.value();
|
||||
|
||||
cq_s_zfrac_effective *= this->well_efficiency_factor_;
|
||||
connectionRates[perf][Indices::contiZfracEqIdx] = Base::restrictEval(cq_s_zfrac_effective);
|
||||
std::tie(connectionRates[perf][Indices::contiZfracEqIdx],
|
||||
cq_s_zfrac_effective) =
|
||||
connectionRatezFraction(perf_data.solvent_rates[perf],
|
||||
perf_rates.dis_gas, cq_s, intQuants);
|
||||
}
|
||||
|
||||
if constexpr (has_brine) {
|
||||
@@ -2410,4 +2400,30 @@ namespace Opm
|
||||
Base::restrictEval(cq_s_urea)};
|
||||
}
|
||||
|
||||
|
||||
template <typename TypeTag>
|
||||
std::tuple<typename StandardWell<TypeTag>::Eval,
|
||||
typename StandardWell<TypeTag>::EvalWell>
|
||||
StandardWell<TypeTag>::
|
||||
connectionRatezFraction(double& rate,
|
||||
const double dis_gas_rate,
|
||||
const std::vector<EvalWell>& cq_s,
|
||||
const IntensiveQuantities& intQuants) const
|
||||
{
|
||||
// TODO: the application of well efficiency factor has not been tested with an example yet
|
||||
const unsigned gasCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::gasCompIdx);
|
||||
EvalWell cq_s_zfrac_effective = cq_s[gasCompIdx];
|
||||
if (this->isInjector()) {
|
||||
cq_s_zfrac_effective *= this->wsolvent();
|
||||
} else if (cq_s_zfrac_effective.value() != 0.0) {
|
||||
const double dis_gas_frac = dis_gas_rate / cq_s_zfrac_effective.value();
|
||||
cq_s_zfrac_effective *= this->extendEval(dis_gas_frac*intQuants.xVolume() + (1.0-dis_gas_frac)*intQuants.yVolume());
|
||||
}
|
||||
|
||||
rate = cq_s_zfrac_effective.value();
|
||||
|
||||
cq_s_zfrac_effective *= this->well_efficiency_factor_;
|
||||
return {Base::restrictEval(cq_s_zfrac_effective), cq_s_zfrac_effective};
|
||||
}
|
||||
|
||||
} // namespace Opm
|
||||
|
||||
Reference in New Issue
Block a user