mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #4914 from vkip/extra_network_output
Allow output of network pressures based on rates at end of time step
This commit is contained in:
commit
16c8184e3f
@ -924,11 +924,44 @@ assignGroupValues(const int reportStepIdx,
|
|||||||
|
|
||||||
void
|
void
|
||||||
BlackoilWellModelGeneric::
|
BlackoilWellModelGeneric::
|
||||||
assignNodeValues(std::map<std::string, data::NodeData>& nodevalues) 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 well groups to GPR:WELLNAME
|
||||||
|
const auto& sched = schedule();
|
||||||
|
if (!sched.hasGroup(node, reportStepIdx)) continue;
|
||||||
|
const auto& group = sched.getGroup(node, reportStepIdx);
|
||||||
|
for (const std::string& wellname : group.wells()) {
|
||||||
|
nodevalues.emplace(wellname, data::NodeData{pressure});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto& network = schedule()[reportStepIdx].network();
|
||||||
|
if (!network.active()) return;
|
||||||
|
|
||||||
|
auto converged_pressures = WellGroupHelpers::computeNetworkPressures(network,
|
||||||
|
this->wellState(),
|
||||||
|
this->groupState(),
|
||||||
|
*(vfp_properties_->getProd()),
|
||||||
|
schedule(),
|
||||||
|
reportStepIdx);
|
||||||
|
for (const auto& [node, converged_pressure] : converged_pressures) {
|
||||||
|
auto it = nodevalues.find(node);
|
||||||
|
assert(it != nodevalues.end() );
|
||||||
|
it->second.converged_pressure = converged_pressure;
|
||||||
|
// Assign node values of group to GPR:WELLNAME
|
||||||
|
const auto& sched = schedule();
|
||||||
|
if (!sched.hasGroup(node, reportStepIdx)) continue;
|
||||||
|
const auto& group = sched.getGroup(node, reportStepIdx);
|
||||||
|
for (const std::string& wellname : group.wells()) {
|
||||||
|
auto it2 = nodevalues.find(wellname);
|
||||||
|
assert(it2 != nodevalues.end());
|
||||||
|
it2->second.converged_pressure = converged_pressure;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -939,7 +972,7 @@ groupAndNetworkData(const int reportStepIdx) const
|
|||||||
auto grp_nwrk_values = data::GroupAndNetworkValues{};
|
auto grp_nwrk_values = data::GroupAndNetworkValues{};
|
||||||
|
|
||||||
this->assignGroupValues(reportStepIdx, grp_nwrk_values.groupData);
|
this->assignGroupValues(reportStepIdx, grp_nwrk_values.groupData);
|
||||||
this->assignNodeValues(grp_nwrk_values.nodeData);
|
this->assignNodeValues(grp_nwrk_values.nodeData, reportStepIdx-1); // Schedule state info at previous step
|
||||||
|
|
||||||
return grp_nwrk_values;
|
return grp_nwrk_values;
|
||||||
}
|
}
|
||||||
|
@ -354,7 +354,7 @@ protected:
|
|||||||
data::GroupData& gdata) const;
|
data::GroupData& gdata) const;
|
||||||
void assignGroupValues(const int reportStepIdx,
|
void assignGroupValues(const int reportStepIdx,
|
||||||
std::map<std::string, data::GroupData>& gvalues) const;
|
std::map<std::string, data::GroupData>& gvalues) const;
|
||||||
void assignNodeValues(std::map<std::string, data::NodeData>& nodevalues) const;
|
void assignNodeValues(std::map<std::string, data::NodeData>& nodevalues, const int reportStepIdx) const;
|
||||||
|
|
||||||
void calculateEfficiencyFactors(const int reportStepIdx);
|
void calculateEfficiencyFactors(const int reportStepIdx);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user