Merge pull request #3701 from vkip/extra_network_output
Allow output of network pressure based on rates at end of timestep
This commit is contained in:
commit
7baccd0318
@ -172,37 +172,42 @@ namespace Opm { namespace data {
|
|||||||
|
|
||||||
struct NodeData {
|
struct NodeData {
|
||||||
double pressure { 0.0 };
|
double pressure { 0.0 };
|
||||||
|
double converged_pressure { 0.0 };
|
||||||
|
|
||||||
template <class MessageBufferType>
|
template <class MessageBufferType>
|
||||||
void write(MessageBufferType& buffer) const
|
void write(MessageBufferType& buffer) const
|
||||||
{
|
{
|
||||||
buffer.write(this->pressure);
|
buffer.write(this->pressure);
|
||||||
|
buffer.write(this->converged_pressure);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class MessageBufferType>
|
template <class MessageBufferType>
|
||||||
void read(MessageBufferType& buffer)
|
void read(MessageBufferType& buffer)
|
||||||
{
|
{
|
||||||
buffer.read(this->pressure);
|
buffer.read(this->pressure);
|
||||||
|
buffer.read(this->converged_pressure);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const NodeData& other) const
|
bool operator==(const NodeData& other) const
|
||||||
{
|
{
|
||||||
return this->pressure == other.pressure;
|
return this->pressure == other.pressure && this->converged_pressure == other.converged_pressure;
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_json(Json::JsonObject& json_data) const {
|
void init_json(Json::JsonObject& json_data) const {
|
||||||
json_data.add_item("pressure", this->pressure);
|
json_data.add_item("pressure", this->pressure);
|
||||||
|
json_data.add_item("converged_pressure", this->converged_pressure);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class Serializer>
|
template<class Serializer>
|
||||||
void serializeOp(Serializer& serializer)
|
void serializeOp(Serializer& serializer)
|
||||||
{
|
{
|
||||||
serializer(pressure);
|
serializer(pressure);
|
||||||
|
serializer(converged_pressure);
|
||||||
}
|
}
|
||||||
|
|
||||||
static NodeData serializationTestObject()
|
static NodeData serializationTestObject()
|
||||||
{
|
{
|
||||||
return NodeData{10.0};
|
return NodeData{10.0, 10.0};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -397,7 +397,7 @@ struct SummaryConfigContext {
|
|||||||
bool is_node_keyword(const std::string& keyword)
|
bool is_node_keyword(const std::string& keyword)
|
||||||
{
|
{
|
||||||
static const auto nodekw = keyword_set {
|
static const auto nodekw = keyword_set {
|
||||||
"GPR", "GPRG", "GPRW",
|
"GPR", "GPRG", "GPRW", "NPR", "GNETPR"
|
||||||
};
|
};
|
||||||
|
|
||||||
return is_in_set(nodekw, keyword);
|
return is_in_set(nodekw, keyword);
|
||||||
@ -427,6 +427,14 @@ struct SummaryConfigContext {
|
|||||||
for (auto step = 0*nstep; step < nstep; ++step) {
|
for (auto step = 0*nstep; step < nstep; ++step) {
|
||||||
const auto& nodes = sched[step].network.get().node_names();
|
const auto& nodes = sched[step].network.get().node_names();
|
||||||
names.insert(nodes.begin(), nodes.end());
|
names.insert(nodes.begin(), nodes.end());
|
||||||
|
// Also insert wells belonging to groups in the network to be able to report network-computed THPs
|
||||||
|
for (const auto& node : nodes) {
|
||||||
|
if (!sched.hasGroup(node, step)) continue;
|
||||||
|
const auto& group = sched.getGroup(node, step);
|
||||||
|
for (const std::string& wellname : group.wells()) {
|
||||||
|
names.insert(wellname);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
node_names.assign(names.begin(), names.end());
|
node_names.assign(names.begin(), names.end());
|
||||||
@ -1559,6 +1567,7 @@ SummaryConfigNode::Category parseKeywordCategory(const std::string& keyword)
|
|||||||
case 'R': return Cat::Region;
|
case 'R': return Cat::Region;
|
||||||
case 'B': return Cat::Block;
|
case 'B': return Cat::Block;
|
||||||
case 'S': return Cat::Segment;
|
case 'S': return Cat::Segment;
|
||||||
|
case 'N': return Cat::Node;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TCPU, MLINEARS, NEWTON, &c
|
// TCPU, MLINEARS, NEWTON, &c
|
||||||
|
20
src/opm/input/eclipse/share/keywords/900_OPM/N/NETWORK_PROBE
Normal file
20
src/opm/input/eclipse/share/keywords/900_OPM/N/NETWORK_PROBE
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"name": "NETWORK_PROBE",
|
||||||
|
"sections": [
|
||||||
|
"SUMMARY"
|
||||||
|
],
|
||||||
|
"comment": "Network output",
|
||||||
|
"deck_names": [
|
||||||
|
"NPR",
|
||||||
|
"GNETPR"
|
||||||
|
],
|
||||||
|
"deck_name_regex": "NU.+",
|
||||||
|
"size": 1,
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"name": "NETWORK_NODES",
|
||||||
|
"size_type": "ALL",
|
||||||
|
"value_type": "STRING"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -1119,6 +1119,7 @@ set( keywords
|
|||||||
900_OPM/M/MICP
|
900_OPM/M/MICP
|
||||||
900_OPM/M/MICPPARA
|
900_OPM/M/MICPPARA
|
||||||
900_OPM/M/MINNPCOL
|
900_OPM/M/MINNPCOL
|
||||||
|
900_OPM/N/NETWORK_PROBE
|
||||||
900_OPM/O/OCOMPIDX
|
900_OPM/O/OCOMPIDX
|
||||||
900_OPM/O/OILDENT
|
900_OPM/O/OILDENT
|
||||||
900_OPM/O/OILJT
|
900_OPM/O/OILJT
|
||||||
|
@ -1390,6 +1390,16 @@ inline quantity node_pressure(const fn_args& args)
|
|||||||
return { nodePos->second.pressure, measure::pressure };
|
return { nodePos->second.pressure, measure::pressure };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline quantity converged_node_pressure(const fn_args& args)
|
||||||
|
{
|
||||||
|
auto nodePos = args.grp_nwrk.nodeData.find(args.group_name);
|
||||||
|
if (nodePos == args.grp_nwrk.nodeData.end()) {
|
||||||
|
return { 0.0, measure::pressure };
|
||||||
|
}
|
||||||
|
|
||||||
|
return { nodePos->second.converged_pressure, measure::pressure };
|
||||||
|
}
|
||||||
|
|
||||||
template <Opm::data::WellBlockAvgPress::Quantity wbp_quantity>
|
template <Opm::data::WellBlockAvgPress::Quantity wbp_quantity>
|
||||||
quantity well_block_average_pressure(const fn_args& args)
|
quantity well_block_average_pressure(const fn_args& args)
|
||||||
{
|
{
|
||||||
@ -2114,6 +2124,8 @@ static const auto funs = std::unordered_map<std::string, ofun> {
|
|||||||
{ "GVPGR", group_guiderate<producer, Opm::data::GuideRateValue::Item::ResV> },
|
{ "GVPGR", group_guiderate<producer, Opm::data::GuideRateValue::Item::ResV> },
|
||||||
|
|
||||||
{ "GPR", node_pressure },
|
{ "GPR", node_pressure },
|
||||||
|
{ "NPR", converged_node_pressure },
|
||||||
|
{ "GNETPR", converged_node_pressure },
|
||||||
|
|
||||||
{ "GWPT", mul( rate< rt::wat, producer >, duration ) },
|
{ "GWPT", mul( rate< rt::wat, producer >, duration ) },
|
||||||
{ "GOPT", mul( rate< rt::oil, producer >, duration ) },
|
{ "GOPT", mul( rate< rt::oil, producer >, duration ) },
|
||||||
|
Loading…
Reference in New Issue
Block a user