mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
dont use explicit vfp lookup for newly opened wells
This commit is contained in:
@@ -142,7 +142,7 @@ namespace Opm {
|
|||||||
BlackoilWellModel(Simulator& ebosSimulator);
|
BlackoilWellModel(Simulator& ebosSimulator);
|
||||||
|
|
||||||
void init();
|
void init();
|
||||||
void initWellContainer() override;
|
void initWellContainer(const int reportStepIdx) override;
|
||||||
|
|
||||||
/////////////
|
/////////////
|
||||||
// <eWoms auxiliary module stuff>
|
// <eWoms auxiliary module stuff>
|
||||||
|
|||||||
@@ -2358,7 +2358,7 @@ runWellPIScaling(const int timeStepIdx,
|
|||||||
this->createWellContainer(timeStepIdx);
|
this->createWellContainer(timeStepIdx);
|
||||||
this->inferLocalShutWells();
|
this->inferLocalShutWells();
|
||||||
|
|
||||||
this->initWellContainer();
|
this->initWellContainer(timeStepIdx);
|
||||||
|
|
||||||
this->calculateProductivityIndexValues(local_deferredLogger);
|
this->calculateProductivityIndexValues(local_deferredLogger);
|
||||||
this->calculateProductivityIndexValuesShutWells(timeStepIdx, local_deferredLogger);
|
this->calculateProductivityIndexValuesShutWells(timeStepIdx, local_deferredLogger);
|
||||||
|
|||||||
@@ -400,7 +400,7 @@ protected:
|
|||||||
|
|
||||||
// create the well container
|
// create the well container
|
||||||
virtual void createWellContainer(const int time_step) = 0;
|
virtual void createWellContainer(const int time_step) = 0;
|
||||||
virtual void initWellContainer() = 0;
|
virtual void initWellContainer(const int reportStepIdx) = 0;
|
||||||
|
|
||||||
virtual void calculateProductivityIndexValuesShutWells(const int reportStepIdx,
|
virtual void calculateProductivityIndexValuesShutWells(const int reportStepIdx,
|
||||||
DeferredLogger& deferred_logger) = 0;
|
DeferredLogger& deferred_logger) = 0;
|
||||||
|
|||||||
@@ -97,11 +97,15 @@ namespace Opm {
|
|||||||
template<typename TypeTag>
|
template<typename TypeTag>
|
||||||
void
|
void
|
||||||
BlackoilWellModel<TypeTag>::
|
BlackoilWellModel<TypeTag>::
|
||||||
initWellContainer()
|
initWellContainer(const int reportStepIdx)
|
||||||
{
|
{
|
||||||
|
const uint64_t effective_events_mask = ScheduleEvents::WELL_STATUS_CHANGE
|
||||||
|
+ ScheduleEvents::NEW_WELL;
|
||||||
|
const auto& events = schedule()[reportStepIdx].wellgroup_events();
|
||||||
for (auto& wellPtr : this->well_container_) {
|
for (auto& wellPtr : this->well_container_) {
|
||||||
|
const bool well_opened_this_step = report_step_starts_ && events.hasEvent(wellPtr->name(), effective_events_mask);
|
||||||
wellPtr->init(&this->phase_usage_, this->depth_, this->gravity_,
|
wellPtr->init(&this->phase_usage_, this->depth_, this->gravity_,
|
||||||
this->local_num_cells_, this->B_avg_);
|
this->local_num_cells_, this->B_avg_, well_opened_this_step);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -268,7 +272,7 @@ namespace Opm {
|
|||||||
// do the initialization for all the wells
|
// do the initialization for all the wells
|
||||||
// TODO: to see whether we can postpone of the intialization of the well containers to
|
// TODO: to see whether we can postpone of the intialization of the well containers to
|
||||||
// optimize the usage of the following several member variables
|
// optimize the usage of the following several member variables
|
||||||
this->initWellContainer();
|
this->initWellContainer(reportStepIdx);
|
||||||
|
|
||||||
// update the updated cell flag
|
// update the updated cell flag
|
||||||
std::fill(is_cell_perforated_.begin(), is_cell_perforated_.end(), false);
|
std::fill(is_cell_perforated_.begin(), is_cell_perforated_.end(), false);
|
||||||
@@ -395,7 +399,7 @@ namespace Opm {
|
|||||||
|
|
||||||
WellInterfacePtr well = createWellForWellTest(well_name, timeStepIdx, deferred_logger);
|
WellInterfacePtr well = createWellForWellTest(well_name, timeStepIdx, deferred_logger);
|
||||||
// some preparation before the well can be used
|
// some preparation before the well can be used
|
||||||
well->init(&phase_usage_, depth_, gravity_, local_num_cells_, B_avg_);
|
well->init(&phase_usage_, depth_, gravity_, local_num_cells_, B_avg_, true);
|
||||||
|
|
||||||
double well_efficiency_factor = wellEcl.getEfficiencyFactor();
|
double well_efficiency_factor = wellEcl.getEfficiencyFactor();
|
||||||
WellGroupHelpers::accumulateGroupEfficiencyFactor(schedule().getGroup(wellEcl.groupName(), timeStepIdx),
|
WellGroupHelpers::accumulateGroupEfficiencyFactor(schedule().getGroup(wellEcl.groupName(), timeStepIdx),
|
||||||
@@ -1582,7 +1586,7 @@ namespace Opm {
|
|||||||
<StandardWell<TypeTag>>(shutWell, reportStepIdx);
|
<StandardWell<TypeTag>>(shutWell, reportStepIdx);
|
||||||
|
|
||||||
wellPtr->init(&this->phase_usage_, this->depth_, this->gravity_,
|
wellPtr->init(&this->phase_usage_, this->depth_, this->gravity_,
|
||||||
this->local_num_cells_, this->B_avg_);
|
this->local_num_cells_, this->B_avg_, true);
|
||||||
|
|
||||||
this->calculateProductivityIndexValues(wellPtr.get(), deferred_logger);
|
this->calculateProductivityIndexValues(wellPtr.get(), deferred_logger);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,8 @@ namespace Opm
|
|||||||
const std::vector<double>& depth_arg,
|
const std::vector<double>& depth_arg,
|
||||||
const double gravity_arg,
|
const double gravity_arg,
|
||||||
const int num_cells,
|
const int num_cells,
|
||||||
const std::vector< Scalar >& B_avg) override;
|
const std::vector< Scalar >& B_avg,
|
||||||
|
const bool changed_to_open_this_step) override;
|
||||||
|
|
||||||
virtual void initPrimaryVariablesEvaluation() const override;
|
virtual void initPrimaryVariablesEvaluation() const override;
|
||||||
|
|
||||||
|
|||||||
@@ -94,9 +94,10 @@ namespace Opm
|
|||||||
const std::vector<double>& depth_arg,
|
const std::vector<double>& depth_arg,
|
||||||
const double gravity_arg,
|
const double gravity_arg,
|
||||||
const int num_cells,
|
const int num_cells,
|
||||||
const std::vector< Scalar >& B_avg)
|
const std::vector< Scalar >& B_avg,
|
||||||
|
const bool changed_to_open_this_step)
|
||||||
{
|
{
|
||||||
Base::init(phase_usage_arg, depth_arg, gravity_arg, num_cells, B_avg);
|
Base::init(phase_usage_arg, depth_arg, gravity_arg, num_cells, B_avg, changed_to_open_this_step);
|
||||||
|
|
||||||
// TODO: for StandardWell, we need to update the perf depth here using depth_arg.
|
// TODO: for StandardWell, we need to update the perf depth here using depth_arg.
|
||||||
// for MultisegmentWell, it is much more complicated.
|
// for MultisegmentWell, it is much more complicated.
|
||||||
|
|||||||
@@ -139,7 +139,8 @@ namespace Opm
|
|||||||
const std::vector<double>& depth_arg,
|
const std::vector<double>& depth_arg,
|
||||||
const double gravity_arg,
|
const double gravity_arg,
|
||||||
const int num_cells,
|
const int num_cells,
|
||||||
const std::vector< Scalar >& B_avg) override;
|
const std::vector< Scalar >& B_avg,
|
||||||
|
const bool changed_to_open_this_step) override;
|
||||||
|
|
||||||
|
|
||||||
virtual void initPrimaryVariablesEvaluation() const override;
|
virtual void initPrimaryVariablesEvaluation() const override;
|
||||||
|
|||||||
@@ -61,9 +61,10 @@ namespace Opm
|
|||||||
const std::vector<double>& depth_arg,
|
const std::vector<double>& depth_arg,
|
||||||
const double gravity_arg,
|
const double gravity_arg,
|
||||||
const int num_cells,
|
const int num_cells,
|
||||||
const std::vector< Scalar >& B_avg)
|
const std::vector< Scalar >& B_avg,
|
||||||
|
const bool changed_to_open_this_step)
|
||||||
{
|
{
|
||||||
Base::init(phase_usage_arg, depth_arg, gravity_arg, num_cells, B_avg);
|
Base::init(phase_usage_arg, depth_arg, gravity_arg, num_cells, B_avg, changed_to_open_this_step);
|
||||||
this->StdWellEval::init(this->perf_depth_, depth_arg, num_cells, Base::has_polymermw);
|
this->StdWellEval::init(this->perf_depth_, depth_arg, num_cells, Base::has_polymermw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -147,7 +147,8 @@ public:
|
|||||||
const std::vector<double>& depth_arg,
|
const std::vector<double>& depth_arg,
|
||||||
const double gravity_arg,
|
const double gravity_arg,
|
||||||
const int num_cells,
|
const int num_cells,
|
||||||
const std::vector< Scalar >& B_avg);
|
const std::vector< Scalar >& B_avg,
|
||||||
|
const bool changed_to_open_this_step);
|
||||||
|
|
||||||
virtual void initPrimaryVariablesEvaluation() const = 0;
|
virtual void initPrimaryVariablesEvaluation() const = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -417,7 +417,7 @@ bool WellInterfaceGeneric::isOperableAndSolvable() const
|
|||||||
bool WellInterfaceGeneric::useVfpExplicit() const
|
bool WellInterfaceGeneric::useVfpExplicit() const
|
||||||
{
|
{
|
||||||
const auto& wvfpexp = well_ecl_.getWVFPEXP();
|
const auto& wvfpexp = well_ecl_.getWVFPEXP();
|
||||||
return (wvfpexp.extrapolate() || operability_status_.use_vfpexplicit);
|
return ((wvfpexp.extrapolate() && !changedToOpenThisStep())|| operability_status_.use_vfpexplicit);
|
||||||
}
|
}
|
||||||
|
|
||||||
double WellInterfaceGeneric::getALQ(const WellState& well_state) const
|
double WellInterfaceGeneric::getALQ(const WellState& well_state) const
|
||||||
|
|||||||
@@ -356,7 +356,7 @@ protected:
|
|||||||
|
|
||||||
std::vector< std::string> well_control_log_;
|
std::vector< std::string> well_control_log_;
|
||||||
|
|
||||||
bool changed_to_open_this_step_ = false;
|
bool changed_to_open_this_step_ = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,11 +73,13 @@ namespace Opm
|
|||||||
const std::vector<double>& /* depth_arg */,
|
const std::vector<double>& /* depth_arg */,
|
||||||
const double gravity_arg,
|
const double gravity_arg,
|
||||||
const int /* num_cells */,
|
const int /* num_cells */,
|
||||||
const std::vector< Scalar >& B_avg)
|
const std::vector< Scalar >& B_avg,
|
||||||
|
const bool changed_to_open_this_step)
|
||||||
{
|
{
|
||||||
this->phase_usage_ = phase_usage_arg;
|
this->phase_usage_ = phase_usage_arg;
|
||||||
this->gravity_ = gravity_arg;
|
this->gravity_ = gravity_arg;
|
||||||
B_avg_ = B_avg;
|
B_avg_ = B_avg;
|
||||||
|
this->changed_to_open_this_step_ = changed_to_open_this_step;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user