Refactor Well Guide Rate Summary Assignment

In anticipation of adding more steps later.
This commit is contained in:
Bård Skaflestad
2020-10-20 00:10:27 +02:00
parent c800c5376d
commit 4e9e60a71b
2 changed files with 25 additions and 10 deletions

View File

@@ -214,16 +214,7 @@ namespace Opm {
{
auto wsrpt = well_state_.report(phase_usage_, Opm::UgGridHelpers::globalCell(grid()));
for (const auto& well : this->wells_ecl_) {
auto xwPos = wsrpt.find(well.name());
if (xwPos == wsrpt.end()) { // No well results. Unexpected.
continue;
}
auto& grval = xwPos->second.guide_rates;
grval.clear();
grval += this->getGuideRateValues(well);
}
this->assignWellGuideRates(wsrpt);
return wsrpt;
}
@@ -473,6 +464,7 @@ namespace Opm {
void setWsolvent(const Group& group, const Schedule& schedule, const int reportStepIdx, double wsolvent);
void assignWellGuideRates(data::Wells& wsrpt) const;
void assignGroupValues(const int reportStepIdx,
const Schedule& sched,
std::map<std::string, data::GroupData>& gvalues) const;

View File

@@ -2591,6 +2591,29 @@ namespace Opm {
}
}
template<typename TypeTag>
void
BlackoilWellModel<TypeTag>::
assignWellGuideRates(data::Wells& wsrpt) const
{
for (const auto& well : this->wells_ecl_) {
auto xwPos = wsrpt.find(well.name());
if (xwPos == wsrpt.end()) { // No well results. Unexpected.
continue;
}
xwPos->second.guide_rates = this->getGuideRateValues(well);
}
}
template <typename TypeTag>
void
BlackoilWellModel<TypeTag>::