mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
changed: put calculation of polymer connection rate in separate method
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user