mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-09-05 04:40:19 -05:00
BlackoilWellModel: move code using WellTestConfig to compile unit
This commit is contained in:
@@ -1260,4 +1260,15 @@ getCellsForConnections(const Well& well) const
|
||||
return wellCells;
|
||||
}
|
||||
|
||||
std::vector<std::string>
|
||||
BlackoilWellModelGeneric::getWellsForTesting(const int timeStepIdx,
|
||||
const double simulationTime)
|
||||
{
|
||||
const auto& wtest_config = schedule()[timeStepIdx].wtest_config();
|
||||
if (!wtest_config.empty()) { // there is a WTEST request
|
||||
return wellTestState().test_wells(wtest_config, simulationTime);
|
||||
} else
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -345,6 +345,9 @@ protected:
|
||||
|
||||
std::vector<int> getCellsForConnections(const Well& well) const;
|
||||
|
||||
std::vector<std::string> getWellsForTesting(const int timeStepIdx,
|
||||
const double simulationTime);
|
||||
|
||||
Schedule& schedule_;
|
||||
const SummaryState& summaryState_;
|
||||
const EclipseState& eclState_;
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
#include <opm/core/props/phaseUsageFromDeck.hpp>
|
||||
#include <opm/grid/utility/cartesianToCompressed.hpp>
|
||||
|
||||
#include <opm/input/eclipse/Schedule/Well/WellTestConfig.hpp>
|
||||
|
||||
#include <opm/input/eclipse/Units/UnitSystem.hpp>
|
||||
|
||||
#include <opm/simulators/wells/BlackoilWellModelConstraints.hpp>
|
||||
@@ -381,30 +379,24 @@ namespace Opm {
|
||||
const double simulationTime,
|
||||
DeferredLogger& deferred_logger)
|
||||
{
|
||||
const auto& wtest_config = schedule()[timeStepIdx].wtest_config();
|
||||
if (!wtest_config.empty()) { // there is a WTEST request
|
||||
const std::vector<std::string> wellsForTesting = wellTestState()
|
||||
.test_wells(wtest_config, simulationTime);
|
||||
for (const std::string& well_name : wellsForTesting) {
|
||||
for (const std::string& well_name : this->getWellsForTesting(timeStepIdx, simulationTime)) {
|
||||
const Well& wellEcl = schedule().getWell(well_name, timeStepIdx);
|
||||
if (wellEcl.getStatus() == Well::Status::SHUT)
|
||||
continue;
|
||||
|
||||
const Well& wellEcl = schedule().getWell(well_name, timeStepIdx);
|
||||
if (wellEcl.getStatus() == Well::Status::SHUT)
|
||||
continue;
|
||||
WellInterfacePtr well = createWellForWellTest(well_name, timeStepIdx, deferred_logger);
|
||||
// some preparation before the well can be used
|
||||
well->init(&phase_usage_, depth_, gravity_, local_num_cells_, B_avg_, true);
|
||||
|
||||
WellInterfacePtr well = createWellForWellTest(well_name, timeStepIdx, deferred_logger);
|
||||
// some preparation before the well can be used
|
||||
well->init(&phase_usage_, depth_, gravity_, local_num_cells_, B_avg_, true);
|
||||
double well_efficiency_factor = wellEcl.getEfficiencyFactor();
|
||||
WellGroupHelpers::accumulateGroupEfficiencyFactor(schedule().getGroup(wellEcl.groupName(), timeStepIdx),
|
||||
schedule(), timeStepIdx, well_efficiency_factor);
|
||||
|
||||
double well_efficiency_factor = wellEcl.getEfficiencyFactor();
|
||||
WellGroupHelpers::accumulateGroupEfficiencyFactor(schedule().getGroup(wellEcl.groupName(), timeStepIdx),
|
||||
schedule(), timeStepIdx, well_efficiency_factor);
|
||||
well->setWellEfficiencyFactor(well_efficiency_factor);
|
||||
well->setVFPProperties(vfp_properties_.get());
|
||||
well->setGuideRate(&guideRate_);
|
||||
|
||||
well->setWellEfficiencyFactor(well_efficiency_factor);
|
||||
well->setVFPProperties(vfp_properties_.get());
|
||||
well->setGuideRate(&guideRate_);
|
||||
|
||||
well->wellTesting(ebosSimulator_, simulationTime, this->wellState(), this->groupState(), wellTestState(), deferred_logger);
|
||||
}
|
||||
well->wellTesting(ebosSimulator_, simulationTime, this->wellState(), this->groupState(), wellTestState(), deferred_logger);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user