calculate efficiency factor in StandardWells

which will be used to scale the perforation flow rate when entering the
matrial balance equations.
This commit is contained in:
Kai Bao 2016-10-18 17:32:42 +02:00
parent ac67a10316
commit aca587b76b
2 changed files with 33 additions and 0 deletions

View File

@ -194,6 +194,8 @@ namespace Opm {
WellCollection* wellCollection() const;
void calculateEfficiencyFactor();
protected:
bool wells_active_;
const Wells* wells_;
@ -201,6 +203,11 @@ namespace Opm {
// It will probably need to be updated during running time.
WellCollection* well_collection_;
// The efficiency factor for each connection
// It is specified based on wells and groups
// By default, they should all be one.
Vector well_perforation_efficiency_factor_;
const BlackoilPropsAdInterface* fluid_;
const std::vector<bool>* active_;
const std::vector<PhasePresence>* phase_condition_;

View File

@ -76,6 +76,7 @@ namespace Opm
, wells_(wells_arg)
, wops_(wells_arg)
, well_collection_(well_collection)
, well_perforation_efficiency_factor_(Vector())
, fluid_(nullptr)
, active_(nullptr)
, phase_condition_(nullptr)
@ -104,6 +105,8 @@ namespace Opm
vfp_properties_ = vfp_properties_arg;
gravity_ = gravity_arg;
perf_cell_depth_ = subset(depth_arg, wellOps().well_cells);;
calculateEfficiencyFactor();
}
@ -1611,4 +1614,27 @@ namespace Opm
}
void StandardWells::calculateEfficiencyFactor() {
if ( !localWellsActive() ) {
return;
}
// get efficiency factor for each well first
const int nw = wells_->number_of_wells;
Vector well_efficiency_factor = Vector::Ones(nw);
for (int w = 0; w < nw; ++w) {
const std::string well_name = wells_->name[w];
const WellNode* well_node = dynamic_cast<const WellNode *>(well_collection_->findNode(well_name));
well_efficiency_factor(w) = well_node->getAccumulativeEfficiencyFactor();
}
// map them to the perforation.
well_perforation_efficiency_factor_ = wellOps().w2p * well_efficiency_factor.matrix();
}
} // namespace Opm