Well Data: Report CTFs for Shut Connections

Needed to ensure that the CTFs reported to the summary files will be
correct in the presence of WELPI even for shut connections.
This commit is contained in:
Bård Skaflestad 2020-10-29 23:16:31 +01:00
parent e780d107ab
commit f6130861df
2 changed files with 34 additions and 1 deletions

View File

@ -215,6 +215,7 @@ namespace Opm {
auto wsrpt = well_state_.report(phase_usage_, Opm::UgGridHelpers::globalCell(grid()));
this->assignWellGuideRates(wsrpt);
this->assignShutConnections(wsrpt);
return wsrpt;
}
@ -468,6 +469,7 @@ namespace Opm {
void setWsolvent(const Group& group, const Schedule& schedule, const int reportStepIdx, double wsolvent);
void assignWellGuideRates(data::Wells& wsrpt) const;
void assignShutConnections(data::Wells& wsrpt) const;
void assignGroupValues(const int reportStepIdx,
const Schedule& sched,
std::map<std::string, data::GroupData>& gvalues) const;

View File

@ -23,8 +23,8 @@
#include <opm/simulators/utils/DeferredLoggingErrorHelpers.hpp>
#include <opm/core/props/phaseUsageFromDeck.hpp>
#include <utility>
#include <algorithm>
#include <utility>
#include <fmt/format.h>
namespace Opm {
@ -2625,6 +2625,37 @@ namespace Opm {
template <typename TypeTag>
void
BlackoilWellModel<TypeTag>::
assignShutConnections(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;
}
auto& xcon = xwPos->second.connections;
for (const auto& conn : well.getConnections()) {
if (conn.state() != Connection::State::SHUT) {
continue;
}
auto& xc = xcon.emplace_back();
xc.index = conn.global_index();
xc.pressure = xc.reservoir_rate = 0.0;
xc.effective_Kh = conn.Kh();
xc.trans_factor = conn.CF();
}
}
}
template <typename TypeTag>
void
BlackoilWellModel<TypeTag>::