mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-23 07:53:29 -06:00
added possibility to add wells to wellcollection without using deck
This commit is contained in:
parent
d4e530eb3c
commit
90f8a780da
@ -93,6 +93,36 @@ namespace Opm
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/// Adds the child to the collection
|
||||
/// and appends it to parent's children.
|
||||
/// \param[in] child the child node
|
||||
/// \param[in] parent name of parent node
|
||||
|
||||
void WellCollection::addChild(std::tr1::shared_ptr<WellsGroupInterface>& child_node,
|
||||
const std::string& parent_name)
|
||||
{
|
||||
WellsGroupInterface* parent = findNode(parent_name);
|
||||
if (parent == NULL) {
|
||||
THROW("Parent with name = " << parent_name << " not found.");
|
||||
}
|
||||
ASSERT(!parent->isLeafNode());
|
||||
static_cast<WellsGroup*>(parent)->addChild(child_node);
|
||||
if (child_node->isLeafNode()) {
|
||||
leaf_nodes_.push_back(static_cast<WellNode*>(child_node.get()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// Adds the node to the collection (as a root node)
|
||||
|
||||
void WellCollection::addChild(std::tr1::shared_ptr<WellsGroupInterface>& child_node)
|
||||
{
|
||||
roots_.push_back(child_node);
|
||||
if (child_node->isLeafNode()) {
|
||||
leaf_nodes_.push_back(static_cast<WellNode*> (child_node.get()));
|
||||
}
|
||||
}
|
||||
|
||||
bool WellCollection::conditionsMet(const std::vector<double>& well_bhp,
|
||||
const std::vector<double>& well_reservoirrates_phase,
|
||||
const std::vector<double>& well_surfacerates_phase)
|
||||
|
@ -43,6 +43,16 @@ namespace Opm
|
||||
const std::string& parent,
|
||||
const EclipseGridParser& deck);
|
||||
|
||||
/// Adds the child to the collection
|
||||
/// and appends it to parent's children.
|
||||
/// \param[in] child the child node
|
||||
/// \param[in] parent name of parent node
|
||||
void addChild(std::tr1::shared_ptr<WellsGroupInterface>& child_node,
|
||||
const std::string& parent);
|
||||
|
||||
/// Adds the node to the collection (as a root node)
|
||||
void addChild(std::tr1::shared_ptr<WellsGroupInterface>& child_node);
|
||||
|
||||
/// Checks if each condition is met, applies well controls where needed
|
||||
/// (that is, it either changes the active control of violating wells, or shuts
|
||||
/// down wells). Only one change is applied per invocation. Typical use will be
|
||||
|
Loading…
Reference in New Issue
Block a user