From b08c165384af66e8aceeb1c85708d7cd3051ad7d Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Thu, 10 Nov 2022 20:23:25 +0100 Subject: [PATCH] rename StandardWellGeneric to StandardWellConnections --- CMakeLists_files.cmake | 4 +-- opm/simulators/wells/StandardWell.hpp | 1 - ...eneric.cpp => StandardWellConnections.cpp} | 26 ++++++++-------- ...eneric.hpp => StandardWellConnections.hpp} | 31 ++++++++++--------- opm/simulators/wells/StandardWellEval.cpp | 2 +- opm/simulators/wells/StandardWellEval.hpp | 4 +-- .../wells/StandardWellPrimaryVariables.cpp | 1 - 7 files changed, 34 insertions(+), 35 deletions(-) rename opm/simulators/wells/{StandardWellGeneric.cpp => StandardWellConnections.cpp} (77%) rename opm/simulators/wells/{StandardWellGeneric.hpp => StandardWellConnections.hpp} (73%) diff --git a/CMakeLists_files.cmake b/CMakeLists_files.cmake index f1094d944..35128eaf8 100644 --- a/CMakeLists_files.cmake +++ b/CMakeLists_files.cmake @@ -97,9 +97,9 @@ list (APPEND MAIN_SOURCE_FILES opm/simulators/wells/SegmentState.cpp opm/simulators/wells/SingleWellState.cpp opm/simulators/wells/StandardWellAssemble.cpp + opm/simulators/wells/StandardWellConnections.cpp opm/simulators/wells/StandardWellEquations.cpp opm/simulators/wells/StandardWellEval.cpp - opm/simulators/wells/StandardWellGeneric.cpp opm/simulators/wells/StandardWellPrimaryVariables.cpp opm/simulators/wells/TargetCalculator.cpp opm/simulators/wells/VFPHelpers.cpp @@ -384,9 +384,9 @@ list (APPEND PUBLIC_HEADER_FILES opm/simulators/wells/StandardWell.hpp opm/simulators/wells/StandardWell_impl.hpp opm/simulators/wells/StandardWellAssemble.hpp + opm/simulators/wells/StandardWellConnections.hpp opm/simulators/wells/StandardWellEquations.hpp opm/simulators/wells/StandardWellEval.hpp - opm/simulators/wells/StandardWellGeneric.hpp opm/simulators/wells/StandardWellPrimaryVariables.hpp opm/simulators/wells/TargetCalculator.hpp opm/simulators/wells/VFPHelpers.hpp diff --git a/opm/simulators/wells/StandardWell.hpp b/opm/simulators/wells/StandardWell.hpp index a97409adc..ff744f007 100644 --- a/opm/simulators/wells/StandardWell.hpp +++ b/opm/simulators/wells/StandardWell.hpp @@ -25,7 +25,6 @@ #include #include -#include #include #include #include diff --git a/opm/simulators/wells/StandardWellGeneric.cpp b/opm/simulators/wells/StandardWellConnections.cpp similarity index 77% rename from opm/simulators/wells/StandardWellGeneric.cpp rename to opm/simulators/wells/StandardWellConnections.cpp index b21def262..1cc5f0ac3 100644 --- a/opm/simulators/wells/StandardWellGeneric.cpp +++ b/opm/simulators/wells/StandardWellConnections.cpp @@ -20,7 +20,7 @@ */ #include -#include +#include #include #include @@ -29,17 +29,17 @@ namespace Opm { template -StandardWellGeneric:: -StandardWellGeneric(const WellInterfaceGeneric& baseif) - : baseif_(baseif) - , perf_densities_(baseif_.numPerfs()) - , perf_pressure_diffs_(baseif_.numPerfs()) +StandardWellConnections:: +StandardWellConnections(const WellInterfaceGeneric& well) + : perf_densities_(well_.numPerfs()) + , perf_pressure_diffs_(well_.numPerfs()) + , well_(well) { } template void -StandardWellGeneric:: +StandardWellConnections:: computeConnectionPressureDelta() { // Algorithm: @@ -56,13 +56,13 @@ computeConnectionPressureDelta() // perforation for each well, for which it will be the // difference to the reference (bhp) depth. - const int nperf = baseif_.numPerfs(); + const int nperf = well_.numPerfs(); perf_pressure_diffs_.resize(nperf, 0.0); - auto z_above = baseif_.parallelWellInfo().communicateAboveValues(baseif_.refDepth(), baseif_.perfDepth()); + auto z_above = well_.parallelWellInfo().communicateAboveValues(well_.refDepth(), well_.perfDepth()); for (int perf = 0; perf < nperf; ++perf) { - const double dz = baseif_.perfDepth()[perf] - z_above[perf]; - perf_pressure_diffs_[perf] = dz * perf_densities_[perf] * baseif_.gravity(); + const double dz = well_.perfDepth()[perf] - z_above[perf]; + perf_pressure_diffs_[perf] = dz * perf_densities_[perf] * well_.gravity(); } // 2. Compute pressure differences to the reference point (bhp) by @@ -71,9 +71,9 @@ computeConnectionPressureDelta() // This accumulation must be done per well. const auto beg = perf_pressure_diffs_.begin(); const auto end = perf_pressure_diffs_.end(); - baseif_.parallelWellInfo().partialSumPerfValues(beg, end); + well_.parallelWellInfo().partialSumPerfValues(beg, end); } -template class StandardWellGeneric; +template class StandardWellConnections; } diff --git a/opm/simulators/wells/StandardWellGeneric.hpp b/opm/simulators/wells/StandardWellConnections.hpp similarity index 73% rename from opm/simulators/wells/StandardWellGeneric.hpp rename to opm/simulators/wells/StandardWellConnections.hpp index 58f6509b3..0567706f9 100644 --- a/opm/simulators/wells/StandardWellGeneric.hpp +++ b/opm/simulators/wells/StandardWellConnections.hpp @@ -20,8 +20,8 @@ */ -#ifndef OPM_STANDARDWELL_GENERIC_HEADER_INCLUDED -#define OPM_STANDARDWELL_GENERIC_HEADER_INCLUDED +#ifndef OPM_STANDARDWELL_CONNECTIONS_HEADER_INCLUDED +#define OPM_STANDARDWELL_CONNECTIONS_HEADER_INCLUDED #include @@ -31,27 +31,28 @@ namespace Opm class WellInterfaceGeneric; template -class StandardWellGeneric +class StandardWellConnections { -protected: - StandardWellGeneric(const WellInterfaceGeneric& baseif); +public: + StandardWellConnections(const WellInterfaceGeneric& well); void computeConnectionPressureDelta(); - // Base interface reference - const WellInterfaceGeneric& baseif_; - - // densities of the fluid in each perforation - std::vector perf_densities_; - // pressure drop between different perforations - std::vector perf_pressure_diffs_; - - double getRho() const + Scalar getRho() const { return this->perf_densities_.empty() ? 0.0 : perf_densities_[0]; } + + // densities of the fluid in each perforation + std::vector perf_densities_; + // pressure drop between different perforations + std::vector perf_pressure_diffs_; + +private: + // Base interface reference + const WellInterfaceGeneric& well_; }; } -#endif // OPM_STANDARDWELL_GENERIC_HEADER_INCLUDED +#endif // OPM_STANDARDWELL_CONNECTIONS_HEADER_INCLUDED diff --git a/opm/simulators/wells/StandardWellEval.cpp b/opm/simulators/wells/StandardWellEval.cpp index a7e0734dc..bc594e127 100644 --- a/opm/simulators/wells/StandardWellEval.cpp +++ b/opm/simulators/wells/StandardWellEval.cpp @@ -49,7 +49,7 @@ namespace Opm template StandardWellEval:: StandardWellEval(const WellInterfaceIndices& baseif) - : StandardWellGeneric(baseif) + : StandardWellConnections(baseif) , baseif_(baseif) , primary_variables_(baseif_) , F0_(numWellConservationEq) diff --git a/opm/simulators/wells/StandardWellEval.hpp b/opm/simulators/wells/StandardWellEval.hpp index d9f78b6b6..8468b1a6b 100644 --- a/opm/simulators/wells/StandardWellEval.hpp +++ b/opm/simulators/wells/StandardWellEval.hpp @@ -23,8 +23,8 @@ #ifndef OPM_STANDARDWELL_EVAL_HEADER_INCLUDED #define OPM_STANDARDWELL_EVAL_HEADER_INCLUDED +#include #include -#include #include #include @@ -45,7 +45,7 @@ template class WellInterfaceIndi class WellState; template -class StandardWellEval : public StandardWellGeneric +class StandardWellEval : public StandardWellConnections { protected: using PrimaryVariables = StandardWellPrimaryVariables; diff --git a/opm/simulators/wells/StandardWellPrimaryVariables.cpp b/opm/simulators/wells/StandardWellPrimaryVariables.cpp index 0d2e65a0f..49d44e037 100644 --- a/opm/simulators/wells/StandardWellPrimaryVariables.cpp +++ b/opm/simulators/wells/StandardWellPrimaryVariables.cpp @@ -34,7 +34,6 @@ #include -#include #include #include