mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Moved well status routines
This commit is contained in:
parent
0f8dec5224
commit
7cb7b0eb82
@ -72,37 +72,6 @@ void WellState::init(const std::vector<double>& cellPressures,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void WellState::shutWell(int well_index)
|
|
||||||
{
|
|
||||||
this->status_[well_index] = Well::Status::SHUT;
|
|
||||||
this->thp_[well_index] = 0;
|
|
||||||
this->bhp_[well_index] = 0;
|
|
||||||
const int np = numPhases();
|
|
||||||
this->wellrates_[well_index].assign(np, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void WellState::stopWell(int well_index)
|
|
||||||
{
|
|
||||||
this->status_[well_index] = Well::Status::STOP;
|
|
||||||
this->thp_[well_index] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void WellState::updateStatus(int well_index, Well::Status status)
|
|
||||||
{
|
|
||||||
switch (status) {
|
|
||||||
case Well::Status::OPEN:
|
|
||||||
this->openWell(well_index);
|
|
||||||
break;
|
|
||||||
case Well::Status::SHUT:
|
|
||||||
this->shutWell(well_index);
|
|
||||||
break;
|
|
||||||
case Well::Status::STOP:
|
|
||||||
this->stopWell(well_index);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw std::logic_error("Invalid well status");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void WellState::initSingleWell(const std::vector<double>& cellPressures,
|
void WellState::initSingleWell(const std::vector<double>& cellPressures,
|
||||||
@ -153,7 +122,7 @@ void WellState::initSingleWell(const std::vector<double>& cellPressures,
|
|||||||
const double global_pressure = well_info->broadcastFirstPerforationValue(local_pressure);
|
const double global_pressure = well_info->broadcastFirstPerforationValue(local_pressure);
|
||||||
|
|
||||||
if (well.getStatus() == Well::Status::OPEN) {
|
if (well.getStatus() == Well::Status::OPEN) {
|
||||||
this->openWell(w);
|
this->status_[w] = Well::Status::OPEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (well.getStatus() == Well::Status::STOP) {
|
if (well.getStatus() == Well::Status::STOP) {
|
||||||
|
@ -110,28 +110,18 @@ public:
|
|||||||
return this->phase_usage_;
|
return this->phase_usage_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void openWell(int well_index) {
|
|
||||||
this->status_[well_index] = Well::Status::OPEN;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void shutWell(int well_index);
|
|
||||||
|
|
||||||
virtual void stopWell(int well_index);
|
|
||||||
|
|
||||||
void updateStatus(int well_index, Well::Status status);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
WellContainer<Well::Status> status_;
|
WellContainer<Well::Status> status_;
|
||||||
WellContainer<std::vector<PerforationData>> well_perf_data_;
|
WellContainer<std::vector<PerforationData>> well_perf_data_;
|
||||||
WellContainer<const ParallelWellInfo*> parallel_well_info_;
|
WellContainer<const ParallelWellInfo*> parallel_well_info_;
|
||||||
WellMapType wellMap_;
|
WellMapType wellMap_;
|
||||||
|
std::vector<double> bhp_;
|
||||||
|
std::vector<double> thp_;
|
||||||
|
WellContainer<std::vector<double>> wellrates_;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PhaseUsage phase_usage_;
|
PhaseUsage phase_usage_;
|
||||||
std::vector<double> bhp_;
|
|
||||||
std::vector<double> thp_;
|
|
||||||
std::vector<double> temperature_;
|
std::vector<double> temperature_;
|
||||||
WellContainer<std::vector<double>> wellrates_;
|
|
||||||
WellContainer<std::vector<double>> perfrates_;
|
WellContainer<std::vector<double>> perfrates_;
|
||||||
WellContainer<std::vector<double>> perfpress_;
|
WellContainer<std::vector<double>> perfpress_;
|
||||||
|
|
||||||
|
@ -841,10 +841,19 @@ int WellStateFullyImplicitBlackoil::topSegmentIndex(const int w) const
|
|||||||
return top_segment_index_[w];
|
return top_segment_index_[w];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WellStateFullyImplicitBlackoil::stopWell(int well_index)
|
||||||
|
{
|
||||||
|
this->status_[well_index] = Well::Status::STOP;
|
||||||
|
this->thp_[well_index] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
void WellStateFullyImplicitBlackoil::shutWell(int well_index)
|
void WellStateFullyImplicitBlackoil::shutWell(int well_index)
|
||||||
{
|
{
|
||||||
WellState::shutWell(well_index);
|
this->status_[well_index] = Well::Status::SHUT;
|
||||||
|
this->thp_[well_index] = 0;
|
||||||
|
this->bhp_[well_index] = 0;
|
||||||
const int np = numPhases();
|
const int np = numPhases();
|
||||||
|
this->wellrates_[well_index].assign(np, 0);
|
||||||
|
|
||||||
auto& resv = this->well_reservoir_rates_[well_index];
|
auto& resv = this->well_reservoir_rates_[well_index];
|
||||||
auto* wpi = &this->productivity_index_[np*well_index + 0];
|
auto* wpi = &this->productivity_index_[np*well_index + 0];
|
||||||
@ -860,6 +869,25 @@ void WellStateFullyImplicitBlackoil::shutWell(int well_index)
|
|||||||
this->conn_productivity_index_.begin() + last, 0.0);
|
this->conn_productivity_index_.begin() + last, 0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WellStateFullyImplicitBlackoil::updateStatus(int well_index, Well::Status status)
|
||||||
|
{
|
||||||
|
switch (status) {
|
||||||
|
case Well::Status::OPEN:
|
||||||
|
this->openWell(well_index);
|
||||||
|
break;
|
||||||
|
case Well::Status::SHUT:
|
||||||
|
this->shutWell(well_index);
|
||||||
|
break;
|
||||||
|
case Well::Status::STOP:
|
||||||
|
this->stopWell(well_index);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw std::logic_error("Invalid well status");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<class Comm>
|
template<class Comm>
|
||||||
void WellStateFullyImplicitBlackoil::communicateGroupRates(const Comm& comm)
|
void WellStateFullyImplicitBlackoil::communicateGroupRates(const Comm& comm)
|
||||||
{
|
{
|
||||||
|
@ -64,7 +64,6 @@ public:
|
|||||||
using BaseType :: bhp;
|
using BaseType :: bhp;
|
||||||
using BaseType :: perfPress;
|
using BaseType :: perfPress;
|
||||||
using BaseType :: numPhases;
|
using BaseType :: numPhases;
|
||||||
using BaseType :: updateStatus;
|
|
||||||
|
|
||||||
explicit WellStateFullyImplicitBlackoil(const PhaseUsage& pu) :
|
explicit WellStateFullyImplicitBlackoil(const PhaseUsage& pu) :
|
||||||
WellState(pu)
|
WellState(pu)
|
||||||
@ -312,8 +311,6 @@ public:
|
|||||||
return perf_water_velocity_;
|
return perf_water_velocity_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void shutWell(int well_index) override;
|
|
||||||
|
|
||||||
template<class Comm>
|
template<class Comm>
|
||||||
void communicateGroupRates(const Comm& comm);
|
void communicateGroupRates(const Comm& comm);
|
||||||
|
|
||||||
@ -396,6 +393,16 @@ public:
|
|||||||
void resetConnectionTransFactors(const int well_index,
|
void resetConnectionTransFactors(const int well_index,
|
||||||
const std::vector<PerforationData>& well_perf_data);
|
const std::vector<PerforationData>& well_perf_data);
|
||||||
|
|
||||||
|
void updateStatus(int well_index, Well::Status status);
|
||||||
|
|
||||||
|
void openWell(int well_index) {
|
||||||
|
this->status_[well_index] = Well::Status::OPEN;
|
||||||
|
}
|
||||||
|
|
||||||
|
void shutWell(int well_index);
|
||||||
|
void stopWell(int well_index);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<double> perfphaserates_;
|
std::vector<double> perfphaserates_;
|
||||||
WellContainer<int> is_producer_; // Size equal to number of local wells.
|
WellContainer<int> is_producer_; // Size equal to number of local wells.
|
||||||
|
Loading…
Reference in New Issue
Block a user