changed: put calculation of polymer connection rate in separate method

This commit is contained in:
Arne Morten Kvarving
2023-05-05 09:55:26 +02:00
parent 4041644171
commit b3fd64d915
2 changed files with 37 additions and 15 deletions

View File

@@ -451,6 +451,11 @@ namespace Opm
connectionRatesMICP(const std::vector<EvalWell>& cq_s,
const IntensiveQuantities& intQuants) const;
std::tuple<Eval,EvalWell>
connectionRatePolymer(double& rate,
const std::vector<EvalWell>& cq_s,
const IntensiveQuantities& intQuants) const;
std::tuple<Eval,EvalWell>
connectionRatezFraction(double& rate,
const double dis_gas_rate,

View File

@@ -694,23 +694,15 @@ namespace Opm
}
if constexpr (has_polymer) {
// TODO: the application of well efficiency factor has not been tested with an example yet
const unsigned waterCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx);
EvalWell cq_s_poly = cq_s[waterCompIdx];
if (this->isInjector()) {
cq_s_poly *= this->wpolymer();
} else {
cq_s_poly *= this->extendEval(intQuants.polymerConcentration() * intQuants.polymerViscosityCorrection());
}
// Note. Efficiency factor is handled in the output layer
auto& perf_rate_polymer = perf_data.polymer_rates;
perf_rate_polymer[perf] = cq_s_poly.value();
cq_s_poly *= this->well_efficiency_factor_;
connectionRates[perf][Indices::contiPolymerEqIdx] = Base::restrictEval(cq_s_poly);
[[maybe_unused]] EvalWell cq_s_poly;
std::tie(connectionRates[perf][Indices::contiPolymerEqIdx],
cq_s_poly) =
connectionRatePolymer(perf_data.polymer_rates[perf],
cq_s, intQuants);
if constexpr (Base::has_polymermw) {
updateConnectionRatePolyMW(cq_s_poly, intQuants, well_state, perf, connectionRates, deferred_logger);
updateConnectionRatePolyMW(cq_s_poly, intQuants, well_state,
perf, connectionRates, deferred_logger);
}
}
@@ -2413,6 +2405,31 @@ namespace Opm
}
template <typename TypeTag>
std::tuple<typename StandardWell<TypeTag>::Eval,
typename StandardWell<TypeTag>::EvalWell>
StandardWell<TypeTag>::
connectionRatePolymer(double& 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 waterCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx);
EvalWell cq_s_poly = cq_s[waterCompIdx];
if (this->isInjector()) {
cq_s_poly *= this->wpolymer();
} else {
cq_s_poly *= this->extendEval(intQuants.polymerConcentration() * intQuants.polymerViscosityCorrection());
}
// Note. Efficiency factor is handled in the output layer
rate = cq_s_poly.value();
cq_s_poly *= this->well_efficiency_factor_;
return {Base::restrictEval(cq_s_poly), cq_s_poly};
}
template <typename TypeTag>
std::tuple<typename StandardWell<TypeTag>::Eval,
typename StandardWell<TypeTag>::EvalWell>