diff --git a/CMakeLists_files.cmake b/CMakeLists_files.cmake index 799cbab21..3e81d026f 100644 --- a/CMakeLists_files.cmake +++ b/CMakeLists_files.cmake @@ -240,7 +240,9 @@ list (APPEND PUBLIC_HEADER_FILES opm/autodiff/StandardWells.hpp opm/autodiff/StandardWells_impl.hpp opm/autodiff/WellInterface.hpp + opm/autodiff/WellInterface_impl.hpp opm/autodiff/StandardWell.hpp + opm/autodiff/StandardWell_impl.hpp opm/autodiff/StandardWellsDense.hpp opm/autodiff/StandardWellsSolvent.hpp opm/autodiff/StandardWellsSolvent_impl.hpp diff --git a/opm/autodiff/BlackoilModelEbos.hpp b/opm/autodiff/BlackoilModelEbos.hpp index b22739ee7..dcfa15aee 100644 --- a/opm/autodiff/BlackoilModelEbos.hpp +++ b/opm/autodiff/BlackoilModelEbos.hpp @@ -154,7 +154,7 @@ namespace Opm { /// \param[in] terminal_output request output to cout/cerr BlackoilModelEbos(Simulator& ebosSimulator, const ModelParameters& param, - const StandardWellsDense& well_model, + StandardWellsDense& well_model, RateConverterType& rate_converter, const NewtonIterationBlackoilInterface& linsolver, const bool terminal_output @@ -800,9 +800,9 @@ namespace Opm { R_sum[ compIdx ] = sumBuffer[ buffIdx ]; } - for( int compIdx = 0, buffIdx = 0; compIdx < numComp; ++compIdx, ++buffIdx ) + for( int compIdx = 0; compIdx < numComp; ++compIdx ) { - maxCoeff[ compIdx ] = maxBuffer[ buffIdx ]; + maxCoeff[ compIdx ] = maxBuffer[ compIdx ]; } // restore global pore volume @@ -1501,7 +1501,7 @@ namespace Opm { SimulatorReport failureReport_; // Well Model - StandardWellsDense well_model_; + StandardWellsDense& well_model_; /// \brief Whether we print something to std::cout bool terminal_output_; diff --git a/opm/autodiff/StandardWell.hpp b/opm/autodiff/StandardWell.hpp index af7b8fda4..df634a830 100644 --- a/opm/autodiff/StandardWell.hpp +++ b/opm/autodiff/StandardWell.hpp @@ -240,9 +240,6 @@ namespace Opm EvalWell extendEval(const Eval& in) const; - // TODO: maybe this type of function can go to some helper file. - void localInvert(DiagMatWell& istlA) const; - // xw = inv(D)*(rw - C*x) void recoverSolutionWell(const BVector& x, BVectorWell& xw) const; diff --git a/opm/autodiff/StandardWell_impl.hpp b/opm/autodiff/StandardWell_impl.hpp index 65a81fcd3..669444caa 100644 --- a/opm/autodiff/StandardWell_impl.hpp +++ b/opm/autodiff/StandardWell_impl.hpp @@ -636,7 +636,7 @@ namespace Opm } // do the local inversion of D. - localInvert( invDuneD_ ); + invDuneD_[0][0].invert(); } @@ -1034,23 +1034,6 @@ namespace Opm - template - void - StandardWell:: - localInvert(DiagMatWell& istlA) const - { - for (auto row = istlA.begin(), rowend = istlA.end(); row != rowend; ++row ) { - for (auto col = row->begin(), colend = row->end(); col != colend; ++col ) { - //std::cout << (*col) << std::endl; - (*col).invert(); - } - } - } - - - - - template void StandardWell:: diff --git a/opm/autodiff/StandardWellsDense.hpp b/opm/autodiff/StandardWellsDense.hpp index e7d1529ea..ba4adf2a2 100644 --- a/opm/autodiff/StandardWellsDense.hpp +++ b/opm/autodiff/StandardWellsDense.hpp @@ -57,8 +57,6 @@ #include -#include - namespace Opm { @@ -130,8 +128,6 @@ namespace Opm { int numWells() const; - const Wells* wellsPointer() const; - /// return true if wells are available in the reservoir bool wellsActive() const; @@ -169,8 +165,7 @@ namespace Opm { // eventually, the wells_ above should be gone. // the name is just temporary // later, might make share_ptr const later. - // TODO: forget why make it share_ptr instead of unique_ptr - std::vector > > well_container_; + std::vector > > well_container_; // TODO: forgot why returning a vector here void createWellContainer(const Wells* wells_arg); diff --git a/opm/autodiff/StandardWellsDense_impl.hpp b/opm/autodiff/StandardWellsDense_impl.hpp index eadfc0d56..088eefe40 100644 --- a/opm/autodiff/StandardWellsDense_impl.hpp +++ b/opm/autodiff/StandardWellsDense_impl.hpp @@ -147,8 +147,7 @@ namespace Opm { } // Basically, we are handling all the wells as StandardWell for the moment - // TODO: to be changed when we begin introducing MultisegmentWell - well_container_.push_back(std::make_shared >(well_ecl, current_timeIdx_, wells_arg) ); + well_container_.emplace_back(new StandardWell(well_ecl, current_timeIdx_, wells_arg) ); } } } @@ -336,18 +335,6 @@ namespace Opm { - template - const Wells* - StandardWellsDense:: - wellsPointer() const - { - return wells_; - } - - - - - template bool StandardWellsDense:: @@ -658,7 +645,7 @@ namespace Opm { // update/setup guide rates for each well based on the well_potentials // TODO: this is one of two places that still need Wells struct. In this function, only the well names // well types are used, probably the order of the wells to locate the correct values in well_potentials. - well_collection_->setGuideRatesWithPotentials(wellsPointer(), phase_usage_, well_potentials); + well_collection_->setGuideRatesWithPotentials(wells_, phase_usage_, well_potentials); } applyVREPGroupControl(well_state);