registerOpenWellsForWbpCalculation: move to BlackoilWellModelGeneric

This commit is contained in:
Arne Morten Kvarving 2024-11-18 11:34:13 +01:00
parent 7ab8d1938f
commit a67e8c44b4
4 changed files with 18 additions and 23 deletions

View File

@ -508,8 +508,6 @@ template<class Scalar> class WellContributions;
typename ParallelWBPCalculation<Scalar>::EvaluatorFactory
makeWellSourceEvaluatorFactory(const std::vector<Well>::size_type wellIdx) const;
void registerOpenWellsForWBPCalculation();
void updateAverageFormationFactor();
void computePotentials(const std::size_t widx,

View File

@ -2085,6 +2085,22 @@ setPrimaryVarsDomain(const int domainIdx, const std::vector<Scalar>& vars)
assert(offset == vars.size());
}
template<class Scalar>
void BlackoilWellModelGeneric<Scalar>::
registerOpenWellsForWBPCalculation()
{
assert (this->wbpCalcMap_.size() == this->wells_ecl_.size());
for (auto& wbpCalc : this->wbpCalcMap_) {
wbpCalc.openWellIdx_.reset();
}
auto openWellIdx = typename std::vector<WellInterfaceGeneric<Scalar>*>::size_type{0};
for (const auto* openWell : this->well_container_generic_) {
this->wbpCalcMap_[openWell->indexOfWell()].openWellIdx_ = openWellIdx++;
}
}
template class BlackoilWellModelGeneric<double>;
#if FLOW_INSTANTIATE_FLOAT

View File

@ -458,6 +458,8 @@ protected:
void assignMassGasRate(data::Wells& wsrpt,
const Scalar& gasDensity) const;
void registerOpenWellsForWBPCalculation();
Schedule& schedule_;
const SummaryState& summaryState_;
const EclipseState& eclState_;

View File

@ -2486,27 +2486,6 @@ namespace Opm {
template <typename TypeTag>
void
BlackoilWellModel<TypeTag>::
registerOpenWellsForWBPCalculation()
{
assert (this->wbpCalcMap_.size() == this->wells_ecl_.size());
for (auto& wbpCalc : this->wbpCalcMap_) {
wbpCalc.openWellIdx_.reset();
}
auto openWellIdx = typename std::vector<WellInterfacePtr>::size_type{0};
for (const auto* openWell : this->well_container_generic_) {
this->wbpCalcMap_[openWell->indexOfWell()].openWellIdx_ = openWellIdx++;
}
}
template<typename TypeTag>
void
BlackoilWellModel<TypeTag>::