Use PhaseUsage to determine output phases

This commit is contained in:
Anders Matheson
2016-09-20 09:43:58 +02:00
parent 0ac0c97612
commit 65b512e903
2 changed files with 10 additions and 9 deletions

View File

@@ -24,6 +24,7 @@
#include <opm/core/wells.h>
#include <opm/core/well_controls.h>
#include <opm/core/simulator/WellState.hpp>
#include <opm/core/props/BlackoilPhases.hpp>
#include <opm/common/ErrorMacros.hpp>
#include <vector>
#include <cassert>
@@ -191,8 +192,8 @@ namespace Opm
std::vector<double>& wellPotentials() { return well_potentials_; }
const std::vector<double>& wellPotentials() const { return well_potentials_; }
data::Wells report() const override {
data::Wells res = WellState::report();
data::Wells report(const PhaseUsage &pu) const override {
data::Wells res = WellState::report(pu);
const int nw = this->numWells();
// If there are now wells numPhases throws a floating point
@@ -230,16 +231,16 @@ namespace Opm
const auto& wv = this->wellRates();
data::Rates wellrates;
if( np > 0 ) {
wellrates.set( rt::wat, wv[ wellrate_index + 0 ] );
if( pu.phase_used[BlackoilPhases::Aqua] ) {
wellrates.set( rt::wat, wv[ wellrate_index + pu.phase_pos[BlackoilPhases::Aqua] ] );
}
if( np > 1 ) {
wellrates.set( rt::oil, wv[ wellrate_index + 1 ] );
if( pu.phase_used[BlackoilPhases::Liquid] ) {
wellrates.set( rt::oil, wv[ wellrate_index + pu.phase_pos[BlackoilPhases::Liquid] ] );
}
if( np > 2 ) {
wellrates.set( rt::gas, wv[ wellrate_index + 2 ] );
if( pu.phase_used[BlackoilPhases::Vapour] ) {
wellrates.set( rt::wat, wv[ wellrate_index + pu.phase_pos[BlackoilPhases::Vapour] ] );
}
const double bhp = this->bhp()[ w ];