mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Avoid exception for non-group nodes
This commit is contained in:
@@ -912,12 +912,13 @@ BlackoilWellModelGeneric::
|
|||||||
assignNodeValues(std::map<std::string, data::NodeData>& nodevalues, const int reportStepIdx) const
|
assignNodeValues(std::map<std::string, data::NodeData>& nodevalues, const int reportStepIdx) const
|
||||||
{
|
{
|
||||||
nodevalues.clear();
|
nodevalues.clear();
|
||||||
if (reportStepIdx < 0) return;
|
|
||||||
|
|
||||||
for (const auto& [node, pressure] : node_pressures_) {
|
for (const auto& [node, pressure] : node_pressures_) {
|
||||||
nodevalues.emplace(node, data::NodeData{pressure});
|
nodevalues.emplace(node, data::NodeData{pressure});
|
||||||
// Assign node values of group to GPR:WELLNAME
|
// Assign node values of well groups to GPR:WELLNAME
|
||||||
const auto& group = schedule().getGroup(node, reportStepIdx);
|
const auto& sched = schedule();
|
||||||
|
if (!sched.hasGroup(node, reportStepIdx)) continue;
|
||||||
|
const auto& group = sched.getGroup(node, reportStepIdx);
|
||||||
for (const std::string& wellname : group.wells()) {
|
for (const std::string& wellname : group.wells()) {
|
||||||
nodevalues.emplace(wellname, data::NodeData{pressure});
|
nodevalues.emplace(wellname, data::NodeData{pressure});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user