From a75f58f19a52e3834acc439187edfb6799cbc0e3 Mon Sep 17 00:00:00 2001 From: Vegard Kippe Date: Thu, 31 Aug 2023 16:10:24 +0200 Subject: [PATCH] Moved two lines --- opm/simulators/wells/MultisegmentWellEval.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opm/simulators/wells/MultisegmentWellEval.cpp b/opm/simulators/wells/MultisegmentWellEval.cpp index 1f8fee018..bc2390ca4 100644 --- a/opm/simulators/wells/MultisegmentWellEval.cpp +++ b/opm/simulators/wells/MultisegmentWellEval.cpp @@ -331,8 +331,6 @@ assembleAccelerationAndHydroPressureLosses(const int seg, WellState& well_state, const bool use_average_density) { - auto& ws = well_state.well(baseif_.indexOfWell()); - auto& segments = ws.segments; if (this->accelerationalPressureLossConsidered()) { handleAccelerationPressureLoss(seg, well_state); } @@ -340,6 +338,8 @@ assembleAccelerationAndHydroPressureLosses(const int seg, // Since density derivatives are organized differently than what is required for assemblePressureEq, // this part needs to be assembled separately. Optionally use average density variant. const auto hydro_pressure_drop_seg = segments_.getHydroPressureLoss(seg, seg); + auto& ws = well_state.well(baseif_.indexOfWell()); + auto& segments = ws.segments; if (!use_average_density){ MultisegmentWellAssemble(baseif_). assembleHydroPressureLoss(seg, seg, hydro_pressure_drop_seg, linSys_);