diff --git a/opm/simulators/wells/BlackoilWellModel.hpp b/opm/simulators/wells/BlackoilWellModel.hpp index 77dde08a9..98856a937 100644 --- a/opm/simulators/wells/BlackoilWellModel.hpp +++ b/opm/simulators/wells/BlackoilWellModel.hpp @@ -37,8 +37,6 @@ #include #include -#include -#include #include #include #include diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index f5ee5340b..861bc328b 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -22,6 +22,7 @@ #include #include +#include namespace Opm { template diff --git a/opm/simulators/wells/SimFIBODetails.hpp b/opm/simulators/wells/SimFIBODetails.hpp index 419e34ed8..396c97157 100644 --- a/opm/simulators/wells/SimFIBODetails.hpp +++ b/opm/simulators/wells/SimFIBODetails.hpp @@ -28,8 +28,6 @@ #include #include -#include - namespace Opm { namespace SimFIBODetails { @@ -48,43 +46,6 @@ namespace Opm return wmap; } - inline int - resv_control(const WellControls* ctrl) - { - int i, n = well_controls_get_num(ctrl); - - bool match = false; - for (i = 0; (! match) && (i < n); ++i) { - match = well_controls_iget_type(ctrl, i) == RESERVOIR_RATE; - } - - if (! match) { i = 0; } - - return i - 1; // -1 if no match, undo final "++" otherwise - } - - inline bool - is_resv(const Wells& wells, - const int w) - { - return (0 <= resv_control(wells.ctrls[w])); - } - - inline std::vector - resvWells(const Wells* wells) - { - std::vector resv_wells; - if( wells ) - { - for (int w = 0, nw = wells->number_of_wells; w < nw; ++w) { - if ( is_resv(*wells, w) ) { - resv_wells.push_back(w); - } - } - } - - return resv_wells; - } inline void historyRates(const PhaseUsage& pu, diff --git a/opm/simulators/wells/VFPInjProperties.hpp b/opm/simulators/wells/VFPInjProperties.hpp index f3021c94d..5af8a384b 100644 --- a/opm/simulators/wells/VFPInjProperties.hpp +++ b/opm/simulators/wells/VFPInjProperties.hpp @@ -21,7 +21,6 @@ #define OPM_AUTODIFF_VFPINJPROPERTIES_HPP_ #include -#include #include #include #include diff --git a/opm/simulators/wells/VFPProdProperties.hpp b/opm/simulators/wells/VFPProdProperties.hpp index f66c34d6c..0338a48b1 100644 --- a/opm/simulators/wells/VFPProdProperties.hpp +++ b/opm/simulators/wells/VFPProdProperties.hpp @@ -21,7 +21,6 @@ #define OPM_AUTODIFF_VFPPRODPROPERTIES_HPP_ #include -#include #include #include #include diff --git a/opm/simulators/wells/WellConnectionAuxiliaryModule.hpp b/opm/simulators/wells/WellConnectionAuxiliaryModule.hpp index cc8a65746..45188b7cf 100644 --- a/opm/simulators/wells/WellConnectionAuxiliaryModule.hpp +++ b/opm/simulators/wells/WellConnectionAuxiliaryModule.hpp @@ -25,8 +25,6 @@ #include -#include - #include namespace Opm diff --git a/opm/simulators/wells/WellHelpers.hpp b/opm/simulators/wells/WellHelpers.hpp index 6aa918d67..f89df78f7 100644 --- a/opm/simulators/wells/WellHelpers.hpp +++ b/opm/simulators/wells/WellHelpers.hpp @@ -22,8 +22,6 @@ #ifndef OPM_WELLHELPERS_HEADER_INCLUDED #define OPM_WELLHELPERS_HEADER_INCLUDED -#include -// #include #include @@ -35,35 +33,6 @@ namespace Opm { namespace wellhelpers { - - // --------- Types --------- - - /** - * Simple hydrostatic correction for VFP table - * @param wells - wells struct - * @param w Well number - * @param vfp_table VFP table - * @param well_perforation_densities Densities at well perforations - * @param gravity Gravitational constant (e.g., 9.81...) - */ - inline - double computeHydrostaticCorrection(const Wells& wells, const int w, double vfp_ref_depth, - const double& rho, const double gravity) { - if ( wells.well_connpos[w] == wells.well_connpos[w+1] ) - { - // This is a well with no perforations. - // If this is the last well we would subscript over the - // bounds below. - // we assume well_perforation_densities to be 0 - return 0; - } - const double well_ref_depth = wells.depth_ref[w]; - const double dh = vfp_ref_depth - well_ref_depth; - const double dp = rho*gravity*dh; - - return dp; - } - inline double computeHydrostaticCorrection(const double well_ref_depth, const double vfp_ref_depth, const double rho, const double gravity) { @@ -73,41 +42,53 @@ namespace Opm { return dp; } - template - inline - Vector computeHydrostaticCorrection(const Wells& wells, const Vector vfp_ref_depth, - const Vector& well_perforation_densities, const double gravity) { - const int nw = wells.number_of_wells; - Vector retval = Vector::Zero(nw); -#if HAVE_OPENMP -#pragma omp parallel for schedule(static) -#endif // HAVE_OPENMP - for (int i=0; i + std::array + getCubeDim(const C2F& c2f, + FC begin_face_centroids, + int cell) + { + std::array< std::vector, dim > X; + { + const std::vector::size_type + nf = std::distance(c2f[cell].begin(), + c2f[cell].end ()); + + for (int d = 0; d < dim; ++d) { + X[d].reserve(nf); + } } - return retval; - } + typedef typename C2F::row_type::const_iterator FI; - inline - std::vector computeHydrostaticCorrection(const Wells& wells, const std::vector& vfp_ref_depth, - const std::vector& well_perforation_densities, const double gravity) { - const int nw = wells.number_of_wells; - std::vector retval(nw,0.0); + for (FI f = c2f[cell].begin(), e = c2f[cell].end(); f != e; ++f) { + using Opm::UgGridHelpers::increment; + using Opm::UgGridHelpers::getCoordinate; -#if HAVE_OPENMP -#pragma omp parallel for schedule(static) -#endif // HAVE_OPENMP - for (int i=0; i cube; + for (int d = 0; d < dim; ++d) { + typedef std::vector::iterator VI; + typedef std::pair PVI; + + const PVI m = std::minmax_element(X[d].begin(), X[d].end()); + + cube[d] = *m.second - *m.first; + } + + return cube; } + } // namespace wellhelpers } diff --git a/opm/simulators/wells/WellInterface.hpp b/opm/simulators/wells/WellInterface.hpp index 541d68c30..690c9828d 100644 --- a/opm/simulators/wells/WellInterface.hpp +++ b/opm/simulators/wells/WellInterface.hpp @@ -32,10 +32,7 @@ #include #include -#include -#include #include -#include #include #include @@ -146,9 +143,6 @@ namespace Opm /// Well cells. const std::vector& cells() const {return well_cells_; } - /// Well controls - WellControls* wellControls() const; - void setVFPProperties(const VFPProperties* vfp_properties_arg); void setGuideRate(const GuideRate* guide_rate_arg); @@ -397,8 +391,6 @@ namespace Opm double getTHPConstraint(const SummaryState& summaryState) const; - int getControlIndex(const WellControlType& type) const; - // Component fractions for each phase for the well const std::vector& compFrac() const; diff --git a/opm/simulators/wells/WellInterface_impl.hpp b/opm/simulators/wells/WellInterface_impl.hpp index cdb449b52..03f1cdaa2 100644 --- a/opm/simulators/wells/WellInterface_impl.hpp +++ b/opm/simulators/wells/WellInterface_impl.hpp @@ -1099,7 +1099,7 @@ namespace Opm { double radius = connection.rw(); const std::array cubical = - WellsManagerDetail::getCubeDim<3>(cell_to_faces, begin_face_centroids, cell); + wellhelpers::getCubeDim<3>(cell_to_faces, begin_face_centroids, cell); double re; // area equivalent radius of the grid block double perf_length; // the length of the well perforation diff --git a/opm/simulators/wells/WellState.hpp b/opm/simulators/wells/WellState.hpp index f963d910c..4f38e1785 100644 --- a/opm/simulators/wells/WellState.hpp +++ b/opm/simulators/wells/WellState.hpp @@ -21,8 +21,6 @@ #define OPM_WELLSTATE_HEADER_INCLUDED #include -#include -#include #include #include #include diff --git a/opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp b/opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp index 643c7b8ab..687e1e42b 100644 --- a/opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp +++ b/opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp @@ -21,8 +21,6 @@ #ifndef OPM_WELLSTATEFULLYIMPLICITBLACKOIL_HEADER_INCLUDED #define OPM_WELLSTATEFULLYIMPLICITBLACKOIL_HEADER_INCLUDED -#include -#include #include #include diff --git a/tests/test_vfpproperties.cpp b/tests/test_vfpproperties.cpp index cef488a37..4fa3bf74b 100644 --- a/tests/test_vfpproperties.cpp +++ b/tests/test_vfpproperties.cpp @@ -34,7 +34,6 @@ #include #include -#include #include #include #include diff --git a/tests/test_wellmodel.cpp b/tests/test_wellmodel.cpp index d1657ca77..d1463f9e2 100644 --- a/tests/test_wellmodel.cpp +++ b/tests/test_wellmodel.cpp @@ -37,8 +37,6 @@ #include #include -#include -#include #include #include diff --git a/tests/test_wellstatefullyimplicitblackoil.cpp b/tests/test_wellstatefullyimplicitblackoil.cpp index 72a440574..381326267 100644 --- a/tests/test_wellstatefullyimplicitblackoil.cpp +++ b/tests/test_wellstatefullyimplicitblackoil.cpp @@ -30,10 +30,10 @@ #include #include +#include + #include #include -#include -#include #include