Segmentstate for accelarition pressure drop

This commit is contained in:
Joakim Hove
2021-05-30 20:10:44 +02:00
parent 33f18279d7
commit 6a859c0664
3 changed files with 3 additions and 19 deletions

View File

@@ -2043,7 +2043,7 @@ namespace Opm
const double sign = mass_rate < 0. ? 1.0 : - 1.0; const double sign = mass_rate < 0. ? 1.0 : - 1.0;
accelerationPressureLoss *= sign; accelerationPressureLoss *= sign;
well_state.segPressDropAcceleration(index_of_well_)[seg] = accelerationPressureLoss.value(); well_state.segments(this->index_of_well_).pressure_drop_accel[seg] = accelerationPressureLoss.value();
resWell_[seg][SPres] -= accelerationPressureLoss.value(); resWell_[seg][SPres] -= accelerationPressureLoss.value();
duneD_[seg][seg][SPres][SPres] -= accelerationPressureLoss.derivative(SPres + numEq); duneD_[seg][seg][SPres][SPres] -= accelerationPressureLoss.derivative(SPres + numEq);

View File

@@ -535,7 +535,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_acceleration_.assign(nw, 0.);
} }
updateWellsDefaultALQ(wells_ecl); updateWellsDefaultALQ(wells_ecl);
@@ -940,7 +939,6 @@ void WellState::initWellStateMSWell(const std::vector<Well>& wells_ecl,
assert(int(seg_press_.size()) == nseg_); assert(int(seg_press_.size()) == nseg_);
assert(int(seg_rates_.size()) == nseg_ * numPhases() ); assert(int(seg_rates_.size()) == nseg_ * numPhases() );
seg_pressdrop_acceleration_.assign(nseg_, 0.);
if (prev_well_state && !prev_well_state->wellMap().empty()) { if (prev_well_state && !prev_well_state->wellMap().empty()) {
const auto& end = prev_well_state->wellMap().end(); const auto& end = prev_well_state->wellMap().end();
@@ -1155,9 +1153,9 @@ WellState::reportSegmentResults(const PhaseUsage& pu,
auto& segpress = seg_res.pressures; auto& segpress = seg_res.pressures;
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::PDropAccel] = this->segPressDropAcceleration(well_id)[seg_ix];
segpress[Value::PDropHydrostatic] = segments.pressure_drop_hydrostatic[seg_ix]; segpress[Value::PDropHydrostatic] = segments.pressure_drop_hydrostatic[seg_ix];
segpress[Value::PDropFriction] = segments.pressure_drop_friction[seg_ix]; segpress[Value::PDropFriction] = segments.pressure_drop_friction[seg_ix];
segpress[Value::PDropAccel] = segments.pressure_drop_accel[seg_ix];
} }
const auto segment_rates = this->segRates(well_id); const auto segment_rates = this->segRates(well_id);

View File

@@ -223,23 +223,11 @@ 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 auto& segments = this->segments(well_index);
const int top_segment_index = this->top_segment_index_[well_index];
return segments.pressure_drop_friction[segment_index] + return segments.pressure_drop_friction[segment_index] +
segments.pressure_drop_hydrostatic[segment_index] + segments.pressure_drop_hydrostatic[segment_index] +
this->seg_pressdrop_acceleration_[top_segment_index + segment_index]; segments.pressure_drop_accel[segment_index];
} }
double * segPressDropAcceleration(std::size_t well_index)
{
const int top_segment_index = this->top_segment_index_[well_index];
return &seg_pressdrop_acceleration_[top_segment_index];
}
const double* segPressDropAcceleration(std::size_t well_index) const
{
const int top_segment_index = this->top_segment_index_[well_index];
return &seg_pressdrop_acceleration_[top_segment_index];
}
int numSegment() const int numSegment() const
{ {
@@ -522,8 +510,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
// accelerational pressure drop
std::vector<double> seg_pressdrop_acceleration_;
// Productivity Index // Productivity Index
std::vector<double> productivity_index_; std::vector<double> productivity_index_;