changed: move isPressureControlled to WellInterfaceGeneric

no typetag dependence. also no need for this to be virtual
This commit is contained in:
Arne Morten Kvarving
2022-11-04 14:20:14 +01:00
parent c8813a4dd0
commit 26d9f18687
4 changed files with 16 additions and 30 deletions

View File

@@ -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