mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Use segmentstate for friction pressure
This commit is contained in:
parent
bccb4f36e4
commit
9801469488
@ -1924,12 +1924,13 @@ namespace Opm
|
|||||||
// after converged
|
// after converged
|
||||||
const auto hydro_pressure_drop = getHydroPressureLoss(seg);
|
const auto hydro_pressure_drop = getHydroPressureLoss(seg);
|
||||||
well_state.segPressDropHydroStatic(index_of_well_)[seg] = hydro_pressure_drop.value();
|
well_state.segPressDropHydroStatic(index_of_well_)[seg] = hydro_pressure_drop.value();
|
||||||
|
auto& segments = well_state.segments(this->index_of_well_);
|
||||||
pressure_equation -= hydro_pressure_drop;
|
pressure_equation -= hydro_pressure_drop;
|
||||||
|
|
||||||
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(index_of_well_)[seg] = friction_pressure_drop.value();
|
segments.pressure_drop_friction[seg] = friction_pressure_drop.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
resWell_[seg][SPres] = pressure_equation.value();
|
resWell_[seg][SPres] = pressure_equation.value();
|
||||||
@ -3254,7 +3255,7 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
pressure_equation = pressure_equation - icd_pressure_drop;
|
pressure_equation = pressure_equation - icd_pressure_drop;
|
||||||
well_state.segPressDropFriction(index_of_well_)[seg] = icd_pressure_drop.value();
|
well_state.segments(this->index_of_well_).pressure_drop_friction[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();
|
||||||
|
@ -536,7 +536,6 @@ void WellState::init(const std::vector<double>& cellPressures,
|
|||||||
//seg_rates_ = wellRates();
|
//seg_rates_ = wellRates();
|
||||||
seg_rates_.assign(nw*np, 0);
|
seg_rates_.assign(nw*np, 0);
|
||||||
seg_pressdrop_hydorstatic_.assign(nw, 0.);
|
seg_pressdrop_hydorstatic_.assign(nw, 0.);
|
||||||
seg_pressdrop_friction_.assign(nw, 0.);
|
|
||||||
seg_pressdrop_acceleration_.assign(nw, 0.);
|
seg_pressdrop_acceleration_.assign(nw, 0.);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -943,7 +942,6 @@ void WellState::initWellStateMSWell(const std::vector<Well>& wells_ecl,
|
|||||||
assert(int(seg_rates_.size()) == nseg_ * numPhases() );
|
assert(int(seg_rates_.size()) == nseg_ * numPhases() );
|
||||||
|
|
||||||
seg_pressdrop_hydorstatic_.assign(nseg_, 0.);
|
seg_pressdrop_hydorstatic_.assign(nseg_, 0.);
|
||||||
seg_pressdrop_friction_.assign(nseg_, 0.);
|
|
||||||
seg_pressdrop_acceleration_.assign(nseg_, 0.);
|
seg_pressdrop_acceleration_.assign(nseg_, 0.);
|
||||||
|
|
||||||
if (prev_well_state && !prev_well_state->wellMap().empty()) {
|
if (prev_well_state && !prev_well_state->wellMap().empty()) {
|
||||||
@ -1149,6 +1147,10 @@ WellState::reportSegmentResults(const PhaseUsage& pu,
|
|||||||
const int seg_ix,
|
const int seg_ix,
|
||||||
const int seg_no) const
|
const int seg_no) const
|
||||||
{
|
{
|
||||||
|
const auto& segments = this->segments(well_id);
|
||||||
|
if (segments.empty())
|
||||||
|
return {};
|
||||||
|
|
||||||
auto seg_res = data::Segment{};
|
auto seg_res = data::Segment{};
|
||||||
{
|
{
|
||||||
using Value = data::SegmentPressures::Value;
|
using Value = data::SegmentPressures::Value;
|
||||||
@ -1156,8 +1158,8 @@ 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(well_id)[seg_ix];
|
segpress[Value::PDropHydrostatic] = this->segPressDropHydroStatic(well_id)[seg_ix];
|
||||||
segpress[Value::PDropFriction] = this->segPressDropFriction(well_id)[seg_ix];
|
|
||||||
segpress[Value::PDropAccel] = this->segPressDropAcceleration(well_id)[seg_ix];
|
segpress[Value::PDropAccel] = this->segPressDropAcceleration(well_id)[seg_ix];
|
||||||
|
segpress[Value::PDropFriction] = segments.pressure_drop_friction[seg_ix];
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto segment_rates = this->segRates(well_id);
|
const auto segment_rates = this->segRates(well_id);
|
||||||
|
@ -222,24 +222,13 @@ public:
|
|||||||
|
|
||||||
double segPressDrop(std::size_t well_index, std::size_t segment_index) const
|
double segPressDrop(std::size_t well_index, std::size_t segment_index) const
|
||||||
{
|
{
|
||||||
|
const auto& segments = this->segments(well_index);
|
||||||
const int top_segment_index = this->top_segment_index_[well_index];
|
const int top_segment_index = this->top_segment_index_[well_index];
|
||||||
return this->seg_pressdrop_friction_[top_segment_index + segment_index] +
|
return segments.pressure_drop_friction[segment_index] +
|
||||||
this->seg_pressdrop_hydorstatic_[top_segment_index + segment_index] +
|
this->seg_pressdrop_hydorstatic_[top_segment_index + segment_index] +
|
||||||
this->seg_pressdrop_acceleration_[top_segment_index + segment_index];
|
this->seg_pressdrop_acceleration_[top_segment_index + segment_index];
|
||||||
}
|
}
|
||||||
|
|
||||||
double* segPressDropFriction(std::size_t well_index)
|
|
||||||
{
|
|
||||||
const int top_segment_index = this->top_segment_index_[well_index];
|
|
||||||
return &seg_pressdrop_friction_[top_segment_index];
|
|
||||||
}
|
|
||||||
|
|
||||||
const double* segPressDropFriction(std::size_t well_index) const
|
|
||||||
{
|
|
||||||
const int top_segment_index = this->top_segment_index_[well_index];
|
|
||||||
return &seg_pressdrop_friction_[top_segment_index];
|
|
||||||
}
|
|
||||||
|
|
||||||
double* segPressDropHydroStatic(std::size_t well_index)
|
double* segPressDropHydroStatic(std::size_t well_index)
|
||||||
{
|
{
|
||||||
const int top_segment_index = this->top_segment_index_[well_index];
|
const int top_segment_index = this->top_segment_index_[well_index];
|
||||||
@ -545,8 +534,6 @@ private:
|
|||||||
int nseg_; // total number of the segments
|
int nseg_; // total number of the segments
|
||||||
|
|
||||||
// The following data are only recorded for output
|
// The following data are only recorded for output
|
||||||
// frictional pressure drop
|
|
||||||
std::vector<double> seg_pressdrop_friction_;
|
|
||||||
// hydrostatic pressure drop
|
// hydrostatic pressure drop
|
||||||
std::vector<double> seg_pressdrop_hydorstatic_;
|
std::vector<double> seg_pressdrop_hydorstatic_;
|
||||||
// accelerational pressure drop
|
// accelerational pressure drop
|
||||||
|
Loading…
Reference in New Issue
Block a user