adapting the change of the function findWellNode().

This commit is contained in:
Kai Bao 2016-11-16 14:28:35 +01:00
parent d06acaa4b5
commit d38a6eb459
3 changed files with 15 additions and 30 deletions

View File

@ -413,13 +413,9 @@ namespace Opm {
for (int w = 0; w < nw; ++w) {
const std::string well_name = wells_->name[w];
// get the pointer to the well node in the well collection
WellNode* well_node = well_collection_->findWellNode(std::string(wells().name[w]));
// maybe should put this if in function findWellNode()
if (well_node == nullptr) {
OPM_THROW(std::runtime_error, "Could not find well " << std::string(wells().name[w]) << " in the well collection!\n");
}
well_efficiency_factors(w) = well_node->getAccumulativeEfficiencyFactor();
// get the well node in the well collection
WellNode& well_node = well_collection_->findWellNode(std::string(wells().name[w]));
well_efficiency_factors(w) = well_node.getAccumulativeEfficiencyFactor();
}
// map them to the perforation.

View File

@ -904,20 +904,16 @@ namespace Opm
break;
}
// get the pointer to the well node in the well collection
WellNode* well_node = well_collection_->findWellNode(std::string(wells().name[w]));
// maybe should put this if in function findWellNode()
if (well_node == nullptr) {
OPM_THROW(std::runtime_error, "Could not find well " << std::string(wells().name[w]) << " in the well collection!\n");
}
// get the well node in the well collection
WellNode& well_node = well_collection_->findWellNode(std::string(wells().name[w]));
// update whehter the well is under group control or individual control
if (well_node->groupControlIndex() >= 0 && current == well_node->groupControlIndex()) {
if (well_node.groupControlIndex() >= 0 && current == well_node.groupControlIndex()) {
// under group control
well_node->setIndividualControl(false);
well_node.setIndividualControl(false);
} else {
// individual control
well_node->setIndividualControl(true);
well_node.setIndividualControl(true);
}
}

View File

@ -852,20 +852,16 @@ namespace Opm
break;
}
// get the pointer to the well node in the well collection
WellNode* well_node = well_collection_->findWellNode(std::string(wells().name[w]));
// maybe should put this if in function findWellNode()
if (well_node == nullptr) {
OPM_THROW(std::runtime_error, "Could not find well " << std::string(wells().name[w]) << " in the well collection!\n");
}
// get well node in the well collection
WellNode& well_node = well_collection_->findWellNode(std::string(wells().name[w]));
// update whehter the well is under group control or individual control
if (well_node->groupControlIndex() >= 0 && current == well_node->groupControlIndex()) {
if (well_node.groupControlIndex() >= 0 && current == well_node.groupControlIndex()) {
// under group control
well_node->setIndividualControl(false);
well_node.setIndividualControl(false);
} else {
// individual control
well_node->setIndividualControl(true);
well_node.setIndividualControl(true);
}
}
@ -1590,12 +1586,9 @@ namespace Opm
for (int w = 0; w < nw; ++w) {
const std::string well_name = wells_->name[w];
const WellNode* well_node = well_collection_->findWellNode(well_name);
if (well_node == nullptr) {
OPM_THROW(std::runtime_error, "Could not find well " << std::string(wells().name[w]) << " in the well collection!\n");
}
const WellNode& well_node = well_collection_->findWellNode(well_name);
well_efficiency_factors(w) = well_node->getAccumulativeEfficiencyFactor();
well_efficiency_factors(w) = well_node.getAccumulativeEfficiencyFactor();
}
// map them to the perforation.