mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #3344 from joakim-hove/perf-wellcontainer
Perf wellcontainer
This commit is contained in:
commit
f28ff9e450
@ -1996,7 +1996,7 @@ namespace Opm {
|
||||
|
||||
auto& perf_pressure = well_state.perfPress(well_index);
|
||||
auto& perf_rates = well_state.perfRates(well_index);
|
||||
auto * perf_phase_rates = well_state.perfPhaseRates(well_index);
|
||||
auto& perf_phase_rates = well_state.perfPhaseRates(well_index);
|
||||
const auto& perf_data = this->well_perf_data_[well_index];
|
||||
|
||||
for (std::size_t perf_index = 0; perf_index < perf_data.size(); perf_index++) {
|
||||
@ -3373,7 +3373,7 @@ namespace Opm {
|
||||
|
||||
auto& well_info = *local_parallel_well_info_[wellID];
|
||||
const int num_perf_this_well = well_info.communication().sum(well_perf_data_[wellID].size());
|
||||
auto * perf_phase_rate = this->wellState().perfPhaseRates(wellID);
|
||||
auto& perf_phase_rate = this->wellState().perfPhaseRates(wellID);
|
||||
|
||||
for (int perf = 0; perf < num_perf_this_well; ++perf) {
|
||||
const int cell_idx = well_perf_data_[wellID][perf].cell_index;
|
||||
|
@ -2637,7 +2637,7 @@ namespace Opm
|
||||
|
||||
// calculating the perforation rate for each perforation that belongs to this segment
|
||||
const EvalWell seg_pressure = getSegmentPressure(seg);
|
||||
auto * perf_rates = well_state.perfPhaseRates(this->index_of_well_);
|
||||
auto& perf_rates = well_state.perfPhaseRates(this->index_of_well_);
|
||||
auto& perf_press_state = well_state.perfPress(this->index_of_well_);
|
||||
for (const int perf : segment_perforations_[seg]) {
|
||||
const int cell_idx = well_cells_[perf];
|
||||
|
@ -591,7 +591,7 @@ namespace Opm
|
||||
const int np = number_of_phases_;
|
||||
|
||||
std::vector<RateVector> connectionRates = connectionRates_; // Copy to get right size.
|
||||
auto * perf_rates = well_state.perfPhaseRates(this->index_of_well_);
|
||||
auto& perf_rates = well_state.perfPhaseRates(this->index_of_well_);
|
||||
for (int perf = 0; perf < number_of_perforations_; ++perf) {
|
||||
// Calculate perforation quantities.
|
||||
std::vector<EvalWell> cq_s(num_components_, {numWellEq_ + numEq, 0.0});
|
||||
@ -628,7 +628,7 @@ namespace Opm
|
||||
|
||||
// Store the perforation phase flux for later usage.
|
||||
if (has_solvent && componentIdx == contiSolventEqIdx) {
|
||||
auto * perf_rate_solvent = well_state.perfRateSolvent(this->index_of_well_);
|
||||
auto& perf_rate_solvent = well_state.perfRateSolvent(this->index_of_well_);
|
||||
perf_rate_solvent[perf] = cq_s[componentIdx].value();
|
||||
} else {
|
||||
perf_rates[perf*np + ebosCompIdxToFlowCompIdx(componentIdx)] = cq_s[componentIdx].value();
|
||||
@ -794,7 +794,7 @@ namespace Opm
|
||||
cq_s_poly *= extendEval(intQuants.polymerConcentration() * intQuants.polymerViscosityCorrection());
|
||||
}
|
||||
// Note. Efficiency factor is handled in the output layer
|
||||
auto * perf_rate_polymer = well_state.perfRatePolymer(this->index_of_well_);
|
||||
auto& perf_rate_polymer = well_state.perfRatePolymer(this->index_of_well_);
|
||||
perf_rate_polymer[perf] = cq_s_poly.value();
|
||||
|
||||
cq_s_poly *= well_efficiency_factor_;
|
||||
@ -827,7 +827,7 @@ namespace Opm
|
||||
const double dis_gas_frac = perf_dis_gas_rate / cq_s_zfrac_effective.value();
|
||||
cq_s_zfrac_effective *= extendEval(dis_gas_frac*intQuants.xVolume() + (1.0-dis_gas_frac)*intQuants.yVolume());
|
||||
}
|
||||
auto * perf_rate_solvent = well_state.perfRateSolvent(this->index_of_well_);
|
||||
auto& perf_rate_solvent = well_state.perfRateSolvent(this->index_of_well_);
|
||||
perf_rate_solvent[perf] = cq_s_zfrac_effective.value();
|
||||
|
||||
cq_s_zfrac_effective *= well_efficiency_factor_;
|
||||
@ -844,7 +844,7 @@ namespace Opm
|
||||
cq_s_sm *= extendEval(intQuants.fluidState().saltConcentration());
|
||||
}
|
||||
// Note. Efficiency factor is handled in the output layer
|
||||
auto * perf_rate_brine = well_state.perfRateBrine(this->index_of_well_);
|
||||
auto& perf_rate_brine = well_state.perfRateBrine(this->index_of_well_);
|
||||
perf_rate_brine[perf] = cq_s_sm.value();
|
||||
|
||||
cq_s_sm *= well_efficiency_factor_;
|
||||
@ -1304,8 +1304,8 @@ namespace Opm
|
||||
// other primary variables related to polymer injectivity study
|
||||
if constexpr (Base::has_polymermw) {
|
||||
if (this->isInjector()) {
|
||||
auto * perf_water_velocity = well_state.perfWaterVelocity(this->index_of_well_);
|
||||
auto * perf_skin_pressure = well_state.perfSkinPressure(this->index_of_well_);
|
||||
auto& perf_water_velocity = well_state.perfWaterVelocity(this->index_of_well_);
|
||||
auto& perf_skin_pressure = well_state.perfSkinPressure(this->index_of_well_);
|
||||
for (int perf = 0; perf < number_of_perforations_; ++perf) {
|
||||
perf_water_velocity[perf] = primary_variables_[Bhp + 1 + perf];
|
||||
perf_skin_pressure[perf] = primary_variables_[Bhp + 1 + number_of_perforations_ + perf];
|
||||
@ -2104,7 +2104,7 @@ namespace Opm
|
||||
const int nperf = number_of_perforations_;
|
||||
const int np = number_of_phases_;
|
||||
std::vector<double> perfRates(b_perf.size(),0.0);
|
||||
const auto * perf_rates_state = well_state.perfPhaseRates(this->index_of_well_);
|
||||
const auto& perf_rates_state = well_state.perfPhaseRates(this->index_of_well_);
|
||||
|
||||
for (int perf = 0; perf < nperf; ++perf) {
|
||||
for (int comp = 0; comp < np; ++comp) {
|
||||
@ -2113,7 +2113,7 @@ namespace Opm
|
||||
}
|
||||
|
||||
if constexpr (has_solvent) {
|
||||
const auto * solvent_perf_rates_state = well_state.perfRateSolvent(this->index_of_well_);
|
||||
const auto& solvent_perf_rates_state = well_state.perfRateSolvent(this->index_of_well_);
|
||||
for (int perf = 0; perf < nperf; ++perf) {
|
||||
perfRates[perf * num_components_ + contiSolventEqIdx] = solvent_perf_rates_state[perf];
|
||||
}
|
||||
@ -2832,8 +2832,8 @@ namespace Opm
|
||||
// other primary variables related to polymer injection
|
||||
if constexpr (Base::has_polymermw) {
|
||||
if (this->isInjector()) {
|
||||
const auto * water_velocity = well_state.perfWaterVelocity(this->index_of_well_);
|
||||
const auto * skin_pressure = well_state.perfSkinPressure(this->index_of_well_);
|
||||
const auto& water_velocity = well_state.perfWaterVelocity(this->index_of_well_);
|
||||
const auto& skin_pressure = well_state.perfSkinPressure(this->index_of_well_);
|
||||
for (int perf = 0; perf < number_of_perforations_; ++perf) {
|
||||
primary_variables_[Bhp + 1 + perf] = water_velocity[perf];
|
||||
primary_variables_[Bhp + 1 + number_of_perforations_ + perf] = skin_pressure[perf];
|
||||
@ -3201,7 +3201,7 @@ namespace Opm
|
||||
{
|
||||
if constexpr (Base::has_polymermw) {
|
||||
if (this->isInjector()) {
|
||||
auto * perf_water_throughput = well_state.perfThroughput(this->index_of_well_);
|
||||
auto& perf_water_throughput = well_state.perfThroughput(this->index_of_well_);
|
||||
for (int perf = 0; perf < number_of_perforations_; ++perf) {
|
||||
const double perf_water_vel = primary_variables_[Bhp + 1 + perf];
|
||||
// we do not consider the formation damage due to water flowing from reservoir into wellbore
|
||||
@ -3262,7 +3262,7 @@ namespace Opm
|
||||
const EvalWell eq_wat_vel = primary_variables_evaluation_[wat_vel_index] - water_velocity;
|
||||
resWell_[0][wat_vel_index] = eq_wat_vel.value();
|
||||
|
||||
const auto * perf_water_throughput = well_state.perfThroughput(this->index_of_well_);
|
||||
const auto& perf_water_throughput = well_state.perfThroughput(this->index_of_well_);
|
||||
const double throughput = perf_water_throughput[perf];
|
||||
const int pskin_index = Bhp + 1 + number_of_perforations_ + perf;
|
||||
|
||||
@ -3441,7 +3441,7 @@ namespace Opm
|
||||
const int wat_vel_index = Bhp + 1 + perf;
|
||||
const EvalWell water_velocity = primary_variables_evaluation_[wat_vel_index];
|
||||
if (water_velocity > 0.) { // injecting
|
||||
const auto * perf_water_throughput = well_state.perfThroughput(this->index_of_well_);
|
||||
const auto& perf_water_throughput = well_state.perfThroughput(this->index_of_well_);
|
||||
const double throughput = perf_water_throughput[perf];
|
||||
const EvalWell molecular_weight = wpolymermw(throughput, water_velocity, deferred_logger);
|
||||
cq_s_polymw *= molecular_weight;
|
||||
|
@ -846,7 +846,7 @@ checkMaxRatioLimitCompletions(const WellState& well_state,
|
||||
double max_ratio_completion = 0;
|
||||
const int np = number_of_phases_;
|
||||
|
||||
const auto * perf_phase_rates = well_state.perfPhaseRates(this->index_of_well_);
|
||||
const auto& perf_phase_rates = well_state.perfPhaseRates(this->index_of_well_);
|
||||
// look for the worst_offending_completion
|
||||
for (const auto& completion : completions_) {
|
||||
std::vector<double> completion_rates(np, 0.0);
|
||||
|
@ -41,7 +41,14 @@ void WellState::base_init(const std::vector<double>& cellPressures,
|
||||
// clear old name mapping
|
||||
this->wellMap_.clear();
|
||||
this->perfpress_.clear();
|
||||
this->perf_skin_pressure_.clear();
|
||||
this->perf_water_throughput_.clear();
|
||||
this->perf_water_velocity_.clear();
|
||||
this->perfphaserates_.clear();
|
||||
this->perfrates_.clear();
|
||||
this->perfRateBrine_.clear();
|
||||
this->perfRateSolvent_.clear();
|
||||
this->perfRatePolymer_.clear();
|
||||
this->status_.clear();
|
||||
this->well_perf_data_.clear();
|
||||
this->parallel_well_info_.clear();
|
||||
@ -101,6 +108,13 @@ void WellState::initSingleWell(const std::vector<double>& cellPressures,
|
||||
this->segment_state.add(well.name(), SegmentState{});
|
||||
this->perfpress_.add(well.name(), std::vector<double>(num_perf_this_well, -1e100));
|
||||
this->perfrates_.add(well.name(), std::vector<double>(num_perf_this_well, 0));
|
||||
this->perfphaserates_.add(well.name(), std::vector<double>(np*num_perf_this_well, 0));
|
||||
this->perf_skin_pressure_.add(well.name(), std::vector<double>(num_perf_this_well, 0));
|
||||
this->perf_water_velocity_.add(well.name(), std::vector<double>(num_perf_this_well, 0));
|
||||
this->perf_water_throughput_.add(well.name(), std::vector<double>(num_perf_this_well, 0));
|
||||
this->perfRatePolymer_.add(well.name(), std::vector<double>(num_perf_this_well, 0));
|
||||
this->perfRateSolvent_.add(well.name(), std::vector<double>(num_perf_this_well, 0));
|
||||
this->perfRateBrine_.add(well.name(), std::vector<double>(num_perf_this_well, 0));
|
||||
this->bhp_.add(well.name(), 0.0);
|
||||
this->thp_.add(well.name(), 0.0);
|
||||
if ( well.isInjector() )
|
||||
@ -275,17 +289,6 @@ void WellState::init(const std::vector<double>& cellPressures,
|
||||
this->events_.add( wname, Events() );
|
||||
}
|
||||
}
|
||||
// Ensure that we start out with zero rates by default.
|
||||
perfphaserates_.clear();
|
||||
perfphaserates_.resize(nperf * this->numPhases(), 0.0);
|
||||
|
||||
// these are only used to monitor the injectivity
|
||||
perf_water_throughput_.clear();
|
||||
perf_water_throughput_.resize(nperf, 0.0);
|
||||
perf_water_velocity_.clear();
|
||||
perf_water_velocity_.resize(nperf, 0.0);
|
||||
perf_skin_pressure_.clear();
|
||||
perf_skin_pressure_.resize(nperf, 0.0);
|
||||
|
||||
first_perf_index_.resize(nw, 0);
|
||||
first_perf_index_[0] = 0;
|
||||
@ -300,7 +303,7 @@ void WellState::init(const std::vector<double>& cellPressures,
|
||||
auto& perf_press = this->perfPress(w);
|
||||
|
||||
first_perf_index_[w] = connpos;
|
||||
auto phase_rates = this->perfPhaseRates(w);
|
||||
auto& phase_rates = this->perfPhaseRates(w);
|
||||
|
||||
for (int perf = 0; perf < num_perf_this_well; ++perf) {
|
||||
if (wells_ecl[w].getStatus() == Well::Status::OPEN) {
|
||||
@ -338,14 +341,10 @@ void WellState::init(const std::vector<double>& cellPressures,
|
||||
}
|
||||
}
|
||||
|
||||
perfRateSolvent_.assign(nperf, 0.0);
|
||||
productivity_index_.assign(nw * this->numPhases(), 0.0);
|
||||
conn_productivity_index_.assign(nperf * this->numPhases(), 0.0);
|
||||
well_potentials_.assign(nw * this->numPhases(), 0.0);
|
||||
|
||||
perfRatePolymer_.assign(nperf, 0.0);
|
||||
perfRateBrine_.assign(nperf, 0.0);
|
||||
|
||||
for (int w = 0; w < nw; ++w) {
|
||||
switch (wells_ecl[w].getStatus()) {
|
||||
case Well::Status::SHUT:
|
||||
@ -371,6 +370,7 @@ void WellState::init(const std::vector<double>& cellPressures,
|
||||
if (well.getStatus() == Well::Status::SHUT) {
|
||||
continue;
|
||||
}
|
||||
const auto& wname = well.name();
|
||||
|
||||
auto it = prevState->wellMap().find(well.name());
|
||||
if (it != end)
|
||||
@ -431,8 +431,8 @@ void WellState::init(const std::vector<double>& cellPressures,
|
||||
// number of perforations.
|
||||
if (global_num_perf_same)
|
||||
{
|
||||
const auto * src_rates = prevState->perfPhaseRates(oldIndex);
|
||||
auto * target_rates = this->perfPhaseRates(newIndex);
|
||||
const auto& src_rates = prevState->perfPhaseRates(oldIndex);
|
||||
auto& target_rates = this->perfPhaseRates(newIndex);
|
||||
for (int perf_index = 0; perf_index < num_perf_this_well; perf_index++) {
|
||||
for (int p = 0; p < np; p++) {
|
||||
target_rates[perf_index*np + p] = src_rates[perf_index*np + p];
|
||||
@ -440,7 +440,7 @@ void WellState::init(const std::vector<double>& cellPressures,
|
||||
}
|
||||
} else {
|
||||
const int global_num_perf_this_well = parallel_well_info[w]->communication().sum(num_perf_this_well);
|
||||
auto * target_rates = this->perfPhaseRates(newIndex);
|
||||
auto& target_rates = this->perfPhaseRates(newIndex);
|
||||
for (int perf_index = 0; perf_index < num_perf_this_well; perf_index++) {
|
||||
for (int p = 0; p < np; ++p) {
|
||||
target_rates[perf_index*np + p] = wellRates(w)[p] / double(global_num_perf_this_well);
|
||||
@ -463,12 +463,7 @@ void WellState::init(const std::vector<double>& cellPressures,
|
||||
if (pu.has_solvent) {
|
||||
if (global_num_perf_same)
|
||||
{
|
||||
auto * solvent_target = this->perfRateSolvent(newIndex);
|
||||
const auto * solvent_src = prevState->perfRateSolvent(oldIndex);
|
||||
for (int perf = 0; perf < num_perf_this_well; ++perf)
|
||||
{
|
||||
solvent_target[perf] = solvent_src[perf];
|
||||
}
|
||||
this->perfRateSolvent_.copy_welldata(prevState->perfRateSolvent_, wname);
|
||||
}
|
||||
}
|
||||
|
||||
@ -480,20 +475,9 @@ void WellState::init(const std::vector<double>& cellPressures,
|
||||
if (pu.has_polymermw) {
|
||||
if (global_num_perf_same)
|
||||
{
|
||||
auto * throughput_target = this->perfThroughput(newIndex);
|
||||
auto * pressure_target = this->perfSkinPressure(newIndex);
|
||||
auto * velocity_target = this->perfWaterVelocity(newIndex);
|
||||
|
||||
const auto * throughput_src = prevState->perfThroughput(oldIndex);
|
||||
const auto * pressure_src = prevState->perfSkinPressure(oldIndex);
|
||||
const auto * velocity_src = prevState->perfWaterVelocity(oldIndex);
|
||||
|
||||
for (int perf = 0; perf < num_perf_this_well; ++perf)
|
||||
{
|
||||
throughput_target[ perf ] = throughput_src[perf];
|
||||
pressure_target[ perf ] = pressure_src[perf];
|
||||
velocity_target[ perf ] = velocity_src[perf];
|
||||
}
|
||||
this->perf_water_velocity_.copy_welldata(prevState->perf_water_velocity_, wname);
|
||||
this->perf_skin_pressure_.copy_welldata(prevState->perf_skin_pressure_, wname);
|
||||
this->perf_water_throughput_.copy_welldata(prevState->perf_water_throughput_, wname);
|
||||
}
|
||||
}
|
||||
|
||||
@ -770,7 +754,7 @@ void WellState::reportConnections(data::Well& well,
|
||||
for( auto& comp : well.connections) {
|
||||
const auto connPhaseOffset = np * (wt.second[1] + local_comp_index);
|
||||
|
||||
const auto * rates = &this->perfPhaseRates(well_index)[np*local_comp_index];
|
||||
const auto& rates = &this->perfPhaseRates(well_index)[np*local_comp_index];
|
||||
const auto connPI = this->connectionProductivityIndex().begin() + connPhaseOffset;
|
||||
|
||||
for( int i = 0; i < np; ++i ) {
|
||||
@ -778,15 +762,15 @@ void WellState::reportConnections(data::Well& well,
|
||||
comp.rates.set( pi [ i ], *(connPI + i) );
|
||||
}
|
||||
if ( pu.has_polymer ) {
|
||||
const auto * perf_polymer_rate = this->perfRatePolymer(well_index);
|
||||
const auto& perf_polymer_rate = this->perfRatePolymer(well_index);
|
||||
comp.rates.set( rt::polymer, perf_polymer_rate[local_comp_index]);
|
||||
}
|
||||
if ( pu.has_brine ) {
|
||||
const auto * perf_brine_rate = this->perfRateBrine(well_index);
|
||||
const auto& perf_brine_rate = this->perfRateBrine(well_index);
|
||||
comp.rates.set( rt::brine, perf_brine_rate[local_comp_index]);
|
||||
}
|
||||
if ( pu.has_solvent ) {
|
||||
const auto * perf_solvent_rate = this->perfRateSolvent(well_index);
|
||||
const auto& perf_solvent_rate = this->perfRateSolvent(well_index);
|
||||
comp.rates.set( rt::solvent, perf_solvent_rate[local_comp_index] );
|
||||
}
|
||||
|
||||
@ -811,8 +795,6 @@ void WellState::initWellStateMSWell(const std::vector<Well>& wells_ecl,
|
||||
for (int w = 0; w < nw; ++w) {
|
||||
const auto& well_ecl = wells_ecl[w];
|
||||
const auto& wname = wells_ecl[w].name();
|
||||
const auto& well_info = this->wellMap().at(wname);
|
||||
const int num_perf_this_well = well_info[2];
|
||||
|
||||
if ( well_ecl.isMultiSegment() ) {
|
||||
const WellSegments& segment_set = well_ecl.getSegments();
|
||||
@ -855,7 +837,7 @@ void WellState::initWellStateMSWell(const std::vector<Well>& wells_ecl,
|
||||
"Inconsistent number of reservoir connections in well");
|
||||
|
||||
if (pu.phase_used[Gas]) {
|
||||
auto * perf_rates = this->perfPhaseRates(w);
|
||||
auto& perf_rates = this->perfPhaseRates(w);
|
||||
const int gaspos = pu.phase_pos[Gas];
|
||||
// scale the phase rates for Gas to avoid too bad initial guess for gas fraction
|
||||
// it will probably benefit the standard well too, while it needs to be justified
|
||||
@ -866,8 +848,8 @@ void WellState::initWellStateMSWell(const std::vector<Well>& wells_ecl,
|
||||
perf_rates[perf*np + gaspos] *= 100;
|
||||
}
|
||||
|
||||
const auto * perf_rates = this->perfPhaseRates(w);
|
||||
std::vector<double> perforation_rates(perf_rates, perf_rates + num_perf_this_well*np);
|
||||
const auto& perf_rates = this->perfPhaseRates(w);
|
||||
std::vector<double> perforation_rates(perf_rates.begin(), perf_rates.end());
|
||||
|
||||
auto& segments = this->segments(w);
|
||||
calculateSegmentRates(segment_inlets, segment_perforations, perforation_rates, np, 0 /* top segment */, segments.rates);
|
||||
@ -952,20 +934,20 @@ WellState::calculateSegmentRates(const std::vector<std::vector<int>>& segment_in
|
||||
|
||||
double WellState::solventWellRate(const int w) const
|
||||
{
|
||||
const auto * perf_rates_solvent = this->perfRateSolvent(w);
|
||||
return parallel_well_info_[w]->sumPerfValues(perf_rates_solvent, perf_rates_solvent + this->numPerf(w));
|
||||
const auto& perf_rates_solvent = this->perfRateSolvent(w);
|
||||
return parallel_well_info_[w]->sumPerfValues(perf_rates_solvent.begin(), perf_rates_solvent.end());
|
||||
}
|
||||
|
||||
double WellState::polymerWellRate(const int w) const
|
||||
{
|
||||
const auto * perf_rates_polymer = this->perfRatePolymer(w);
|
||||
return parallel_well_info_[w]->sumPerfValues(perf_rates_polymer, perf_rates_polymer + this->numPerf(w));
|
||||
const auto& perf_rates_polymer = this->perfRatePolymer(w);
|
||||
return parallel_well_info_[w]->sumPerfValues(perf_rates_polymer.begin(), perf_rates_polymer.end());
|
||||
}
|
||||
|
||||
double WellState::brineWellRate(const int w) const
|
||||
{
|
||||
const auto * perf_rates_brine = this->perfRateBrine(w);
|
||||
return parallel_well_info_[w]->sumPerfValues(perf_rates_brine, perf_rates_brine + this->numPerf(w));
|
||||
const auto& perf_rates_brine = this->perfRateBrine(w);
|
||||
return parallel_well_info_[w]->sumPerfValues(perf_rates_brine.begin(), perf_rates_brine.end());
|
||||
}
|
||||
|
||||
|
||||
|
@ -81,7 +81,7 @@ public:
|
||||
|
||||
/// Allocate and initialize if wells is non-null. Also tries
|
||||
/// to give useful initial values to the bhp(), wellRates()
|
||||
/// and perfPhaseRates() fields, depending on controls
|
||||
/// and perfPhaseRatesORG() fields, depending on controls
|
||||
void init(const std::vector<double>& cellPressures,
|
||||
const Schedule& schedule,
|
||||
const std::vector<Well>& wells_ecl,
|
||||
@ -100,12 +100,13 @@ public:
|
||||
const SummaryState& summary_state);
|
||||
|
||||
/// One rate per phase and well connection.
|
||||
double * perfPhaseRates(std::size_t well_index) {
|
||||
return &this->perfphaserates_[this->first_perf_index_[well_index] * this->numPhases()];
|
||||
|
||||
std::vector<double>& perfPhaseRates(std::size_t well_index) {
|
||||
return this->perfphaserates_[well_index];
|
||||
}
|
||||
|
||||
const double * perfPhaseRates(std::size_t well_index) const {
|
||||
return &this->perfphaserates_[this->first_perf_index_[well_index] * this->numPhases()];
|
||||
const std::vector<double>& perfPhaseRates(std::size_t well_index) const {
|
||||
return this->perfphaserates_[well_index];
|
||||
}
|
||||
|
||||
/// One current control per injecting well.
|
||||
@ -158,36 +159,36 @@ public:
|
||||
}
|
||||
|
||||
/// One rate pr well connection.
|
||||
double * perfRateSolvent(std::size_t well_index) {
|
||||
return &perfRateSolvent_[this->first_perf_index_[well_index]];
|
||||
std::vector<double>& perfRateSolvent(std::size_t well_index) {
|
||||
return this->perfRateSolvent_[well_index];
|
||||
}
|
||||
|
||||
const double * perfRateSolvent(std::size_t well_index) const {
|
||||
return &perfRateSolvent_[this->first_perf_index_[well_index]];
|
||||
const std::vector<double>& perfRateSolvent(std::size_t well_index) const {
|
||||
return this->perfRateSolvent_[well_index];
|
||||
}
|
||||
|
||||
/// One rate pr well
|
||||
double solventWellRate(const int w) const;
|
||||
|
||||
/// One rate pr well connection.
|
||||
double * perfRatePolymer(std::size_t well_index) {
|
||||
return &this->perfRatePolymer_[this->first_perf_index_[well_index]];
|
||||
std::vector<double>& perfRatePolymer(std::size_t well_index) {
|
||||
return this->perfRatePolymer_[well_index];
|
||||
}
|
||||
|
||||
const double * perfRatePolymer(std::size_t well_index) const {
|
||||
return &this->perfRatePolymer_[this->first_perf_index_[well_index]];
|
||||
const std::vector<double>& perfRatePolymer(std::size_t well_index) const {
|
||||
return this->perfRatePolymer_[well_index];
|
||||
}
|
||||
|
||||
/// One rate pr well
|
||||
double polymerWellRate(const int w) const;
|
||||
|
||||
/// One rate pr well connection.
|
||||
double* perfRateBrine(std::size_t well_index) {
|
||||
return &this->perfRateBrine_[this->first_perf_index_[well_index]];
|
||||
std::vector<double>& perfRateBrine(std::size_t well_index) {
|
||||
return this->perfRateBrine_[well_index];
|
||||
}
|
||||
|
||||
const double* perfRateBrine(std::size_t well_index) const {
|
||||
return &this->perfRateBrine_[this->first_perf_index_[well_index]];
|
||||
const std::vector<double>& perfRateBrine(std::size_t well_index) const {
|
||||
return this->perfRateBrine_[well_index];
|
||||
}
|
||||
|
||||
/// One rate pr well
|
||||
@ -258,28 +259,28 @@ public:
|
||||
return well_potentials_;
|
||||
}
|
||||
|
||||
double * perfThroughput(std::size_t well_index) {
|
||||
return &perf_water_throughput_[this->first_perf_index_[well_index]];
|
||||
std::vector<double>& perfThroughput(std::size_t well_index) {
|
||||
return perf_water_throughput_[well_index];
|
||||
}
|
||||
|
||||
const double * perfThroughput(std::size_t well_index) const {
|
||||
return &perf_water_throughput_[this->first_perf_index_[well_index]];
|
||||
const std::vector<double>& perfThroughput(std::size_t well_index) const {
|
||||
return perf_water_throughput_[well_index];
|
||||
}
|
||||
|
||||
double * perfSkinPressure(std::size_t well_index) {
|
||||
return &perf_skin_pressure_[this->first_perf_index_[well_index]];
|
||||
std::vector<double>& perfSkinPressure(std::size_t well_index) {
|
||||
return perf_skin_pressure_[well_index];
|
||||
}
|
||||
|
||||
const double * perfSkinPressure(std::size_t well_index) const {
|
||||
return &perf_skin_pressure_[this->first_perf_index_[well_index]];
|
||||
const std::vector<double>& perfSkinPressure(std::size_t well_index) const {
|
||||
return perf_skin_pressure_[well_index];
|
||||
}
|
||||
|
||||
double * perfWaterVelocity(std::size_t well_index) {
|
||||
return &perf_water_velocity_[this->first_perf_index_[well_index]];
|
||||
std::vector<double>& perfWaterVelocity(std::size_t well_index) {
|
||||
return perf_water_velocity_[well_index];
|
||||
}
|
||||
|
||||
const double * perfWaterVelocity(std::size_t well_index) const {
|
||||
return &perf_water_velocity_[this->first_perf_index_[well_index]];
|
||||
const std::vector<double>& perfWaterVelocity(std::size_t well_index) const {
|
||||
return perf_water_velocity_[well_index];
|
||||
}
|
||||
|
||||
template<class Comm>
|
||||
@ -436,7 +437,7 @@ private:
|
||||
WellContainer<std::vector<double>> perfrates_;
|
||||
WellContainer<std::vector<double>> perfpress_;
|
||||
|
||||
std::vector<double> perfphaserates_;
|
||||
WellContainer<std::vector<double>> perfphaserates_;
|
||||
WellContainer<int> is_producer_; // Size equal to number of local wells.
|
||||
|
||||
// vector with size number of wells +1.
|
||||
@ -452,24 +453,24 @@ private:
|
||||
std::map<std::string, std::pair<bool, std::vector<double>>> well_rates;
|
||||
|
||||
|
||||
std::vector<double> perfRateSolvent_;
|
||||
WellContainer<std::vector<double>> perfRateSolvent_;
|
||||
|
||||
// only for output
|
||||
std::vector<double> perfRatePolymer_;
|
||||
std::vector<double> perfRateBrine_;
|
||||
WellContainer<std::vector<double>> perfRatePolymer_;
|
||||
WellContainer<std::vector<double>> perfRateBrine_;
|
||||
|
||||
// it is the throughput of water flow through the perforations
|
||||
// it is used as a measure of formation damage around well-bore due to particle deposition
|
||||
// it will only be used for injectors to check the injectivity
|
||||
std::vector<double> perf_water_throughput_;
|
||||
WellContainer<std::vector<double>> perf_water_throughput_;
|
||||
|
||||
// skin pressure of peforation
|
||||
// it will only be used for injectors to check the injectivity
|
||||
std::vector<double> perf_skin_pressure_;
|
||||
WellContainer<std::vector<double>> perf_skin_pressure_;
|
||||
|
||||
// it will only be used for injectors to check the injectivity
|
||||
// water velocity of perforation
|
||||
std::vector<double> perf_water_velocity_;
|
||||
WellContainer<std::vector<double>> perf_water_velocity_;
|
||||
|
||||
// phase rates under reservoir condition for wells
|
||||
// or voidage phase rates
|
||||
|
Loading…
Reference in New Issue
Block a user