mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Remove WellState::top_segment_index
This commit is contained in:
parent
5d8a4c5751
commit
59f36eacc0
@ -521,14 +521,6 @@ void WellState::init(const std::vector<double>& cellPressures,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
// we need to create a trival segment related values to avoid there will be some
|
|
||||||
// multi-segment wells added later.
|
|
||||||
top_segment_index_.resize(nw);
|
|
||||||
for (int w = 0; w < nw; ++w) {
|
|
||||||
top_segment_index_[w] = w;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
updateWellsDefaultALQ(wells_ecl);
|
updateWellsDefaultALQ(wells_ecl);
|
||||||
do_glift_optimization_ = true;
|
do_glift_optimization_ = true;
|
||||||
@ -814,11 +806,8 @@ void WellState::initWellStateMSWell(const std::vector<Well>& wells_ecl,
|
|||||||
const auto& pu = this->phaseUsage();
|
const auto& pu = this->phaseUsage();
|
||||||
const int np = pu.num_phases;
|
const int np = pu.num_phases;
|
||||||
|
|
||||||
top_segment_index_.clear();
|
|
||||||
|
|
||||||
// in the init function, the well rates and perforation rates have been initialized or copied from prevState
|
// in the init function, the well rates and perforation rates have been initialized or copied from prevState
|
||||||
// what we do here, is to set the segment rates and perforation rates
|
// what we do here, is to set the segment rates and perforation rates
|
||||||
int nseg_ = 0;
|
|
||||||
for (int w = 0; w < nw; ++w) {
|
for (int w = 0; w < nw; ++w) {
|
||||||
const auto& well_ecl = wells_ecl[w];
|
const auto& well_ecl = wells_ecl[w];
|
||||||
const auto& wname = wells_ecl[w].name();
|
const auto& wname = wells_ecl[w].name();
|
||||||
@ -826,10 +815,7 @@ void WellState::initWellStateMSWell(const std::vector<Well>& wells_ecl,
|
|||||||
const int connpos = well_info[1];
|
const int connpos = well_info[1];
|
||||||
const int num_perf_this_well = well_info[2];
|
const int num_perf_this_well = well_info[2];
|
||||||
|
|
||||||
top_segment_index_.push_back(nseg_);
|
if ( well_ecl.isMultiSegment() ) {
|
||||||
if ( !well_ecl.isMultiSegment() ) { // not multi-segment well
|
|
||||||
nseg_ += 1;
|
|
||||||
} else { // it is a multi-segment well
|
|
||||||
const WellSegments& segment_set = well_ecl.getSegments();
|
const WellSegments& segment_set = well_ecl.getSegments();
|
||||||
// assuming the order of the perforations in well_ecl is the same with Wells
|
// assuming the order of the perforations in well_ecl is the same with Wells
|
||||||
const WellConnections& completion_set = well_ecl.getConnections();
|
const WellConnections& completion_set = well_ecl.getConnections();
|
||||||
@ -837,7 +823,6 @@ void WellState::initWellStateMSWell(const std::vector<Well>& wells_ecl,
|
|||||||
this->segment_state.update(w, SegmentState{np, segment_set});
|
this->segment_state.update(w, SegmentState{np, segment_set});
|
||||||
const int well_nseg = segment_set.size();
|
const int well_nseg = segment_set.size();
|
||||||
int n_activeperf = 0;
|
int n_activeperf = 0;
|
||||||
nseg_ += well_nseg;
|
|
||||||
|
|
||||||
// we need to know for each segment, how many perforation it has and how many segments using it as outlet_segment
|
// we need to know for each segment, how many perforation it has and how many segments using it as outlet_segment
|
||||||
// that is why I think we should use a well model to initialize the WellState here
|
// that is why I think we should use a well model to initialize the WellState here
|
||||||
@ -986,12 +971,6 @@ double WellState::brineWellRate(const int w) const
|
|||||||
return parallel_well_info_[w]->sumPerfValues(perf_rates_brine, perf_rates_brine + this->numPerf(w));
|
return parallel_well_info_[w]->sumPerfValues(perf_rates_brine, perf_rates_brine + this->numPerf(w));
|
||||||
}
|
}
|
||||||
|
|
||||||
int WellState::topSegmentIndex(const int w) const
|
|
||||||
{
|
|
||||||
assert(w < int(top_segment_index_.size()) );
|
|
||||||
|
|
||||||
return top_segment_index_[w];
|
|
||||||
}
|
|
||||||
|
|
||||||
void WellState::stopWell(int well_index)
|
void WellState::stopWell(int well_index)
|
||||||
{
|
{
|
||||||
|
@ -197,8 +197,6 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int topSegmentIndex(const int w) const;
|
|
||||||
|
|
||||||
|
|
||||||
const SegmentState& segments(const std::size_t well_index) const {
|
const SegmentState& segments(const std::size_t well_index) const {
|
||||||
return this->segment_state[well_index];
|
return this->segment_state[well_index];
|
||||||
@ -471,11 +469,6 @@ private:
|
|||||||
WellContainer<Events> events_;
|
WellContainer<Events> events_;
|
||||||
|
|
||||||
WellContainer<SegmentState> segment_state;
|
WellContainer<SegmentState> segment_state;
|
||||||
// the index of the top segments, which is used to locate the
|
|
||||||
// multisegment well related information in WellState
|
|
||||||
std::vector<int> top_segment_index_;
|
|
||||||
|
|
||||||
// The following data are only recorded for output
|
|
||||||
|
|
||||||
// Productivity Index
|
// Productivity Index
|
||||||
std::vector<double> productivity_index_;
|
std::vector<double> productivity_index_;
|
||||||
|
@ -249,16 +249,10 @@ BOOST_AUTO_TEST_CASE(Linearisation)
|
|||||||
std::vector<Opm::ParallelWellInfo> pinfos;
|
std::vector<Opm::ParallelWellInfo> pinfos;
|
||||||
const auto wstate = buildWellState(setup, tstep, pinfos);
|
const auto wstate = buildWellState(setup, tstep, pinfos);
|
||||||
|
|
||||||
BOOST_CHECK_EQUAL(wstate.numSegment(), 6 + 1);
|
BOOST_CHECK_EQUAL(wstate.segments("PROD01").size(), 6);
|
||||||
|
|
||||||
const auto& wells = setup.sched.getWellsatEnd();
|
const auto& wells = setup.sched.getWellsatEnd();
|
||||||
BOOST_CHECK_EQUAL(wells.size(), 2);
|
BOOST_CHECK_EQUAL(wells.size(), 2);
|
||||||
|
|
||||||
const auto prod01_first = wells[0].name() == "PROD01";
|
|
||||||
|
|
||||||
BOOST_CHECK_EQUAL(wstate.topSegmentIndex(0), 0);
|
|
||||||
BOOST_CHECK_EQUAL(wstate.topSegmentIndex(1),
|
|
||||||
prod01_first ? 6 : 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user