mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-25 16:51:00 -06:00
changed: move isPressureControlled to WellInterfaceGeneric
no typetag dependence. also no need for this to be virtual
This commit is contained in:
parent
c8813a4dd0
commit
26d9f18687
@ -225,8 +225,6 @@ public:
|
||||
// Add well contributions to matrix
|
||||
virtual void addWellContributions(SparseMatrixAdapter&) const = 0;
|
||||
|
||||
virtual bool isPressureControlled(const WellState& well_state) const;
|
||||
|
||||
virtual void addWellPressureEquations(PressureMatrix& mat,
|
||||
const BVector& x,
|
||||
const int pressureVarIndex,
|
||||
|
@ -416,4 +416,18 @@ void WellInterfaceGeneric::reportWellSwitching(const SingleWellState& ws, Deferr
|
||||
}
|
||||
}
|
||||
|
||||
bool WellInterfaceGeneric::isPressureControlled(const WellState& well_state) const
|
||||
{
|
||||
const auto& ws = well_state.well(this->index_of_well_);
|
||||
if (this->isInjector()) {
|
||||
const Well::InjectorCMode& current = ws.injection_cmode;
|
||||
return current == Well::InjectorCMode::THP ||
|
||||
current == Well::InjectorCMode::BHP;
|
||||
} else {
|
||||
const Well::ProducerCMode& current = ws.production_cmode;
|
||||
return current == Well::ProducerCMode::THP ||
|
||||
current == Well::ProducerCMode::BHP;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Opm
|
||||
|
@ -193,6 +193,8 @@ public:
|
||||
WellTestState& wellTestState,
|
||||
DeferredLogger& deferred_logger) const;
|
||||
|
||||
bool isPressureControlled(const WellState& well_state) const;
|
||||
|
||||
protected:
|
||||
bool getAllowCrossFlow() const;
|
||||
|
||||
|
@ -571,34 +571,6 @@ namespace Opm
|
||||
assembleWellEqWithoutIteration(ebosSimulator, dt, inj_controls, prod_controls, well_state, group_state, deferred_logger);
|
||||
}
|
||||
|
||||
template<typename TypeTag>
|
||||
bool
|
||||
WellInterface<TypeTag>::isPressureControlled(const WellState& well_state) const
|
||||
{
|
||||
bool thp_controlled_well = false;
|
||||
bool bhp_controlled_well = false;
|
||||
const auto& ws = well_state.well(this->index_of_well_);
|
||||
if (this->isInjector()) {
|
||||
const Well::InjectorCMode& current = ws.injection_cmode;
|
||||
if (current == Well::InjectorCMode::THP) {
|
||||
thp_controlled_well = true;
|
||||
}
|
||||
if (current == Well::InjectorCMode::BHP) {
|
||||
bhp_controlled_well = true;
|
||||
}
|
||||
} else {
|
||||
const Well::ProducerCMode& current = ws.production_cmode;
|
||||
if (current == Well::ProducerCMode::THP) {
|
||||
thp_controlled_well = true;
|
||||
}
|
||||
if (current == Well::ProducerCMode::BHP) {
|
||||
bhp_controlled_well = true;
|
||||
}
|
||||
}
|
||||
bool ispressureControlled = (bhp_controlled_well || thp_controlled_well);
|
||||
return ispressureControlled;
|
||||
}
|
||||
|
||||
template<typename TypeTag>
|
||||
void
|
||||
WellInterface<TypeTag>::addCellRates(RateVector& rates, int cellIdx) const
|
||||
|
Loading…
Reference in New Issue
Block a user