Use well index for segment friction pressure drop

This commit is contained in:
Joakim Hove 2021-05-27 08:20:06 +02:00
parent 92e31b4ee3
commit ee1a1c6afc
3 changed files with 11 additions and 9 deletions

View File

@ -1930,7 +1930,7 @@ namespace Opm
if (frictionalPressureLossConsidered()) { if (frictionalPressureLossConsidered()) {
const auto friction_pressure_drop = getFrictionPressureLoss(seg); const auto friction_pressure_drop = getFrictionPressureLoss(seg);
pressure_equation -= friction_pressure_drop; pressure_equation -= friction_pressure_drop;
well_state.segPressDropFriction()[top_segment_index + seg] = friction_pressure_drop.value(); well_state.segPressDropFriction(index_of_well_)[seg] = friction_pressure_drop.value();
} }
resWell_[seg][SPres] = pressure_equation.value(); resWell_[seg][SPres] = pressure_equation.value();
@ -2705,8 +2705,9 @@ namespace Opm
} }
auto seg_press_drop = well_state.segPressDrop(index_of_well_); auto seg_press_drop = well_state.segPressDrop(index_of_well_);
auto seg_press_friction = well_state.segPressDropFriction(index_of_well_);
seg_press_drop[seg] = well_state.segPressDropHydroStatic()[seg] + seg_press_drop[seg] = well_state.segPressDropHydroStatic()[seg] +
well_state.segPressDropFriction()[seg] + seg_press_friction[seg] +
well_state.segPressDropAcceleration()[seg]; well_state.segPressDropAcceleration()[seg];
} }
} }
@ -3261,8 +3262,7 @@ namespace Opm
} }
} }
pressure_equation = pressure_equation - icd_pressure_drop; pressure_equation = pressure_equation - icd_pressure_drop;
auto top_segment_index = well_state.topSegmentIndex(this->index_of_well_); well_state.segPressDropFriction(index_of_well_)[seg] = icd_pressure_drop.value();
well_state.segPressDropFriction()[top_segment_index + seg] = icd_pressure_drop.value();
const int seg_upwind = upwinding_segments_[seg]; const int seg_upwind = upwinding_segments_[seg];
resWell_[seg][SPres] = pressure_equation.value(); resWell_[seg][SPres] = pressure_equation.value();

View File

@ -1159,7 +1159,7 @@ WellState::reportSegmentResults(const PhaseUsage& pu,
segpress[Value::Pressure] = this->segPress(well_id)[seg_ix]; segpress[Value::Pressure] = this->segPress(well_id)[seg_ix];
segpress[Value::PDrop] = this->segPressDrop(well_id)[seg_ix]; segpress[Value::PDrop] = this->segPressDrop(well_id)[seg_ix];
segpress[Value::PDropHydrostatic] = this->segPressDropHydroStatic()[seg_dof]; segpress[Value::PDropHydrostatic] = this->segPressDropHydroStatic()[seg_dof];
segpress[Value::PDropFriction] = this->segPressDropFriction()[seg_dof]; segpress[Value::PDropFriction] = this->segPressDropFriction(well_id)[seg_ix];
segpress[Value::PDropAccel] = this->segPressDropAcceleration()[seg_dof]; segpress[Value::PDropAccel] = this->segPressDropAcceleration()[seg_dof];
} }

View File

@ -229,14 +229,16 @@ public:
return &seg_pressdrop_[top_segment_index]; return &seg_pressdrop_[top_segment_index];
} }
std::vector<double>& segPressDropFriction() double* segPressDropFriction(std::size_t well_index)
{ {
return seg_pressdrop_friction_; const int top_segment_index = this->top_segment_index_[well_index];
return &seg_pressdrop_friction_[top_segment_index];
} }
const std::vector<double>& segPressDropFriction() const const double* segPressDropFriction(std::size_t well_index) const
{ {
return seg_pressdrop_friction_; const int top_segment_index = this->top_segment_index_[well_index];
return &seg_pressdrop_friction_[top_segment_index];
} }
std::vector<double>& segPressDropHydroStatic() std::vector<double>& segPressDropHydroStatic()