bool Well::setStatus(size_t timeStep, WellCommon::StatusEnum status) { if ((WellCommon::StatusEnum::OPEN == status) && getCompletions(timeStep)->allCompletionsShut()) { m_messages.note("When handling keyword for well " + name() + ": Cannot open a well where all completions are shut"); return false; } else return m_status->update( timeStep , status ); }
bool Well::setStatus(size_t timeStep, WellCommon::StatusEnum status) { if ((WellCommon::StatusEnum::OPEN == status) && getCompletions(timeStep).allCompletionsShut()) { m_messages.note("When handling keyword for well " + name() + ": Cannot open a well where all completions are shut"); return false; } else { bool update = m_status.update( timeStep , status ); if (update) addEvent( ScheduleEvents::WELL_STATUS_CHANGE , timeStep ); return update; } }
void Well::setRefDepthFromCompletions() const { size_t timeStep = m_creationTimeStep; while (true) { auto completions = getCompletions( timeStep ); if (completions->size() > 0) { auto firstCompletion = completions->get(0); double depth = m_grid->getCellDepth( firstCompletion->getI() , firstCompletion->getJ() , firstCompletion->getK()); m_refDepth.setValue( depth ); break; } else { timeStep++; if (timeStep >= m_timeMap->size()) throw std::invalid_argument("No completions defined for well: " + name() + " can not infer reference depth"); } } }