mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #4923 from GitPaean/using_report_step
distinguishing report step and time step
This commit is contained in:
commit
3af34e4ae6
@ -370,11 +370,11 @@ namespace Opm {
|
||||
void initializeWellState(const int timeStepIdx);
|
||||
|
||||
// create the well container
|
||||
void createWellContainer(const int time_step) override;
|
||||
void createWellContainer(const int report_step) override;
|
||||
|
||||
WellInterfacePtr
|
||||
createWellPointer(const int wellID,
|
||||
const int time_step) const;
|
||||
const int report_step) const;
|
||||
|
||||
template <typename WellType>
|
||||
std::unique_ptr<WellType>
|
||||
|
@ -1290,27 +1290,27 @@ updateWellPotentials(const int reportStepIdx,
|
||||
|
||||
void
|
||||
BlackoilWellModelGeneric::
|
||||
runWellPIScaling(const int timeStepIdx,
|
||||
runWellPIScaling(const int reportStepIdx,
|
||||
DeferredLogger& local_deferredLogger)
|
||||
{
|
||||
if (this->last_run_wellpi_.has_value() && (*this->last_run_wellpi_ == timeStepIdx)) {
|
||||
if (this->last_run_wellpi_.has_value() && (*this->last_run_wellpi_ == reportStepIdx)) {
|
||||
// We've already run WELPI scaling for this report step. Most
|
||||
// common for the very first report step. Don't redo WELPI scaling.
|
||||
return;
|
||||
}
|
||||
|
||||
auto hasWellPIEvent = [this, timeStepIdx](const int well_index) -> bool
|
||||
auto hasWellPIEvent = [this, reportStepIdx](const int well_index) -> bool
|
||||
{
|
||||
return this->schedule()[timeStepIdx].wellgroup_events()
|
||||
return this->schedule()[reportStepIdx].wellgroup_events()
|
||||
.hasEvent(this->wells_ecl_[well_index].name(),
|
||||
ScheduleEvents::Events::WELL_PRODUCTIVITY_INDEX);
|
||||
};
|
||||
|
||||
auto updateEclWell = [this, timeStepIdx](const int well_index) -> void
|
||||
auto updateEclWell = [this, reportStepIdx](const int well_index) -> void
|
||||
{
|
||||
const auto& schedule = this->schedule();
|
||||
const auto& wname = this->wells_ecl_[well_index].name();
|
||||
this->wells_ecl_[well_index] = schedule.getWell(wname, timeStepIdx);
|
||||
this->wells_ecl_[well_index] = schedule.getWell(wname, reportStepIdx);
|
||||
|
||||
const auto& well = this->wells_ecl_[well_index];
|
||||
auto& pd = this->well_perf_data_[well_index];
|
||||
@ -1328,12 +1328,12 @@ runWellPIScaling(const int timeStepIdx,
|
||||
|
||||
|
||||
auto rescaleWellPI =
|
||||
[this, timeStepIdx](const int well_index,
|
||||
const double newWellPI) -> void
|
||||
[this, reportStepIdx](const int well_index,
|
||||
const double newWellPI) -> void
|
||||
{
|
||||
const auto& wname = this->wells_ecl_[well_index].name();
|
||||
|
||||
schedule_.applyWellProdIndexScaling(wname, timeStepIdx, newWellPI);
|
||||
schedule_.applyWellProdIndexScaling(wname, reportStepIdx, newWellPI);
|
||||
};
|
||||
|
||||
// Minimal well setup to compute PI/II values
|
||||
@ -1341,13 +1341,13 @@ runWellPIScaling(const int timeStepIdx,
|
||||
auto saved_previous_wgstate = this->prevWGState();
|
||||
this->commitWGState();
|
||||
|
||||
this->createWellContainer(timeStepIdx);
|
||||
this->createWellContainer(reportStepIdx);
|
||||
this->inferLocalShutWells();
|
||||
|
||||
this->initWellContainer(timeStepIdx);
|
||||
this->initWellContainer(reportStepIdx);
|
||||
|
||||
this->calculateProductivityIndexValues(local_deferredLogger);
|
||||
this->calculateProductivityIndexValuesShutWells(timeStepIdx, local_deferredLogger);
|
||||
this->calculateProductivityIndexValuesShutWells(reportStepIdx, local_deferredLogger);
|
||||
|
||||
this->commitWGState(std::move(saved_previous_wgstate));
|
||||
}
|
||||
@ -1360,7 +1360,7 @@ runWellPIScaling(const int timeStepIdx,
|
||||
}
|
||||
}
|
||||
|
||||
this->last_run_wellpi_ = timeStepIdx;
|
||||
this->last_run_wellpi_ = reportStepIdx;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -407,7 +407,7 @@ protected:
|
||||
DeferredLogger& deferred_logger) = 0;
|
||||
virtual void calculateProductivityIndexValues(DeferredLogger& deferred_logger) = 0;
|
||||
|
||||
void runWellPIScaling(const int timeStepIdx,
|
||||
void runWellPIScaling(const int reportStepIdx,
|
||||
DeferredLogger& local_deferredLogger);
|
||||
|
||||
/// \brief get compressed index for interior cells (-1, otherwise
|
||||
|
@ -754,7 +754,7 @@ namespace Opm {
|
||||
template<typename TypeTag>
|
||||
void
|
||||
BlackoilWellModel<TypeTag>::
|
||||
createWellContainer(const int time_step)
|
||||
createWellContainer(const int report_step)
|
||||
{
|
||||
DeferredLogger local_deferredLogger;
|
||||
|
||||
@ -775,7 +775,7 @@ namespace Opm {
|
||||
|
||||
const std::string& well_name = well_ecl.name();
|
||||
const auto well_status = this->schedule()
|
||||
.getWell(well_name, time_step).getStatus();
|
||||
.getWell(well_name, report_step).getStatus();
|
||||
|
||||
if ((well_ecl.getStatus() == Well::Status::SHUT) ||
|
||||
(well_status == Well::Status::SHUT))
|
||||
@ -881,7 +881,7 @@ namespace Opm {
|
||||
wellIsStopped = true;
|
||||
}
|
||||
|
||||
well_container_.emplace_back(this->createWellPointer(w, time_step));
|
||||
well_container_.emplace_back(this->createWellPointer(w, report_step));
|
||||
|
||||
if (wellIsStopped)
|
||||
well_container_.back()->stopWell();
|
||||
@ -900,7 +900,7 @@ namespace Opm {
|
||||
for (auto& w : well_container_)
|
||||
well_container_generic_.push_back(w.get());
|
||||
|
||||
const auto& network = schedule()[time_step].network();
|
||||
const auto& network = schedule()[report_step].network();
|
||||
if (network.active() && !this->node_pressures_.empty()) {
|
||||
for (auto& well: well_container_generic_) {
|
||||
// Producers only, since we so far only support the
|
||||
@ -928,15 +928,15 @@ namespace Opm {
|
||||
template <typename TypeTag>
|
||||
typename BlackoilWellModel<TypeTag>::WellInterfacePtr
|
||||
BlackoilWellModel<TypeTag>::
|
||||
createWellPointer(const int wellID, const int time_step) const
|
||||
createWellPointer(const int wellID, const int report_step) const
|
||||
{
|
||||
const auto is_multiseg = this->wells_ecl_[wellID].isMultiSegment();
|
||||
|
||||
if (! (this->param_.use_multisegment_well_ && is_multiseg)) {
|
||||
return this->template createTypedWellPointer<StandardWell<TypeTag>>(wellID, time_step);
|
||||
return this->template createTypedWellPointer<StandardWell<TypeTag>>(wellID, report_step);
|
||||
}
|
||||
else {
|
||||
return this->template createTypedWellPointer<MultisegmentWell<TypeTag>>(wellID, time_step);
|
||||
return this->template createTypedWellPointer<MultisegmentWell<TypeTag>>(wellID, report_step);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user