mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
applying the efficiency factor to flow
This commit is contained in:
parent
aca587b76b
commit
623ef3850e
@ -967,8 +967,10 @@ namespace detail {
|
|||||||
// Add well contributions to mass balance equations
|
// Add well contributions to mass balance equations
|
||||||
const int nc = Opm::AutoDiffGrid::numCells(grid_);
|
const int nc = Opm::AutoDiffGrid::numCells(grid_);
|
||||||
const int np = asImpl().numPhases();
|
const int np = asImpl().numPhases();
|
||||||
|
const V& efficiency_factors = wellModel().wellPerfEfficiencyFactors();
|
||||||
for (int phase = 0; phase < np; ++phase) {
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,7 +194,9 @@ namespace Opm {
|
|||||||
|
|
||||||
WellCollection* wellCollection() const;
|
WellCollection* wellCollection() const;
|
||||||
|
|
||||||
void calculateEfficiencyFactor();
|
void calculateEfficiencyFactors();
|
||||||
|
|
||||||
|
const Vector& wellPerfEfficiencyFactors() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool wells_active_;
|
bool wells_active_;
|
||||||
@ -206,7 +208,7 @@ namespace Opm {
|
|||||||
// The efficiency factor for each connection
|
// The efficiency factor for each connection
|
||||||
// It is specified based on wells and groups
|
// It is specified based on wells and groups
|
||||||
// By default, they should all be one.
|
// By default, they should all be one.
|
||||||
Vector well_perforation_efficiency_factor_;
|
Vector well_perforation_efficiency_factors_;
|
||||||
|
|
||||||
const BlackoilPropsAdInterface* fluid_;
|
const BlackoilPropsAdInterface* fluid_;
|
||||||
const std::vector<bool>* active_;
|
const std::vector<bool>* active_;
|
||||||
|
@ -76,7 +76,7 @@ namespace Opm
|
|||||||
, wells_(wells_arg)
|
, wells_(wells_arg)
|
||||||
, wops_(wells_arg)
|
, wops_(wells_arg)
|
||||||
, well_collection_(well_collection)
|
, well_collection_(well_collection)
|
||||||
, well_perforation_efficiency_factor_(Vector())
|
, well_perforation_efficiency_factors_(Vector())
|
||||||
, fluid_(nullptr)
|
, fluid_(nullptr)
|
||||||
, active_(nullptr)
|
, active_(nullptr)
|
||||||
, phase_condition_(nullptr)
|
, phase_condition_(nullptr)
|
||||||
@ -106,7 +106,7 @@ namespace Opm
|
|||||||
gravity_ = gravity_arg;
|
gravity_ = gravity_arg;
|
||||||
perf_cell_depth_ = subset(depth_arg, wellOps().well_cells);;
|
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_;
|
return well_collection_;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1617,23 +1618,31 @@ namespace Opm
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void StandardWells::calculateEfficiencyFactor() {
|
void StandardWells::calculateEfficiencyFactors()
|
||||||
|
{
|
||||||
if ( !localWellsActive() ) {
|
if ( !localWellsActive() ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// get efficiency factor for each well first
|
// get efficiency factor for each well first
|
||||||
const int nw = wells_->number_of_wells;
|
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) {
|
for (int w = 0; w < nw; ++w) {
|
||||||
const std::string well_name = wells_->name[w];
|
const std::string well_name = wells_->name[w];
|
||||||
const WellNode* well_node = dynamic_cast<const WellNode *>(well_collection_->findNode(well_name));
|
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.
|
// 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_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user