00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef OPM_WELLSTATEFULLYIMPLICITBLACKOILSOLVENT_HEADER_INCLUDED
00021 #define OPM_WELLSTATEFULLYIMPLICITBLACKOILSOLVENT_HEADER_INCLUDED
00022
00023 #include <opm/autodiff/WellStateFullyImplicitBlackoil.hpp>
00024
00025 namespace Opm
00026 {
00027
00028 class WellStateFullyImplicitBlackoilSolvent : public WellStateFullyImplicitBlackoil
00029 {
00030 typedef WellStateFullyImplicitBlackoil BaseType;
00031 public:
00032
00034 std::vector<double>& solventFraction() { return solvent_fraction_; }
00035 const std::vector<double>& solventFraction() const { return solvent_fraction_; }
00036
00037 data::Wells report(const PhaseUsage &pu) const override {
00038 data::Wells res = WellStateFullyImplicitBlackoil::report(pu);
00039
00040 const int nw = WellState::numWells();
00041
00042
00043
00044 if (nw == 0) {
00045 return res;
00046 }
00047
00048 const int np = BaseType::numPhases();
00049
00050 assert( np == 3 );
00051
00052
00053 for( auto w = 0; w < nw; ++w ) {
00054 using rt = data::Rates::opt;
00055 double solvent_well_rate = 0.0;
00056 for (int perf = wells_->well_connpos[w]; perf < wells_->well_connpos[w+1]; ++perf ) {
00057 auto solvent_rate_this = BaseType::perfPhaseRates()[np*perf + pu.phase_pos[BlackoilPhases::Vapour]] * solventFraction()[perf];
00058 solvent_well_rate += solvent_rate_this;
00059 }
00060
00061 res.at( wells_->name[ w ]).rates.set( rt::solvent, solvent_well_rate );
00062
00063 }
00064
00065 return res;
00066 }
00067 private:
00068 std::vector<double> solvent_fraction_;
00069 };
00070
00071 }
00072
00073 #endif // OPM_WELLSTATEFULLYIMPLICITBLACKOILSOLVENT_HEADER_INCLUDED