applying the efficiency factor to flow

This commit is contained in:
Kai Bao 2016-10-19 10:40:11 +02:00
parent aca587b76b
commit 623ef3850e
3 changed files with 23 additions and 10 deletions

View File

@ -967,8 +967,10 @@ namespace detail {
// Add well contributions to mass balance equations
const int nc = Opm::AutoDiffGrid::numCells(grid_);
const int np = asImpl().numPhases();
const V& efficiency_factors = wellModel().wellPerfEfficiencyFactors();
for (int phase = 0; phase < np; ++phase) {
residual_.material_balance_eq[phase] -= superset(cq_s[phase], wellModel().wellOps().well_cells, nc);
residual_.material_balance_eq[phase] -= superset(efficiency_factors * cq_s[phase],
wellModel().wellOps().well_cells, nc);
}
}

View File

@ -194,7 +194,9 @@ namespace Opm {
WellCollection* wellCollection() const;
void calculateEfficiencyFactor();
void calculateEfficiencyFactors();
const Vector& wellPerfEfficiencyFactors() const;
protected:
bool wells_active_;
@ -206,7 +208,7 @@ namespace Opm {
// 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_;
Vector well_perforation_efficiency_factors_;
const BlackoilPropsAdInterface* fluid_;
const std::vector<bool>* active_;

View File

@ -76,7 +76,7 @@ namespace Opm
, wells_(wells_arg)
, wops_(wells_arg)
, well_collection_(well_collection)
, well_perforation_efficiency_factor_(Vector())
, well_perforation_efficiency_factors_(Vector())
, fluid_(nullptr)
, active_(nullptr)
, phase_condition_(nullptr)
@ -106,7 +106,7 @@ namespace Opm
gravity_ = gravity_arg;
perf_cell_depth_ = subset(depth_arg, wellOps().well_cells);;
calculateEfficiencyFactor();
calculateEfficiencyFactors();
}
@ -1609,7 +1609,8 @@ namespace Opm
WellCollection* StandardWells::wellCollection() const {
WellCollection* StandardWells::wellCollection() const
{
return well_collection_;
}
@ -1617,23 +1618,31 @@ namespace Opm
void StandardWells::calculateEfficiencyFactor() {
void StandardWells::calculateEfficiencyFactors()
{
if ( !localWellsActive() ) {
return;
}
// get efficiency factor for each well first
const int nw = wells_->number_of_wells;
Vector well_efficiency_factor = Vector::Ones(nw);
Vector well_efficiency_factors = 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();
well_efficiency_factors(w) = well_node->getAccumulativeEfficiencyFactor();
}
// map them to the perforation.
well_perforation_efficiency_factor_ = wellOps().w2p * well_efficiency_factor.matrix();
well_perforation_efficiency_factors_ = wellOps().w2p * well_efficiency_factors.matrix();
}
const StandardWells::Vector&
StandardWells::wellPerfEfficiencyFactors() const
{
return well_perforation_efficiency_factors_;
}