mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-02 04:26:55 -06:00
Add method BlackoilWellModel::forceShutWellByName().
This commit is contained in:
parent
3bbc13a9ce
commit
422d477945
@ -239,6 +239,9 @@ namespace Opm {
|
||||
/// Return true if any well has a THP constraint.
|
||||
bool hasTHPConstraints() const;
|
||||
|
||||
/// Shut down any single well.
|
||||
void forceShutWellByName(const std::string& wellname, const double simulation_time);
|
||||
|
||||
protected:
|
||||
|
||||
void extractLegacyPressure_(std::vector<double>& cellPressure) const
|
||||
|
@ -133,6 +133,33 @@ namespace Opm {
|
||||
|
||||
|
||||
|
||||
/// Return true if any well has a THP constraint.
|
||||
template<typename TypeTag>
|
||||
void
|
||||
BlackoilWellModel<TypeTag>::
|
||||
forceShutWellByName(const std::string& wellname,
|
||||
const double simulation_time)
|
||||
{
|
||||
// Only add the well to the closed list on the
|
||||
// process that owns it.
|
||||
for (const auto& well : well_container_) {
|
||||
if (well->name() == wellname) {
|
||||
wellTestState_.addClosedWell(wellname, WellTestConfig::Reason::PHYSICAL, simulation_time);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Only log a message on the output rank.
|
||||
if (terminal_output_) {
|
||||
const std::string msg = "Well " + wellname
|
||||
+ " will be shut because it cannot get converged.";
|
||||
OpmLog::info(msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<typename TypeTag>
|
||||
void
|
||||
BlackoilWellModel<TypeTag>::
|
||||
|
Loading…
Reference in New Issue
Block a user