From 69c9faefccf75d158bcd4478d0bceea55490749f Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Wed, 18 Aug 2021 16:17:55 +0200 Subject: [PATCH] Use SummaryState::get_well_var() with default --- src/opm/output/eclipse/AggregateMSWData.cpp | 5 ++--- tests/test_AggregateMSWData.cpp | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/opm/output/eclipse/AggregateMSWData.cpp b/src/opm/output/eclipse/AggregateMSWData.cpp index 2525f7aa9..9174a2042 100644 --- a/src/opm/output/eclipse/AggregateMSWData.cpp +++ b/src/opm/output/eclipse/AggregateMSWData.cpp @@ -745,7 +745,6 @@ namespace { const auto& conn0 = well.getConnections(); const auto& welConns = Opm::WellConnections(conn0, grid); const auto& wname = well.name(); - const auto wPKey = "WBHP:" + wname; const auto& wRatesIt = wr.find(wname); // //Do not calculate well segment rates for shut wells @@ -790,7 +789,7 @@ namespace { temp_w = sSFR.swfr[0]*0.1; temp_g = sSFR.sgfr[0]*gfactor; //Item 12 Segment pressure - use well flow bhp - rSeg[iS + Ix::Pressure] = (smry.has(wPKey)) ? smry.get(wPKey) :0.0; + rSeg[iS + Ix::Pressure] = smry.get_well_var(wname, "WBHP", 0); } else { // Note: Segment flow rates and pressure from 'smry' have correct @@ -846,7 +845,7 @@ namespace { temp_w = sSFR.swfr[segIndex]*0.1; temp_g = sSFR.sgfr[segIndex]*gfactor; //Item 12 Segment pressure - use well flow bhp - rSeg[iS + Ix::Pressure] = (smry.has(wPKey)) ? smry.get(wPKey) :0.0; + rSeg[iS + Ix::Pressure] = smry.get_well_var(wname, "WBHP", 0); } else { // Note: Segment flow rates and pressure from 'smry' have correct diff --git a/tests/test_AggregateMSWData.cpp b/tests/test_AggregateMSWData.cpp index 29787a194..f98226814 100644 --- a/tests/test_AggregateMSWData.cpp +++ b/tests/test_AggregateMSWData.cpp @@ -89,7 +89,7 @@ Opm::SummaryState sim_state() state.update("SWFR:WINJ:3", 23.); state.update("SWFR:WINJ:4", 24.); - state.update("WBHP:WINJ", 234.); + state.update_well_var("WINJ", "WBHP", 234.); return state; } Opm::data::Wells wr()