adding function underPredictionMode() to WellInterface

to indicate whether a well is under prediction mode.
This commit is contained in:
Kai Bao 2018-11-14 23:24:10 +01:00
parent 9bfa39224f
commit 01efbc639c
2 changed files with 27 additions and 0 deletions

View File

@ -312,6 +312,8 @@ namespace Opm
bool checkRateEconLimits(const WellEconProductionLimits& econ_production_limits,
const WellState& well_state) const;
bool underPredictionMode() const;
bool wellHasTHPConstraints() const;
// Component fractions for each phase for the well

View File

@ -446,6 +446,31 @@ namespace Opm
template<typename TypeTag>
bool
WellInterface<TypeTag>::
underPredictionMode() const
{
bool under_prediction_mode = false;
switch( well_type_ ) {
case PRODUCER:
under_prediction_mode = well_ecl_->getProductionProperties(current_step_).predictionMode;
break;
case INJECTOR:
under_prediction_mode = well_ecl_->getInjectionProperties(current_step_).predictionMode;
break;
default:
OPM_THROW(std::logic_error, "Expected PRODUCER or INJECTOR type for well " << name());
}
return under_prediction_mode;
}
template<typename TypeTag>
bool
WellInterface<TypeTag>::