diff --git a/opm/autodiff/BlackoilModelBase.hpp b/opm/autodiff/BlackoilModelBase.hpp index c9870e6ea..b8ceae236 100644 --- a/opm/autodiff/BlackoilModelBase.hpp +++ b/opm/autodiff/BlackoilModelBase.hpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -269,44 +270,6 @@ namespace Opm { ADB mob; // Phase mobility (per cell) }; - class StandardWells { - protected: - struct WellOps { - explicit WellOps(const Wells* wells); - Eigen::SparseMatrix w2p; // well -> perf (scatter) - Eigen::SparseMatrix p2w; // perf -> well (gather) - std::vector well_cells; // the set of perforated cells - }; - - public: - explicit StandardWells(const Wells* wells); - - const Wells& wells() const; - - // return true if wells are available in the reservoir - bool wellsActive() const; - void setWellsActive(const bool wells_active); - // return true if wells are available on this process - bool localWellsActive() const; - - const WellOps& wellOps() const; - - //Density of each well perforation - V& wellPerforationDensities(); - const V& wellPerforationDensities() const; - - // Diff to bhp for each well perforation. - V& wellPerforationPressureDiffs(); - const V& wellPerforationPressureDiffs() const; - - protected: - bool wells_active_; - const Wells* wells_; - const WellOps wops_; - V well_perforation_densities_; - V well_perforation_pressure_diffs_; - }; - // --------- Data members --------- const Grid& grid_; diff --git a/opm/autodiff/BlackoilModelBase_impl.hpp b/opm/autodiff/BlackoilModelBase_impl.hpp index 567e5e857..b6a32191e 100644 --- a/opm/autodiff/BlackoilModelBase_impl.hpp +++ b/opm/autodiff/BlackoilModelBase_impl.hpp @@ -418,169 +418,6 @@ namespace detail { - template - BlackoilModelBase:: - StandardWells:: - WellOps::WellOps(const Wells* wells) - : w2p(), - p2w(), - well_cells() - { - if( wells ) - { - w2p = Eigen::SparseMatrix(wells->well_connpos[ wells->number_of_wells ], wells->number_of_wells); - p2w = Eigen::SparseMatrix(wells->number_of_wells, wells->well_connpos[ wells->number_of_wells ]); - - const int nw = wells->number_of_wells; - const int* const wpos = wells->well_connpos; - - typedef Eigen::Triplet Tri; - - std::vector scatter, gather; - scatter.reserve(wpos[nw]); - gather .reserve(wpos[nw]); - - for (int w = 0, i = 0; w < nw; ++w) { - for (; i < wpos[ w + 1 ]; ++i) { - scatter.push_back(Tri(i, w, 1.0)); - gather .push_back(Tri(w, i, 1.0)); - } - } - - w2p.setFromTriplets(scatter.begin(), scatter.end()); - p2w.setFromTriplets(gather .begin(), gather .end()); - - well_cells.assign(wells->well_cells, wells->well_cells + wells->well_connpos[wells->number_of_wells]); - } - } - - - - - - template - BlackoilModelBase:: - StandardWells::StandardWells(const Wells* wells_arg) - : wells_(wells_arg) - , wops_(wells_arg) - , well_perforation_densities_(V()) - , well_perforation_pressure_diffs_(V()) - { - } - - - - - - template - const Wells& - BlackoilModelBase:: - StandardWells::wells() const - { - assert(wells_ != 0); - return *(wells_); - } - - - - - - template - bool - BlackoilModelBase:: - StandardWells::wellsActive() const - { - return wells_active_; - } - - - - - - template - void - BlackoilModelBase:: - StandardWells::setWellsActive(const bool wells_active) - { - wells_active_ = wells_active; - } - - - - - - template - bool - BlackoilModelBase:: - StandardWells::localWellsActive() const - { - return wells_ ? (wells_->number_of_wells > 0 ) : false; - } - - - - - - template - const typename BlackoilModelBase::StandardWells::WellOps& - BlackoilModelBase:: - StandardWells::wellOps() const - { - return wops_; - } - - - - - - template - V& - BlackoilModelBase:: - StandardWells::wellPerforationDensities() - { - return well_perforation_densities_; - } - - - - - - template - const V& - BlackoilModelBase:: - StandardWells::wellPerforationDensities() const - { - return well_perforation_densities_; - } - - - - - - template - V& - BlackoilModelBase:: - StandardWells::wellPerforationPressureDiffs() - { - return well_perforation_pressure_diffs_; - } - - - - - - template - const V& - BlackoilModelBase:: - StandardWells::wellPerforationPressureDiffs() const - { - return well_perforation_pressure_diffs_; - } - - - - - template int BlackoilModelBase::numWellVars() const diff --git a/opm/autodiff/StandardWells.cpp b/opm/autodiff/StandardWells.cpp index 60ef126f6..6b49be6ab 100644 --- a/opm/autodiff/StandardWells.cpp +++ b/opm/autodiff/StandardWells.cpp @@ -1,5 +1,6 @@ /* Copyright 2016 SINTEF ICT, Applied Mathematics. + Copyright 2016 Statoil ASA. This file is part of the Open Porous Media project (OPM). diff --git a/opm/autodiff/StandardWells.hpp b/opm/autodiff/StandardWells.hpp index 73280d692..1c3d556b7 100644 --- a/opm/autodiff/StandardWells.hpp +++ b/opm/autodiff/StandardWells.hpp @@ -1,5 +1,6 @@ /* Copyright 2016 SINTEF ICT, Applied Mathematics. + Copyright 2016 Statoil ASA. This file is part of the Open Porous Media project (OPM). @@ -37,7 +38,6 @@ namespace Opm { // --------- Types --------- typedef AutoDiffBlock ADB; typedef ADB::V Vector; - // typedef ADB::M Matrix; /// Class for handling the standard well model. class StandardWells {