diff --git a/ebos/ebos.hh b/ebos/ebos.hh index 6a12b7038..c236a046d 100644 --- a/ebos/ebos.hh +++ b/ebos/ebos.hh @@ -52,7 +52,7 @@ struct EbosTypeTag { // Set the problem class template struct Problem { - using type = Opm::EbosProblem; + using type = EbosProblem; }; // Enable experimental features for ebos: ebos is the research simulator of the OPM @@ -66,7 +66,7 @@ struct EnableExperiments { // use flow's well model for now template struct EclWellModel { - using type = Opm::BlackoilWellModel; + using type = BlackoilWellModel; }; // currently, ebos uses the non-multisegment well model by default to avoid @@ -103,7 +103,7 @@ struct UseVolumetricResidual { // by default use flow's aquifer model for now template struct EclAquiferModel { - using type = Opm::BlackoilAquiferModel; + using type = BlackoilAquiferModel; }; // use flow's linear solver backend for now @@ -187,7 +187,7 @@ public: { ParentType::registerParameters(); - Opm::BlackoilModelParametersEbos::registerParameters(); + BlackoilModelParametersEbos::registerParameters(); EWOMS_REGISTER_PARAM(TypeTag, bool, EnableTerminalOutput, "Do *NOT* use!"); EWOMS_HIDE_PARAM(TypeTag, DbhpMaxRel); EWOMS_HIDE_PARAM(TypeTag, DwellFractionMax); diff --git a/ebos/ebos_blackoil.cc b/ebos/ebos_blackoil.cc index 7f4d7da83..3d84dde95 100644 --- a/ebos/ebos_blackoil.cc +++ b/ebos/ebos_blackoil.cc @@ -39,11 +39,11 @@ bool ebosBlackOilDeckFileNameIsSet(int argc, char** argv) // use the ewoms parameter machinery and the blackoil vanguard to handle the grunt of // the work Parameters::reset(); - Opm::setupParameters_(argc, - const_cast(argv), - /*doRegistration=*/true, - /*allowUnused=*/true, - /*handleHelp=*/false); + setupParameters_(argc, + const_cast(argv), + /*doRegistration=*/true, + /*allowUnused=*/true, + /*handleHelp=*/false); bool result = EWOMS_PARAM_IS_SET(ProblemTypeTag, std::string, EclDeckFileName); Parameters::reset(); @@ -58,11 +58,11 @@ std::string ebosBlackOilGetDeckFileName(int argc, char** argv) // use the ewoms parameter machinery and the blackoil vanguard to handle the grunt of // the work Parameters::reset(); - Opm::setupParameters_(argc, - const_cast(argv), - /*doRegistration=*/true, - /*allowUnused=*/true, - /*handleHelp=*/false); + setupParameters_(argc, + const_cast(argv), + /*doRegistration=*/true, + /*allowUnused=*/true, + /*handleHelp=*/false); std::string rawDeckFileName = EWOMS_GET_PARAM(ProblemTypeTag, std::string, EclDeckFileName); std::string result = Vanguard::canonicalDeckPath(rawDeckFileName).string(); Parameters::reset(); @@ -70,7 +70,7 @@ std::string ebosBlackOilGetDeckFileName(int argc, char** argv) return result; } -std::unique_ptr ebosBlackOilCreateParseContext(int argc, char** argv) +std::unique_ptr ebosBlackOilCreateParseContext(int argc, char** argv) { using ProblemTypeTag = Properties::TTag::EbosTypeTag; using Vanguard = GetPropType; @@ -78,20 +78,20 @@ std::unique_ptr ebosBlackOilCreateParseContext(int argc, char // use the ewoms parameter machinery and the blackoil vanguard to handle the grunt of // the work Parameters::reset(); - Opm::setupParameters_(argc, - const_cast(argv), - /*doRegistration=*/true, - /*allowUnused=*/true, - /*handleHelp=*/false); - std::unique_ptr result = Vanguard::createParseContext(); + setupParameters_(argc, + const_cast(argv), + /*doRegistration=*/true, + /*allowUnused=*/true, + /*handleHelp=*/false); + std::unique_ptr result = Vanguard::createParseContext(); Parameters::reset(); return result; } -void ebosBlackOilSetDeck(std::unique_ptr deck, - std::unique_ptr parseContext, - std::unique_ptr errorGuard, +void ebosBlackOilSetDeck(std::unique_ptr deck, + std::unique_ptr parseContext, + std::unique_ptr errorGuard, double externalSetupTime) { using ProblemTypeTag = Properties::TTag::EbosTypeTag; @@ -106,7 +106,7 @@ void ebosBlackOilSetDeck(std::unique_ptr deck, int ebosBlackOilMain(int argc, char **argv) { using ProblemTypeTag = Properties::TTag::EbosTypeTag; - return Opm::startEbos(argc, argv); + return startEbos(argc, argv); } } diff --git a/ebos/ebos_brine.cc b/ebos/ebos_brine.cc index dee1a1672..8e823e61d 100644 --- a/ebos/ebos_brine.cc +++ b/ebos/ebos_brine.cc @@ -48,9 +48,9 @@ struct EnableBrine { namespace Opm { -void ebosBrineSetDeck(std::unique_ptr deck, - std::unique_ptr parseContext, - std::unique_ptr errorGuard, +void ebosBrineSetDeck(std::unique_ptr deck, + std::unique_ptr parseContext, + std::unique_ptr errorGuard, double externalSetupTime) { using ProblemTypeTag = Properties::TTag::EbosBrineTypeTag; @@ -65,7 +65,7 @@ void ebosBrineSetDeck(std::unique_ptr deck, int ebosBrineMain(int argc, char **argv) { using ProblemTypeTag = Properties::TTag::EbosBrineTypeTag; - return Opm::startEbos(argc, argv); + return startEbos(argc, argv); } } diff --git a/ebos/ebos_energy.cc b/ebos/ebos_energy.cc index 7ab5cf63b..4d8d61ba5 100644 --- a/ebos/ebos_energy.cc +++ b/ebos/ebos_energy.cc @@ -48,9 +48,9 @@ struct EnableEnergy { namespace Opm { -void ebosEnergySetDeck(std::unique_ptr deck, - std::unique_ptr parseContext, - std::unique_ptr errorGuard, +void ebosEnergySetDeck(std::unique_ptr deck, + std::unique_ptr parseContext, + std::unique_ptr errorGuard, double externalSetupTime) { using ProblemTypeTag = Properties::TTag::EbosEnergyTypeTag; @@ -65,7 +65,7 @@ void ebosEnergySetDeck(std::unique_ptr deck, int ebosEnergyMain(int argc, char **argv) { using ProblemTypeTag = Properties::TTag::EbosEnergyTypeTag; - return Opm::startEbos(argc, argv); + return startEbos(argc, argv); } } diff --git a/ebos/ebos_extbo.cc b/ebos/ebos_extbo.cc index 61391841e..9c8d3b6e6 100644 --- a/ebos/ebos_extbo.cc +++ b/ebos/ebos_extbo.cc @@ -48,9 +48,9 @@ struct EnableExtbo { namespace Opm { -void ebosExtboSetDeck(std::unique_ptr deck, - std::unique_ptr parseContext, - std::unique_ptr errorGuard, +void ebosExtboSetDeck(std::unique_ptr deck, + std::unique_ptr parseContext, + std::unique_ptr errorGuard, double externalSetupTime) { using ProblemTypeTag = Properties::TTag::EbosExtboTypeTag; @@ -65,7 +65,7 @@ void ebosExtboSetDeck(std::unique_ptr deck, int ebosExtboMain(int argc, char **argv) { using ProblemTypeTag = Properties::TTag::EbosExtboTypeTag; - return Opm::startEbos(argc, argv); + return startEbos(argc, argv); } } diff --git a/ebos/ebos_foam.cc b/ebos/ebos_foam.cc index c6af9da0b..e34583fb2 100644 --- a/ebos/ebos_foam.cc +++ b/ebos/ebos_foam.cc @@ -48,9 +48,9 @@ struct EnableFoam { namespace Opm { -void ebosFoamSetDeck(std::unique_ptr deck, - std::unique_ptr parseContext, - std::unique_ptr errorGuard, +void ebosFoamSetDeck(std::unique_ptr deck, + std::unique_ptr parseContext, + std::unique_ptr errorGuard, double externalSetupTime) { using ProblemTypeTag = Properties::TTag::EbosFoamTypeTag; @@ -65,7 +65,7 @@ void ebosFoamSetDeck(std::unique_ptr deck, int ebosFoamMain(int argc, char **argv) { using ProblemTypeTag = Properties::TTag::EbosFoamTypeTag; - return Opm::startEbos(argc, argv); + return startEbos(argc, argv); } } diff --git a/ebos/ebos_gasoil.cc b/ebos/ebos_gasoil.cc index abe3d842d..ff8901e22 100644 --- a/ebos/ebos_gasoil.cc +++ b/ebos/ebos_gasoil.cc @@ -63,9 +63,9 @@ public: namespace Opm { -void ebosGasOilSetDeck(std::unique_ptr deck, - std::unique_ptr parseContext, - std::unique_ptr errorGuard, +void ebosGasOilSetDeck(std::unique_ptr deck, + std::unique_ptr parseContext, + std::unique_ptr errorGuard, double externalSetupTime) { using ProblemTypeTag = Properties::TTag::EbosGasOilTypeTag; @@ -80,7 +80,7 @@ void ebosGasOilSetDeck(std::unique_ptr deck, int ebosGasOilMain(int argc, char **argv) { using ProblemTypeTag = Properties::TTag::EbosGasOilTypeTag; - return Opm::startEbos(argc, argv); + return startEbos(argc, argv); } } diff --git a/ebos/ebos_gaswater.cc b/ebos/ebos_gaswater.cc index aa6730c2e..c54c9fc65 100644 --- a/ebos/ebos_gaswater.cc +++ b/ebos/ebos_gaswater.cc @@ -53,23 +53,23 @@ private: using FluidSystem = GetPropType; public: - typedef Opm::BlackOilTwoPhaseIndices(), - getPropValue(), - getPropValue(), - getPropValue(), - getPropValue(), - getPropValue(), - /*PVOffset=*/0, - /*disabledCompIdx=*/FluidSystem::oilCompIdx> type; + typedef BlackOilTwoPhaseIndices(), + getPropValue(), + getPropValue(), + getPropValue(), + getPropValue(), + getPropValue(), + /*PVOffset=*/0, + /*disabledCompIdx=*/FluidSystem::oilCompIdx> type; }; } // namespace Opm::Properties namespace Opm { -void ebosGasWaterSetDeck(std::unique_ptr deck, - std::unique_ptr parseContext, - std::unique_ptr errorGuard, +void ebosGasWaterSetDeck(std::unique_ptr deck, + std::unique_ptr parseContext, + std::unique_ptr errorGuard, double externalSetupTime) { using ProblemTypeTag = Properties::TTag::EbosGasWaterTypeTag; @@ -84,7 +84,7 @@ void ebosGasWaterSetDeck(std::unique_ptr deck, int ebosGasWaterMain(int argc, char **argv) { using ProblemTypeTag = Properties::TTag::EbosGasWaterTypeTag; - return Opm::startEbos(argc, argv); + return startEbos(argc, argv); } } diff --git a/ebos/ebos_oilwater.cc b/ebos/ebos_oilwater.cc index 95816bccd..fdb636f61 100644 --- a/ebos/ebos_oilwater.cc +++ b/ebos/ebos_oilwater.cc @@ -49,23 +49,23 @@ private: using FluidSystem = GetPropType; public: - typedef Opm::BlackOilTwoPhaseIndices(), - getPropValue(), - getPropValue(), - getPropValue(), - getPropValue(), - getPropValue(), - /*PVOffset=*/0, - /*disabledCompIdx=*/FluidSystem::gasCompIdx> type; + typedef BlackOilTwoPhaseIndices(), + getPropValue(), + getPropValue(), + getPropValue(), + getPropValue(), + getPropValue(), + /*PVOffset=*/0, + /*disabledCompIdx=*/FluidSystem::gasCompIdx> type; }; } // namespace Opm::Properties namespace Opm { -void ebosOilWaterSetDeck(std::unique_ptr deck, - std::unique_ptr parseContext, - std::unique_ptr errorGuard, +void ebosOilWaterSetDeck(std::unique_ptr deck, + std::unique_ptr parseContext, + std::unique_ptr errorGuard, double externalSetupTime) { using ProblemTypeTag = Properties::TTag::EbosOilWaterTypeTag; @@ -80,7 +80,7 @@ void ebosOilWaterSetDeck(std::unique_ptr deck, int ebosOilWaterMain(int argc, char **argv) { using ProblemTypeTag = Properties::TTag::EbosOilWaterTypeTag; - return Opm::startEbos(argc, argv); + return startEbos(argc, argv); } } diff --git a/ebos/ebos_oilwater_polymer.cc b/ebos/ebos_oilwater_polymer.cc index 4e4eebe11..655eea51b 100644 --- a/ebos/ebos_oilwater_polymer.cc +++ b/ebos/ebos_oilwater_polymer.cc @@ -54,23 +54,23 @@ private: using FluidSystem = GetPropType; public: - typedef Opm::BlackOilTwoPhaseIndices(), - getPropValue(), - getPropValue(), - getPropValue(), - getPropValue(), - getPropValue(), - /*PVOffset=*/0, - /*disabledCompIdx=*/FluidSystem::gasCompIdx> type; + typedef BlackOilTwoPhaseIndices(), + getPropValue(), + getPropValue(), + getPropValue(), + getPropValue(), + getPropValue(), + /*PVOffset=*/0, + /*disabledCompIdx=*/FluidSystem::gasCompIdx> type; }; } // namespace Opm::Properties namespace Opm { -void ebosOilWaterPolymerSetDeck(std::unique_ptr deck, - std::unique_ptr parseContext, - std::unique_ptr errorGuard, +void ebosOilWaterPolymerSetDeck(std::unique_ptr deck, + std::unique_ptr parseContext, + std::unique_ptr errorGuard, double externalSetupTime) { using ProblemTypeTag = Properties::TTag::EbosOilWaterPolymerTypeTag; @@ -85,7 +85,7 @@ void ebosOilWaterPolymerSetDeck(std::unique_ptr deck, int ebosOilWaterPolymerMain(int argc, char **argv) { using ProblemTypeTag = Properties::TTag::EbosOilWaterPolymerTypeTag; - return Opm::startEbos(argc, argv); + return startEbos(argc, argv); } } diff --git a/ebos/ebos_polymer.cc b/ebos/ebos_polymer.cc index 11d02f23a..f2b6c0956 100644 --- a/ebos/ebos_polymer.cc +++ b/ebos/ebos_polymer.cc @@ -48,9 +48,9 @@ struct EnablePolymer { namespace Opm { -void ebosPolymerSetDeck(std::unique_ptr deck, - std::unique_ptr parseContext, - std::unique_ptr errorGuard, +void ebosPolymerSetDeck(std::unique_ptr deck, + std::unique_ptr parseContext, + std::unique_ptr errorGuard, double externalSetupTime) { using ProblemTypeTag = Properties::TTag::EbosPolymerTypeTag; @@ -65,7 +65,7 @@ void ebosPolymerSetDeck(std::unique_ptr deck, int ebosPolymerMain(int argc, char **argv) { using ProblemTypeTag = Properties::TTag::EbosPolymerTypeTag; - return Opm::startEbos(argc, argv); + return startEbos(argc, argv); } } diff --git a/ebos/eclbaseaquifermodel.hh b/ebos/eclbaseaquifermodel.hh index 3e8aeba67..248387597 100644 --- a/ebos/eclbaseaquifermodel.hh +++ b/ebos/eclbaseaquifermodel.hh @@ -150,8 +150,8 @@ public: { } - Opm::data::Aquifers aquiferData() const - { return Opm::data::Aquifers{}; } + data::Aquifers aquiferData() const + { return data::Aquifers{}; } protected: diff --git a/ebos/eclbasevanguard.hh b/ebos/eclbasevanguard.hh index 0f225e502..f91407a70 100644 --- a/ebos/eclbasevanguard.hh +++ b/ebos/eclbasevanguard.hh @@ -252,20 +252,20 @@ public: * The input can either be the canonical deck file name or the name of the case * (i.e., without the .DATA extension) */ - static Opm::filesystem::path canonicalDeckPath(const std::string& caseName) + static filesystem::path canonicalDeckPath(const std::string& caseName) { - const auto fileExists = [](const Opm::filesystem::path& f) -> bool + const auto fileExists = [](const filesystem::path& f) -> bool { - if (!Opm::filesystem::exists(f)) + if (!filesystem::exists(f)) return false; - if (Opm::filesystem::is_regular_file(f)) + if (filesystem::is_regular_file(f)) return true; - return Opm::filesystem::is_symlink(f) && Opm::filesystem::is_regular_file(Opm::filesystem::read_symlink(f)); + return filesystem::is_symlink(f) && filesystem::is_regular_file(filesystem::read_symlink(f)); }; - auto simcase = Opm::filesystem::path(caseName); + auto simcase = filesystem::path(caseName); if (fileExists(simcase)) return simcase; @@ -280,18 +280,18 @@ public: /*! * \brief Creates an Opm::parseContext object assuming that the parameters are ready. */ - static std::unique_ptr createParseContext() + static std::unique_ptr createParseContext() { - typedef std::pair ParseModePair; + typedef std::pair ParseModePair; typedef std::vector ParseModePairs; ParseModePairs tmp; - tmp.emplace_back(Opm::ParseContext::PARSE_RANDOM_SLASH, Opm::InputError::IGNORE); - tmp.emplace_back(Opm::ParseContext::PARSE_MISSING_DIMS_KEYWORD, Opm::InputError::WARN); - tmp.emplace_back(Opm::ParseContext::SUMMARY_UNKNOWN_WELL, Opm::InputError::WARN); - tmp.emplace_back(Opm::ParseContext::SUMMARY_UNKNOWN_GROUP, Opm::InputError::WARN); - tmp.emplace_back(Opm::ParseContext::PARSE_EXTRA_RECORDS, Opm::InputError::WARN); + tmp.emplace_back(ParseContext::PARSE_RANDOM_SLASH, InputError::IGNORE); + tmp.emplace_back(ParseContext::PARSE_MISSING_DIMS_KEYWORD, InputError::WARN); + tmp.emplace_back(ParseContext::SUMMARY_UNKNOWN_WELL, InputError::WARN); + tmp.emplace_back(ParseContext::SUMMARY_UNKNOWN_GROUP, InputError::WARN); + tmp.emplace_back(ParseContext::PARSE_EXTRA_RECORDS, InputError::WARN); - auto parseContext = std::make_unique(tmp); + auto parseContext = std::make_unique(tmp); const std::string ignoredKeywords = EWOMS_GET_PARAM(TypeTag, std::string, IgnoreKeywords); if (ignoredKeywords.size() > 0) { @@ -309,7 +309,7 @@ public: } if (EWOMS_GET_PARAM(TypeTag, bool, EclStrictParsing)) - parseContext->update(Opm::InputError::DELAYED_EXIT1); + parseContext->update(InputError::DELAYED_EXIT1); return parseContext; } @@ -331,13 +331,13 @@ public: /*! * \brief Set the Opm::ParseContext object which ought to be used for parsing the deck and creating the Opm::EclipseState object. */ - static void setExternalParseContext(std::unique_ptr parseContext) + static void setExternalParseContext(std::unique_ptr parseContext) { externalParseContext_ = std::move(parseContext); } /*! * \brief Set the Opm::ErrorGuard object which ought to be used for parsing the deck and creating the Opm::EclipseState object. */ - static void setExternalErrorGuard(std::unique_ptr errorGuard) + static void setExternalErrorGuard(std::unique_ptr errorGuard) { externalErrorGuard_ = std::move(errorGuard); } /*! @@ -350,13 +350,13 @@ public: * management of these two objects, i.e., they are not allowed to be deleted as long * as the simulator vanguard object is alive. */ - static void setExternalDeck(std::unique_ptr deck) + static void setExternalDeck(std::unique_ptr deck) { externalDeck_ = std::move(deck); externalDeckSet_ = true; } /*! * \brief Set the Opm::EclipseState object which ought to be used when the simulator * vanguard is instantiated. */ - static void setExternalEclState(std::unique_ptr eclState) + static void setExternalEclState(std::unique_ptr eclState) { externalEclState_ = std::move(eclState); } /*! @@ -455,9 +455,9 @@ public: std::move(parseContext_), /* initFromRestart = */ false, /* checkDeck = */ enableExperiments, outputInterval); - this->summaryState_ = std::make_unique( Opm::TimeService::from_time_t(this->eclSchedule_->getStartTime() )); - this->udqState_ = std::make_unique( this->eclSchedule_->getUDQConfig(0).params().undefinedValue() ); - this->actionState_ = std::make_unique() ; + this->summaryState_ = std::make_unique( TimeService::from_time_t(this->eclSchedule_->getStartTime() )); + this->udqState_ = std::make_unique( this->eclSchedule_->getUDQConfig(0).params().undefinedValue() ); + this->actionState_ = std::make_unique() ; // Initialize parallelWells with all local wells const auto& schedule_wells = schedule().getWellsatEnd(); @@ -512,28 +512,28 @@ public: /*! * \brief Return a reference to the parsed ECL deck. */ - const Opm::Deck& deck() const + const Deck& deck() const { return *deck_; } - Opm::Deck& deck() + Deck& deck() { return *deck_; } /*! * \brief Return a reference to the internalized ECL deck. */ - const Opm::EclipseState& eclState() const + const EclipseState& eclState() const { return *eclState_; } - Opm::EclipseState& eclState() + EclipseState& eclState() { return *eclState_; } /*! * \brief Return a reference to the object that managages the ECL schedule. */ - const Opm::Schedule& schedule() const + const Schedule& schedule() const { return *eclSchedule_; } - Opm::Schedule& schedule() + Schedule& schedule() { return *eclSchedule_; } /*! @@ -542,14 +542,14 @@ public: * The lifetime of this object is not managed by the vanguard, i.e., the object must * stay valid until after the vanguard gets destroyed. */ - static void setExternalSchedule(std::unique_ptr schedule) + static void setExternalSchedule(std::unique_ptr schedule) { externalEclSchedule_ = std::move(schedule); } /*! * \brief Return a reference to the object that determines which quantities ought to * be put into the ECL summary output. */ - const Opm::SummaryConfig& summaryConfig() const + const SummaryConfig& summaryConfig() const { return *eclSummaryConfig_; } /*! @@ -558,7 +558,7 @@ public: * The lifetime of this object is not managed by the vanguard, i.e., the object must * stay valid until after the vanguard gets destroyed. */ - static void setExternalSummaryConfig(std::unique_ptr summaryConfig) + static void setExternalSummaryConfig(std::unique_ptr summaryConfig) { externalEclSummaryConfig_ = std::move(summaryConfig); } @@ -569,10 +569,10 @@ public: * computed, ready to use summary values. The values will typically be used by * the UDQ, WTEST and ACTIONX calculations. */ - Opm::SummaryState& summaryState() + SummaryState& summaryState() { return *summaryState_; } - const Opm::SummaryState& summaryState() const + const SummaryState& summaryState() const { return *summaryState_; } @@ -581,10 +581,10 @@ public: * * The ActionState keeps track of how many times the various actions have run. */ - Opm::Action::State& actionState() + Action::State& actionState() { return *actionState_; } - const Opm::Action::State& actionState() const + const Action::State& actionState() const { return *actionState_; } /*! @@ -592,10 +592,10 @@ public: * * The UDQState keeps track of the result of UDQ evaluations. */ - Opm::UDQState& udqState() + UDQState& udqState() { return *udqState_; } - const Opm::UDQState& udqState() const + const UDQState& udqState() const { return *udqState_; } /*! @@ -829,7 +829,7 @@ protected: const auto& schEndIt = this->schedule().end(); for(; schIt != schEndIt; ++schIt) { const auto& oilVaporizationControl = schIt->oilvap(); - if(oilVaporizationControl.getType() == Opm::OilVaporizationProperties::OilVaporization::DRSDTCON) { + if(oilVaporizationControl.getType() == OilVaporizationProperties::OilVaporization::DRSDTCON) { drsdtcon = true; break; } @@ -868,9 +868,9 @@ private: outputDir = ioConfig.getOutputDir(); // ensure that the output directory exists and that it is a directory - if (!Opm::filesystem::is_directory(outputDir)) { + if (!filesystem::is_directory(outputDir)) { try { - Opm::filesystem::create_directories(outputDir); + filesystem::create_directories(outputDir); } catch (...) { throw std::runtime_error("Creation of output directory '"+outputDir+"' failed\n"); @@ -910,27 +910,27 @@ private: static Scalar externalSetupTime_; - static std::unique_ptr externalParseContext_; - static std::unique_ptr externalErrorGuard_; - static std::unique_ptr externalDeck_; + static std::unique_ptr externalParseContext_; + static std::unique_ptr externalErrorGuard_; + static std::unique_ptr externalDeck_; static bool externalDeckSet_; - static std::unique_ptr externalEclState_; - static std::unique_ptr externalEclSchedule_; - static std::unique_ptr externalEclSummaryConfig_; + static std::unique_ptr externalEclState_; + static std::unique_ptr externalEclSchedule_; + static std::unique_ptr externalEclSummaryConfig_; - std::unique_ptr summaryState_; - std::unique_ptr actionState_; - std::unique_ptr udqState_; + std::unique_ptr summaryState_; + std::unique_ptr actionState_; + std::unique_ptr udqState_; // these attributes point either to the internal or to the external version of the // parser objects. - std::unique_ptr parseContext_; - std::unique_ptr errorGuard_; - std::unique_ptr deck_; - std::unique_ptr eclState_; - std::unique_ptr eclSchedule_; - std::unique_ptr eclSummaryConfig_; - std::shared_ptr python = std::make_shared(); + std::unique_ptr parseContext_; + std::unique_ptr errorGuard_; + std::unique_ptr deck_; + std::unique_ptr eclState_; + std::unique_ptr eclSchedule_; + std::unique_ptr eclSummaryConfig_; + std::shared_ptr python = std::make_shared(); Dune::EdgeWeightMethod edgeWeightsMethod_; bool ownersFirst_; @@ -971,25 +971,25 @@ template typename EclBaseVanguard::Scalar EclBaseVanguard::externalSetupTime_ = 0.0; template -std::unique_ptr EclBaseVanguard::externalParseContext_ = nullptr; +std::unique_ptr EclBaseVanguard::externalParseContext_ = nullptr; template -std::unique_ptr EclBaseVanguard::externalErrorGuard_ = nullptr; +std::unique_ptr EclBaseVanguard::externalErrorGuard_ = nullptr; template -std::unique_ptr EclBaseVanguard::externalDeck_ = nullptr; +std::unique_ptr EclBaseVanguard::externalDeck_ = nullptr; template bool EclBaseVanguard::externalDeckSet_ = false; template -std::unique_ptr EclBaseVanguard::externalEclState_; +std::unique_ptr EclBaseVanguard::externalEclState_; template -std::unique_ptr EclBaseVanguard::externalEclSchedule_ = nullptr; +std::unique_ptr EclBaseVanguard::externalEclSchedule_ = nullptr; template -std::unique_ptr EclBaseVanguard::externalEclSummaryConfig_ = nullptr; +std::unique_ptr EclBaseVanguard::externalEclSummaryConfig_ = nullptr; } // namespace Opm diff --git a/ebos/eclfluxmodule.hh b/ebos/eclfluxmodule.hh index be82fda7e..379223550 100644 --- a/ebos/eclfluxmodule.hh +++ b/ebos/eclfluxmodule.hh @@ -114,7 +114,7 @@ class EclTransExtensiveQuantities enum { enableExtbo = getPropValue() }; enum { enableEnergy = getPropValue() }; - typedef Opm::MathToolbox Toolbox; + typedef MathToolbox Toolbox; typedef Dune::FieldVector DimVector; typedef Dune::FieldVector EvalDimVector; typedef Dune::FieldMatrix DimMatrix; @@ -211,7 +211,7 @@ protected: */ void calculateGradients_(const ElementContext& elemCtx, unsigned scvfIdx, unsigned timeIdx) { - Opm::Valgrind::SetUndefined(*this); + Valgrind::SetUndefined(*this); const auto& problem = elemCtx.problem(); const auto& stencil = elemCtx.stencil(timeIdx); diff --git a/ebos/eclnewtonmethod.hh b/ebos/eclnewtonmethod.hh index 31607c820..f900ea8be 100644 --- a/ebos/eclnewtonmethod.hh +++ b/ebos/eclnewtonmethod.hh @@ -195,7 +195,7 @@ public: tmpError2 *= dofVolume; } - this->error_ = Opm::max(std::abs(tmpError), this->error_); + this->error_ = max(std::abs(tmpError), this->error_); if (std::abs(tmpError) > this->tolerance_) cnvViolated = true; @@ -232,14 +232,14 @@ public: // make sure that the error never grows beyond the maximum // allowed one if (this->error_ > newtonMaxError) - throw Opm::NumericalIssue("Newton: Error "+std::to_string(double(this->error_)) + throw NumericalIssue("Newton: Error "+std::to_string(double(this->error_)) +" is larger than maximum allowed error of " +std::to_string(double(newtonMaxError))); // make sure that the error never grows beyond the maximum // allowed one if (errorSum_ > newtonMaxError) - throw Opm::NumericalIssue("Newton: Sum of the error "+std::to_string(double(errorSum_)) + throw NumericalIssue("Newton: Sum of the error "+std::to_string(double(errorSum_)) +" is larger than maximum allowed error of " +std::to_string(double(newtonMaxError))); } diff --git a/ebos/ecloutputblackoilmodule.hh b/ebos/ecloutputblackoilmodule.hh index 73d7c3dc8..3ef5c4e39 100644 --- a/ebos/ecloutputblackoilmodule.hh +++ b/ebos/ecloutputblackoilmodule.hh @@ -198,7 +198,7 @@ public: EclOutputBlackOilModule(const Simulator& simulator, const std::vector& wbp_index_list, const CollectDataToIORankType& collectToIORank) : simulator_(simulator) { - const Opm::SummaryConfig summaryConfig = simulator_.vanguard().summaryConfig(); + const SummaryConfig summaryConfig = simulator_.vanguard().summaryConfig(); const auto& fp = simulator_.vanguard().eclState().fieldProps(); this->regions_["FIPNUM"] = fp.get_int("FIPNUM"); @@ -211,7 +211,7 @@ public: this->RPRNodes_ = summaryConfig.keywords("RPR*"); this->RPRPNodes_ = summaryConfig.keywords("RPRP*"); - for (const auto& phase : Opm::Inplace::phases()) { + for (const auto& phase : Inplace::phases()) { std::string key_pattern = "R" + EclString(phase) + "*"; this->regionNodes_[phase] = summaryConfig.keywords(key_pattern); } @@ -248,11 +248,11 @@ public: */ void allocBuffers(unsigned bufferSize, unsigned reportStepNum, const bool substep, const bool log, const bool isRestart) { - if (!std::is_same >::value) + if (!std::is_same >::value) return; // Summary output is for all steps - const Opm::SummaryConfig summaryConfig = simulator_.vanguard().summaryConfig(); + const SummaryConfig summaryConfig = simulator_.vanguard().summaryConfig(); const auto& schedule = simulator_.vanguard().schedule(); // Only output RESTART_AUXILIARY asked for by the user. @@ -270,7 +270,7 @@ public: computeFip_ = false; // Fluid in place - for (const auto& phase : Opm::Inplace::phases()) { + for (const auto& phase : Inplace::phases()) { if (!substep || summaryConfig.require3DField(EclString(phase))) { if (rstKeywords["FIP"] > 0) { rstKeywords["FIP"] = 0; @@ -284,7 +284,7 @@ public: } if (!substep || summaryConfig.hasKeyword("FPR") || summaryConfig.hasKeyword("FPRP") || !this->RPRNodes_.empty()) { - fip_[Opm::Inplace::Phase::PoreVolume].resize(bufferSize, 0.0); + fip_[Inplace::Phase::PoreVolume].resize(bufferSize, 0.0); hydrocarbonPoreVolume_.resize(bufferSize, 0.0); pressureTimesPoreVolume_.resize(bufferSize, 0.0); pressureTimesHydrocarbonVolume_.resize(bufferSize, 0.0); @@ -493,7 +493,7 @@ public: std::string logstring = "Keyword '"; logstring.append(keyValue.first); logstring.append("' is unhandled for output to file."); - Opm::OpmLog::warning("Unhandled output keyword", logstring); + OpmLog::warning("Unhandled output keyword", logstring); } } } @@ -515,7 +515,7 @@ public: */ void processElement(const ElementContext& elemCtx) { - if (!std::is_same >::value) + if (!std::is_same >::value) return; const auto& problem = elemCtx.simulator().problem(); @@ -531,85 +531,85 @@ public: if (saturation_[phaseIdx].size() == 0) continue; - saturation_[phaseIdx][globalDofIdx] = Opm::getValue(fs.saturation(phaseIdx)); - Opm::Valgrind::CheckDefined(saturation_[phaseIdx][globalDofIdx]); + saturation_[phaseIdx][globalDofIdx] = getValue(fs.saturation(phaseIdx)); + Valgrind::CheckDefined(saturation_[phaseIdx][globalDofIdx]); } if (oilPressure_.size() > 0) { if (FluidSystem::phaseIsActive(oilPhaseIdx)) { - oilPressure_[globalDofIdx] = Opm::getValue(fs.pressure(oilPhaseIdx)); + oilPressure_[globalDofIdx] = getValue(fs.pressure(oilPhaseIdx)); }else{ // put pressure in oil pressure for output if (FluidSystem::phaseIsActive(waterPhaseIdx)) { - oilPressure_[globalDofIdx] = Opm::getValue(fs.pressure(waterPhaseIdx)); + oilPressure_[globalDofIdx] = getValue(fs.pressure(waterPhaseIdx)); } else { - oilPressure_[globalDofIdx] = Opm::getValue(fs.pressure(gasPhaseIdx)); + oilPressure_[globalDofIdx] = getValue(fs.pressure(gasPhaseIdx)); } } - Opm::Valgrind::CheckDefined(oilPressure_[globalDofIdx]); + Valgrind::CheckDefined(oilPressure_[globalDofIdx]); } if (temperature_.size() > 0) { - temperature_[globalDofIdx] = Opm::getValue(fs.temperature(oilPhaseIdx)); - Opm::Valgrind::CheckDefined(temperature_[globalDofIdx]); + temperature_[globalDofIdx] = getValue(fs.temperature(oilPhaseIdx)); + Valgrind::CheckDefined(temperature_[globalDofIdx]); } if (gasDissolutionFactor_.size() > 0) { Scalar SoMax = elemCtx.problem().maxOilSaturation(globalDofIdx); gasDissolutionFactor_[globalDofIdx] = FluidSystem::template saturatedDissolutionFactor(fs, oilPhaseIdx, pvtRegionIdx, SoMax); - Opm::Valgrind::CheckDefined(gasDissolutionFactor_[globalDofIdx]); + Valgrind::CheckDefined(gasDissolutionFactor_[globalDofIdx]); } if (oilVaporizationFactor_.size() > 0) { Scalar SoMax = elemCtx.problem().maxOilSaturation(globalDofIdx); oilVaporizationFactor_[globalDofIdx] = FluidSystem::template saturatedDissolutionFactor(fs, gasPhaseIdx, pvtRegionIdx, SoMax); - Opm::Valgrind::CheckDefined(oilVaporizationFactor_[globalDofIdx]); + Valgrind::CheckDefined(oilVaporizationFactor_[globalDofIdx]); } if (gasFormationVolumeFactor_.size() > 0) { gasFormationVolumeFactor_[globalDofIdx] = 1.0/FluidSystem::template inverseFormationVolumeFactor(fs, gasPhaseIdx, pvtRegionIdx); - Opm::Valgrind::CheckDefined(gasFormationVolumeFactor_[globalDofIdx]); + Valgrind::CheckDefined(gasFormationVolumeFactor_[globalDofIdx]); } if (saturatedOilFormationVolumeFactor_.size() > 0) { saturatedOilFormationVolumeFactor_[globalDofIdx] = 1.0/FluidSystem::template saturatedInverseFormationVolumeFactor(fs, oilPhaseIdx, pvtRegionIdx); - Opm::Valgrind::CheckDefined(saturatedOilFormationVolumeFactor_[globalDofIdx]); + Valgrind::CheckDefined(saturatedOilFormationVolumeFactor_[globalDofIdx]); } if (oilSaturationPressure_.size() > 0) { oilSaturationPressure_[globalDofIdx] = FluidSystem::template saturationPressure(fs, oilPhaseIdx, pvtRegionIdx); - Opm::Valgrind::CheckDefined(oilSaturationPressure_[globalDofIdx]); + Valgrind::CheckDefined(oilSaturationPressure_[globalDofIdx]); } if (rs_.size()) { - rs_[globalDofIdx] = Opm::getValue(fs.Rs()); - Opm::Valgrind::CheckDefined(rs_[globalDofIdx]); + rs_[globalDofIdx] = getValue(fs.Rs()); + Valgrind::CheckDefined(rs_[globalDofIdx]); } if (rv_.size()) { - rv_[globalDofIdx] = Opm::getValue(fs.Rv()); - Opm::Valgrind::CheckDefined(rv_[globalDofIdx]); + rv_[globalDofIdx] = getValue(fs.Rv()); + Valgrind::CheckDefined(rv_[globalDofIdx]); } for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) { if (invB_[phaseIdx].size() == 0) continue; - invB_[phaseIdx][globalDofIdx] = Opm::getValue(fs.invB(phaseIdx)); - Opm::Valgrind::CheckDefined(invB_[phaseIdx][globalDofIdx]); + invB_[phaseIdx][globalDofIdx] = getValue(fs.invB(phaseIdx)); + Valgrind::CheckDefined(invB_[phaseIdx][globalDofIdx]); } for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) { if (density_[phaseIdx].size() == 0) continue; - density_[phaseIdx][globalDofIdx] = Opm::getValue(fs.density(phaseIdx)); - Opm::Valgrind::CheckDefined(density_[phaseIdx][globalDofIdx]); + density_[phaseIdx][globalDofIdx] = getValue(fs.density(phaseIdx)); + Valgrind::CheckDefined(density_[phaseIdx][globalDofIdx]); } for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) { @@ -617,20 +617,20 @@ public: continue; if (extboX_.size() > 0 && phaseIdx==oilPhaseIdx) - viscosity_[phaseIdx][globalDofIdx] = Opm::getValue(intQuants.oilViscosity()); + viscosity_[phaseIdx][globalDofIdx] = getValue(intQuants.oilViscosity()); else if (extboX_.size() > 0 && phaseIdx==gasPhaseIdx) - viscosity_[phaseIdx][globalDofIdx] = Opm::getValue(intQuants.gasViscosity()); + viscosity_[phaseIdx][globalDofIdx] = getValue(intQuants.gasViscosity()); else - viscosity_[phaseIdx][globalDofIdx] = Opm::getValue(fs.viscosity(phaseIdx)); - Opm::Valgrind::CheckDefined(viscosity_[phaseIdx][globalDofIdx]); + viscosity_[phaseIdx][globalDofIdx] = getValue(fs.viscosity(phaseIdx)); + Valgrind::CheckDefined(viscosity_[phaseIdx][globalDofIdx]); } for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) { if (relativePermeability_[phaseIdx].size() == 0) continue; - relativePermeability_[phaseIdx][globalDofIdx] = Opm::getValue(intQuants.relativePermeability(phaseIdx)); - Opm::Valgrind::CheckDefined(relativePermeability_[phaseIdx][globalDofIdx]); + relativePermeability_[phaseIdx][globalDofIdx] = getValue(intQuants.relativePermeability(phaseIdx)); + Valgrind::CheckDefined(relativePermeability_[phaseIdx][globalDofIdx]); } if (sSol_.size() > 0) { @@ -662,12 +662,12 @@ public: } if (mFracCo2_.size() > 0) { - const Scalar stdVolOil = Opm::getValue(fs.saturation(oilPhaseIdx))*Opm::getValue(fs.invB(oilPhaseIdx)) - + Opm::getValue(fs.saturation(gasPhaseIdx))*Opm::getValue(fs.invB(gasPhaseIdx))*Opm::getValue(fs.Rv()); - const Scalar stdVolGas = Opm::getValue(fs.saturation(gasPhaseIdx))*Opm::getValue(fs.invB(gasPhaseIdx))*(1.0-intQuants.yVolume().value()) - + Opm::getValue(fs.saturation(oilPhaseIdx))*Opm::getValue(fs.invB(oilPhaseIdx))*Opm::getValue(fs.Rs())*(1.0-intQuants.xVolume().value()); - const Scalar stdVolCo2 = Opm::getValue(fs.saturation(gasPhaseIdx))*Opm::getValue(fs.invB(gasPhaseIdx))*intQuants.yVolume().value() - + Opm::getValue(fs.saturation(oilPhaseIdx))*Opm::getValue(fs.invB(oilPhaseIdx))*Opm::getValue(fs.Rs())*intQuants.xVolume().value(); + const Scalar stdVolOil = getValue(fs.saturation(oilPhaseIdx))*getValue(fs.invB(oilPhaseIdx)) + + getValue(fs.saturation(gasPhaseIdx))*getValue(fs.invB(gasPhaseIdx))*getValue(fs.Rv()); + const Scalar stdVolGas = getValue(fs.saturation(gasPhaseIdx))*getValue(fs.invB(gasPhaseIdx))*(1.0-intQuants.yVolume().value()) + + getValue(fs.saturation(oilPhaseIdx))*getValue(fs.invB(oilPhaseIdx))*getValue(fs.Rs())*(1.0-intQuants.xVolume().value()); + const Scalar stdVolCo2 = getValue(fs.saturation(gasPhaseIdx))*getValue(fs.invB(gasPhaseIdx))*intQuants.yVolume().value() + + getValue(fs.saturation(oilPhaseIdx))*getValue(fs.invB(oilPhaseIdx))*getValue(fs.Rs())*intQuants.xVolume().value(); const Scalar rhoO= FluidSystem::referenceDensity(gasPhaseIdx, pvtRegionIdx); const Scalar rhoG= FluidSystem::referenceDensity(gasPhaseIdx, pvtRegionIdx); const Scalar rhoCO2= intQuants.zRefDensity(); @@ -679,18 +679,18 @@ public: if (bubblePointPressure_.size() > 0) { try { - bubblePointPressure_[globalDofIdx] = Opm::getValue(FluidSystem::bubblePointPressure(fs, intQuants.pvtRegionIndex())); + bubblePointPressure_[globalDofIdx] = getValue(FluidSystem::bubblePointPressure(fs, intQuants.pvtRegionIndex())); } - catch (const Opm::NumericalIssue&) { + catch (const NumericalIssue&) { const auto cartesianIdx = elemCtx.simulator().vanguard().grid().globalCell()[globalDofIdx]; failedCellsPb_.push_back(cartesianIdx); } } if (dewPointPressure_.size() > 0) { try { - dewPointPressure_[globalDofIdx] = Opm::getValue(FluidSystem::dewPointPressure(fs, intQuants.pvtRegionIndex())); + dewPointPressure_[globalDofIdx] = getValue(FluidSystem::dewPointPressure(fs, intQuants.pvtRegionIndex())); } - catch (const Opm::NumericalIssue&) { + catch (const NumericalIssue&) { const auto cartesianIdx = elemCtx.simulator().vanguard().grid().globalCell()[globalDofIdx]; failedCellsPd_.push_back(cartesianIdx); } @@ -698,17 +698,17 @@ public: if (soMax_.size() > 0) soMax_[globalDofIdx] = - std::max(Opm::getValue(fs.saturation(oilPhaseIdx)), + std::max(getValue(fs.saturation(oilPhaseIdx)), problem.maxOilSaturation(globalDofIdx)); if (swMax_.size() > 0) swMax_[globalDofIdx] = - std::max(Opm::getValue(fs.saturation(waterPhaseIdx)), + std::max(getValue(fs.saturation(waterPhaseIdx)), problem.maxWaterSaturation(globalDofIdx)); if (minimumOilPressure_.size() > 0) minimumOilPressure_[globalDofIdx] = - std::min(Opm::getValue(fs.pressure(oilPhaseIdx)), + std::min(getValue(fs.pressure(oilPhaseIdx)), problem.minOilPressure(globalDofIdx)); if (overburdenPressure_.size() > 0) @@ -796,60 +796,60 @@ public: int cartesianIdxBlock = key.second - 1; if (cartesianIdx == cartesianIdxBlock) { if ((key.first == "BWSAT") || (key.first == "BSWAT")) - val.second = Opm::getValue(fs.saturation(waterPhaseIdx)); + val.second = getValue(fs.saturation(waterPhaseIdx)); else if ((key.first == "BGSAT") || (key.first == "BSGAS")) - val.second = Opm::getValue(fs.saturation(gasPhaseIdx)); + val.second = getValue(fs.saturation(gasPhaseIdx)); else if ((key.first == "BOSAT") || (key.first == "BSOIL")) - val.second = Opm::getValue(fs.saturation(oilPhaseIdx)); + val.second = getValue(fs.saturation(oilPhaseIdx)); else if ((key.first == "BPR") || (key.first == "BPRESSUR")) - val.second = Opm::getValue(fs.pressure(oilPhaseIdx)); + val.second = getValue(fs.pressure(oilPhaseIdx)); else if (key.first == "BWKR" || key.first == "BKRW") - val.second = Opm::getValue(intQuants.relativePermeability(waterPhaseIdx)); + val.second = getValue(intQuants.relativePermeability(waterPhaseIdx)); else if (key.first == "BGKR" || key.first == "BKRG") - val.second = Opm::getValue(intQuants.relativePermeability(gasPhaseIdx)); + val.second = getValue(intQuants.relativePermeability(gasPhaseIdx)); else if (key.first == "BOKR" || key.first == "BKRO") - val.second = Opm::getValue(intQuants.relativePermeability(oilPhaseIdx)); + val.second = getValue(intQuants.relativePermeability(oilPhaseIdx)); else if (key.first == "BKROG") { const auto& materialParams = problem.materialLawParams(elemCtx, dofIdx, /* timeIdx = */ 0); const auto krog = MaterialLaw::template relpermOilInOilGasSystem(materialParams, fs); - val.second = Opm::getValue(krog); + val.second = getValue(krog); } else if (key.first == "BKROW") { const auto& materialParams = problem.materialLawParams(elemCtx, dofIdx, /* timeIdx = */ 0); const auto krow = MaterialLaw::template relpermOilInOilWaterSystem(materialParams, fs); - val.second = Opm::getValue(krow); + val.second = getValue(krow); } else if (key.first == "BWPC") - val.second = Opm::getValue(fs.pressure(oilPhaseIdx)) - Opm::getValue(fs.pressure(waterPhaseIdx)); + val.second = getValue(fs.pressure(oilPhaseIdx)) - getValue(fs.pressure(waterPhaseIdx)); else if (key.first == "BGPC") - val.second = Opm::getValue(fs.pressure(gasPhaseIdx)) - Opm::getValue(fs.pressure(oilPhaseIdx)); + val.second = getValue(fs.pressure(gasPhaseIdx)) - getValue(fs.pressure(oilPhaseIdx)); else if (key.first == "BVWAT" || key.first == "BWVIS") - val.second = Opm::getValue(fs.viscosity(waterPhaseIdx)); + val.second = getValue(fs.viscosity(waterPhaseIdx)); else if (key.first == "BVGAS" || key.first == "BGVIS") - val.second = Opm::getValue(fs.viscosity(gasPhaseIdx)); + val.second = getValue(fs.viscosity(gasPhaseIdx)); else if (key.first == "BVOIL" || key.first == "BOVIS") - val.second = Opm::getValue(fs.viscosity(oilPhaseIdx)); + val.second = getValue(fs.viscosity(oilPhaseIdx)); else { std::string logstring = "Keyword '"; logstring.append(key.first); logstring.append("' is unhandled for output to file."); - Opm::OpmLog::warning("Unhandled output keyword", logstring); + OpmLog::warning("Unhandled output keyword", logstring); } } } // Adding Well RFT data if (oilConnectionPressures_.count(cartesianIdx) > 0) { - oilConnectionPressures_[cartesianIdx] = Opm::getValue(fs.pressure(oilPhaseIdx)); + oilConnectionPressures_[cartesianIdx] = getValue(fs.pressure(oilPhaseIdx)); } if (waterConnectionSaturations_.count(cartesianIdx) > 0) { - waterConnectionSaturations_[cartesianIdx] = Opm::getValue(fs.saturation(waterPhaseIdx)); + waterConnectionSaturations_[cartesianIdx] = getValue(fs.saturation(waterPhaseIdx)); } if (gasConnectionSaturations_.count(cartesianIdx) > 0) { - gasConnectionSaturations_[cartesianIdx] = Opm::getValue(fs.saturation(gasPhaseIdx)); + gasConnectionSaturations_[cartesianIdx] = getValue(fs.saturation(gasPhaseIdx)); } if (this->wbpData_.count(cartesianIdx) > 0) - this->wbpData_[cartesianIdx] = Opm::getValue(fs.pressure(oilPhaseIdx)); + this->wbpData_[cartesianIdx] = getValue(fs.pressure(oilPhaseIdx)); // tracers const auto& tracerModel = simulator_.problem().tracerModel(); @@ -912,7 +912,7 @@ public: errlog << ", ..."; } errlog << "]"; - Opm::OpmLog::warning("Bubble point numerical problem", errlog.str()); + OpmLog::warning("Bubble point numerical problem", errlog.str()); } if (globalFailedCellsPd.size() > 0) { std::stringstream errlog; @@ -926,11 +926,11 @@ public: errlog << ", ..."; } errlog << "]"; - Opm::OpmLog::warning("Dew point numerical problem", errlog.str()); + OpmLog::warning("Dew point numerical problem", errlog.str()); } } - void addRftDataToWells(Opm::data::Wells& wellDatas, size_t reportStepNum) + void addRftDataToWells(data::Wells& wellDatas, size_t reportStepNum) { const auto& schedule = simulator_.vanguard().schedule(); const auto& rft_config = schedule[reportStepNum].rft_config(); @@ -943,7 +943,7 @@ public: //add data infrastructure for shut wells if (!wellDatas.count(well.name())) { - Opm::data::Well wellData; + data::Well wellData; if (!rft_config.active()) continue; @@ -963,7 +963,7 @@ public: wellDatas.emplace(std::make_pair(well.name(), wellData)); } - Opm::data::Well& wellData = wellDatas.at(well.name()); + data::Well& wellData = wellDatas.at(well.name()); for (auto& connectionData: wellData.connections) { const auto index = connectionData.index; if (oilConnectionPressures_.count(index) > 0) @@ -982,158 +982,158 @@ public: /*! * \brief Move all buffers to data::Solution. */ - void assignToSolution(Opm::data::Solution& sol) + void assignToSolution(data::Solution& sol) { - if (!std::is_same>::value) + if (!std::is_same>::value) return; if (oilPressure_.size() > 0) { - sol.insert("PRESSURE", Opm::UnitSystem::measure::pressure, std::move(oilPressure_), Opm::data::TargetType::RESTART_SOLUTION); + sol.insert("PRESSURE", UnitSystem::measure::pressure, std::move(oilPressure_), data::TargetType::RESTART_SOLUTION); } if (temperature_.size() > 0) { - sol.insert("TEMP", Opm::UnitSystem::measure::temperature, std::move(temperature_), Opm::data::TargetType::RESTART_SOLUTION); + sol.insert("TEMP", UnitSystem::measure::temperature, std::move(temperature_), data::TargetType::RESTART_SOLUTION); } if (FluidSystem::phaseIsActive(waterPhaseIdx) && saturation_[waterPhaseIdx].size() > 0) { - sol.insert("SWAT", Opm::UnitSystem::measure::identity, std::move(saturation_[waterPhaseIdx]), Opm::data::TargetType::RESTART_SOLUTION); + sol.insert("SWAT", UnitSystem::measure::identity, std::move(saturation_[waterPhaseIdx]), data::TargetType::RESTART_SOLUTION); } if (FluidSystem::phaseIsActive(gasPhaseIdx) && saturation_[gasPhaseIdx].size() > 0) { - sol.insert("SGAS", Opm::UnitSystem::measure::identity, std::move(saturation_[gasPhaseIdx]), Opm::data::TargetType::RESTART_SOLUTION); + sol.insert("SGAS", UnitSystem::measure::identity, std::move(saturation_[gasPhaseIdx]), data::TargetType::RESTART_SOLUTION); } if (ppcw_.size() > 0) { - sol.insert ("PPCW", Opm::UnitSystem::measure::pressure, std::move(ppcw_), Opm::data::TargetType::RESTART_SOLUTION); + sol.insert ("PPCW", UnitSystem::measure::pressure, std::move(ppcw_), data::TargetType::RESTART_SOLUTION); } if (gasDissolutionFactor_.size() > 0) { - sol.insert("RSSAT", Opm::UnitSystem::measure::gas_oil_ratio, std::move(gasDissolutionFactor_), Opm::data::TargetType::RESTART_AUXILIARY); + sol.insert("RSSAT", UnitSystem::measure::gas_oil_ratio, std::move(gasDissolutionFactor_), data::TargetType::RESTART_AUXILIARY); } if (oilVaporizationFactor_.size() > 0) { - sol.insert("RVSAT", Opm::UnitSystem::measure::oil_gas_ratio, std::move(oilVaporizationFactor_), Opm::data::TargetType::RESTART_AUXILIARY); + sol.insert("RVSAT", UnitSystem::measure::oil_gas_ratio, std::move(oilVaporizationFactor_), data::TargetType::RESTART_AUXILIARY); } if (rs_.size() > 0) { - sol.insert("RS", Opm::UnitSystem::measure::gas_oil_ratio, std::move(rs_), Opm::data::TargetType::RESTART_SOLUTION); + sol.insert("RS", UnitSystem::measure::gas_oil_ratio, std::move(rs_), data::TargetType::RESTART_SOLUTION); } if (rv_.size() > 0) { - sol.insert("RV", Opm::UnitSystem::measure::oil_gas_ratio, std::move(rv_), Opm::data::TargetType::RESTART_SOLUTION); + sol.insert("RV", UnitSystem::measure::oil_gas_ratio, std::move(rv_), data::TargetType::RESTART_SOLUTION); } if (invB_[waterPhaseIdx].size() > 0) { - sol.insert("1OVERBW", Opm::UnitSystem::measure::water_inverse_formation_volume_factor, std::move(invB_[waterPhaseIdx]), Opm::data::TargetType::RESTART_AUXILIARY); + sol.insert("1OVERBW", UnitSystem::measure::water_inverse_formation_volume_factor, std::move(invB_[waterPhaseIdx]), data::TargetType::RESTART_AUXILIARY); } if (invB_[oilPhaseIdx].size() > 0) { - sol.insert("1OVERBO", Opm::UnitSystem::measure::oil_inverse_formation_volume_factor, std::move(invB_[oilPhaseIdx]), Opm::data::TargetType::RESTART_AUXILIARY); + sol.insert("1OVERBO", UnitSystem::measure::oil_inverse_formation_volume_factor, std::move(invB_[oilPhaseIdx]), data::TargetType::RESTART_AUXILIARY); } if (invB_[gasPhaseIdx].size() > 0) { - sol.insert("1OVERBG", Opm::UnitSystem::measure::gas_inverse_formation_volume_factor, std::move(invB_[gasPhaseIdx]), Opm::data::TargetType::RESTART_AUXILIARY); + sol.insert("1OVERBG", UnitSystem::measure::gas_inverse_formation_volume_factor, std::move(invB_[gasPhaseIdx]), data::TargetType::RESTART_AUXILIARY); } if (density_[waterPhaseIdx].size() > 0) { - sol.insert("WAT_DEN", Opm::UnitSystem::measure::density, std::move(density_[waterPhaseIdx]), Opm::data::TargetType::RESTART_AUXILIARY); + sol.insert("WAT_DEN", UnitSystem::measure::density, std::move(density_[waterPhaseIdx]), data::TargetType::RESTART_AUXILIARY); } if (density_[oilPhaseIdx].size() > 0) { - sol.insert("OIL_DEN", Opm::UnitSystem::measure::density, std::move(density_[oilPhaseIdx]), Opm::data::TargetType::RESTART_AUXILIARY); + sol.insert("OIL_DEN", UnitSystem::measure::density, std::move(density_[oilPhaseIdx]), data::TargetType::RESTART_AUXILIARY); } if (density_[gasPhaseIdx].size() > 0) { - sol.insert("GAS_DEN", Opm::UnitSystem::measure::density, std::move(density_[gasPhaseIdx]), Opm::data::TargetType::RESTART_AUXILIARY); + sol.insert("GAS_DEN", UnitSystem::measure::density, std::move(density_[gasPhaseIdx]), data::TargetType::RESTART_AUXILIARY); } if (viscosity_[waterPhaseIdx].size() > 0) { - sol.insert("WAT_VISC", Opm::UnitSystem::measure::viscosity, std::move(viscosity_[waterPhaseIdx]), Opm::data::TargetType::RESTART_AUXILIARY); + sol.insert("WAT_VISC", UnitSystem::measure::viscosity, std::move(viscosity_[waterPhaseIdx]), data::TargetType::RESTART_AUXILIARY); } if (viscosity_[oilPhaseIdx].size() > 0) { - sol.insert("OIL_VISC", Opm::UnitSystem::measure::viscosity, std::move(viscosity_[oilPhaseIdx]), Opm::data::TargetType::RESTART_AUXILIARY); + sol.insert("OIL_VISC", UnitSystem::measure::viscosity, std::move(viscosity_[oilPhaseIdx]), data::TargetType::RESTART_AUXILIARY); } if (viscosity_[gasPhaseIdx].size() > 0) { - sol.insert("GAS_VISC", Opm::UnitSystem::measure::viscosity, std::move(viscosity_[gasPhaseIdx]), Opm::data::TargetType::RESTART_AUXILIARY); + sol.insert("GAS_VISC", UnitSystem::measure::viscosity, std::move(viscosity_[gasPhaseIdx]), data::TargetType::RESTART_AUXILIARY); } if (relativePermeability_[waterPhaseIdx].size() > 0) { - sol.insert("WATKR", Opm::UnitSystem::measure::identity, std::move(relativePermeability_[waterPhaseIdx]), Opm::data::TargetType::RESTART_AUXILIARY); + sol.insert("WATKR", UnitSystem::measure::identity, std::move(relativePermeability_[waterPhaseIdx]), data::TargetType::RESTART_AUXILIARY); } if (relativePermeability_[oilPhaseIdx].size() > 0) { - sol.insert("OILKR", Opm::UnitSystem::measure::identity, std::move(relativePermeability_[oilPhaseIdx]), Opm::data::TargetType::RESTART_AUXILIARY); + sol.insert("OILKR", UnitSystem::measure::identity, std::move(relativePermeability_[oilPhaseIdx]), data::TargetType::RESTART_AUXILIARY); } if (relativePermeability_[gasPhaseIdx].size() > 0) { - sol.insert("GASKR", Opm::UnitSystem::measure::identity, std::move(relativePermeability_[gasPhaseIdx]), Opm::data::TargetType::RESTART_AUXILIARY); + sol.insert("GASKR", UnitSystem::measure::identity, std::move(relativePermeability_[gasPhaseIdx]), data::TargetType::RESTART_AUXILIARY); } if (pcSwMdcOw_.size() > 0) - sol.insert ("PCSWM_OW", Opm::UnitSystem::measure::identity, std::move(pcSwMdcOw_), Opm::data::TargetType::RESTART_AUXILIARY); + sol.insert ("PCSWM_OW", UnitSystem::measure::identity, std::move(pcSwMdcOw_), data::TargetType::RESTART_AUXILIARY); if (krnSwMdcOw_.size() > 0) - sol.insert ("KRNSW_OW", Opm::UnitSystem::measure::identity, std::move(krnSwMdcOw_), Opm::data::TargetType::RESTART_AUXILIARY); + sol.insert ("KRNSW_OW", UnitSystem::measure::identity, std::move(krnSwMdcOw_), data::TargetType::RESTART_AUXILIARY); if (pcSwMdcGo_.size() > 0) - sol.insert ("PCSWM_GO", Opm::UnitSystem::measure::identity, std::move(pcSwMdcGo_), Opm::data::TargetType::RESTART_AUXILIARY); + sol.insert ("PCSWM_GO", UnitSystem::measure::identity, std::move(pcSwMdcGo_), data::TargetType::RESTART_AUXILIARY); if (krnSwMdcGo_.size() > 0) - sol.insert ("KRNSW_GO", Opm::UnitSystem::measure::identity, std::move(krnSwMdcGo_), Opm::data::TargetType::RESTART_AUXILIARY); + sol.insert ("KRNSW_GO", UnitSystem::measure::identity, std::move(krnSwMdcGo_), data::TargetType::RESTART_AUXILIARY); if (soMax_.size() > 0) - sol.insert ("SOMAX", Opm::UnitSystem::measure::identity, std::move(soMax_), Opm::data::TargetType::RESTART_SOLUTION); + sol.insert ("SOMAX", UnitSystem::measure::identity, std::move(soMax_), data::TargetType::RESTART_SOLUTION); if (sSol_.size() > 0) - sol.insert ("SSOLVENT", Opm::UnitSystem::measure::identity, std::move(sSol_), Opm::data::TargetType::RESTART_SOLUTION); + sol.insert ("SSOLVENT", UnitSystem::measure::identity, std::move(sSol_), data::TargetType::RESTART_SOLUTION); if (extboX_.size() > 0) - sol.insert ("SS_X", Opm::UnitSystem::measure::identity, std::move(extboX_), Opm::data::TargetType::RESTART_SOLUTION); + sol.insert ("SS_X", UnitSystem::measure::identity, std::move(extboX_), data::TargetType::RESTART_SOLUTION); if (extboY_.size() > 0) - sol.insert ("SS_Y", Opm::UnitSystem::measure::identity, std::move(extboY_), Opm::data::TargetType::RESTART_SOLUTION); + sol.insert ("SS_Y", UnitSystem::measure::identity, std::move(extboY_), data::TargetType::RESTART_SOLUTION); if (extboZ_.size() > 0) - sol.insert ("SS_Z", Opm::UnitSystem::measure::identity, std::move(extboZ_), Opm::data::TargetType::RESTART_SOLUTION); + sol.insert ("SS_Z", UnitSystem::measure::identity, std::move(extboZ_), data::TargetType::RESTART_SOLUTION); if (mFracOil_.size() > 0) - sol.insert ("STD_OIL", Opm::UnitSystem::measure::identity, std::move(mFracOil_), Opm::data::TargetType::RESTART_SOLUTION); + sol.insert ("STD_OIL", UnitSystem::measure::identity, std::move(mFracOil_), data::TargetType::RESTART_SOLUTION); if (mFracGas_.size() > 0) - sol.insert ("STD_GAS", Opm::UnitSystem::measure::identity, std::move(mFracGas_), Opm::data::TargetType::RESTART_SOLUTION); + sol.insert ("STD_GAS", UnitSystem::measure::identity, std::move(mFracGas_), data::TargetType::RESTART_SOLUTION); if (mFracCo2_.size() > 0) - sol.insert ("STD_CO2", Opm::UnitSystem::measure::identity, std::move(mFracCo2_), Opm::data::TargetType::RESTART_SOLUTION); + sol.insert ("STD_CO2", UnitSystem::measure::identity, std::move(mFracCo2_), data::TargetType::RESTART_SOLUTION); if (cPolymer_.size() > 0) - sol.insert ("POLYMER", Opm::UnitSystem::measure::identity, std::move(cPolymer_), Opm::data::TargetType::RESTART_SOLUTION); + sol.insert ("POLYMER", UnitSystem::measure::identity, std::move(cPolymer_), data::TargetType::RESTART_SOLUTION); if (cFoam_.size() > 0) - sol.insert ("FOAM", Opm::UnitSystem::measure::identity, std::move(cFoam_), Opm::data::TargetType::RESTART_SOLUTION); + sol.insert ("FOAM", UnitSystem::measure::identity, std::move(cFoam_), data::TargetType::RESTART_SOLUTION); if (cSalt_.size() > 0) - sol.insert ("SALT", Opm::UnitSystem::measure::salinity, std::move(cSalt_), Opm::data::TargetType::RESTART_SOLUTION); + sol.insert ("SALT", UnitSystem::measure::salinity, std::move(cSalt_), data::TargetType::RESTART_SOLUTION); if (dewPointPressure_.size() > 0) - sol.insert ("PDEW", Opm::UnitSystem::measure::pressure, std::move(dewPointPressure_), Opm::data::TargetType::RESTART_AUXILIARY); + sol.insert ("PDEW", UnitSystem::measure::pressure, std::move(dewPointPressure_), data::TargetType::RESTART_AUXILIARY); if (bubblePointPressure_.size() > 0) - sol.insert ("PBUB", Opm::UnitSystem::measure::pressure, std::move(bubblePointPressure_), Opm::data::TargetType::RESTART_AUXILIARY); + sol.insert ("PBUB", UnitSystem::measure::pressure, std::move(bubblePointPressure_), data::TargetType::RESTART_AUXILIARY); if (swMax_.size() > 0) - sol.insert ("SWMAX", Opm::UnitSystem::measure::identity, std::move(swMax_), Opm::data::TargetType::RESTART_SOLUTION); + sol.insert ("SWMAX", UnitSystem::measure::identity, std::move(swMax_), data::TargetType::RESTART_SOLUTION); if (minimumOilPressure_.size() > 0) - sol.insert ("PRESROCC", Opm::UnitSystem::measure::pressure, std::move(minimumOilPressure_), Opm::data::TargetType::RESTART_SOLUTION); + sol.insert ("PRESROCC", UnitSystem::measure::pressure, std::move(minimumOilPressure_), data::TargetType::RESTART_SOLUTION); if (overburdenPressure_.size() > 0) - sol.insert ("PRES_OVB", Opm::UnitSystem::measure::pressure, std::move(overburdenPressure_), Opm::data::TargetType::RESTART_SOLUTION); + sol.insert ("PRES_OVB", UnitSystem::measure::pressure, std::move(overburdenPressure_), data::TargetType::RESTART_SOLUTION); if (rockCompPorvMultiplier_.size() > 0) - sol.insert ("PORV_RC", Opm::UnitSystem::measure::identity, std::move(rockCompPorvMultiplier_), Opm::data::TargetType::RESTART_SOLUTION); + sol.insert ("PORV_RC", UnitSystem::measure::identity, std::move(rockCompPorvMultiplier_), data::TargetType::RESTART_SOLUTION); if (rockCompTransMultiplier_.size() > 0) - sol.insert ("TMULT_RC", Opm::UnitSystem::measure::identity, std::move(rockCompTransMultiplier_), Opm::data::TargetType::RESTART_SOLUTION); + sol.insert ("TMULT_RC", UnitSystem::measure::identity, std::move(rockCompTransMultiplier_), data::TargetType::RESTART_SOLUTION); // Fluid in place - for (const auto& phase : Opm::Inplace::phases()) { + for (const auto& phase : Inplace::phases()) { if (outputFipRestart_ && fip_[phase].size() > 0) { sol.insert(EclString(phase), - Opm::UnitSystem::measure::volume, + UnitSystem::measure::volume, fip_[phase], - Opm::data::TargetType::SUMMARY); + data::TargetType::SUMMARY); } } @@ -1142,7 +1142,7 @@ public: if (tracerConcentrations_.size() > 0) { for (int tracerIdx = 0; tracerIdx& values) { + void update(Inplace& inplace, const std::string& region_name, Inplace::Phase phase, std::size_t ntFip, const std::vector& values) { double sum = 0; for (std::size_t region_number = 0; region_number < ntFip; region_number++) { inplace.add( region_name, phase, region_number + 1, values[region_number] ); @@ -1163,22 +1163,22 @@ public: } - void makeRegionSum(Opm::Inplace& inplace, const std::string& region_name) { + void makeRegionSum(Inplace& inplace, const std::string& region_name) { const auto& region = this->regions_.at(region_name); std::size_t ntFip = this->regionMax(region); - update(inplace, region_name, Opm::Inplace::Phase::PressurePV, ntFip, this->regionSum(this->pressureTimesPoreVolume_, region, ntFip)); - update(inplace, region_name, Opm::Inplace::Phase::HydroCarbonPV, ntFip, this->regionSum(this->hydrocarbonPoreVolume_, region, ntFip)); - update(inplace, region_name, Opm::Inplace::Phase::PressureHydroCarbonPV, ntFip, this->regionSum(this->pressureTimesHydrocarbonVolume_, region, ntFip)); + update(inplace, region_name, Inplace::Phase::PressurePV, ntFip, this->regionSum(this->pressureTimesPoreVolume_, region, ntFip)); + update(inplace, region_name, Inplace::Phase::HydroCarbonPV, ntFip, this->regionSum(this->hydrocarbonPoreVolume_, region, ntFip)); + update(inplace, region_name, Inplace::Phase::PressureHydroCarbonPV, ntFip, this->regionSum(this->pressureTimesHydrocarbonVolume_, region, ntFip)); - for (const auto& phase : Opm::Inplace::phases()) + for (const auto& phase : Inplace::phases()) update(inplace, region_name, phase, ntFip, this->regionSum(this->fip_[phase], region, ntFip)); } - Opm::Inplace accumulateRegionSums() { - const Opm::SummaryConfig summaryConfig = simulator_.vanguard().summaryConfig(); - Opm::Inplace inplace; + Inplace accumulateRegionSums() { + const SummaryConfig summaryConfig = simulator_.vanguard().summaryConfig(); + Inplace inplace; for (const auto& [region_name, _] : this->regions_) { (void)_; @@ -1208,58 +1208,58 @@ public: std::map& miscSummaryData, std::map>& regionData) const { - const Opm::SummaryConfig summaryConfig = simulator_.vanguard().summaryConfig(); + const SummaryConfig summaryConfig = simulator_.vanguard().summaryConfig(); // The field summary vectors should only use the FIPNUM based region sum. { - for (const auto& phase : Opm::Inplace::phases()) { + for (const auto& phase : Inplace::phases()) { std::string key = "F" + EclString(phase); if (summaryConfig.hasKeyword(key)) miscSummaryData[key] = inplace.get(phase); } if (summaryConfig.hasKeyword("FOE") && this->initialInplace_) - miscSummaryData["FOE"] = inplace.get(Opm::Inplace::Phase::OIL) - / this->initialInplace_.value().get(Opm::Inplace::Phase::OIL); + miscSummaryData["FOE"] = inplace.get(Inplace::Phase::OIL) + / this->initialInplace_.value().get(Inplace::Phase::OIL); if (summaryConfig.hasKeyword("FPR")) - miscSummaryData["FPR"] = pressureAverage_(inplace.get(Opm::Inplace::Phase::PressureHydroCarbonPV), - inplace.get(Opm::Inplace::Phase::HydroCarbonPV), - inplace.get(Opm::Inplace::Phase::PressurePV), - inplace.get(Opm::Inplace::Phase::PoreVolume), + miscSummaryData["FPR"] = pressureAverage_(inplace.get(Inplace::Phase::PressureHydroCarbonPV), + inplace.get(Inplace::Phase::HydroCarbonPV), + inplace.get(Inplace::Phase::PressurePV), + inplace.get(Inplace::Phase::PoreVolume), true); if (summaryConfig.hasKeyword("FPRP")) - miscSummaryData["FPRP"] = pressureAverage_(inplace.get(Opm::Inplace::Phase::PressureHydroCarbonPV), - inplace.get(Opm::Inplace::Phase::HydroCarbonPV), - inplace.get(Opm::Inplace::Phase::PressurePV), - inplace.get(Opm::Inplace::Phase::PoreVolume), + miscSummaryData["FPRP"] = pressureAverage_(inplace.get(Inplace::Phase::PressureHydroCarbonPV), + inplace.get(Inplace::Phase::HydroCarbonPV), + inplace.get(Inplace::Phase::PressurePV), + inplace.get(Inplace::Phase::PoreVolume), false); } // The region summary vectors should loop through the FIPxxx regions to // support the RPR__xxx summary keywords. { - for (const auto& phase : Opm::Inplace::phases()) { + for (const auto& phase : Inplace::phases()) { for (const auto& node : this->regionNodes_.at(phase)) regionData[node.keyword()] = inplace.get_vector(node.fip_region(), phase); } // The exact same quantity is calculated for RPR and RPRP - is that correct? for (const auto& node : this->RPRNodes_) - regionData[node.keyword()] = pressureAverage_(inplace.get_vector(node.fip_region(), Opm::Inplace::Phase::PressureHydroCarbonPV), - inplace.get_vector(node.fip_region(), Opm::Inplace::Phase::HydroCarbonPV), - inplace.get_vector(node.fip_region(), Opm::Inplace::Phase::PressurePV), - inplace.get_vector(node.fip_region(), Opm::Inplace::Phase::PoreVolume), + regionData[node.keyword()] = pressureAverage_(inplace.get_vector(node.fip_region(), Inplace::Phase::PressureHydroCarbonPV), + inplace.get_vector(node.fip_region(), Inplace::Phase::HydroCarbonPV), + inplace.get_vector(node.fip_region(), Inplace::Phase::PressurePV), + inplace.get_vector(node.fip_region(), Inplace::Phase::PoreVolume), true); for (const auto& node : this->RPRPNodes_) - regionData[node.keyword()] = pressureAverage_(inplace.get_vector(node.fip_region(), Opm::Inplace::Phase::PressureHydroCarbonPV), - inplace.get_vector(node.fip_region(), Opm::Inplace::Phase::HydroCarbonPV), - inplace.get_vector(node.fip_region(), Opm::Inplace::Phase::PressurePV), - inplace.get_vector(node.fip_region(), Opm::Inplace::Phase::PoreVolume), + regionData[node.keyword()] = pressureAverage_(inplace.get_vector(node.fip_region(), Inplace::Phase::PressureHydroCarbonPV), + inplace.get_vector(node.fip_region(), Inplace::Phase::HydroCarbonPV), + inplace.get_vector(node.fip_region(), Inplace::Phase::PressurePV), + inplace.get_vector(node.fip_region(), Inplace::Phase::PoreVolume), false); } @@ -1270,16 +1270,16 @@ public: { - Scalar fieldHydroCarbonPoreVolumeAveragedPressure = pressureAverage_(inplace.get(Opm::Inplace::Phase::PressureHydroCarbonPV), - inplace.get(Opm::Inplace::Phase::HydroCarbonPV), - inplace.get(Opm::Inplace::Phase::PressurePV), - inplace.get(Opm::Inplace::Phase::PoreVolume), + Scalar fieldHydroCarbonPoreVolumeAveragedPressure = pressureAverage_(inplace.get(Inplace::Phase::PressureHydroCarbonPV), + inplace.get(Inplace::Phase::HydroCarbonPV), + inplace.get(Inplace::Phase::PressurePV), + inplace.get(Inplace::Phase::PoreVolume), true); - std::unordered_map initial_values; - std::unordered_map current_values; + std::unordered_map initial_values; + std::unordered_map current_values; - for (const auto& phase : Opm::Inplace::phases()) { + for (const auto& phase : Inplace::phases()) { initial_values[phase] = this->initialInplace_->get(phase); current_values[phase] = inplace.get(phase); } @@ -1295,10 +1295,10 @@ public: } for (size_t reg = 1; reg <= inplace.max_region("FIPNUM"); ++reg) { - std::unordered_map initial_values; - std::unordered_map current_values; + std::unordered_map initial_values; + std::unordered_map current_values; - for (const auto& phase : Opm::Inplace::phases()) { + for (const auto& phase : Inplace::phases()) { initial_values[phase] = this->initialInplace_->get("FIPNUM", phase, reg); current_values[phase] = inplace.get("FIPNUM", phase, reg); } @@ -1306,10 +1306,10 @@ public: fipUnitConvert_(current_values); Scalar regHydroCarbonPoreVolumeAveragedPressure - = pressureAverage_(inplace.get("FIPNUM", Opm::Inplace::Phase::PressureHydroCarbonPV, reg), - inplace.get("FIPNUM", Opm::Inplace::Phase::HydroCarbonPV, reg), - inplace.get("FIPNUM", Opm::Inplace::Phase::PressurePV, reg), - inplace.get("FIPNUM", Opm::Inplace::Phase::PoreVolume, reg), + = pressureAverage_(inplace.get("FIPNUM", Inplace::Phase::PressureHydroCarbonPV, reg), + inplace.get("FIPNUM", Inplace::Phase::HydroCarbonPV, reg), + inplace.get("FIPNUM", Inplace::Phase::PressurePV, reg), + inplace.get("FIPNUM", Inplace::Phase::PoreVolume, reg), true); pressureUnitConvert_(regHydroCarbonPoreVolumeAveragedPressure); outputRegionFluidInPlace_(initial_values, current_values, regHydroCarbonPoreVolumeAveragedPressure, reg); @@ -1320,7 +1320,7 @@ public: // write Fluid In Place to output log - Opm::Inplace outputFipLog(std::map& miscSummaryData, std::map>& regionData, const bool substep) + Inplace outputFipLog(std::map& miscSummaryData, std::map>& regionData, const bool substep) { auto inplace = this->accumulateRegionSums(); if (!isIORank_()) @@ -1714,7 +1714,7 @@ public: } } - void setRestart(const Opm::data::Solution& sol, unsigned elemIdx, unsigned globalDofIndex) + void setRestart(const data::Solution& sol, unsigned elemIdx, unsigned globalDofIndex) { Scalar so = 1.0; if (saturation_[waterPhaseIdx].size() > 0 && sol.has("SWAT")) { @@ -1785,8 +1785,8 @@ public: Dune::FieldVector< Scalar, numPhases > pc(0); const MaterialLawParams& matParams = simulator_.problem().materialLawParams(elemIdx); MaterialLaw::capillaryPressures(pc, matParams, fs); - Opm::Valgrind::CheckDefined(oilPressure_[elemIdx]); - Opm::Valgrind::CheckDefined(pc); + Valgrind::CheckDefined(oilPressure_[elemIdx]); + Valgrind::CheckDefined(pc); assert(FluidSystem::phaseIsActive(oilPhaseIdx)); for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) { if (!FluidSystem::phaseIsActive(phaseIdx)) @@ -1872,7 +1872,7 @@ public: const std::map, double>& getBlockData() { return blockData_; } - const Opm::Inplace& initialInplace() const { + const Inplace& initialInplace() const { return this->initialInplace_.value(); } @@ -1917,20 +1917,20 @@ private: if (pressureTimesHydrocarbonVolume_.size() > 0 && pressureTimesPoreVolume_.size() > 0) { assert(hydrocarbonPoreVolume_.size() == pressureTimesHydrocarbonVolume_.size()); - assert(fip_[Opm::Inplace::Phase::PoreVolume].size() == pressureTimesPoreVolume_.size()); + assert(fip_[Inplace::Phase::PoreVolume].size() == pressureTimesPoreVolume_.size()); - fip_[Opm::Inplace::Phase::PoreVolume][globalDofIdx] = pv; + fip_[Inplace::Phase::PoreVolume][globalDofIdx] = pv; Scalar hydrocarbon = 0.0; if (FluidSystem::phaseIsActive(oilPhaseIdx)) - hydrocarbon += Opm::getValue(fs.saturation(oilPhaseIdx)); + hydrocarbon += getValue(fs.saturation(oilPhaseIdx)); if (FluidSystem::phaseIsActive(gasPhaseIdx)) - hydrocarbon += Opm::getValue(fs.saturation(gasPhaseIdx)); + hydrocarbon += getValue(fs.saturation(gasPhaseIdx)); hydrocarbonPoreVolume_[globalDofIdx] = pv * hydrocarbon; if (FluidSystem::phaseIsActive(oilPhaseIdx)) { - pressureTimesPoreVolume_[globalDofIdx] = Opm::getValue(fs.pressure(oilPhaseIdx)) * pv; + pressureTimesPoreVolume_[globalDofIdx] = getValue(fs.pressure(oilPhaseIdx)) * pv; pressureTimesHydrocarbonVolume_[globalDofIdx] = pressureTimesPoreVolume_[globalDofIdx] * hydrocarbon; } } @@ -1943,39 +1943,39 @@ private: if (!FluidSystem::phaseIsActive(phaseIdx)) continue; - const double b = Opm::getValue(fs.invB(phaseIdx)); - const double s = Opm::getValue(fs.saturation(phaseIdx)); + const double b = getValue(fs.invB(phaseIdx)); + const double s = getValue(fs.saturation(phaseIdx)); fip[phaseIdx] = b * s * pv; } - if (FluidSystem::phaseIsActive(oilPhaseIdx) && fip_[Opm::Inplace::Phase::OIL].size() > 0) - fip_[Opm::Inplace::Phase::OIL][globalDofIdx] = fip[oilPhaseIdx]; - if (FluidSystem::phaseIsActive(gasPhaseIdx) && fip_[Opm::Inplace::Phase::GAS].size() > 0) - fip_[Opm::Inplace::Phase::GAS][globalDofIdx] = fip[gasPhaseIdx]; - if (FluidSystem::phaseIsActive(waterPhaseIdx) && fip_[Opm::Inplace::Phase::WATER].size() > 0) - fip_[Opm::Inplace::Phase::WATER][globalDofIdx] = fip[waterPhaseIdx]; + if (FluidSystem::phaseIsActive(oilPhaseIdx) && fip_[Inplace::Phase::OIL].size() > 0) + fip_[Inplace::Phase::OIL][globalDofIdx] = fip[oilPhaseIdx]; + if (FluidSystem::phaseIsActive(gasPhaseIdx) && fip_[Inplace::Phase::GAS].size() > 0) + fip_[Inplace::Phase::GAS][globalDofIdx] = fip[gasPhaseIdx]; + if (FluidSystem::phaseIsActive(waterPhaseIdx) && fip_[Inplace::Phase::WATER].size() > 0) + fip_[Inplace::Phase::WATER][globalDofIdx] = fip[waterPhaseIdx]; // Store the pure oil and gas Fip - if (FluidSystem::phaseIsActive(oilPhaseIdx) && fip_[Opm::Inplace::Phase::OilInLiquidPhase].size() > 0) - fip_[Opm::Inplace::Phase::OilInLiquidPhase][globalDofIdx] = fip[oilPhaseIdx]; + if (FluidSystem::phaseIsActive(oilPhaseIdx) && fip_[Inplace::Phase::OilInLiquidPhase].size() > 0) + fip_[Inplace::Phase::OilInLiquidPhase][globalDofIdx] = fip[oilPhaseIdx]; - if (FluidSystem::phaseIsActive(gasPhaseIdx) && fip_[Opm::Inplace::Phase::GasInGasPhase].size() > 0) - fip_[Opm::Inplace::Phase::GasInGasPhase][globalDofIdx] = fip[gasPhaseIdx]; + if (FluidSystem::phaseIsActive(gasPhaseIdx) && fip_[Inplace::Phase::GasInGasPhase].size() > 0) + fip_[Inplace::Phase::GasInGasPhase][globalDofIdx] = fip[gasPhaseIdx]; if (FluidSystem::phaseIsActive(oilPhaseIdx) && FluidSystem::phaseIsActive(gasPhaseIdx)) { // Gas dissolved in oil and vaporized oil - Scalar gasInPlaceLiquid = Opm::getValue(fs.Rs()) * fip[oilPhaseIdx]; - Scalar oilInPlaceGas = Opm::getValue(fs.Rv()) * fip[gasPhaseIdx]; - if (fip_[Opm::Inplace::Phase::GasInLiquidPhase].size() > 0) - fip_[Opm::Inplace::Phase::GasInLiquidPhase][globalDofIdx] = gasInPlaceLiquid; - if (fip_[Opm::Inplace::Phase::OilInGasPhase].size() > 0) - fip_[Opm::Inplace::Phase::OilInGasPhase][globalDofIdx] = oilInPlaceGas; + Scalar gasInPlaceLiquid = getValue(fs.Rs()) * fip[oilPhaseIdx]; + Scalar oilInPlaceGas = getValue(fs.Rv()) * fip[gasPhaseIdx]; + if (fip_[Inplace::Phase::GasInLiquidPhase].size() > 0) + fip_[Inplace::Phase::GasInLiquidPhase][globalDofIdx] = gasInPlaceLiquid; + if (fip_[Inplace::Phase::OilInGasPhase].size() > 0) + fip_[Inplace::Phase::OilInGasPhase][globalDofIdx] = oilInPlaceGas; // Add dissolved gas and vaporized oil to total Fip - if (fip_[Opm::Inplace::Phase::OIL].size() > 0) - fip_[Opm::Inplace::Phase::OIL][globalDofIdx] += oilInPlaceGas; - if (fip_[Opm::Inplace::Phase::GAS].size() > 0) - fip_[Opm::Inplace::Phase::GAS][globalDofIdx] += gasInPlaceLiquid; + if (fip_[Inplace::Phase::OIL].size() > 0) + fip_[Inplace::Phase::OIL][globalDofIdx] += oilInPlaceGas; + if (fip_[Inplace::Phase::GAS].size() > 0) + fip_[Inplace::Phase::GAS][globalDofIdx] += gasInPlaceLiquid; } } @@ -2042,31 +2042,31 @@ private: return pressurePv / pv; } - void fipUnitConvert_(std::unordered_map& fip) const + void fipUnitConvert_(std::unordered_map& fip) const { - const Opm::UnitSystem& units = simulator_.vanguard().eclState().getUnits(); - if (units.getType() == Opm::UnitSystem::UnitType::UNIT_TYPE_FIELD) { - fip[Opm::Inplace::Phase::WATER] = Opm::unit::convert::to(fip[Opm::Inplace::Phase::WATER], Opm::unit::stb); - fip[Opm::Inplace::Phase::OIL] = Opm::unit::convert::to(fip[Opm::Inplace::Phase::OIL], Opm::unit::stb); - fip[Opm::Inplace::Phase::OilInLiquidPhase] = Opm::unit::convert::to(fip[Opm::Inplace::Phase::OilInLiquidPhase], Opm::unit::stb); - fip[Opm::Inplace::Phase::OilInGasPhase] = Opm::unit::convert::to(fip[Opm::Inplace::Phase::OilInGasPhase], Opm::unit::stb); - fip[Opm::Inplace::Phase::GAS] = Opm::unit::convert::to(fip[Opm::Inplace::Phase::GAS], 1000*Opm::unit::cubic(Opm::unit::feet)); - fip[Opm::Inplace::Phase::GasInLiquidPhase] = Opm::unit::convert::to(fip[Opm::Inplace::Phase::GasInLiquidPhase], 1000*Opm::unit::cubic(Opm::unit::feet)); - fip[Opm::Inplace::Phase::GasInGasPhase] = Opm::unit::convert::to(fip[Opm::Inplace::Phase::GasInGasPhase], 1000*Opm::unit::cubic(Opm::unit::feet)); - fip[Opm::Inplace::Phase::PoreVolume] = Opm::unit::convert::to(fip[Opm::Inplace::Phase::PoreVolume], Opm::unit::stb); + const UnitSystem& units = simulator_.vanguard().eclState().getUnits(); + if (units.getType() == UnitSystem::UnitType::UNIT_TYPE_FIELD) { + fip[Inplace::Phase::WATER] = unit::convert::to(fip[Inplace::Phase::WATER], unit::stb); + fip[Inplace::Phase::OIL] = unit::convert::to(fip[Inplace::Phase::OIL], unit::stb); + fip[Inplace::Phase::OilInLiquidPhase] = unit::convert::to(fip[Inplace::Phase::OilInLiquidPhase], unit::stb); + fip[Inplace::Phase::OilInGasPhase] = unit::convert::to(fip[Inplace::Phase::OilInGasPhase], unit::stb); + fip[Inplace::Phase::GAS] = unit::convert::to(fip[Inplace::Phase::GAS], 1000*unit::cubic(unit::feet)); + fip[Inplace::Phase::GasInLiquidPhase] = unit::convert::to(fip[Inplace::Phase::GasInLiquidPhase], 1000*unit::cubic(unit::feet)); + fip[Inplace::Phase::GasInGasPhase] = unit::convert::to(fip[Inplace::Phase::GasInGasPhase], 1000*unit::cubic(unit::feet)); + fip[Inplace::Phase::PoreVolume] = unit::convert::to(fip[Inplace::Phase::PoreVolume], unit::stb); } - else if (units.getType() == Opm::UnitSystem::UnitType::UNIT_TYPE_LAB) { - Scalar scc = Opm::unit::cubic(Opm::prefix::centi * Opm::unit::meter); //standard cubic cm. - fip[Opm::Inplace::Phase::WATER] = Opm::unit::convert::to(fip[Opm::Inplace::Phase::WATER], scc); - fip[Opm::Inplace::Phase::OIL] = Opm::unit::convert::to(fip[Opm::Inplace::Phase::OIL], scc); - fip[Opm::Inplace::Phase::OilInLiquidPhase] = Opm::unit::convert::to(fip[Opm::Inplace::Phase::OilInLiquidPhase], scc); - fip[Opm::Inplace::Phase::OilInGasPhase] = Opm::unit::convert::to(fip[Opm::Inplace::Phase::OilInGasPhase], scc); - fip[Opm::Inplace::Phase::GAS] = Opm::unit::convert::to(fip[Opm::Inplace::Phase::GAS], scc); - fip[Opm::Inplace::Phase::GasInLiquidPhase] = Opm::unit::convert::to(fip[Opm::Inplace::Phase::GasInLiquidPhase], scc); - fip[Opm::Inplace::Phase::GasInGasPhase] = Opm::unit::convert::to(fip[Opm::Inplace::Phase::GasInGasPhase], scc); - fip[Opm::Inplace::Phase::PoreVolume] = Opm::unit::convert::to(fip[Opm::Inplace::Phase::PoreVolume], scc); + else if (units.getType() == UnitSystem::UnitType::UNIT_TYPE_LAB) { + Scalar scc = unit::cubic(prefix::centi * unit::meter); //standard cubic cm. + fip[Inplace::Phase::WATER] = unit::convert::to(fip[Inplace::Phase::WATER], scc); + fip[Inplace::Phase::OIL] = unit::convert::to(fip[Inplace::Phase::OIL], scc); + fip[Inplace::Phase::OilInLiquidPhase] = unit::convert::to(fip[Inplace::Phase::OilInLiquidPhase], scc); + fip[Inplace::Phase::OilInGasPhase] = unit::convert::to(fip[Inplace::Phase::OilInGasPhase], scc); + fip[Inplace::Phase::GAS] = unit::convert::to(fip[Inplace::Phase::GAS], scc); + fip[Inplace::Phase::GasInLiquidPhase] = unit::convert::to(fip[Inplace::Phase::GasInLiquidPhase], scc); + fip[Inplace::Phase::GasInGasPhase] = unit::convert::to(fip[Inplace::Phase::GasInGasPhase], scc); + fip[Inplace::Phase::PoreVolume] = unit::convert::to(fip[Inplace::Phase::PoreVolume], scc); } - else if (units.getType() == Opm::UnitSystem::UnitType::UNIT_TYPE_METRIC) { + else if (units.getType() == UnitSystem::UnitType::UNIT_TYPE_METRIC) { // nothing to do } else { @@ -2076,15 +2076,15 @@ private: void pressureUnitConvert_(Scalar& pav) const { - const Opm::UnitSystem& units = simulator_.vanguard().eclState().getUnits(); - if (units.getType() == Opm::UnitSystem::UnitType::UNIT_TYPE_FIELD) { - pav = Opm::unit::convert::to(pav, Opm::unit::psia); + const UnitSystem& units = simulator_.vanguard().eclState().getUnits(); + if (units.getType() == UnitSystem::UnitType::UNIT_TYPE_FIELD) { + pav = unit::convert::to(pav, unit::psia); } - else if (units.getType() == Opm::UnitSystem::UnitType::UNIT_TYPE_METRIC) { - pav = Opm::unit::convert::to(pav, Opm::unit::barsa); + else if (units.getType() == UnitSystem::UnitType::UNIT_TYPE_METRIC) { + pav = unit::convert::to(pav, unit::barsa); } - else if (units.getType() == Opm::UnitSystem::UnitType::UNIT_TYPE_LAB) { - pav = Opm::unit::convert::to(pav, Opm::unit::atm); + else if (units.getType() == UnitSystem::UnitType::UNIT_TYPE_LAB) { + pav = unit::convert::to(pav, unit::atm); } else { @@ -2092,18 +2092,18 @@ private: } } - void outputRegionFluidInPlace_(std::unordered_map oip, - std::unordered_map cip, + void outputRegionFluidInPlace_(std::unordered_map oip, + std::unordered_map cip, const Scalar& pav, const int reg = 0) const { if (forceDisableFipOutput_) return; // don't output FIPNUM report if the region has no porv. - if (cip[Opm::Inplace::Phase::PoreVolume] == 0) + if (cip[Inplace::Phase::PoreVolume] == 0) return; - const Opm::UnitSystem& units = simulator_.vanguard().eclState().getUnits(); + const UnitSystem& units = simulator_.vanguard().eclState().getUnits(); std::ostringstream ss; if (reg == 0) { ss << " ===================================================\n" @@ -2114,20 +2114,20 @@ private: << " : FIPNUM report region " << std::setw(2) << reg << " :\n"; } - if (units.getType() == Opm::UnitSystem::UnitType::UNIT_TYPE_METRIC) { + if (units.getType() == UnitSystem::UnitType::UNIT_TYPE_METRIC) { ss << " : PAV =" << std::setw(14) << pav << " BARSA :\n" << std::fixed << std::setprecision(0) - << " : PORV =" << std::setw(14) << cip[Opm::Inplace::Phase::PoreVolume] << " RM3 :\n"; + << " : PORV =" << std::setw(14) << cip[Inplace::Phase::PoreVolume] << " RM3 :\n"; if (!reg) { ss << " : Pressure is weighted by hydrocarbon pore volume :\n" << " : Porv volumes are taken at reference conditions :\n"; } ss << " :--------------- Oil SM3 ---------------:-- Wat SM3 --:--------------- Gas SM3 ---------------:\n"; } - if (units.getType() == Opm::UnitSystem::UnitType::UNIT_TYPE_FIELD) { + if (units.getType() == UnitSystem::UnitType::UNIT_TYPE_FIELD) { ss << " : PAV =" << std::setw(14) << pav << " PSIA :\n" << std::fixed << std::setprecision(0) - << " : PORV =" << std::setw(14) << cip[Opm::Inplace::Phase::PoreVolume] << " RB :\n"; + << " : PORV =" << std::setw(14) << cip[Inplace::Phase::PoreVolume] << " RB :\n"; if (!reg) { ss << " : Pressure is weighted by hydrocarbon pore volume :\n" << " : Pore volumes are taken at reference conditions :\n"; @@ -2136,13 +2136,13 @@ private: } ss << " : Liquid Vapour Total : Total : Free Dissolved Total :" << "\n" << ":------------------------:------------------------------------------:----------------:------------------------------------------:" << "\n" - << ":Currently in place :" << std::setw(14) << cip[Opm::Inplace::Phase::OilInLiquidPhase] << std::setw(14) << cip[Opm::Inplace::Phase::OilInGasPhase] << std::setw(14) << cip[Opm::Inplace::Phase::OIL] << ":" - << std::setw(13) << cip[Opm::Inplace::Phase::WATER] << " :" << std::setw(14) << (cip[Opm::Inplace::Phase::GasInGasPhase]) << std::setw(14) << cip[Opm::Inplace::Phase::GasInLiquidPhase] << std::setw(14) << cip[Opm::Inplace::Phase::GAS] << ":\n" + << ":Currently in place :" << std::setw(14) << cip[Inplace::Phase::OilInLiquidPhase] << std::setw(14) << cip[Inplace::Phase::OilInGasPhase] << std::setw(14) << cip[Inplace::Phase::OIL] << ":" + << std::setw(13) << cip[Inplace::Phase::WATER] << " :" << std::setw(14) << (cip[Inplace::Phase::GasInGasPhase]) << std::setw(14) << cip[Inplace::Phase::GasInLiquidPhase] << std::setw(14) << cip[Inplace::Phase::GAS] << ":\n" << ":------------------------:------------------------------------------:----------------:------------------------------------------:\n" - << ":Originally in place :" << std::setw(14) << oip[Opm::Inplace::Phase::OilInLiquidPhase] << std::setw(14) << oip[Opm::Inplace::Phase::OilInGasPhase] << std::setw(14) << oip[Opm::Inplace::Phase::OIL] << ":" - << std::setw(13) << oip[Opm::Inplace::Phase::WATER] << " :" << std::setw(14) << oip[Opm::Inplace::Phase::GasInGasPhase] << std::setw(14) << oip[Opm::Inplace::Phase::GasInLiquidPhase] << std::setw(14) << oip[Opm::Inplace::Phase::GAS] << ":\n" + << ":Originally in place :" << std::setw(14) << oip[Inplace::Phase::OilInLiquidPhase] << std::setw(14) << oip[Inplace::Phase::OilInGasPhase] << std::setw(14) << oip[Inplace::Phase::OIL] << ":" + << std::setw(13) << oip[Inplace::Phase::WATER] << " :" << std::setw(14) << oip[Inplace::Phase::GasInGasPhase] << std::setw(14) << oip[Inplace::Phase::GasInLiquidPhase] << std::setw(14) << oip[Inplace::Phase::GAS] << ":\n" << ":========================:==========================================:================:==========================================:\n"; - Opm::OpmLog::note(ss.str()); + OpmLog::note(ss.str()); } void outputProductionReport_(const ScalarBuffer& wellProd, const StringBuffer& wellProdNames, const bool forceDisableProdOutput) @@ -2150,19 +2150,19 @@ private: if(forceDisableProdOutput) return; - const Opm::UnitSystem& units = simulator_.vanguard().eclState().getUnits(); + const UnitSystem& units = simulator_.vanguard().eclState().getUnits(); std::ostringstream ss; if (wellProdNames[WellProdDataType::WellName].empty()) { ss << "======================================================= PRODUCTION REPORT =======================================================\n"//=================== \n" << ": WELL : LOCATION :CTRL: OIL : WATER : GAS : FLUID : WATER : GAS/OIL : WAT/GAS : BHP OR : THP OR :\n"// STEADY-ST PI :\n" << ": NAME : (I,J,K) :MODE: RATE : RATE : RATE : RES.VOL. : CUT : RATIO : RATIO : CON.PR.: BLK.PR.:\n";// OR POTN OF PREF. PH:\n"; - if (units.getType() == Opm::UnitSystem::UnitType::UNIT_TYPE_METRIC) { + if (units.getType() == UnitSystem::UnitType::UNIT_TYPE_METRIC) { ss << ": : : : SCM/DAY : SCM/DAY : SCM/DAY : RCM/DAY : SCM/SCM : SCM/SCM : SCM/SCM : BARSA : BARSA :\n";// :\n"; } - if (units.getType() == Opm::UnitSystem::UnitType::UNIT_TYPE_FIELD) { + if (units.getType() == UnitSystem::UnitType::UNIT_TYPE_FIELD) { ss << ": : : : STB/DAY : STB/DAY : MSCF/DAY : RB/DAY : : MSCF/STB : STB/MSCF : PSIA : PSIA :\n";// :\n"; } - if (units.getType() == Opm::UnitSystem::UnitType::UNIT_TYPE_LAB) { + if (units.getType() == UnitSystem::UnitType::UNIT_TYPE_LAB) { ss << ": : : : SCC/HR : SCC/HR : SCC/HR : RCC : SCC/SCC : SCC/SCC : SCC/SCC : ATMA : ATMA :\n";// :\n"; } ss << "=================================================================================================================================\n";//=================== \n"; @@ -2176,7 +2176,7 @@ private: } ss << ":"<< std::setfill ('-') << std::setw (9) << ":" << std::setfill ('-') << std::setw (12) << ":" << std::setfill ('-') << std::setw (5) << ":" << std::setfill ('-') << std::setw (12) << ":" << std::setfill ('-') << std::setw (12) << ":" << std::setfill ('-') << std::setw (12) << ":" << std::setfill ('-') << std::setw (12) << ":" << std::setfill ('-') << std::setw (12) << ":" << std::setfill ('-') << std::setw (11) << ":" << std::setfill ('-') << std::setw (13) << ":" << std::setfill ('-') << std::setw (9) << ":" << std::setfill ('-') << std::setw (9) << ":" << "\n"; } - Opm::OpmLog::note(ss.str()); + OpmLog::note(ss.str()); } void outputInjectionReport_(const ScalarBuffer& wellInj, const StringBuffer& wellInjNames, const bool forceDisableInjOutput) @@ -2184,19 +2184,19 @@ private: if(forceDisableInjOutput) return; - const Opm::UnitSystem& units = simulator_.vanguard().eclState().getUnits(); + const UnitSystem& units = simulator_.vanguard().eclState().getUnits(); std::ostringstream ss; if (wellInjNames[WellInjDataType::WellName].empty()) { ss << "=================================================== INJECTION REPORT ========================================\n"//===================== \n" << ": WELL : LOCATION : CTRL : CTRL : CTRL : OIL : WATER : GAS : FLUID : BHP OR : THP OR :\n"// STEADY-ST II :\n" << ": NAME : (I,J,K) : MODE : MODE : MODE : RATE : RATE : RATE : RES.VOL. : CON.PR.: BLK.PR.:\n";// OR POTENTIAL :\n"; - if (units.getType() == Opm::UnitSystem::UnitType::UNIT_TYPE_METRIC) { + if (units.getType() == UnitSystem::UnitType::UNIT_TYPE_METRIC) { ss << ": : : OIL : WAT : GAS : SCM/DAY : SCM/DAY : SCM/DAY : RCM/DAY : BARSA : BARSA :\n";// :\n"; } - if (units.getType() == Opm::UnitSystem::UnitType::UNIT_TYPE_FIELD) { + if (units.getType() == UnitSystem::UnitType::UNIT_TYPE_FIELD) { ss << ": : : OIL : WAT : GAS : STB/DAY : STB/DAY : MSCF/DAY : RB/DAY : PSIA : PSIA :\n";// :\n"; } - if (units.getType() == Opm::UnitSystem::UnitType::UNIT_TYPE_LAB) { + if (units.getType() == UnitSystem::UnitType::UNIT_TYPE_LAB) { ss << ": : : OIL : WAT : GAS : SCC/HR : SCC/HR : SCC/HR : RCC/HR : ATMA : ATMA :\n";// :\n"; } ss << "==============================================================================================================\n";//===================== \n"; @@ -2210,7 +2210,7 @@ private: } ss << ":--------:-----------:------:------:------:------------:----------:-----------:-----------:--------:--------: \n";//--------------------:\n"; } - Opm::OpmLog::note(ss.str()); + OpmLog::note(ss.str()); } void outputCumulativeReport_(const ScalarBuffer& wellCum, const StringBuffer& wellCumNames, const bool forceDisableCumOutput) @@ -2218,19 +2218,19 @@ private: if(forceDisableCumOutput) return; - const Opm::UnitSystem& units = simulator_.vanguard().eclState().getUnits(); + const UnitSystem& units = simulator_.vanguard().eclState().getUnits(); std::ostringstream ss; if (wellCumNames[WellCumDataType::WellName].empty()) { ss << "=================================================== CUMULATIVE PRODUCTION/INJECTION REPORT =========================================\n" << ": WELL : LOCATION : WELL :CTRL: OIL : WATER : GAS : Prod : OIL : WATER : GAS : INJ :\n" << ": NAME : (I,J,K) : TYPE :MODE: PROD : PROD : PROD : RES.VOL. : INJ : INJ : INJ : RES.VOL. :\n"; - if (units.getType() == Opm::UnitSystem::UnitType::UNIT_TYPE_METRIC) { + if (units.getType() == UnitSystem::UnitType::UNIT_TYPE_METRIC) { ss << ": : : : : MSCM : MSCM : MMSCM : MRCM : MSCM : MSCM : MMSCM : MRCM :\n"; } - if (units.getType() == Opm::UnitSystem::UnitType::UNIT_TYPE_FIELD) { + if (units.getType() == UnitSystem::UnitType::UNIT_TYPE_FIELD) { ss << ": : : : : MSTB : MSTB : MMSCF : MRB : MSTB : MSTB : MMSCF : MRB :\n"; } - if (units.getType() == Opm::UnitSystem::UnitType::UNIT_TYPE_LAB) { + if (units.getType() == UnitSystem::UnitType::UNIT_TYPE_LAB) { ss << ": : : : : MSCC : MSCC : MMSCC : MRCC : MSCC : MSCC : MMSCC : MRCC :\n"; } ss << "====================================================================================================================================\n"; @@ -2244,7 +2244,7 @@ private: } ss << ":--------:-----------:--------:----:------------:----------:-----------:-----------:------------:----------:-----------:-----------: \n"; } - Opm::OpmLog::note(ss.str()); + OpmLog::note(ss.str()); } std::string WPEnumToString_(int i) @@ -2369,13 +2369,13 @@ private: std::vector failedCellsPb_; std::vector failedCellsPd_; std::unordered_map> regions_; - std::unordered_map fip_; - std::optional initialInplace_; + std::unordered_map fip_; + std::optional initialInplace_; - std::vector RPRNodes_; - std::vector RPRPNodes_; - std::unordered_map> regionNodes_; + std::vector RPRNodes_; + std::vector RPRPNodes_; + std::unordered_map> regionNodes_; diff --git a/ebos/eclproblem.hh b/ebos/eclproblem.hh index 2c1f6099b..d8326c591 100644 --- a/ebos/eclproblem.hh +++ b/ebos/eclproblem.hh @@ -222,7 +222,7 @@ struct OutputMode { // Set the problem property template struct Problem { - using type = Opm::EclProblem; + using type = EclProblem; }; // Select the element centered finite volume method as spatial discretization @@ -245,13 +245,13 @@ private: using Scalar = GetPropType; using FluidSystem = GetPropType; - typedef Opm::ThreePhaseMaterialTraits Traits; + typedef ThreePhaseMaterialTraits Traits; public: - typedef Opm::EclMaterialLawManager EclMaterialLawManager; + typedef ::Opm::EclMaterialLawManager EclMaterialLawManager; typedef typename EclMaterialLawManager::MaterialLaw type; }; @@ -265,7 +265,7 @@ private: using FluidSystem = GetPropType; public: - typedef Opm::EclThermalLawManager EclThermalLawManager; + typedef ::Opm::EclThermalLawManager EclThermalLawManager; typedef typename EclThermalLawManager::SolidEnergyLaw type; }; @@ -279,7 +279,7 @@ private: using FluidSystem = GetPropType; public: - typedef Opm::EclThermalLawManager EclThermalLawManager; + typedef ::Opm::EclThermalLawManager EclThermalLawManager; typedef typename EclThermalLawManager::ThermalConductionLaw type; }; @@ -294,16 +294,16 @@ private: using GridView = GetPropType; public: - typedef Opm::EcfvStencil type; + typedef EcfvStencil type; }; // by default use the dummy aquifer "model" template struct EclAquiferModel { - using type = Opm::EclBaseAquiferModel; + using type = EclBaseAquiferModel; }; // use the built-in proof of concept well model by default @@ -482,20 +482,20 @@ struct EnableStorageCache { // Use the "velocity module" which uses the Eclipse "NEWTRAN" transmissibilities template struct FluxModule { - using type = Opm::EclTransFluxModule; + using type = EclTransFluxModule; }; // Use the dummy gradient calculator in order not to do unnecessary work. template struct GradientCalculator { - using type = Opm::EclDummyGradientCalculator; + using type = EclDummyGradientCalculator; }; // Use a custom Newton-Raphson method class for ebos in order to attain more // sophisticated update and error computation mechanisms template struct NewtonMethod { - using type = Opm::EclNewtonMethod; + using type = EclNewtonMethod; }; // The frequency of writing restart (*.ers) files. This is the number of time steps @@ -667,7 +667,7 @@ class EclProblem : public GetPropType typedef typename EclEquilInitializer::ScalarFluidState InitialFluidState; - typedef Opm::MathToolbox Toolbox; + typedef MathToolbox Toolbox; typedef Dune::FieldMatrix DimMatrix; typedef EclWriter EclWriterType; @@ -676,8 +676,8 @@ class EclProblem : public GetPropType typedef typename GridView::template Codim<0>::Iterator ElementIterator; - typedef Opm::UniformXTabulated2DFunction TabulatedTwoDFunction; - typedef Opm::Tabulated1DFunction TabulatedFunction; + typedef UniformXTabulated2DFunction TabulatedTwoDFunction; + typedef Tabulated1DFunction TabulatedFunction; struct RockParams { Scalar referencePressure; @@ -851,7 +851,7 @@ public: restartShrinkFactor_ = EWOMS_GET_PARAM(TypeTag, Scalar, EclRestartShrinkFactor); maxFails_ = EWOMS_GET_PARAM(TypeTag, unsigned, MaxTimeStepDivisions); - Opm::RelpermDiagnostics relpermDiagnostics; + RelpermDiagnostics relpermDiagnostics; relpermDiagnostics.diagnosis(vanguard.eclState(), vanguard.cartesianIndexMapper()); } @@ -1042,7 +1042,7 @@ public: const auto& schedule = simulator.vanguard().schedule(); const auto& events = schedule[episodeIdx].events(); - if (episodeIdx >= 0 && events.hasEvent(Opm::ScheduleEvents::GEO_MODIFIER)) { + if (episodeIdx >= 0 && events.hasEvent(ScheduleEvents::GEO_MODIFIER)) { // bring the contents of the keywords to the current state of the SCHEDULE // section. // @@ -1078,7 +1078,7 @@ public: // react to TUNING changes bool tuningEvent = false; - if (episodeIdx > 0 && enableTuning_ && events.hasEvent(Opm::ScheduleEvents::TUNING_CHANGE)) + if (episodeIdx > 0 && enableTuning_ && events.hasEvent(ScheduleEvents::TUNING_CHANGE)) { const auto& tuning = schedule[episodeIdx].tuning(); initialTimeStepSize_ = tuning.TSINIT; @@ -1117,7 +1117,7 @@ public: if (enableExperiments && this->gridView().comm().rank() == 0 && episodeIdx >= 0) { std::ostringstream ss; boost::posix_time::time_facet* facet = new boost::posix_time::time_facet("%d-%b-%Y"); - boost::posix_time::ptime date = boost::posix_time::from_time_t((this->simulator().startTime())) + boost::posix_time::milliseconds(static_cast(this->simulator().time() / Opm::prefix::milli)); + boost::posix_time::ptime date = boost::posix_time::from_time_t((this->simulator().startTime())) + boost::posix_time::milliseconds(static_cast(this->simulator().time() / prefix::milli)); ss.imbue(std::locale(std::locale::classic(), facet)); ss <<"\nTime step " << this->simulator().timeStepIndex() << ", stepsize " << unit::convert::to(this->simulator().timeStepSize(), unit::day) << " days," @@ -1308,8 +1308,8 @@ public: std::unordered_map fetchWellPI(int reportStep, - const Opm::Action::ActionX& action, - const Opm::Schedule& schedule, + const Action::ActionX& action, + const Schedule& schedule, const std::vector& matching_wells) { auto wellpi_wells = action.wellpi_wells(WellMatcher(schedule[reportStep].well_order(), @@ -1356,16 +1356,16 @@ public: void applyActions(int reportStep, double sim_time, - Opm::EclipseState& ecl_state, - Opm::Schedule& schedule, - Opm::Action::State& actionState, - Opm::SummaryState& summaryState) { + EclipseState& ecl_state, + Schedule& schedule, + Action::State& actionState, + SummaryState& summaryState) { const auto& actions = schedule[reportStep].actions(); if (actions.empty()) return; - Opm::Action::Context context( summaryState, schedule[reportStep].wlist_manager() ); - auto now = Opm::TimeStampUTC( schedule.getStartTime() ) + std::chrono::duration(sim_time); + Action::Context context( summaryState, schedule[reportStep].wlist_manager() ); + auto now = TimeStampUTC( schedule.getStartTime() ) + std::chrono::duration(sim_time); std::string ts; { std::ostringstream os; @@ -1381,7 +1381,7 @@ public: } bool commit_wellstate = false; - auto simTime = Opm::asTimeT(now); + auto simTime = asTimeT(now); for (const auto& action : actions.pending(actionState, simTime)) { auto actionResult = action->eval(context); if (actionResult) { @@ -1393,18 +1393,18 @@ public: wells_string += matching_wells.back(); } std::string msg = "The action: " + action->name() + " evaluated to true at " + ts + " wells: " + wells_string; - Opm::OpmLog::info(msg); + OpmLog::info(msg); const auto& wellpi = this->fetchWellPI(reportStep, *action, schedule, matching_wells); - auto affected_wells = schedule.applyAction(reportStep, Opm::TimeService::from_time_t(simTime), *action, actionResult, wellpi); + auto affected_wells = schedule.applyAction(reportStep, TimeService::from_time_t(simTime), *action, actionResult, wellpi); actionState.add_run(*action, simTime); this->wellModel_.updateEclWells(reportStep, affected_wells); if (!affected_wells.empty()) commit_wellstate = true; } else { std::string msg = "The action: " + action->name() + " evaluated to false at " + ts; - Opm::OpmLog::info(msg); + OpmLog::info(msg); } } /* @@ -1961,8 +1961,8 @@ public: for (unsigned eqIdx = 0; eqIdx < numEq; ++ eqIdx) { rate[eqIdx] /= this->model().dofTotalVolume(globalDofIdx); - Opm::Valgrind::CheckDefined(rate[eqIdx]); - assert(Opm::isfinite(rate[eqIdx])); + Valgrind::CheckDefined(rate[eqIdx]); + assert(isfinite(rate[eqIdx])); } if (enableAquifers_) @@ -2130,7 +2130,7 @@ public: const InitialFluidState& initialFluidState(unsigned globalDofIdx) const { return initialFluidStates_[globalDofIdx]; } - const Opm::EclipseIO& eclIO() const + const EclipseIO& eclIO() const { return eclWriter_->eclIO(); } bool vapparsActive() const @@ -2138,7 +2138,7 @@ public: const auto& simulator = this->simulator(); int episodeIdx = std::max(simulator.episodeIndex(), 0); const auto& oilVaporizationControl = simulator.vanguard().schedule()[episodeIdx].oilvap(); - return (oilVaporizationControl.getType() == Opm::OilVaporizationProperties::OilVaporization::VAPPARS); + return (oilVaporizationControl.getType() == OilVaporizationProperties::OilVaporization::VAPPARS); } bool nonTrivialBoundaryConditions() const @@ -2200,12 +2200,12 @@ public: tableIdx = rockTableIdx_[elementIdx]; const auto& fs = intQuants.fluidState(); - LhsEval effectiveOilPressure = Opm::decay(fs.pressure(oilPhaseIdx)); + LhsEval effectiveOilPressure = decay(fs.pressure(oilPhaseIdx)); if (!minOilPressure_.empty()) // The pore space change is irreversible effectiveOilPressure = - Opm::min(Opm::decay(fs.pressure(oilPhaseIdx)), - minOilPressure_[elementIdx]); + min(decay(fs.pressure(oilPhaseIdx)), + minOilPressure_[elementIdx]); if (!overburdenPressure_.empty()) effectiveOilPressure -= overburdenPressure_[elementIdx]; @@ -2217,7 +2217,7 @@ public: // water compaction assert(!rockCompPoroMultWc_.empty()); - LhsEval SwMax = Opm::max(Opm::decay(fs.saturation(waterPhaseIdx)), maxWaterSaturation_[elementIdx]); + LhsEval SwMax = max(decay(fs.saturation(waterPhaseIdx)), maxWaterSaturation_[elementIdx]); LhsEval SwDeltaMax = SwMax - initialFluidStates_[elementIdx].saturation(waterPhaseIdx); return rockCompPoroMultWc_[tableIdx].eval(effectiveOilPressure, SwDeltaMax, /*extrapolation=*/true); @@ -2239,13 +2239,13 @@ public: tableIdx = rockTableIdx_[elementIdx]; const auto& fs = intQuants.fluidState(); - LhsEval effectiveOilPressure = Opm::decay(fs.pressure(oilPhaseIdx)); + LhsEval effectiveOilPressure = decay(fs.pressure(oilPhaseIdx)); if (!minOilPressure_.empty()) // The pore space change is irreversible effectiveOilPressure = - Opm::min(Opm::decay(fs.pressure(oilPhaseIdx)), - minOilPressure_[elementIdx]); + min(decay(fs.pressure(oilPhaseIdx)), + minOilPressure_[elementIdx]); if (overburdenPressure_.size() > 0) effectiveOilPressure -= overburdenPressure_[elementIdx]; @@ -2255,7 +2255,7 @@ public: // water compaction assert(!rockCompTransMultWc_.empty()); - LhsEval SwMax = Opm::max(Opm::decay(fs.saturation(waterPhaseIdx)), maxWaterSaturation_[elementIdx]); + LhsEval SwMax = max(decay(fs.saturation(waterPhaseIdx)), maxWaterSaturation_[elementIdx]); LhsEval SwDeltaMax = SwMax - initialFluidStates_[elementIdx].saturation(waterPhaseIdx); return rockCompTransMultWc_[tableIdx].eval(effectiveOilPressure, SwDeltaMax, /*extrapolation=*/true); @@ -2396,21 +2396,21 @@ private: Scalar distZ = vanguard.cellThickness(compressedDofIdx); const auto& iq = elemCtx.intensiveQuantities(/*spaceIdx=*/0, /*timeIdx=*/0); const auto& fs = iq.fluidState(); - Scalar t = Opm::getValue(fs.temperature(FluidSystem::oilPhaseIdx)); - Scalar p = Opm::getValue(fs.pressure(FluidSystem::oilPhaseIdx)); - Scalar so = Opm::getValue(fs.saturation(FluidSystem::oilPhaseIdx)); + Scalar t = getValue(fs.temperature(FluidSystem::oilPhaseIdx)); + Scalar p = getValue(fs.pressure(FluidSystem::oilPhaseIdx)); + Scalar so = getValue(fs.saturation(FluidSystem::oilPhaseIdx)); Scalar rssat = FluidSystem::oilPvt().saturatedGasDissolutionFactor(fs.pvtRegionIndex(),t,p); Scalar saturatedDensity = FluidSystem::oilPvt().saturatedInverseFormationVolumeFactor(fs.pvtRegionIndex(),t,p); Scalar rsZero = 0.0; Scalar pureDensity = FluidSystem::oilPvt().inverseFormationVolumeFactor(fs.pvtRegionIndex(),t,p,rsZero); Scalar deltaDensity = saturatedDensity-pureDensity; - Scalar rs = Opm::getValue(fs.Rs()); + Scalar rs = getValue(fs.Rs()); Scalar visc = FluidSystem::oilPvt().viscosity(fs.pvtRegionIndex(),t,p,rs); - Scalar poro = Opm::getValue(iq.porosity()); + Scalar poro = getValue(iq.porosity()); // Note that for so = 0 this gives no limits (inf) for the dissolution rate // Also we restrict the effect of convective mixing to positive density differences // i.e. we only allow for fingers moving downward - convectiveDrs_[compressedDofIdx] = permz * rssat * Opm::max(0.0, deltaDensity) * g / ( so * visc * distZ * poro); + convectiveDrs_[compressedDofIdx] = permz * rssat * max(0.0, deltaDensity) * g / ( so * visc * distZ * poro); } } @@ -2436,9 +2436,9 @@ private: const auto& oilVaporizationControl = simulator.vanguard().schedule()[episodeIdx].oilvap(); if (oilVaporizationControl.getOption(pvtRegionIdx) || fs.saturation(gasPhaseIdx) > freeGasMinSaturation_) lastRs_[compressedDofIdx] = - Opm::BlackOil::template getRs_(fs, iq.pvtRegionIndex()); + BlackOil::template getRs_(fs, iq.pvtRegionIndex()); else lastRs_[compressedDofIdx] = std::numeric_limits::infinity(); } @@ -2464,9 +2464,9 @@ private: typedef typename std::decay::type FluidState; lastRv_[compressedDofIdx] = - Opm::BlackOil::template getRv_(fs, iq.pvtRegionIndex()); + BlackOil::template getRv_(fs, iq.pvtRegionIndex()); } } } @@ -2491,7 +2491,7 @@ private: const auto& iq = elemCtx.intensiveQuantities(/*spaceIdx=*/0, /*timeIdx=*/0); const auto& fs = iq.fluidState(); - Scalar So = Opm::decay(fs.saturation(oilPhaseIdx)); + Scalar So = decay(fs.saturation(oilPhaseIdx)); maxOilSaturation_[compressedDofIdx] = std::max(maxOilSaturation_[compressedDofIdx], So); } @@ -2525,7 +2525,7 @@ private: const auto& iq = elemCtx.intensiveQuantities(/*spaceIdx=*/0, /*timeIdx=*/0); const auto& fs = iq.fluidState(); - Scalar Sw = Opm::decay(fs.saturation(waterPhaseIdx)); + Scalar Sw = decay(fs.saturation(waterPhaseIdx)); maxWaterSaturation_[compressedDofIdx] = std::max(maxWaterSaturation_[compressedDofIdx], Sw); } @@ -2554,7 +2554,7 @@ private: minOilPressure_[compressedDofIdx] = std::min(minOilPressure_[compressedDofIdx], - Opm::getValue(fs.pressure(oilPhaseIdx))); + getValue(fs.pressure(oilPhaseIdx))); } return true; @@ -2596,9 +2596,9 @@ private: if (overburdTables.size() != numRocktabTables) throw std::runtime_error(std::to_string(numRocktabTables) +" OVERBURD tables is expected, but " + std::to_string(overburdTables.size()) +" is provided"); - std::vector> overburdenTables(numRocktabTables); + std::vector> overburdenTables(numRocktabTables); for (size_t regionIdx = 0; regionIdx < numRocktabTables; ++regionIdx) { - const Opm::OverburdTable& overburdTable = overburdTables.template getTable(regionIdx); + const OverburdTable& overburdTable = overburdTables.template getTable(regionIdx); overburdenTables[regionIdx].setXYContainers(overburdTable.getDepthColumn(),overburdTable.getOverburdenPressureColumn()); } @@ -2647,7 +2647,7 @@ private: rockCompPoroMult_.resize(numRocktabTables); rockCompTransMult_.resize(numRocktabTables); for (size_t regionIdx = 0; regionIdx < numRocktabTables; ++regionIdx) { - const auto& rocktabTable = rocktabTables.template getTable(regionIdx); + const auto& rocktabTable = rocktabTables.template getTable(regionIdx); const auto& pressureColumn = rocktabTable.getPressureColumn(); const auto& poroColumn = rocktabTable.getPoreVolumeMultiplierColumn(); const auto& transColumn = rocktabTable.getTransmissibilityMultiplierColumn(); @@ -2670,7 +2670,7 @@ private: //TODO check size match rockCompPoroMultWc_.resize(numRocktabTables, TabulatedTwoDFunction(TabulatedTwoDFunction::InterpolationPolicy::Vertical)); for (size_t regionIdx = 0; regionIdx < numRocktabTables; ++regionIdx) { - const Opm::RockwnodTable& rockwnodTable = rockwnodTables.template getTable(regionIdx); + const RockwnodTable& rockwnodTable = rockwnodTables.template getTable(regionIdx); const auto& rock2dTable = rock2dTables[regionIdx]; if (rockwnodTable.getSaturationColumn().size() != rock2dTable.sizeMultValues()) @@ -2688,7 +2688,7 @@ private: if (!rock2dtrTables.empty()) { rockCompTransMultWc_.resize(numRocktabTables, TabulatedTwoDFunction(TabulatedTwoDFunction::InterpolationPolicy::Vertical)); for (size_t regionIdx = 0; regionIdx < numRocktabTables; ++regionIdx) { - const Opm::RockwnodTable& rockwnodTable = rockwnodTables.template getTable(regionIdx); + const RockwnodTable& rockwnodTable = rockwnodTables.template getTable(regionIdx); const auto& rock2dtrTable = rock2dtrTables[regionIdx]; if (rockwnodTable.getSaturationColumn().size() != rock2dtrTable.sizeMultValues()) @@ -2816,7 +2816,7 @@ private: const auto& simulator = this->simulator(); // initial condition corresponds to hydrostatic conditions. - typedef Opm::EclEquilInitializer EquilInitializer; + typedef EclEquilInitializer EquilInitializer; EquilInitializer equilInitializer(simulator, *materialLawManager_); size_t numElems = this->model().numGridDof(); @@ -2861,7 +2861,7 @@ private: const std::string msg {"Support of the RESTART for polymer molecular weight " "is not implemented yet. The polymer weight value will be " "zero when RESTART begins"}; - Opm::OpmLog::warning("NO_POLYMW_RESTART", msg); + OpmLog::warning("NO_POLYMW_RESTART", msg); polymerMoleWeight_.resize(numElems, 0.0); } @@ -3077,8 +3077,8 @@ private: Dune::FieldVector pc(0.0); const auto& matParams = materialLawParams(dofIdx); MaterialLaw::capillaryPressures(pc, matParams, dofFluidState); - Opm::Valgrind::CheckDefined(oilPressure); - Opm::Valgrind::CheckDefined(pc); + Valgrind::CheckDefined(oilPressure); + Valgrind::CheckDefined(pc); for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) { if (!FluidSystem::phaseIsActive(phaseIdx)) continue; @@ -3185,7 +3185,7 @@ private: unsigned compressedDofIdx = elemCtx.globalSpaceIndex(/*spaceIdx=*/0, /*timeIdx=*/0); const auto& intQuants = elemCtx.intensiveQuantities(/*spaceIdx=*/0, /*timeIdx=*/0); - maxPolymerAdsorption_[compressedDofIdx] = std::max(maxPolymerAdsorption_[compressedDofIdx] , Opm::scalarValue(intQuants.polymerAdsorption())); + maxPolymerAdsorption_[compressedDofIdx] = std::max(maxPolymerAdsorption_[compressedDofIdx] , scalarValue(intQuants.polymerAdsorption())); } } @@ -3230,9 +3230,9 @@ private: struct PffDofData_ { - Opm::ConditionalStorage thermalHalfTransIn; - Opm::ConditionalStorage thermalHalfTransOut; - Opm::ConditionalStorage diffusivity; + ConditionalStorage thermalHalfTransIn; + ConditionalStorage thermalHalfTransOut; + ConditionalStorage diffusivity; Scalar transmissibility; }; @@ -3436,10 +3436,10 @@ private: int reportStepIdx = std::max(episodeIdx, 0); const auto& events = simulator.vanguard().schedule()[reportStepIdx].events(); bool wellEventOccured = - events.hasEvent(Opm::ScheduleEvents::NEW_WELL) - || events.hasEvent(Opm::ScheduleEvents::PRODUCTION_UPDATE) - || events.hasEvent(Opm::ScheduleEvents::INJECTION_UPDATE) - || events.hasEvent(Opm::ScheduleEvents::WELL_STATUS_CHANGE); + events.hasEvent(ScheduleEvents::NEW_WELL) + || events.hasEvent(ScheduleEvents::PRODUCTION_UPDATE) + || events.hasEvent(ScheduleEvents::INJECTION_UPDATE) + || events.hasEvent(ScheduleEvents::WELL_STATUS_CHANGE); if (episodeIdx >= 0 && wellEventOccured && maxTimeStepAfterWellEvent_ > 0) dtNext = std::min(dtNext, maxTimeStepAfterWellEvent_); } diff --git a/ebos/eclthresholdpressure.hh b/ebos/eclthresholdpressure.hh index 234023a8d..d20214c50 100644 --- a/ebos/eclthresholdpressure.hh +++ b/ebos/eclthresholdpressure.hh @@ -204,7 +204,7 @@ private: const auto& vanguard = simulator_.vanguard(); const auto& gridView = vanguard.gridView(); - typedef Opm::MathToolbox Toolbox; + typedef MathToolbox Toolbox; // loop over the whole grid and compute the maximum gravity adjusted pressure // difference between two EQUIL regions. auto elemIt = gridView.template begin(); @@ -238,7 +238,7 @@ private: // don't include connections with negligible flow const Evaluation& trans = simulator_.problem().transmissibility(elemCtx, i, j); Scalar faceArea = face.area(); - if (std::abs(faceArea*Opm::getValue(trans)) < 1e-18) + if (std::abs(faceArea*getValue(trans)) < 1e-18) continue; // determine the maximum difference of the pressure of any phase over the @@ -277,7 +277,7 @@ private: const auto& gridView = vanguard.gridView(); const auto& elementMapper = simulator_.model().elementMapper(); const auto& eclState = simulator_.vanguard().eclState(); - const Opm::SimulationConfig& simConfig = eclState.getSimulationConfig(); + const SimulationConfig& simConfig = eclState.getSimulationConfig(); const auto& thpres = simConfig.getThresholdPressure(); // set the threshold pressures for all EQUIL region boundaries which have a @@ -338,11 +338,11 @@ private: } - void extractThpresft_(const Opm::DeckKeyword& thpresftKeyword) + void extractThpresft_(const DeckKeyword& thpresftKeyword) { // retrieve the faults collection. - const Opm::EclipseState& eclState = simulator_.vanguard().eclState(); - const Opm::FaultCollection& faults = eclState.getFaults(); + const EclipseState& eclState = simulator_.vanguard().eclState(); + const FaultCollection& faults = eclState.getFaults(); // extract the multipliers from the deck keyword int numFaults = faults.size(); @@ -350,7 +350,7 @@ private: thpresftValues_.resize(numFaults, -1.0); cartElemFaultIdx_.resize(numCartesianElem, -1); for (size_t recordIdx = 0; recordIdx < thpresftKeyword.size(); ++ recordIdx) { - const Opm::DeckRecord& record = thpresftKeyword.getRecord(recordIdx); + const DeckRecord& record = thpresftKeyword.getRecord(recordIdx); const std::string& faultName = record.getItem("FAULT_NAME").getTrimmedString(0); Scalar thpresValue = record.getItem("VALUE").getSIDouble(0); @@ -361,7 +361,7 @@ private: continue; thpresftValues_[faultIdx] = thpresValue; - for (const Opm::FaultFace& face: fault) + for (const FaultFace& face: fault) // "face" is a misnomer because the object describes a set of cell // indices, but we go with the conventions of the parser here... for (size_t cartElemIdx: face) diff --git a/ebos/ecltracermodel.hh b/ebos/ecltracermodel.hh index 5ea35800c..0b9cd9a39 100644 --- a/ebos/ecltracermodel.hh +++ b/ebos/ecltracermodel.hh @@ -74,7 +74,7 @@ class EclTracerModel using RateVector = GetPropType; using Indices = GetPropType; - typedef Opm::DenseAd::Evaluation TracerEvaluation; + typedef DenseAd::Evaluation TracerEvaluation; enum { numEq = getPropValue() }; enum { numPhases = FluidSystem::numPhases }; @@ -332,19 +332,19 @@ protected: const auto& intQuants = elemCtx.intensiveQuantities(scvIdx, timeIdx); const auto& fs = intQuants.fluidState(); Scalar phaseVolume = - Opm::decay(fs.saturation(tracerPhaseIdx_[tracerIdx])) - *Opm::decay(fs.invB(tracerPhaseIdx_[tracerIdx])) - *Opm::decay(intQuants.porosity()); + decay(fs.saturation(tracerPhaseIdx_[tracerIdx])) + *decay(fs.invB(tracerPhaseIdx_[tracerIdx])) + *decay(intQuants.porosity()); // avoid singular matrix if no water is present. - phaseVolume = Opm::max(phaseVolume, 1e-10); + phaseVolume = max(phaseVolume, 1e-10); if (std::is_same::value) tracerStorage = phaseVolume * tracerConcentrationInitial_[tracerIdx][globalDofIdx]; else tracerStorage = phaseVolume - * Opm::variable(tracerConcentration_[tracerIdx][globalDofIdx][0], 0); + * variable(tracerConcentration_[tracerIdx][globalDofIdx][0], 0); } // evaluate the tracerflux over one face @@ -370,12 +370,12 @@ protected: const auto& fs = intQuants.fluidState(); Scalar A = scvf.area(); - Scalar v = Opm::decay(extQuants.volumeFlux(tracerPhaseIdx)); - Scalar b = Opm::decay(fs.invB(tracerPhaseIdx_[tracerIdx])); + Scalar v = decay(extQuants.volumeFlux(tracerPhaseIdx)); + Scalar b = decay(fs.invB(tracerPhaseIdx_[tracerIdx])); Scalar c = tracerConcentration_[tracerIdx][globalUpIdx]; if (inIdx == upIdx) - tracerFlux = A*v*b*Opm::variable(c, 0); + tracerFlux = A*v*b*variable(c, 0); else tracerFlux = A*v*b*c; @@ -427,8 +427,8 @@ protected: Scalar extrusionFactor = elemCtx.intensiveQuantities(/*dofIdx=*/ 0, /*timeIdx=*/0).extrusionFactor(); - Opm::Valgrind::CheckDefined(extrusionFactor); - assert(Opm::isfinite(extrusionFactor)); + Valgrind::CheckDefined(extrusionFactor); + assert(isfinite(extrusionFactor)); assert(extrusionFactor > 0.0); Scalar scvVolume = elemCtx.stencil(/*timeIdx=*/0).subControlVolume(/*dofIdx=*/ 0).volume() @@ -468,14 +468,14 @@ protected: const auto& wells = simulator_.vanguard().schedule().getWells(episodeIdx); for (const auto& well : wells) { - if (well.getStatus() == Opm::Well::Status::SHUT) + if (well.getStatus() == Well::Status::SHUT) continue; const double wtracer = well.getTracerProperties().getConcentration(tracerNames_[tracerIdx]); std::array cartesianCoordinate; for (auto& connection : well.getConnections()) { - if (connection.state() == Opm::Connection::State::SHUT) + if (connection.state() == Connection::State::SHUT) continue; cartesianCoordinate[0] = connection.getI(); diff --git a/ebos/eclwriter.hh b/ebos/eclwriter.hh index 78e78304e..2e1685cec 100644 --- a/ebos/eclwriter.hh +++ b/ebos/eclwriter.hh @@ -195,10 +195,10 @@ public: std::vector wbp_index_list; if (collectToIORank_.isIORank()) { const auto& schedule = simulator_.vanguard().schedule(); - eclIO_.reset(new Opm::EclipseIO(simulator_.vanguard().eclState(), - Opm::UgGridHelpers::createEclipseGrid(globalGrid(), simulator_.vanguard().eclState().getInputGrid()), - schedule, - simulator_.vanguard().summaryConfig())); + eclIO_.reset(new EclipseIO(simulator_.vanguard().eclState(), + UgGridHelpers::createEclipseGrid(globalGrid(), simulator_.vanguard().eclState().getInputGrid()), + schedule, + simulator_.vanguard().summaryConfig())); const auto& wbp_calculators = eclIO_->summary().wbp_calculators( schedule.size() - 1 ); wbp_index_list = wbp_calculators.index_list(); @@ -225,7 +225,7 @@ public: ~EclWriter() { } - const Opm::EclipseIO& eclIO() const + const EclipseIO& eclIO() const { assert(eclIO_); return *eclIO_; @@ -242,8 +242,8 @@ public: std::map > integerVectors; if (collectToIORank_.isParallel()) integerVectors.emplace("MPI_RANK", collectToIORank_.globalRanks()); - auto cartMap = Opm::cartesianToCompressed(globalGrid().size(0), - Opm::UgGridHelpers::globalCell(globalGrid())); + auto cartMap = cartesianToCompressed(globalGrid().size(0), + UgGridHelpers::globalCell(globalGrid())); eclIO_->writeInitial(computeTrans_(cartMap), integerVectors, exportNncStructure_(cartMap)); } } @@ -380,7 +380,7 @@ public: MPI_Bcast(buffer.data(), buffer_size, MPI_CHAR, collectToIORank_.ioRank, MPI_COMM_WORLD); if (!collectToIORank_.isIORank()) { - Opm::SummaryState& st = summaryState(); + SummaryState& st = summaryState(); st.deserialize(buffer); } #endif @@ -400,7 +400,7 @@ public: auto localGroupAndNetworkData = simulator_.problem().wellModel() .groupAndNetworkData(reportStepNum, simulator_.vanguard().schedule()); - Opm::data::Solution localCellData = {}; + data::Solution localCellData = {}; if (! isSubStep) { this->eclOutputModule_->assignToSolution(localCellData); @@ -429,25 +429,25 @@ public: { bool enableHysteresis = simulator_.problem().materialLawManager()->enableHysteresis(); bool enableSwatinit = simulator_.vanguard().eclState().fieldProps().has_double("SWATINIT"); - std::vector solutionKeys{ - {"PRESSURE", Opm::UnitSystem::measure::pressure}, - {"SWAT", Opm::UnitSystem::measure::identity, static_cast(FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx))}, - {"SGAS", Opm::UnitSystem::measure::identity, static_cast(FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx))}, - {"TEMP" , Opm::UnitSystem::measure::temperature, enableEnergy}, - {"SSOLVENT" , Opm::UnitSystem::measure::identity, enableSolvent}, - {"RS", Opm::UnitSystem::measure::gas_oil_ratio, FluidSystem::enableDissolvedGas()}, - {"RV", Opm::UnitSystem::measure::oil_gas_ratio, FluidSystem::enableVaporizedOil()}, - {"SOMAX", Opm::UnitSystem::measure::identity, simulator_.problem().vapparsActive()}, - {"PCSWM_OW", Opm::UnitSystem::measure::identity, enableHysteresis}, - {"KRNSW_OW", Opm::UnitSystem::measure::identity, enableHysteresis}, - {"PCSWM_GO", Opm::UnitSystem::measure::identity, enableHysteresis}, - {"KRNSW_GO", Opm::UnitSystem::measure::identity, enableHysteresis}, - {"PPCW", Opm::UnitSystem::measure::pressure, enableSwatinit} + std::vector solutionKeys{ + {"PRESSURE", UnitSystem::measure::pressure}, + {"SWAT", UnitSystem::measure::identity, static_cast(FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx))}, + {"SGAS", UnitSystem::measure::identity, static_cast(FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx))}, + {"TEMP" , UnitSystem::measure::temperature, enableEnergy}, + {"SSOLVENT" , UnitSystem::measure::identity, enableSolvent}, + {"RS", UnitSystem::measure::gas_oil_ratio, FluidSystem::enableDissolvedGas()}, + {"RV", UnitSystem::measure::oil_gas_ratio, FluidSystem::enableVaporizedOil()}, + {"SOMAX", UnitSystem::measure::identity, simulator_.problem().vapparsActive()}, + {"PCSWM_OW", UnitSystem::measure::identity, enableHysteresis}, + {"KRNSW_OW", UnitSystem::measure::identity, enableHysteresis}, + {"PCSWM_GO", UnitSystem::measure::identity, enableHysteresis}, + {"KRNSW_GO", UnitSystem::measure::identity, enableHysteresis}, + {"PPCW", UnitSystem::measure::pressure, enableSwatinit} }; const auto& inputThpres = eclState().getSimulationConfig().getThresholdPressure(); - std::vector extraKeys = {{"OPMEXTRA", Opm::UnitSystem::measure::identity, false}, - {"THRESHPR", Opm::UnitSystem::measure::pressure, inputThpres.active()}}; + std::vector extraKeys = {{"OPMEXTRA", UnitSystem::measure::identity, false}, + {"THRESHPR", UnitSystem::measure::pressure, inputThpres.active()}}; // The episodeIndex is rewined one back before beginRestart is called // and can not be used here. @@ -461,8 +461,8 @@ public: eclOutputModule_->allocBuffers(numElements, restartStepIdx, /*isSubStep=*/false, /*log=*/false, /*isRestart*/ true); { - Opm::SummaryState& summaryState = simulator_.vanguard().summaryState(); - Opm::Action::State& actionState = simulator_.vanguard().actionState(); + SummaryState& summaryState = simulator_.vanguard().summaryState(); + Action::State& actionState = simulator_.vanguard().actionState(); auto restartValues = loadParallelRestart(eclIO_.get(), actionState, summaryState, solutionKeys, extraKeys, gridView.grid().comm()); for (unsigned elemIdx = 0; elemIdx < numElements; ++elemIdx) { @@ -500,15 +500,15 @@ private: static bool enableEclOutput_() { return EWOMS_GET_PARAM(TypeTag, bool, EnableEclOutput); } - Opm::data::Solution computeTrans_(const std::unordered_map& cartesianToActive) const + data::Solution computeTrans_(const std::unordered_map& cartesianToActive) const { const auto& cartMapper = simulator_.vanguard().equilCartesianIndexMapper(); const auto& cartDims = cartMapper.cartesianDimensions(); const int globalSize = cartDims[0]*cartDims[1]*cartDims[2]; - Opm::data::CellData tranx = {Opm::UnitSystem::measure::transmissibility, std::vector(globalSize), Opm::data::TargetType::INIT}; - Opm::data::CellData trany = {Opm::UnitSystem::measure::transmissibility, std::vector(globalSize), Opm::data::TargetType::INIT}; - Opm::data::CellData tranz = {Opm::UnitSystem::measure::transmissibility, std::vector(globalSize), Opm::data::TargetType::INIT}; + data::CellData tranx = {UnitSystem::measure::transmissibility, std::vector(globalSize), data::TargetType::INIT}; + data::CellData trany = {UnitSystem::measure::transmissibility, std::vector(globalSize), data::TargetType::INIT}; + data::CellData tranz = {UnitSystem::measure::transmissibility, std::vector(globalSize), data::TargetType::INIT}; for (size_t i = 0; i < tranx.data.size(); ++i) { tranx.data[0] = 0.0; @@ -592,7 +592,7 @@ private: std::size_t ny = eclState().getInputGrid().getNY(); auto nncData = eclState().getInputNNC().input(); const auto& unitSystem = simulator_.vanguard().eclState().getDeckUnitSystem(); - std::vector outputNnc; + std::vector outputNnc; std::size_t index = 0; for( const auto& entry : nncData ) { @@ -602,7 +602,7 @@ private: auto cellDiff = entry.cell2 - entry.cell1; if (cellDiff != 1 && cellDiff != nx && cellDiff != nx*ny) { - auto tt = unitSystem.from_si(Opm::UnitSystem::measure::transmissibility, entry.trans); + auto tt = unitSystem.from_si(UnitSystem::measure::transmissibility, entry.trans); // Eclipse ignores NNCs (with EDITNNC applied) that are small. Seems like the threshold is 1.0e-6 if ( tt >= 1.0e-6 ) outputNnc.emplace_back(entry.cell1, entry.cell2, entry.trans); @@ -667,7 +667,7 @@ private: // We need to check whether an NNC for this face was also specified // via the NNC keyword in the deck (i.e. in the first origNncSize entries. auto t = globalTrans->transmissibility(c1, c2); - auto candidate = std::lower_bound(nncData.begin(), nncData.end(), Opm::NNCdata(cc1, cc2, 0.0)); + auto candidate = std::lower_bound(nncData.begin(), nncData.end(), NNCdata(cc1, cc2, 0.0)); while ( candidate != nncData.end() && candidate->cell1 == cc1 && candidate->cell2 == cc2) { @@ -677,7 +677,7 @@ private: // eclipse ignores NNCs with zero transmissibility (different threshold than for NNC // with corresponding EDITNNC above). In addition we do set small transmissibilties // to zero when setting up the simulator. These will be ignored here, too. - auto tt = unitSystem.from_si(Opm::UnitSystem::measure::transmissibility, std::abs(t)); + auto tt = unitSystem.from_si(UnitSystem::measure::transmissibility, std::abs(t)); if ( tt > 1e-12 ) outputNnc.push_back({cc1, cc2, t}); } @@ -689,24 +689,24 @@ private: struct EclWriteTasklet : public TaskletInterface { - Opm::Action::State actionState_; - Opm::SummaryState summaryState_; - Opm::UDQState udqState_; - Opm::EclipseIO& eclIO_; + Action::State actionState_; + SummaryState summaryState_; + UDQState udqState_; + EclipseIO& eclIO_; int reportStepNum_; bool isSubStep_; double secondsElapsed_; - Opm::RestartValue restartValue_; + RestartValue restartValue_; bool writeDoublePrecision_; - explicit EclWriteTasklet(const Opm::Action::State& actionState, - const Opm::SummaryState& summaryState, - const Opm::UDQState& udqState, - Opm::EclipseIO& eclIO, + explicit EclWriteTasklet(const Action::State& actionState, + const SummaryState& summaryState, + const UDQState& udqState, + EclipseIO& eclIO, int reportStepNum, bool isSubStep, double secondsElapsed, - Opm::RestartValue restartValue, + RestartValue restartValue, bool writeDoublePrecision) : actionState_(actionState) , summaryState_(summaryState) @@ -733,19 +733,19 @@ private: } }; - const Opm::EclipseState& eclState() const + const EclipseState& eclState() const { return simulator_.vanguard().eclState(); } - Opm::SummaryState& summaryState() + SummaryState& summaryState() { return simulator_.vanguard().summaryState(); } - Opm::Action::State& actionState() + Action::State& actionState() { return simulator_.vanguard().actionState(); } - Opm::UDQState& udqState() + UDQState& udqState() { return simulator_.vanguard().udqState(); } - const Opm::Schedule& schedule() const + const Schedule& schedule() const { return simulator_.vanguard().schedule(); } void prepareLocalCellData(const bool isSubStep, @@ -782,7 +782,7 @@ private: const Scalar nextStepSize = simulator_.problem().nextTimeStepSize(); const auto isParallel = this->collectToIORank_.isParallel(); - Opm::RestartValue restartValue { + RestartValue restartValue { isParallel ? this->collectToIORank_.globalCellData() : std::move(localCellData), @@ -794,7 +794,7 @@ private: }; if (simulator_.vanguard().eclState().getSimulationConfig().useThresholdPressure()) { - restartValue.addExtra("THRESHPR", Opm::UnitSystem::measure::pressure, + restartValue.addExtra("THRESHPR", UnitSystem::measure::pressure, simulator_.problem().thresholdPressure().data()); } @@ -823,7 +823,7 @@ private: Simulator& simulator_; CollectDataToIORankType collectToIORank_; std::unique_ptr> eclOutputModule_; - std::unique_ptr eclIO_; + std::unique_ptr eclIO_; std::unique_ptr taskletRunner_; Scalar restartTimeStepSize_; }; diff --git a/ebos/startEbos.hh b/ebos/startEbos.hh index 7dfcf8856..da3105173 100644 --- a/ebos/startEbos.hh +++ b/ebos/startEbos.hh @@ -91,7 +91,7 @@ static inline int startEbos(int argc, char **argv) // Call the main function. Parameters are already registered // They should not be registered again - return Opm::start(argc, argv, /*registerParams=*/false); + return start(argc, argv, /*registerParams=*/false); } diff --git a/ebos/vtkecltracermodule.hh b/ebos/vtkecltracermodule.hh index 6065670f1..78263b147 100644 --- a/ebos/vtkecltracermodule.hh +++ b/ebos/vtkecltracermodule.hh @@ -81,7 +81,7 @@ namespace Opm { using FluidSystem = GetPropType; static const int vtkFormat = getPropValue(); - typedef Opm::VtkMultiWriter VtkMultiWriter; + typedef ::Opm::VtkMultiWriter VtkMultiWriter; typedef typename ParentType::ScalarBuffer ScalarBuffer; diff --git a/flow/flow_ebos_blackoil.hpp b/flow/flow_ebos_blackoil.hpp index cd1679b20..fa854ea93 100644 --- a/flow/flow_ebos_blackoil.hpp +++ b/flow/flow_ebos_blackoil.hpp @@ -35,7 +35,7 @@ void flowEbosBlackoilSetDeck(double setupTime, std::unique_ptr deck, int flowEbosBlackoilMain(int argc, char** argv, bool outputCout, bool outputFiles); -std::unique_ptr> +std::unique_ptr> flowEbosBlackoilMainInit(int argc, char** argv, bool outputCout, bool outputFiles); } diff --git a/flow/flow_ebos_brine.cpp b/flow/flow_ebos_brine.cpp index 6ba2b673b..9ffc85b47 100644 --- a/flow/flow_ebos_brine.cpp +++ b/flow/flow_ebos_brine.cpp @@ -64,7 +64,7 @@ int flowEbosBrineMain(int argc, char** argv, bool outputCout, bool outputFiles) { // we always want to use the default locale, and thus spare us the trouble // with incorrect locale settings. - Opm::resetLocale(); + resetLocale(); // initialize MPI, finalize is done automatically on exit #if HAVE_DUNE_FEM @@ -73,7 +73,7 @@ int flowEbosBrineMain(int argc, char** argv, bool outputCout, bool outputFiles) Dune::MPIHelper::instance(argc, argv).rank(); #endif - Opm::FlowMainEbos + FlowMainEbos mainfunc {argc, argv, outputCout, outputFiles}; return mainfunc.execute(); } diff --git a/flow/flow_ebos_energy.cpp b/flow/flow_ebos_energy.cpp index 5f45c0708..13f41eda5 100644 --- a/flow/flow_ebos_energy.cpp +++ b/flow/flow_ebos_energy.cpp @@ -63,7 +63,7 @@ int flowEbosEnergyMain(int argc, char** argv, bool outputCout, bool outputFiles) { // we always want to use the default locale, and thus spare us the trouble // with incorrect locale settings. - Opm::resetLocale(); + resetLocale(); // initialize MPI, finalize is done automatically on exit #if HAVE_DUNE_FEM @@ -72,7 +72,7 @@ int flowEbosEnergyMain(int argc, char** argv, bool outputCout, bool outputFiles) Dune::MPIHelper::instance(argc, argv).rank(); #endif - Opm::FlowMainEbos + FlowMainEbos mainfunc {argc, argv, outputCout, outputFiles}; return mainfunc.execute(); } diff --git a/flow/flow_ebos_extbo.cpp b/flow/flow_ebos_extbo.cpp index 85eeb7ff2..a759c6929 100644 --- a/flow/flow_ebos_extbo.cpp +++ b/flow/flow_ebos_extbo.cpp @@ -63,7 +63,7 @@ int flowEbosExtboMain(int argc, char** argv, bool outputCout, bool outputFiles) { // we always want to use the default locale, and thus spare us the trouble // with incorrect locale settings. - Opm::resetLocale(); + resetLocale(); // initialize MPI, finalize is done automatically on exit #if HAVE_DUNE_FEM @@ -72,7 +72,7 @@ int flowEbosExtboMain(int argc, char** argv, bool outputCout, bool outputFiles) Dune::MPIHelper::instance(argc, argv).rank(); #endif - Opm::FlowMainEbos + FlowMainEbos mainfunc {argc, argv, outputCout, outputFiles}; return mainfunc.execute(); } diff --git a/flow/flow_ebos_foam.cpp b/flow/flow_ebos_foam.cpp index afee1ac43..6d40ca6da 100644 --- a/flow/flow_ebos_foam.cpp +++ b/flow/flow_ebos_foam.cpp @@ -64,7 +64,7 @@ int flowEbosFoamMain(int argc, char** argv, bool outputCout, bool outputFiles) { // we always want to use the default locale, and thus spare us the trouble // with incorrect locale settings. - Opm::resetLocale(); + resetLocale(); // initialize MPI, finalize is done automatically on exit #if HAVE_DUNE_FEM @@ -73,7 +73,7 @@ int flowEbosFoamMain(int argc, char** argv, bool outputCout, bool outputFiles) Dune::MPIHelper::instance(argc, argv).rank(); #endif - Opm::FlowMainEbos + FlowMainEbos mainfunc {argc, argv, outputCout, outputFiles}; return mainfunc.execute(); } diff --git a/flow/flow_ebos_gasoil.cpp b/flow/flow_ebos_gasoil.cpp index 429c21388..69f4e9c37 100644 --- a/flow/flow_ebos_gasoil.cpp +++ b/flow/flow_ebos_gasoil.cpp @@ -51,14 +51,14 @@ private: using FluidSystem = GetPropType; public: - typedef Opm::BlackOilTwoPhaseIndices(), - getPropValue(), - getPropValue(), - getPropValue(), - getPropValue(), - getPropValue(), - /*PVOffset=*/0, - /*disabledCompIdx=*/FluidSystem::waterCompIdx> type; + typedef BlackOilTwoPhaseIndices(), + getPropValue(), + getPropValue(), + getPropValue(), + getPropValue(), + getPropValue(), + /*PVOffset=*/0, + /*disabledCompIdx=*/FluidSystem::waterCompIdx> type; }; }} @@ -84,7 +84,7 @@ int flowEbosGasOilMain(int argc, char** argv, bool outputCout, bool outputFiles) { // we always want to use the default locale, and thus spare us the trouble // with incorrect locale settings. - Opm::resetLocale(); + resetLocale(); #if HAVE_DUNE_FEM Dune::Fem::MPIManager::initialize(argc, argv); @@ -92,7 +92,7 @@ int flowEbosGasOilMain(int argc, char** argv, bool outputCout, bool outputFiles) Dune::MPIHelper::instance(argc, argv); #endif - Opm::FlowMainEbos + FlowMainEbos mainfunc {argc, argv, outputCout, outputFiles} ; return mainfunc.execute(); } diff --git a/flow/flow_ebos_gaswater.cpp b/flow/flow_ebos_gaswater.cpp index 36771df9f..c76500db8 100644 --- a/flow/flow_ebos_gaswater.cpp +++ b/flow/flow_ebos_gaswater.cpp @@ -54,14 +54,14 @@ private: using FluidSystem = GetPropType; public: - typedef Opm::BlackOilTwoPhaseIndices(), - getPropValue(), - getPropValue(), - getPropValue(), - getPropValue(), - getPropValue(), - /*PVOffset=*/0, - /*disabledCompIdx=*/FluidSystem::oilCompIdx> type; + typedef BlackOilTwoPhaseIndices(), + getPropValue(), + getPropValue(), + getPropValue(), + getPropValue(), + getPropValue(), + /*PVOffset=*/0, + /*disabledCompIdx=*/FluidSystem::oilCompIdx> type; }; }} @@ -87,7 +87,7 @@ int flowEbosGasWaterMain(int argc, char** argv, bool outputCout, bool outputFile { // we always want to use the default locale, and thus spare us the trouble // with incorrect locale settings. - Opm::resetLocale(); + resetLocale(); #if HAVE_DUNE_FEM Dune::Fem::MPIManager::initialize(argc, argv); @@ -95,7 +95,7 @@ int flowEbosGasWaterMain(int argc, char** argv, bool outputCout, bool outputFile Dune::MPIHelper::instance(argc, argv); #endif - Opm::FlowMainEbos + FlowMainEbos mainfunc {argc, argv, outputCout, outputFiles} ; return mainfunc.execute(); } diff --git a/flow/flow_ebos_oilwater.cpp b/flow/flow_ebos_oilwater.cpp index 3a1e1b99d..557601a43 100644 --- a/flow/flow_ebos_oilwater.cpp +++ b/flow/flow_ebos_oilwater.cpp @@ -51,14 +51,14 @@ private: using FluidSystem = GetPropType; public: - typedef Opm::BlackOilTwoPhaseIndices(), - getPropValue(), - getPropValue(), - getPropValue(), - getPropValue(), - getPropValue(), - /*PVOffset=*/0, - /*disabledCompIdx=*/FluidSystem::gasCompIdx> type; + typedef BlackOilTwoPhaseIndices(), + getPropValue(), + getPropValue(), + getPropValue(), + getPropValue(), + getPropValue(), + /*PVOffset=*/0, + /*disabledCompIdx=*/FluidSystem::gasCompIdx> type; }; }} @@ -83,7 +83,7 @@ int flowEbosOilWaterMain(int argc, char** argv, bool outputCout, bool outputFile { // we always want to use the default locale, and thus spare us the trouble // with incorrect locale settings. - Opm::resetLocale(); + resetLocale(); #if HAVE_DUNE_FEM Dune::Fem::MPIManager::initialize(argc, argv); @@ -91,7 +91,7 @@ int flowEbosOilWaterMain(int argc, char** argv, bool outputCout, bool outputFile Dune::MPIHelper::instance(argc, argv); #endif - Opm::FlowMainEbos + FlowMainEbos mainfunc {argc, argv, outputCout, outputFiles}; return mainfunc.execute(); } diff --git a/flow/flow_ebos_oilwater_brine.cpp b/flow/flow_ebos_oilwater_brine.cpp index f0b2dbbbb..759a0f610 100644 --- a/flow/flow_ebos_oilwater_brine.cpp +++ b/flow/flow_ebos_oilwater_brine.cpp @@ -54,14 +54,14 @@ private: using FluidSystem = GetPropType; public: - typedef Opm::BlackOilTwoPhaseIndices(), - getPropValue(), - getPropValue(), - getPropValue(), - getPropValue(), - getPropValue(), - /*PVOffset=*/0, - /*disabledCompIdx=*/FluidSystem::gasCompIdx> type; + typedef BlackOilTwoPhaseIndices(), + getPropValue(), + getPropValue(), + getPropValue(), + getPropValue(), + getPropValue(), + /*PVOffset=*/0, + /*disabledCompIdx=*/FluidSystem::gasCompIdx> type; }; }} @@ -86,7 +86,7 @@ int flowEbosOilWaterBrineMain(int argc, char** argv, bool outputCout, bool outpu { // we always want to use the default locale, and thus spare us the trouble // with incorrect locale settings. - Opm::resetLocale(); + resetLocale(); #if HAVE_DUNE_FEM Dune::Fem::MPIManager::initialize(argc, argv); @@ -94,7 +94,7 @@ int flowEbosOilWaterBrineMain(int argc, char** argv, bool outputCout, bool outpu Dune::MPIHelper::instance(argc, argv); #endif - Opm::FlowMainEbos + FlowMainEbos mainfunc {argc, argv, outputCout, outputFiles}; return mainfunc.execute(); } diff --git a/flow/flow_ebos_oilwater_polymer.cpp b/flow/flow_ebos_oilwater_polymer.cpp index e3207c195..e25508776 100644 --- a/flow/flow_ebos_oilwater_polymer.cpp +++ b/flow/flow_ebos_oilwater_polymer.cpp @@ -54,14 +54,14 @@ private: using FluidSystem = GetPropType; public: - typedef Opm::BlackOilTwoPhaseIndices(), - getPropValue(), - getPropValue(), - getPropValue(), - getPropValue(), - getPropValue(), - /*PVOffset=*/0, - /*disabledCompIdx=*/FluidSystem::gasCompIdx> type; + typedef BlackOilTwoPhaseIndices(), + getPropValue(), + getPropValue(), + getPropValue(), + getPropValue(), + getPropValue(), + /*PVOffset=*/0, + /*disabledCompIdx=*/FluidSystem::gasCompIdx> type; }; }} @@ -86,7 +86,7 @@ int flowEbosOilWaterPolymerMain(int argc, char** argv, bool outputCout, bool out { // we always want to use the default locale, and thus spare us the trouble // with incorrect locale settings. - Opm::resetLocale(); + resetLocale(); #if HAVE_DUNE_FEM Dune::Fem::MPIManager::initialize(argc, argv); @@ -94,7 +94,7 @@ int flowEbosOilWaterPolymerMain(int argc, char** argv, bool outputCout, bool out Dune::MPIHelper::instance(argc, argv); #endif - Opm::FlowMainEbos + FlowMainEbos mainfunc {argc, argv, outputCout, outputFiles}; return mainfunc.execute(); } diff --git a/flow/flow_ebos_oilwater_polymer_injectivity.cpp b/flow/flow_ebos_oilwater_polymer_injectivity.cpp index 09af0ba7f..e0639eaa6 100644 --- a/flow/flow_ebos_oilwater_polymer_injectivity.cpp +++ b/flow/flow_ebos_oilwater_polymer_injectivity.cpp @@ -60,14 +60,14 @@ private: using FluidSystem = GetPropType; public: - typedef Opm::BlackOilTwoPhaseIndices<0, - 0, - 2, - 0, - getPropValue(), - getPropValue(), - /*PVOffset=*/0, - /*disabledCompIdx=*/FluidSystem::gasCompIdx> type; + typedef BlackOilTwoPhaseIndices<0, + 0, + 2, + 0, + getPropValue(), + getPropValue(), + /*PVOffset=*/0, + /*disabledCompIdx=*/FluidSystem::gasCompIdx> type; }; }} @@ -85,7 +85,7 @@ int flowEbosOilWaterPolymerInjectivityMain(int argc, char** argv, bool outputCou { // we always want to use the default locale, and thus spare us the trouble // with incorrect locale settings. - Opm::resetLocale(); + resetLocale(); #if HAVE_DUNE_FEM Dune::Fem::MPIManager::initialize(argc, argv); @@ -93,7 +93,7 @@ int flowEbosOilWaterPolymerInjectivityMain(int argc, char** argv, bool outputCou Dune::MPIHelper::instance(argc, argv); #endif - Opm::FlowMainEbos + FlowMainEbos mainfunc {argc, argv, outputCout, outputFiles}; return mainfunc.execute(); } diff --git a/flow/flow_ebos_polymer.cpp b/flow/flow_ebos_polymer.cpp index 8d87d1803..ef4eab9b7 100644 --- a/flow/flow_ebos_polymer.cpp +++ b/flow/flow_ebos_polymer.cpp @@ -63,7 +63,7 @@ int flowEbosPolymerMain(int argc, char** argv, bool outputCout, bool outputFiles { // we always want to use the default locale, and thus spare us the trouble // with incorrect locale settings. - Opm::resetLocale(); + resetLocale(); // initialize MPI, finalize is done automatically on exit #if HAVE_DUNE_FEM @@ -72,7 +72,7 @@ int flowEbosPolymerMain(int argc, char** argv, bool outputCout, bool outputFiles Dune::MPIHelper::instance(argc, argv).rank(); #endif - Opm::FlowMainEbos + FlowMainEbos mainfunc {argc, argv, outputCout, outputFiles}; return mainfunc.execute(); } diff --git a/flow/flow_ebos_solvent.cpp b/flow/flow_ebos_solvent.cpp index 96095eb03..329d3a87b 100644 --- a/flow/flow_ebos_solvent.cpp +++ b/flow/flow_ebos_solvent.cpp @@ -64,7 +64,7 @@ int flowEbosSolventMain(int argc, char** argv, bool outputCout, bool outputFiles { // we always want to use the default locale, and thus spare us the trouble // with incorrect locale settings. - Opm::resetLocale(); + resetLocale(); // initialize MPI, finalize is done automatically on exit #if HAVE_DUNE_FEM @@ -73,7 +73,7 @@ int flowEbosSolventMain(int argc, char** argv, bool outputCout, bool outputFiles Dune::MPIHelper::instance(argc, argv).rank(); #endif - Opm::FlowMainEbos + FlowMainEbos mainfunc {argc, argv, outputCout, outputFiles}; return mainfunc.execute(); } diff --git a/opm/core/props/phaseUsageFromDeck.cpp b/opm/core/props/phaseUsageFromDeck.cpp index a430fc1ff..d223cb36d 100644 --- a/opm/core/props/phaseUsageFromDeck.cpp +++ b/opm/core/props/phaseUsageFromDeck.cpp @@ -144,7 +144,7 @@ PhaseUsage phaseUsage(const Phases& phases) return pu; } -PhaseUsage phaseUsageFromDeck(const Opm::EclipseState& eclipseState) +PhaseUsage phaseUsageFromDeck(const EclipseState& eclipseState) { const auto& phases = eclipseState.runspec().phases(); @@ -153,7 +153,7 @@ PhaseUsage phaseUsageFromDeck(const Opm::EclipseState& eclipseState) /// Looks at presence of WATER, OIL and GAS keywords in deck /// to determine active phases. -PhaseUsage phaseUsageFromDeck(const Opm::Deck& deck) +PhaseUsage phaseUsageFromDeck(const Deck& deck) { Runspec runspec( deck ); const auto& phases = runspec.phases(); diff --git a/opm/core/props/phaseUsageFromDeck.hpp b/opm/core/props/phaseUsageFromDeck.hpp index 7171e11ad..57acfc858 100644 --- a/opm/core/props/phaseUsageFromDeck.hpp +++ b/opm/core/props/phaseUsageFromDeck.hpp @@ -34,11 +34,11 @@ namespace Opm /// Looks at presence of WATER, OIL and GAS keywords in state object /// to determine active phases. - PhaseUsage phaseUsageFromDeck(const Opm::EclipseState& eclipseState); + PhaseUsage phaseUsageFromDeck(const EclipseState& eclipseState); /// Looks at presence of WATER, OIL and GAS keywords in deck /// to determine active phases. - PhaseUsage phaseUsageFromDeck(const Opm::Deck& deck); + PhaseUsage phaseUsageFromDeck(const Deck& deck); } #endif // OPM_PHASEUSAGEFROMDECK_HEADER_INCLUDED diff --git a/opm/core/props/satfunc/RelpermDiagnostics.cpp b/opm/core/props/satfunc/RelpermDiagnostics.cpp index d154eda84..b780b84a1 100644 --- a/opm/core/props/satfunc/RelpermDiagnostics.cpp +++ b/opm/core/props/satfunc/RelpermDiagnostics.cpp @@ -98,7 +98,7 @@ namespace Opm{ - void RelpermDiagnostics::satFamilyCheck_(const Opm::EclipseState& eclState) + void RelpermDiagnostics::satFamilyCheck_(const EclipseState& eclState) { const PhaseUsage pu = phaseUsageFromDeck(eclState); @@ -237,7 +237,7 @@ namespace Opm{ - void RelpermDiagnostics::swofTableCheck_(const Opm::SwofTable& swofTables, + void RelpermDiagnostics::swofTableCheck_(const SwofTable& swofTables, const int satnumIdx) { const auto& sw = swofTables.getSwColumn(); @@ -272,7 +272,7 @@ namespace Opm{ - void RelpermDiagnostics::sgofTableCheck_(const Opm::SgofTable& sgofTables, + void RelpermDiagnostics::sgofTableCheck_(const SgofTable& sgofTables, const int satnumIdx) { const auto& sg = sgofTables.getSgColumn(); @@ -307,7 +307,7 @@ namespace Opm{ //TODO check if run with water. } - void RelpermDiagnostics::slgofTableCheck_(const Opm::SlgofTable& slgofTables, + void RelpermDiagnostics::slgofTableCheck_(const SlgofTable& slgofTables, const int satnumIdx) { const auto& sl = slgofTables.getSlColumn(); @@ -344,7 +344,7 @@ namespace Opm{ - void RelpermDiagnostics::swfnTableCheck_(const Opm::SwfnTable& swfnTables, + void RelpermDiagnostics::swfnTableCheck_(const SwfnTable& swfnTables, const int satnumIdx) { const auto& sw = swfnTables.getSwColumn(); @@ -372,7 +372,7 @@ namespace Opm{ - void RelpermDiagnostics::sgfnTableCheck_(const Opm::SgfnTable& sgfnTables, + void RelpermDiagnostics::sgfnTableCheck_(const SgfnTable& sgfnTables, const int satnumIdx) { const auto& sg = sgfnTables.getSgColumn(); @@ -399,7 +399,7 @@ namespace Opm{ - void RelpermDiagnostics::sof3TableCheck_(const Opm::Sof3Table& sof3Tables, + void RelpermDiagnostics::sof3TableCheck_(const Sof3Table& sof3Tables, const int satnumIdx) { const auto& so = sof3Tables.getSoColumn(); @@ -444,7 +444,7 @@ namespace Opm{ - void RelpermDiagnostics::sof2TableCheck_(const Opm::Sof2Table& sof2Tables, + void RelpermDiagnostics::sof2TableCheck_(const Sof2Table& sof2Tables, const int satnumIdx) { const auto& so = sof2Tables.getSoColumn(); @@ -472,7 +472,7 @@ namespace Opm{ - void RelpermDiagnostics::sgwfnTableCheck_(const Opm::SgwfnTable& sgwfnTables, + void RelpermDiagnostics::sgwfnTableCheck_(const SgwfnTable& sgwfnTables, const int satnumIdx) { const auto& sg = sgwfnTables.getSgColumn(); @@ -509,7 +509,7 @@ namespace Opm{ - void RelpermDiagnostics::sgcwmisTableCheck_(const Opm::SgcwmisTable& sgcwmisTables, + void RelpermDiagnostics::sgcwmisTableCheck_(const SgcwmisTable& sgcwmisTables, const int satnumIdx) { const auto& sw = sgcwmisTables.getWaterSaturationColumn(); @@ -532,7 +532,7 @@ namespace Opm{ - void RelpermDiagnostics::sorwmisTableCheck_(const Opm::SorwmisTable& sorwmisTables, + void RelpermDiagnostics::sorwmisTableCheck_(const SorwmisTable& sorwmisTables, const int satnumIdx) { const auto& sw = sorwmisTables.getWaterSaturationColumn(); @@ -554,7 +554,7 @@ namespace Opm{ - void RelpermDiagnostics::ssfnTableCheck_(const Opm::SsfnTable& ssfnTables, + void RelpermDiagnostics::ssfnTableCheck_(const SsfnTable& ssfnTables, const int satnumIdx) { const auto& frac = ssfnTables.getSolventFractionColumn(); @@ -585,7 +585,7 @@ namespace Opm{ - void RelpermDiagnostics::miscTableCheck_(const Opm::MiscTable& miscTables, + void RelpermDiagnostics::miscTableCheck_(const MiscTable& miscTables, const int miscnumIdx) { const auto& frac = miscTables.getSolventFractionColumn(); @@ -609,7 +609,7 @@ namespace Opm{ - void RelpermDiagnostics::msfnTableCheck_(const Opm::MsfnTable& msfnTables, + void RelpermDiagnostics::msfnTableCheck_(const MsfnTable& msfnTables, const int satnumIdx) { const auto& frac = msfnTables.getGasPhaseFractionColumn(); @@ -730,7 +730,7 @@ namespace Opm{ } template - void RelpermDiagnostics::diagnosis(const Opm::EclipseState& eclState, + void RelpermDiagnostics::diagnosis(const EclipseState& eclState, const CartesianIndexMapper& cartesianIndexMapper) { OpmLog::info("\n===============Saturation Functions Diagnostics===============\n"); diff --git a/opm/core/props/satfunc/RelpermDiagnostics.hpp b/opm/core/props/satfunc/RelpermDiagnostics.hpp index 578a00412..ffc683fa8 100644 --- a/opm/core/props/satfunc/RelpermDiagnostics.hpp +++ b/opm/core/props/satfunc/RelpermDiagnostics.hpp @@ -73,8 +73,8 @@ namespace Opm { SaturationFunctionFamily satFamily_; - std::vector > unscaledEpsInfo_; - std::vector > scaledEpsInfo_; + std::vector > unscaledEpsInfo_; + std::vector > scaledEpsInfo_; ///Check the phase that used. @@ -95,32 +95,32 @@ namespace Opm { const CartesianIndexMapper& cartesianIndexMapper); ///For every table, need to deal with case by case. - void swofTableCheck_(const Opm::SwofTable& swofTables, + void swofTableCheck_(const SwofTable& swofTables, const int satnumIdx); - void sgofTableCheck_(const Opm::SgofTable& sgofTables, + void sgofTableCheck_(const SgofTable& sgofTables, const int satnumIdx); - void slgofTableCheck_(const Opm::SlgofTable& slgofTables, + void slgofTableCheck_(const SlgofTable& slgofTables, const int satnumIdx); - void swfnTableCheck_(const Opm::SwfnTable& swfnTables, + void swfnTableCheck_(const SwfnTable& swfnTables, const int satnumIdx); - void sgfnTableCheck_(const Opm::SgfnTable& sgfnTables, + void sgfnTableCheck_(const SgfnTable& sgfnTables, const int satnumIdx); - void sof3TableCheck_(const Opm::Sof3Table& sof3Tables, + void sof3TableCheck_(const Sof3Table& sof3Tables, const int satnumIdx); - void sof2TableCheck_(const Opm::Sof2Table& sof2Tables, + void sof2TableCheck_(const Sof2Table& sof2Tables, const int satnumIdx); - void sgwfnTableCheck_(const Opm::SgwfnTable& sgwfnTables, + void sgwfnTableCheck_(const SgwfnTable& sgwfnTables, const int satnumIdx); ///Tables for solvent model - void sgcwmisTableCheck_(const Opm::SgcwmisTable& sgcwmisTables, + void sgcwmisTableCheck_(const SgcwmisTable& sgcwmisTables, const int satnumIdx); - void sorwmisTableCheck_(const Opm::SorwmisTable& sorwmisTables, + void sorwmisTableCheck_(const SorwmisTable& sorwmisTables, const int satnumIdx); - void ssfnTableCheck_(const Opm::SsfnTable& ssfnTables, + void ssfnTableCheck_(const SsfnTable& ssfnTables, const int satnumIdx); - void miscTableCheck_(const Opm::MiscTable& miscTables, + void miscTableCheck_(const MiscTable& miscTables, const int miscnumIdx); - void msfnTableCheck_(const Opm::MsfnTable& msfnTables, + void msfnTableCheck_(const MsfnTable& msfnTables, const int satnumIdx); }; diff --git a/opm/simulators/aquifers/AquiferCarterTracy.hpp b/opm/simulators/aquifers/AquiferCarterTracy.hpp index 4ab6534d0..71e63f7c9 100644 --- a/opm/simulators/aquifers/AquiferCarterTracy.hpp +++ b/opm/simulators/aquifers/AquiferCarterTracy.hpp @@ -70,7 +70,7 @@ public: comm.sum(&this->fluxValue_, 1); } - Opm::data::AquiferData aquiferData() const + data::AquiferData aquiferData() const { data::AquiferData data; data.aquiferID = this->aquiferID; @@ -82,7 +82,7 @@ public: } data.volume = this->W_flux_.value(); data.initPressure = this->pa0_; - data.type = Opm::data::AquiferType::CarterTracy; + data.type = data::AquiferType::CarterTracy; data.aquCT = std::make_shared(); data.aquCT->dimensionless_time = this->dimensionless_time_; @@ -113,17 +113,17 @@ protected: { // We use the opm-common numeric linear interpolator this->dimensionless_pressure_ = - Opm::linearInterpolation(this->aquct_data_.td, - this->aquct_data_.pi, - this->dimensionless_time_); + linearInterpolation(this->aquct_data_.td, + this->aquct_data_.pi, + this->dimensionless_time_); const auto PItd = - Opm::linearInterpolation(this->aquct_data_.td, - this->aquct_data_.pi, td_plus_dt); + linearInterpolation(this->aquct_data_.td, + this->aquct_data_.pi, td_plus_dt); const auto PItdprime = - Opm::linearInterpolationDerivative(this->aquct_data_.td, - this->aquct_data_.pi, td_plus_dt); + linearInterpolationDerivative(this->aquct_data_.td, + this->aquct_data_.pi, td_plus_dt); return std::make_pair(PItd, PItdprime); } diff --git a/opm/simulators/aquifers/AquiferFetkovich.hpp b/opm/simulators/aquifers/AquiferFetkovich.hpp index 5d54b7d7f..381872de8 100644 --- a/opm/simulators/aquifers/AquiferFetkovich.hpp +++ b/opm/simulators/aquifers/AquiferFetkovich.hpp @@ -68,7 +68,7 @@ public: aquifer_pressure_ = aquiferPressure(); } - Opm::data::AquiferData aquiferData() const + data::AquiferData aquiferData() const { // TODO: how to unify the two functions? data::AquiferData data; @@ -80,7 +80,7 @@ public: } data.volume = this->W_flux_.value(); data.initPressure = this->pa0_; - data.type = Opm::data::AquiferType::Fetkovich; + data.type = data::AquiferType::Fetkovich; // Not handling std::shared_ptr aquFet for now, // because we do not need it yet return data; diff --git a/opm/simulators/aquifers/AquiferInterface.hpp b/opm/simulators/aquifers/AquiferInterface.hpp index 79b01edab..d292e1429 100644 --- a/opm/simulators/aquifers/AquiferInterface.hpp +++ b/opm/simulators/aquifers/AquiferInterface.hpp @@ -61,13 +61,13 @@ public: typedef DenseAd::Evaluation Eval; - typedef Opm::BlackOilFluidState + typedef BlackOilFluidState FluidState; static const auto waterCompIdx = FluidSystem::waterCompIdx; @@ -126,7 +126,7 @@ public: elemCtx.updateIntensiveQuantities(0); const auto& iq = elemCtx.intensiveQuantities(0, 0); - pressure_previous_[idx] = Opm::getValue(iq.fluidState().pressure(waterPhaseIdx)); + pressure_previous_[idx] = getValue(iq.fluidState().pressure(waterPhaseIdx)); } } @@ -232,7 +232,7 @@ protected: this->faceArea_connected_.resize(this->size(), 0.0); // Translate the C face tag into the enum used by opm-parser's TransMult class - Opm::FaceDir::DirEnum faceDirection; + FaceDir::DirEnum faceDirection; // denom_face_areas is the sum of the areas connected to an aquifer Scalar denom_face_areas = 0.; @@ -278,22 +278,22 @@ protected: int insideFaceIdx = intersection.indexInInside(); switch (insideFaceIdx) { case 0: - faceDirection = Opm::FaceDir::XMinus; + faceDirection = FaceDir::XMinus; break; case 1: - faceDirection = Opm::FaceDir::XPlus; + faceDirection = FaceDir::XPlus; break; case 2: - faceDirection = Opm::FaceDir::YMinus; + faceDirection = FaceDir::YMinus; break; case 3: - faceDirection = Opm::FaceDir::YPlus; + faceDirection = FaceDir::YPlus; break; case 4: - faceDirection = Opm::FaceDir::ZMinus; + faceDirection = FaceDir::ZMinus; break; case 5: - faceDirection = Opm::FaceDir::ZPlus; + faceDirection = FaceDir::ZPlus; break; default: OPM_THROW(std::logic_error, diff --git a/opm/simulators/aquifers/AquiferNumerical.hpp b/opm/simulators/aquifers/AquiferNumerical.hpp index d671508df..2387ff3f7 100644 --- a/opm/simulators/aquifers/AquiferNumerical.hpp +++ b/opm/simulators/aquifers/AquiferNumerical.hpp @@ -45,7 +45,7 @@ public: static const int numEq = BlackoilIndices::numEq; using Eval = DenseAd::Evaluation; - using Toolbox = Opm::MathToolbox; + using Toolbox = MathToolbox; // Constructor AquiferNumerical(const SingleNumericalAquifer& aquifer, @@ -84,7 +84,7 @@ public: this->cumulative_flux_ += this->flux_rate_ * this->ebos_simulator_.timeStepSize(); } - Opm::data::AquiferData aquiferData() const + data::AquiferData aquiferData() const { data::AquiferData data; data.aquiferID = this->id_; @@ -92,7 +92,7 @@ public: data.pressure = this->pressure_; data.fluxRate = this->flux_rate_; data.volume = this->cumulative_flux_; - data.type = Opm::data::AquiferType::Numerical; + data.type = data::AquiferType::Numerical; return data; } diff --git a/opm/simulators/aquifers/BlackoilAquiferModel.hpp b/opm/simulators/aquifers/BlackoilAquiferModel.hpp index af80516e6..2d064ab31 100644 --- a/opm/simulators/aquifers/BlackoilAquiferModel.hpp +++ b/opm/simulators/aquifers/BlackoilAquiferModel.hpp @@ -99,7 +99,7 @@ public: void endTimeStep(); void endEpisode(); - Opm::data::Aquifers aquiferData() const; + data::Aquifers aquiferData() const; template void serialize(Restarter& res); diff --git a/opm/simulators/aquifers/BlackoilAquiferModel_impl.hpp b/opm/simulators/aquifers/BlackoilAquiferModel_impl.hpp index dc16bb615..2f8673320 100644 --- a/opm/simulators/aquifers/BlackoilAquiferModel_impl.hpp +++ b/opm/simulators/aquifers/BlackoilAquiferModel_impl.hpp @@ -204,7 +204,7 @@ BlackoilAquiferModel::init() const auto& num_aquifers = aquifer.numericalAquifers().aquifers(); const auto& ugrid = simulator_.vanguard().grid(); const int number_of_cells = simulator_.gridView().size(0); - const int* global_cell = Opm::UgGridHelpers::globalCell(ugrid); + const int* global_cell = UgGridHelpers::globalCell(ugrid); const std::unordered_map cartesian_to_compressed = cartesianToCompressed(number_of_cells, global_cell); for ([[maybe_unused]]const auto& [id, aqu] : num_aquifers) { @@ -234,25 +234,25 @@ BlackoilAquiferModel::aquiferNumericalActive() const } template -Opm::data::Aquifers BlackoilAquiferModel::aquiferData() const { - Opm::data::Aquifers data; +data::Aquifers BlackoilAquiferModel::aquiferData() const { + data::Aquifers data; if (this->aquiferCarterTracyActive()) { for (const auto& aqu : aquifers_CarterTracy) { - Opm::data::AquiferData aqu_data = aqu.aquiferData(); + data::AquiferData aqu_data = aqu.aquiferData(); data[aqu_data.aquiferID] = aqu_data; } } if (this->aquiferFetkovichActive()) { for (const auto& aqu : aquifers_Fetkovich) { - Opm::data::AquiferData aqu_data = aqu.aquiferData(); + data::AquiferData aqu_data = aqu.aquiferData(); data[aqu_data.aquiferID] = aqu_data; } } if (this->aquiferNumericalActive()) { for (const auto& aqu : this->aquifers_numerical) { - Opm::data::AquiferData aqu_data = aqu.aquiferData(); + data::AquiferData aqu_data = aqu.aquiferData(); data[aqu_data.aquiferID] = aqu_data; } } diff --git a/opm/simulators/flow/BlackoilModelEbos.hpp b/opm/simulators/flow/BlackoilModelEbos.hpp index 856416441..c6a7ca764 100644 --- a/opm/simulators/flow/BlackoilModelEbos.hpp +++ b/opm/simulators/flow/BlackoilModelEbos.hpp @@ -96,7 +96,7 @@ struct UseVolumetricResidual { template struct EclAquiferModel { - using type = Opm::BlackoilAquiferModel; + using type = BlackoilAquiferModel; }; // disable all extensions supported by black oil model. this should not really be @@ -128,7 +128,7 @@ struct EnableBrine { template struct EclWellModel { - using type = Opm::BlackoilWellModel; + using type = BlackoilWellModel; }; template struct LinearSolverSplice { @@ -316,9 +316,9 @@ namespace Opm { // Throw if any NaN or too large residual found. if (severity == ConvergenceReport::Severity::NotANumber) { - OPM_THROW(Opm::NumericalIssue, "NaN residual found!"); + OPM_THROW(NumericalIssue, "NaN residual found!"); } else if (severity == ConvergenceReport::Severity::TooLarge) { - OPM_THROW(Opm::NumericalIssue, "Too large residual found!"); + OPM_THROW(NumericalIssue, "Too large residual found!"); } } report.update_time += perfTimer.stop(); diff --git a/opm/simulators/flow/FlowMainEbos.hpp b/opm/simulators/flow/FlowMainEbos.hpp index ecda9a0fd..ae63f06f6 100644 --- a/opm/simulators/flow/FlowMainEbos.hpp +++ b/opm/simulators/flow/FlowMainEbos.hpp @@ -93,7 +93,7 @@ namespace Opm using Scalar = GetPropType; using FluidSystem = GetPropType; - typedef Opm::SimulatorFullyImplicitBlackoilEbos Simulator; + typedef SimulatorFullyImplicitBlackoilEbos Simulator; FlowMainEbos(int argc, char **argv, bool output_cout, bool output_files ) : argc_{argc}, argv_{argv}, @@ -127,7 +127,7 @@ namespace Opm Simulator::registerParameters(); // register the parameters inherited from ebos - Opm::registerAllParameters_(/*finalizeRegistration=*/false); + registerAllParameters_(/*finalizeRegistration=*/false); // hide the parameters unused by flow. TODO: this is a pain to maintain EWOMS_HIDE_PARAM(TypeTag, EnableGravity); @@ -219,14 +219,14 @@ namespace Opm #endif // read in the command line parameters - int status = Opm::setupParameters_(argc, const_cast(argv), /*doRegistration=*/false, /*allowUnused=*/true, /*handleHelp=*/(mpiRank==0)); + int status = ::Opm::setupParameters_(argc, const_cast(argv), /*doRegistration=*/false, /*allowUnused=*/true, /*handleHelp=*/(mpiRank==0)); if (status == 0) { // deal with unknown parameters. int unknownKeyWords = 0; if (mpiRank == 0) { - unknownKeyWords = Opm::Parameters::printUnused(std::cerr); + unknownKeyWords = Parameters::printUnused(std::cerr); } #if HAVE_MPI int globalUnknownKeyWords; @@ -258,13 +258,13 @@ namespace Opm if (EWOMS_GET_PARAM(TypeTag, int, PrintProperties) == 1) { doExit = true; if (mpiRank == 0) - Opm::Properties::printValues(); + Properties::printValues(); } if (EWOMS_GET_PARAM(TypeTag, int, PrintParameters) == 1) { doExit = true; if (mpiRank == 0) - Opm::Parameters::printValues(); + Parameters::printValues(); } if (doExit) @@ -384,7 +384,7 @@ namespace Opm ss << "Simulation started on " << tmstr << " hrs\n"; ss << "Parameters used by Flow:\n"; - Opm::Parameters::printValues(ss); + Parameters::printValues(ss); OpmLog::note(ss.str()); } @@ -475,7 +475,7 @@ namespace Opm return; } - namespace fs = Opm::filesystem; + namespace fs = ::Opm::filesystem; const std::string& output_dir = eclState().getIOConfig().getOutputDir(); fs::path output_path(output_dir); fs::path deck_filename(EWOMS_GET_PARAM(TypeTag, std::string, EclDeckFileName)); @@ -587,7 +587,7 @@ namespace Opm report.reportFullyImplicit(ss); OpmLog::info(ss.str()); const std::string dir = eclState().getIOConfig().getOutputDir(); - namespace fs = Opm::filesystem; + namespace fs = ::Opm::filesystem; fs::path output_dir(dir); { std::string filename = eclState().getIOConfig().getBaseName() + ".INFOSTEP"; @@ -615,7 +615,7 @@ namespace Opm // This allows a user to catch typos and misunderstandings in the // use of simulator parameters. - if (Opm::Parameters::printUnused(oss)) { + if (Parameters::printUnused(oss)) { std::cout << "----------------- Unrecognized parameters: -----------------\n"; std::cout << oss.str(); std::cout << "----------------------------------------------------------------" << std::endl; diff --git a/opm/simulators/flow/Main.hpp b/opm/simulators/flow/Main.hpp index 910659528..b1876b15c 100644 --- a/opm/simulators/flow/Main.hpp +++ b/opm/simulators/flow/Main.hpp @@ -94,14 +94,14 @@ namespace Opm { { // we always want to use the default locale, and thus spare us the trouble // with incorrect locale settings. - Opm::resetLocale(); + resetLocale(); # if HAVE_DUNE_FEM Dune::Fem::MPIManager::initialize(argc, argv); # else Dune::MPIHelper::instance(argc, argv); # endif - Opm::FlowMainEbos mainfunc(argc, argv, outputCout, outputFiles); + FlowMainEbos mainfunc(argc, argv, outputCout, outputFiles); return mainfunc.execute(); } } @@ -120,7 +120,7 @@ namespace Opm class Main { private: - using FlowMainEbosType = Opm::FlowMainEbos; + using FlowMainEbosType = FlowMainEbos; public: Main(int argc, char** argv) : argc_(argc), argv_(argv) { } @@ -137,10 +137,10 @@ namespace Opm Main(int argc, char** argv, - std::unique_ptr deck, - std::unique_ptr eclipseState, - std::unique_ptr schedule, - std::unique_ptr summaryConfig) + std::unique_ptr deck, + std::unique_ptr eclipseState, + std::unique_ptr schedule, + std::unique_ptr summaryConfig) : argc_(argc) , argv_(argv) , deck_(std::move(deck)) @@ -181,13 +181,13 @@ namespace Opm if (initialize_(exitCode)) { // TODO: check that this deck really represents a blackoil // case. E.g. check that number of phases == 3 - Opm::flowEbosBlackoilSetDeck( + flowEbosBlackoilSetDeck( setupTime_, std::move(deck_), std::move(eclipseState_), std::move(schedule_), std::move(summaryConfig_)); - return Opm::flowEbosBlackoilMainInit( + return flowEbosBlackoilMainInit( argc_, argv_, outputCout_, outputFiles_); } else { //NOTE: exitCode was set by initialize_() above; @@ -209,23 +209,23 @@ namespace Opm // Twophase cases else if( phases.size() == 2 ) { // oil-gas - if (phases.active( Opm::Phase::OIL ) && phases.active( Opm::Phase::GAS )) { - Opm::flowEbosGasOilSetDeck(setupTime_, std::move(deck_), std::move(eclipseState_), - std::move(schedule_), std::move(summaryConfig_)); - return Opm::flowEbosGasOilMain(argc_, argv_, outputCout_, outputFiles_); + if (phases.active( Phase::OIL ) && phases.active( Phase::GAS )) { + flowEbosGasOilSetDeck(setupTime_, std::move(deck_), std::move(eclipseState_), + std::move(schedule_), std::move(summaryConfig_)); + return flowEbosGasOilMain(argc_, argv_, outputCout_, outputFiles_); } // oil-water - else if ( phases.active( Opm::Phase::OIL ) && phases.active( Opm::Phase::WATER ) ) { - Opm::flowEbosOilWaterSetDeck(setupTime_, std::move(deck_), std::move(eclipseState_), std::move(schedule_), std::move(summaryConfig_)); - return Opm::flowEbosOilWaterMain(argc_, argv_, outputCout_, outputFiles_); + else if ( phases.active( Phase::OIL ) && phases.active( Phase::WATER ) ) { + flowEbosOilWaterSetDeck(setupTime_, std::move(deck_), std::move(eclipseState_), std::move(schedule_), std::move(summaryConfig_)); + return flowEbosOilWaterMain(argc_, argv_, outputCout_, outputFiles_); } // gas-water - else if ( phases.active( Opm::Phase::GAS ) && phases.active( Opm::Phase::WATER ) ) { + else if ( phases.active( Phase::GAS ) && phases.active( Phase::WATER ) ) { if (outputCout_) std::cerr << "Gas-water systems are not yet supported" << std::endl; return EXIT_FAILURE; - Opm::flowEbosGasWaterSetDeck(setupTime_, std::move(deck_), std::move(eclipseState_), std::move(schedule_), std::move(summaryConfig_)); - return Opm::flowEbosGasWaterMain(argc_, argv_, outputCout_, outputFiles_); + flowEbosGasWaterSetDeck(setupTime_, std::move(deck_), std::move(eclipseState_), std::move(schedule_), std::move(summaryConfig_)); + return flowEbosGasWaterMain(argc_, argv_, outputCout_, outputFiles_); } else { if (outputCout_) @@ -234,8 +234,8 @@ namespace Opm } } // Polymer case - else if ( phases.active( Opm::Phase::POLYMER ) ) { - if ( !phases.active( Opm::Phase::WATER) ) { + else if ( phases.active( Phase::POLYMER ) ) { + if ( !phases.active( Phase::WATER) ) { if (outputCout_) std::cerr << "No valid configuration is found for polymer simulation, valid options include " << "oilwater + polymer and blackoil + polymer" << std::endl; @@ -244,88 +244,88 @@ namespace Opm // Need to track the polymer molecular weight // for the injectivity study - if ( phases.active( Opm::Phase::POLYMW ) ) { + if ( phases.active( Phase::POLYMW ) ) { // only oil water two phase for now assert( phases.size() == 4); - return Opm::flowEbosOilWaterPolymerInjectivityMain(argc_, argv_, outputCout_, outputFiles_); + return flowEbosOilWaterPolymerInjectivityMain(argc_, argv_, outputCout_, outputFiles_); } if ( phases.size() == 3 ) { // oil water polymer case - Opm::flowEbosOilWaterPolymerSetDeck(setupTime_, std::move(deck_), - std::move(eclipseState_), - std::move(schedule_), - std::move(summaryConfig_)); - return Opm::flowEbosOilWaterPolymerMain(argc_, argv_, outputCout_, outputFiles_); + flowEbosOilWaterPolymerSetDeck(setupTime_, std::move(deck_), + std::move(eclipseState_), + std::move(schedule_), + std::move(summaryConfig_)); + return flowEbosOilWaterPolymerMain(argc_, argv_, outputCout_, outputFiles_); } else { - Opm::flowEbosPolymerSetDeck(setupTime_, std::move(deck_), + flowEbosPolymerSetDeck(setupTime_, std::move(deck_), std::move(eclipseState_), std::move(schedule_), std::move(summaryConfig_)); - return Opm::flowEbosPolymerMain(argc_, argv_, outputCout_, outputFiles_); + return flowEbosPolymerMain(argc_, argv_, outputCout_, outputFiles_); } } // Foam case - else if ( phases.active( Opm::Phase::FOAM ) ) { - Opm::flowEbosFoamSetDeck(setupTime_, std::move(deck_), - std::move(eclipseState_), - std::move(schedule_), - std::move(summaryConfig_)); - return Opm::flowEbosFoamMain(argc_, argv_, outputCout_, outputFiles_); + else if ( phases.active( Phase::FOAM ) ) { + flowEbosFoamSetDeck(setupTime_, std::move(deck_), + std::move(eclipseState_), + std::move(schedule_), + std::move(summaryConfig_)); + return flowEbosFoamMain(argc_, argv_, outputCout_, outputFiles_); } // Brine case - else if ( phases.active( Opm::Phase::BRINE ) ) { - if ( !phases.active( Opm::Phase::WATER) ) { + else if ( phases.active( Phase::BRINE ) ) { + if ( !phases.active( Phase::WATER) ) { if (outputCout_) std::cerr << "No valid configuration is found for brine simulation, valid options include " << "oilwater + brine and blackoil + brine" << std::endl; return EXIT_FAILURE; } if ( phases.size() == 3 ) { // oil water brine case - Opm::flowEbosOilWaterBrineSetDeck(setupTime_, std::move(deck_), - std::move(eclipseState_), - std::move(schedule_), - std::move(summaryConfig_)); - return Opm::flowEbosOilWaterBrineMain(argc_, argv_, outputCout_, outputFiles_); + flowEbosOilWaterBrineSetDeck(setupTime_, std::move(deck_), + std::move(eclipseState_), + std::move(schedule_), + std::move(summaryConfig_)); + return flowEbosOilWaterBrineMain(argc_, argv_, outputCout_, outputFiles_); } else { - Opm::flowEbosBrineSetDeck(setupTime_, std::move(deck_), - std::move(eclipseState_), - std::move(schedule_), - std::move(summaryConfig_)); - return Opm::flowEbosBrineMain(argc_, argv_, outputCout_, outputFiles_); + flowEbosBrineSetDeck(setupTime_, std::move(deck_), + std::move(eclipseState_), + std::move(schedule_), + std::move(summaryConfig_)); + return flowEbosBrineMain(argc_, argv_, outputCout_, outputFiles_); } } // Solvent case - else if ( phases.active( Opm::Phase::SOLVENT ) ) { - Opm::flowEbosSolventSetDeck(setupTime_, std::move(deck_), - std::move(eclipseState_), - std::move(schedule_), - std::move(summaryConfig_)); - return Opm::flowEbosSolventMain(argc_, argv_, outputCout_, outputFiles_); + else if ( phases.active( Phase::SOLVENT ) ) { + flowEbosSolventSetDeck(setupTime_, std::move(deck_), + std::move(eclipseState_), + std::move(schedule_), + std::move(summaryConfig_)); + return flowEbosSolventMain(argc_, argv_, outputCout_, outputFiles_); } // Extended BO case - else if ( phases.active( Opm::Phase::ZFRACTION ) ) { - Opm::flowEbosExtboSetDeck(setupTime_, std::move(deck_), - std::move(eclipseState_), - std::move(schedule_), - std::move(summaryConfig_)); - return Opm::flowEbosExtboMain(argc_, argv_, outputCout_, outputFiles_); + else if ( phases.active( Phase::ZFRACTION ) ) { + flowEbosExtboSetDeck(setupTime_, std::move(deck_), + std::move(eclipseState_), + std::move(schedule_), + std::move(summaryConfig_)); + return flowEbosExtboMain(argc_, argv_, outputCout_, outputFiles_); } // Energy case else if (eclipseState_->getSimulationConfig().isThermal()) { - Opm::flowEbosEnergySetDeck(setupTime_, std::move(deck_), - std::move(eclipseState_), - std::move(schedule_), - std::move(summaryConfig_)); - return Opm::flowEbosEnergyMain(argc_, argv_, outputCout_, outputFiles_); + flowEbosEnergySetDeck(setupTime_, std::move(deck_), + std::move(eclipseState_), + std::move(schedule_), + std::move(summaryConfig_)); + return flowEbosEnergyMain(argc_, argv_, outputCout_, outputFiles_); } #endif // FLOW_BLACKOIL_ONLY // Blackoil case else if( phases.size() == 3 ) { - Opm::flowEbosBlackoilSetDeck(setupTime_, std::move(deck_), - std::move(eclipseState_), - std::move(schedule_), - std::move(summaryConfig_)); - return Opm::flowEbosBlackoilMain(argc_, argv_, outputCout_, outputFiles_); + flowEbosBlackoilSetDeck(setupTime_, std::move(deck_), + std::move(eclipseState_), + std::move(schedule_), + std::move(summaryConfig_)); + return flowEbosBlackoilMain(argc_, argv_, outputCout_, outputFiles_); } else { if (outputCout_) @@ -337,11 +337,11 @@ namespace Opm template int dispatchStatic_() { - Opm::flowEbosSetDeck(std::move(deck_), - std::move(eclipseState_), - std::move(schedule_), - std::move(summaryConfig_)); - return Opm::flowEbosMain(argc_, argv_, outputCout_, outputFiles_); + flowEbosSetDeck(std::move(deck_), + std::move(eclipseState_), + std::move(schedule_), + std::move(summaryConfig_)); + return flowEbosMain(argc_, argv_, outputCout_, outputFiles_); } /// \brief Initialize @@ -370,7 +370,7 @@ namespace Opm // we always want to use the default locale, and thus spare us the trouble // with incorrect locale settings. - Opm::resetLocale(); + resetLocale(); // this is a work-around for a catch 22: we do not know what code path to use without // parsing the deck, but we don't know the deck without having access to the @@ -382,7 +382,7 @@ namespace Opm using PreProblem = GetPropType; PreProblem::setBriefDescription("Flow, an advanced reservoir simulator for ECL-decks provided by the Open Porous Media project."); - int status = Opm::FlowMainEbos::setupParameters_(argc_, argv_); + int status = FlowMainEbos::setupParameters_(argc_, argv_); if (status != 0) { // if setupParameters_ returns a value smaller than 0, there was no error, but // the program should abort. This is the case e.g. for the --help and the @@ -427,11 +427,11 @@ namespace Opm return false; } if (outputCout_) { - Opm::FlowMainEbos::printBanner(); + FlowMainEbos::printBanner(); } // Create Deck and EclipseState. try { - auto python = std::make_shared(); + auto python = std::make_shared(); const bool init_from_restart_file = !EWOMS_GET_PARAM(PreTypeTag, bool, SchedRestart); if (outputDir.empty()) outputDir = EWOMS_GET_PARAM(PreTypeTag, std::string, OutputDir); @@ -441,15 +441,15 @@ namespace Opm EWOMS_GET_PARAM(PreTypeTag, std::string, OutputMode), outputCout_, "STDOUT_LOGGER"); auto parseContext = - std::make_unique(std::vector> - {{Opm::ParseContext::PARSE_RANDOM_SLASH, Opm::InputError::IGNORE}, - {Opm::ParseContext::PARSE_MISSING_DIMS_KEYWORD, Opm::InputError::WARN}, - {Opm::ParseContext::SUMMARY_UNKNOWN_WELL, Opm::InputError::WARN}, - {Opm::ParseContext::SUMMARY_UNKNOWN_GROUP, Opm::InputError::WARN}}); + std::make_unique(std::vector> + {{ParseContext::PARSE_RANDOM_SLASH, InputError::IGNORE}, + {ParseContext::PARSE_MISSING_DIMS_KEYWORD, InputError::WARN}, + {ParseContext::SUMMARY_UNKNOWN_WELL, InputError::WARN}, + {ParseContext::SUMMARY_UNKNOWN_GROUP, InputError::WARN}}); if (EWOMS_GET_PARAM(PreTypeTag, bool, EclStrictParsing)) - parseContext->update(Opm::InputError::DELAYED_EXIT1); + parseContext->update(InputError::DELAYED_EXIT1); - Opm::FlowMainEbos::printPRTHeader(outputCout_); + FlowMainEbos::printPRTHeader(outputCout_); if (outputCout_) { OpmLog::info("Reading deck file '" + deckFilename + "'"); @@ -484,8 +484,8 @@ namespace Opm return true; } - Opm::filesystem::path simulationCaseName_( const std::string& casename ) { - namespace fs = Opm::filesystem; + filesystem::path simulationCaseName_( const std::string& casename ) { + namespace fs = ::Opm::filesystem; const auto exists = []( const fs::path& f ) -> bool { if( !fs::exists( f ) ) return false; @@ -523,7 +523,7 @@ namespace Opm for ( int i = 1; i < argc; ++i ) { if (std::strcmp(argv[i], "--version") == 0) { - std::cout << "flow " << Opm::moduleVersionName() << std::endl; + std::cout << "flow " << moduleVersionName() << std::endl; std::exit(EXIT_SUCCESS); } } @@ -538,10 +538,10 @@ namespace Opm std::string deckFilename_; std::string flowProgName_; char *saveArgs_[2]; - std::unique_ptr deck_; - std::unique_ptr eclipseState_; - std::unique_ptr schedule_; - std::unique_ptr summaryConfig_; + std::unique_ptr deck_; + std::unique_ptr eclipseState_; + std::unique_ptr schedule_; + std::unique_ptr summaryConfig_; }; } // namespace Opm diff --git a/opm/simulators/flow/NonlinearSolverEbos.hpp b/opm/simulators/flow/NonlinearSolverEbos.hpp index 2bb128720..cc615c4f8 100644 --- a/opm/simulators/flow/NonlinearSolverEbos.hpp +++ b/opm/simulators/flow/NonlinearSolverEbos.hpp @@ -220,7 +220,7 @@ namespace Opm { failureReport_ = report; std::string msg = "Solver convergence failure - Failed to complete a time step within " + std::to_string(maxIter()) + " iterations."; - OPM_THROW_NOLOG(Opm::TooManyIterations, msg); + OPM_THROW_NOLOG(TooManyIterations, msg); } // Do model-specific post-step actions. diff --git a/opm/simulators/flow/SimulatorFullyImplicitBlackoilEbos.hpp b/opm/simulators/flow/SimulatorFullyImplicitBlackoilEbos.hpp index 1c2b7de8f..c2d1dfeb5 100644 --- a/opm/simulators/flow/SimulatorFullyImplicitBlackoilEbos.hpp +++ b/opm/simulators/flow/SimulatorFullyImplicitBlackoilEbos.hpp @@ -78,7 +78,7 @@ public: using MaterialLawParams = GetPropType; typedef AdaptiveTimeSteppingEbos TimeStepper; - typedef Opm::BlackOilPolymerModule PolymerModule; + typedef BlackOilPolymerModule PolymerModule; typedef WellStateFullyImplicitBlackoil WellState; typedef BlackoilModelEbos Model; @@ -157,15 +157,15 @@ public: ebosSimulator_.setEpisodeIndex(-1); // Create timers and file for writing timing info. - solverTimer_ = std::make_unique(); - totalTimer_ = std::make_unique(); + solverTimer_ = std::make_unique(); + totalTimer_ = std::make_unique(); totalTimer_->start(); // adaptive time stepping bool enableAdaptive = EWOMS_GET_PARAM(TypeTag, bool, EnableAdaptiveTimeStepping); bool enableTUNING = EWOMS_GET_PARAM(TypeTag, bool, EnableTuning); if (enableAdaptive) { - const Opm::UnitSystem& unitSystem = this->ebosSimulator_.vanguard().eclState().getUnits(); + const UnitSystem& unitSystem = this->ebosSimulator_.vanguard().eclState().getUnits(); if (enableTUNING) { adaptiveTimeStepping_ = std::make_unique(schedule()[timer.currentStepNum()].tuning(), unitSystem, terminalOutput_); @@ -383,8 +383,8 @@ protected: bool terminalOutput_; SimulatorReport report_; - std::unique_ptr solverTimer_; - std::unique_ptr totalTimer_; + std::unique_ptr solverTimer_; + std::unique_ptr totalTimer_; std::unique_ptr adaptiveTimeStepping_; }; diff --git a/opm/simulators/linalg/FlowLinearSolverParameters.hpp b/opm/simulators/linalg/FlowLinearSolverParameters.hpp index 3244d4d40..1c1afde76 100644 --- a/opm/simulators/linalg/FlowLinearSolverParameters.hpp +++ b/opm/simulators/linalg/FlowLinearSolverParameters.hpp @@ -190,7 +190,7 @@ struct LinearSolverIgnoreConvergenceFailure }; template struct LinearSolverBackend { - using type = Opm::ISTLSolverEbos; + using type = ISTLSolverEbos; }; template struct PreconditionerAddWellContributions { @@ -252,7 +252,7 @@ namespace Opm int linear_solver_restart_; int linear_solver_verbosity_; int ilu_fillin_level_; - Opm::MILU_VARIANT ilu_milu_; + MILU_VARIANT ilu_milu_; bool ilu_redblack_; bool ilu_reorder_sphere_; bool newton_use_gmres_; diff --git a/opm/simulators/linalg/ISTLSolverEbos.hpp b/opm/simulators/linalg/ISTLSolverEbos.hpp index 752c7941d..b8d707324 100644 --- a/opm/simulators/linalg/ISTLSolverEbos.hpp +++ b/opm/simulators/linalg/ISTLSolverEbos.hpp @@ -58,10 +58,10 @@ struct SparseMatrixAdapter private: using Scalar = GetPropType; enum { numEq = getPropValue() }; - typedef Opm::MatrixBlock Block; + typedef MatrixBlock Block; public: - typedef typename Opm::Linear::IstlSparseMatrixAdapter type; + typedef typename Linear::IstlSparseMatrixAdapter type; }; } // namespace Opm::Properties @@ -241,10 +241,10 @@ namespace Opm const int verbosity = prm_.get("verbosity", 0); const bool write_matrix = verbosity > 10; if (write_matrix) { - Opm::Helper::writeSystem(simulator_, //simulator is only used to get names - getMatrix(), - *rhs_, - comm_.get()); + Helper::writeSystem(simulator_, //simulator is only used to get names + getMatrix(), + *rhs_, + comm_.get()); } // Solve system. @@ -428,7 +428,7 @@ namespace Opm if (weightsType == "quasiimpes") { // weighs will be created as default in the solver weightsCalculator = [this, transpose, pressureIndex]() { - return Opm::Amg::getQuasiImpesWeights(this->getMatrix(), pressureIndex, transpose); + return Amg::getQuasiImpesWeights(this->getMatrix(), pressureIndex, transpose); }; } else if (weightsType == "trueimpes") { weightsCalculator = [this, pressureIndex]() { @@ -451,9 +451,9 @@ namespace Opm { Vector weights(rhs_->size()); ElementContext elemCtx(simulator_); - Opm::Amg::getTrueImpesWeights(pressureVarIndex, weights, simulator_.vanguard().gridView(), - elemCtx, simulator_.model(), - ThreadManager::threadId()); + Amg::getTrueImpesWeights(pressureVarIndex, weights, simulator_.vanguard().gridView(), + elemCtx, simulator_.model(), + ThreadManager::threadId()); return weights; } diff --git a/opm/simulators/linalg/WriteSystemMatrixHelper.hpp b/opm/simulators/linalg/WriteSystemMatrixHelper.hpp index 22772bc9a..35041dea4 100644 --- a/opm/simulators/linalg/WriteSystemMatrixHelper.hpp +++ b/opm/simulators/linalg/WriteSystemMatrixHelper.hpp @@ -40,7 +40,7 @@ namespace Helper } else if (!dir.empty() && dir.back() != '/') { dir += "/"; } - namespace fs = Opm::filesystem; + namespace fs = ::Opm::filesystem; fs::path output_dir(dir); fs::path subdir("reports"); output_dir = output_dir / subdir; diff --git a/opm/simulators/linalg/getQuasiImpesWeights.hpp b/opm/simulators/linalg/getQuasiImpesWeights.hpp index 6a310a5ce..7294ce78c 100644 --- a/opm/simulators/linalg/getQuasiImpesWeights.hpp +++ b/opm/simulators/linalg/getQuasiImpesWeights.hpp @@ -66,7 +66,7 @@ namespace Amg if (transpose) { diag_block.solve(bweights, rhs); } else { - auto diag_block_transpose = Opm::Details::transposeDenseMatrix(diag_block); + auto diag_block_transpose = Details::transposeDenseMatrix(diag_block); diag_block_transpose.solve(bweights, rhs); } double abs_max = *std::max_element( diff --git a/opm/simulators/linalg/setupPropertyTree_impl.hpp b/opm/simulators/linalg/setupPropertyTree_impl.hpp index 24ec32055..558ff9ca8 100644 --- a/opm/simulators/linalg/setupPropertyTree_impl.hpp +++ b/opm/simulators/linalg/setupPropertyTree_impl.hpp @@ -41,7 +41,7 @@ setupPropertyTree(FlowLinearSolverParameters p) // Note: copying the parameters // Get configuration from file. if (conf.size() > 5 && conf.substr(conf.size() - 5, 5) == ".json") { // the ends_with() method is not available until C++20 #if BOOST_VERSION / 100 % 1000 > 48 - if ( !Opm::filesystem::exists(conf) ) { + if ( !filesystem::exists(conf) ) { OPM_THROW(std::invalid_argument, "JSON file " << conf << " does not exist."); } try { diff --git a/opm/simulators/timestepping/AdaptiveTimeSteppingEbos.hpp b/opm/simulators/timestepping/AdaptiveTimeSteppingEbos.hpp index c44efe465..ba4aacc41 100644 --- a/opm/simulators/timestepping/AdaptiveTimeSteppingEbos.hpp +++ b/opm/simulators/timestepping/AdaptiveTimeSteppingEbos.hpp @@ -409,21 +409,21 @@ namespace Opm { OpmLog::debug("Overall linear iterations used: " + std::to_string(substepReport.total_linear_iterations)); } } - catch (const Opm::TooManyIterations& e) { + catch (const TooManyIterations& e) { substepReport = solver.failureReport(); causeOfFailure = "Solver convergence failure - Iteration limit reached"; logException_(e, solverVerbose_); // since linearIterations is < 0 this will restart the solver } - catch (const Opm::LinearSolverProblem& e) { + catch (const LinearSolverProblem& e) { substepReport = solver.failureReport(); causeOfFailure = "Linear solver convergence failure"; logException_(e, solverVerbose_); // since linearIterations is < 0 this will restart the solver } - catch (const Opm::NumericalIssue& e) { + catch (const NumericalIssue& e) { substepReport = solver.failureReport(); causeOfFailure = "Solver convergence failure - Numerical problem encountered"; @@ -496,7 +496,7 @@ namespace Opm { if (fipnum) { solver.computeFluidInPlace(*fipnum); } - Opm::time::StopWatch perfTimer; + time::StopWatch perfTimer; perfTimer.start(); ebosProblem.writeOutput(); @@ -522,7 +522,7 @@ namespace Opm { if (solverVerbose_) { OpmLog::error(msg); } - OPM_THROW_NOLOG(Opm::NumericalIssue, msg); + OPM_THROW_NOLOG(NumericalIssue, msg); } // The new, chopped timestep. @@ -538,7 +538,7 @@ namespace Opm { if (solverVerbose_) { OpmLog::error(msg); } - OPM_THROW_NOLOG(Opm::NumericalIssue, msg); + OPM_THROW_NOLOG(NumericalIssue, msg); } // Define utility function for chopping timestep. diff --git a/opm/simulators/utils/ParallelFileMerger.hpp b/opm/simulators/utils/ParallelFileMerger.hpp index 1c8438dba..4b6602ad8 100644 --- a/opm/simulators/utils/ParallelFileMerger.hpp +++ b/opm/simulators/utils/ParallelFileMerger.hpp @@ -34,7 +34,7 @@ namespace Opm namespace detail { -namespace fs = Opm::filesystem; +namespace fs = ::Opm::filesystem; /// \brief A functor that merges multiple files of a parallel run to one file. /// diff --git a/opm/simulators/utils/readDeck.hpp b/opm/simulators/utils/readDeck.hpp index cc77a55c6..7d29f8e48 100644 --- a/opm/simulators/utils/readDeck.hpp +++ b/opm/simulators/utils/readDeck.hpp @@ -52,9 +52,9 @@ FileOutputMode setupLogging(int mpi_rank_, const std::string& deck_filename, con /// \brief Reads the deck and creates all necessary objects if needed /// /// If pointers already contains objects then they are used otherwise they are created and can be used outside later. -void readDeck(int rank, std::string& deckFilename, std::unique_ptr& deck, std::unique_ptr& eclipseState, - std::unique_ptr& schedule, std::unique_ptr& summaryConfig, - std::unique_ptr errorGuard, std::shared_ptr& python, std::unique_ptr parseContext, +void readDeck(int rank, std::string& deckFilename, std::unique_ptr& deck, std::unique_ptr& eclipseState, + std::unique_ptr& schedule, std::unique_ptr& summaryConfig, + std::unique_ptr errorGuard, std::shared_ptr& python, std::unique_ptr parseContext, bool initFromRestart, bool checkDeck, const std::optional& outputInterval); } // end namespace Opm diff --git a/opm/simulators/wells/BlackoilWellModel.hpp b/opm/simulators/wells/BlackoilWellModel.hpp index 03de545a8..436cfd7cf 100644 --- a/opm/simulators/wells/BlackoilWellModel.hpp +++ b/opm/simulators/wells/BlackoilWellModel.hpp @@ -89,7 +89,7 @@ namespace Opm { /// Class for handling the blackoil well model. template - class BlackoilWellModel : public Opm::BaseAuxiliaryModule + class BlackoilWellModel : public BaseAuxiliaryModule { public: // --------- Types --------- @@ -106,10 +106,10 @@ namespace Opm { using GlobalEqVector = GetPropType; using SparseMatrixAdapter = GetPropType; - typedef typename Opm::BaseAuxiliaryModule::NeighborSet NeighborSet; - using GasLiftSingleWell = Opm::GasLiftSingleWell; - using GasLiftStage2 = Opm::GasLiftStage2; - using GLiftWellState = Opm::GasLiftWellState; + typedef typename BaseAuxiliaryModule::NeighborSet NeighborSet; + using GasLiftSingleWell = ::Opm::GasLiftSingleWell; + using GasLiftStage2 = ::Opm::GasLiftStage2; + using GLiftWellState = ::Opm::GasLiftWellState; using GLiftWellStateMap = std::map>; using GLiftOptWells = @@ -130,7 +130,7 @@ namespace Opm { typedef Dune::FieldMatrix MatrixBlockType; - typedef Opm::BlackOilPolymerModule PolymerModule; + typedef BlackOilPolymerModule PolymerModule; // For the conversion between the surface volume rate and resrevoir voidage rate using RateConverterType = RateConverter:: @@ -217,8 +217,8 @@ namespace Opm { void initFromRestartFile(const RestartValue& restartValues); - Opm::data::GroupAndNetworkValues - groupAndNetworkData(const int reportStepIdx, const Opm::Schedule& sched) const + data::GroupAndNetworkValues + groupAndNetworkData(const int reportStepIdx, const Schedule& sched) const { auto grp_nwrk_values = ::Opm::data::GroupAndNetworkValues{}; @@ -337,9 +337,9 @@ namespace Opm { return this->active_wgstate_.group_state; } - Opm::data::Wells wellData() const + data::Wells wellData() const { - auto wsrpt = this->wellState().report(Opm::UgGridHelpers::globalCell(grid()), + auto wsrpt = this->wellState().report(UgGridHelpers::globalCell(grid()), [this](const int well_ndex) -> bool { return this->wasDynamicallyShutThisTimeStep(well_ndex); @@ -400,12 +400,12 @@ namespace Opm { // twice at the beginning of the time step /// Calculating the explict quantities used in the well calculation. By explicit, we mean they are cacluated /// at the beginning of the time step and no derivatives are included in these quantities - void calculateExplicitQuantities(Opm::DeferredLogger& deferred_logger) const; + void calculateExplicitQuantities(DeferredLogger& deferred_logger) const; // some preparation work, mostly related to group control and RESV, // at the beginning of each time step (Not report step) - void prepareTimeStep(Opm::DeferredLogger& deferred_logger); + void prepareTimeStep(DeferredLogger& deferred_logger); void initPrimaryVariablesEvaluation() const; - void updateWellControls(Opm::DeferredLogger& deferred_logger, const bool checkGroupControls); + void updateWellControls(DeferredLogger& deferred_logger, const bool checkGroupControls); WellInterfacePtr getWell(const std::string& well_name) const; protected: Simulator& ebosSimulator_; @@ -451,7 +451,7 @@ namespace Opm { createTypedWellPointer(const int wellID, const int time_step) const; - WellInterfacePtr createWellForWellTest(const std::string& well_name, const int report_step, Opm::DeferredLogger& deferred_logger) const; + WellInterfacePtr createWellForWellTest(const std::string& well_name, const int report_step, DeferredLogger& deferred_logger) const; const ModelParameters param_; @@ -497,7 +497,7 @@ namespace Opm { void gliftDebug( const std::string &msg, - Opm::DeferredLogger& deferred_logger) const; + DeferredLogger& deferred_logger) const; /// \brief Get the wells of our partition that are not shut. /// \param timeStepIdx The index of the time step. @@ -528,7 +528,7 @@ namespace Opm { void updateNetworkPressures(); // setting the well_solutions_ based on well_state. - void updatePrimaryVariables(Opm::DeferredLogger& deferred_logger); + void updatePrimaryVariables(DeferredLogger& deferred_logger); void setupCartesianToCompressed_(const int* global_cell, int local_num__cells); @@ -538,7 +538,7 @@ namespace Opm { void updateAverageFormationFactor(); // Calculating well potentials for each well - void computeWellPotentials(std::vector& well_potentials, const int reportStepIdx, Opm::DeferredLogger& deferred_logger); + void computeWellPotentials(std::vector& well_potentials, const int reportStepIdx, DeferredLogger& deferred_logger); const std::vector& wellPerfEfficiencyFactors() const; @@ -558,13 +558,13 @@ namespace Opm { int reportStepIndex() const; - void assembleWellEq(const double dt, Opm::DeferredLogger& deferred_logger); + void assembleWellEq(const double dt, DeferredLogger& deferred_logger); - void maybeDoGasLiftOptimize(Opm::DeferredLogger& deferred_logger); + void maybeDoGasLiftOptimize(DeferredLogger& deferred_logger); - void gliftDebugShowALQ(Opm::DeferredLogger& deferred_logger); + void gliftDebugShowALQ(DeferredLogger& deferred_logger); - void gasLiftOptimizationStage2(Opm::DeferredLogger& deferred_logger, + void gasLiftOptimizationStage2(DeferredLogger& deferred_logger, GLiftProdWells &prod_wells, GLiftOptWells &glift_wells, GLiftWellStateMap &map); @@ -583,7 +583,7 @@ namespace Opm { /// upate the wellTestState related to economic limits void updateWellTestState(const double& simulationTime, WellTestState& wellTestState) const; - void wellTesting(const int timeStepIdx, const double simulationTime, Opm::DeferredLogger& deferred_logger); + void wellTesting(const int timeStepIdx, const double simulationTime, DeferredLogger& deferred_logger); // convert well data from opm-common to well state from opm-core void loadRestartData( const data::Wells& wells, @@ -597,19 +597,19 @@ namespace Opm { const Well& getWellEcl(const std::string& well_name) const; - void updateGroupIndividualControls(Opm::DeferredLogger& deferred_logger, std::set& switched_groups); - void updateGroupIndividualControl(const Group& group, Opm::DeferredLogger& deferred_logger, std::set& switched_groups); - bool checkGroupConstraints(const Group& group, Opm::DeferredLogger& deferred_logger) const; - Group::ProductionCMode checkGroupProductionConstraints(const Group& group, Opm::DeferredLogger& deferred_logger) const; + void updateGroupIndividualControls(DeferredLogger& deferred_logger, std::set& switched_groups); + void updateGroupIndividualControl(const Group& group, DeferredLogger& deferred_logger, std::set& switched_groups); + bool checkGroupConstraints(const Group& group, DeferredLogger& deferred_logger) const; + Group::ProductionCMode checkGroupProductionConstraints(const Group& group, DeferredLogger& deferred_logger) const; Group::InjectionCMode checkGroupInjectionConstraints(const Group& group, const Phase& phase) const; - void checkGconsaleLimits(const Group& group, WellState& well_state, Opm::DeferredLogger& deferred_logger ); + void checkGconsaleLimits(const Group& group, WellState& well_state, DeferredLogger& deferred_logger ); - void updateGroupHigherControls(Opm::DeferredLogger& deferred_logger, std::set& switched_groups); - void checkGroupHigherConstraints(const Group& group, Opm::DeferredLogger& deferred_logger, std::set& switched_groups); + void updateGroupHigherControls(DeferredLogger& deferred_logger, std::set& switched_groups); + void checkGroupHigherConstraints(const Group& group, DeferredLogger& deferred_logger, std::set& switched_groups); - void actionOnBrokenConstraints(const Group& group, const Group::ExceedAction& exceed_action, const Group::ProductionCMode& newControl, Opm::DeferredLogger& deferred_logger); + void actionOnBrokenConstraints(const Group& group, const Group::ExceedAction& exceed_action, const Group::ProductionCMode& newControl, DeferredLogger& deferred_logger); - void actionOnBrokenConstraints(const Group& group, const Group::InjectionCMode& newControl, const Phase& topUpPhase, Opm::DeferredLogger& deferred_logger); + void actionOnBrokenConstraints(const Group& group, const Group::InjectionCMode& newControl, const Phase& topUpPhase, DeferredLogger& deferred_logger); void updateWsolvent(const Group& group, const Schedule& schedule, const int reportStepIdx, const WellStateFullyImplicitBlackoil& wellState); diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index 90fae1f93..daef3103f 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -54,8 +54,8 @@ namespace Opm { // Set up cartesian mapping. { const auto& grid = this->ebosSimulator_.vanguard().grid(); - const auto& cartDims = Opm::UgGridHelpers::cartDims(grid); - setupCartesianToCompressed_(Opm::UgGridHelpers::globalCell(grid), + const auto& cartDims = UgGridHelpers::cartDims(grid); + setupCartesianToCompressed_(UgGridHelpers::globalCell(grid), cartDims[0] * cartDims[1] * cartDims[2]); auto& parallel_wells = ebosSimulator.vanguard().parallelWells(); @@ -260,7 +260,7 @@ namespace Opm { BlackoilWellModel:: beginReportStep(const int timeStepIdx) { - Opm::DeferredLogger local_deferredLogger; + DeferredLogger local_deferredLogger; report_step_starts_ = true; const Grid& grid = ebosSimulator_.vanguard().grid(); @@ -316,7 +316,7 @@ namespace Opm { updatePerforationIntensiveQuantities(); updateAverageFormationFactor(); - Opm::DeferredLogger local_deferredLogger; + DeferredLogger local_deferredLogger; this->resetWGState(); updateAndCommunicateGroupData(); @@ -457,7 +457,7 @@ namespace Opm { template void BlackoilWellModel::gliftDebug( - const std::string &msg, Opm::DeferredLogger &deferred_logger) const + const std::string &msg, DeferredLogger &deferred_logger) const { if (this->glift_debug) { const std::string message = fmt::format( @@ -470,7 +470,7 @@ namespace Opm { void BlackoilWellModel::wellTesting(const int timeStepIdx, const double simulationTime, - Opm::DeferredLogger& deferred_logger) + DeferredLogger& deferred_logger) { const auto& wtest_config = schedule()[timeStepIdx].wtest_config(); if (wtest_config.size() != 0) { // there is a WTEST request @@ -545,7 +545,7 @@ namespace Opm { report_step_starts_ = false; const int reportStepIdx = ebosSimulator_.episodeIndex(); - Opm::DeferredLogger local_deferredLogger; + DeferredLogger local_deferredLogger; for (const auto& well : well_container_) { if (getPropValue() && well->isInjector()) { well->updateWaterThroughput(dt, this->wellState()); @@ -574,7 +574,7 @@ namespace Opm { this->commitWGState(); - Opm::DeferredLogger global_deferredLogger = gatherDeferredLogger(local_deferredLogger); + DeferredLogger global_deferredLogger = gatherDeferredLogger(local_deferredLogger); if (terminal_output_) { global_deferredLogger.logMessages(); } @@ -640,7 +640,7 @@ namespace Opm { const int nw = wells_ecl_.size(); if (nw > 0) { const auto phaseUsage = phaseUsageFromDeck(eclState()); - const size_t numCells = Opm::UgGridHelpers::numCells(grid()); + const size_t numCells = UgGridHelpers::numCells(grid()); const bool handle_ms_well = (param_.use_multisegment_well_ && anyMSWellOpenLocal()); this->wellState().resize(wells_ecl_, local_parallel_well_info_, schedule(), handle_ms_well, numCells, well_perf_data_, summaryState); // Resize for restart step loadRestartData(restartValues.wells, restartValues.grp_nwrk, phaseUsage, handle_ms_well, this->wellState()); @@ -784,7 +784,7 @@ namespace Opm { { std::vector well_container; - Opm::DeferredLogger local_deferredLogger; + DeferredLogger local_deferredLogger; const int nw = numLocalWells(); @@ -903,7 +903,7 @@ namespace Opm { } // Collect log messages and print. - Opm::DeferredLogger global_deferredLogger = gatherDeferredLogger(local_deferredLogger); + DeferredLogger global_deferredLogger = gatherDeferredLogger(local_deferredLogger); if (terminal_output_) { global_deferredLogger.logMessages(); } @@ -996,7 +996,7 @@ namespace Opm { BlackoilWellModel:: createWellForWellTest(const std::string& well_name, const int report_step, - Opm::DeferredLogger& deferred_logger) const + DeferredLogger& deferred_logger) const { // Finding the location of the well in wells_ecl const int nw_wells_ecl = wells_ecl_.size(); @@ -1025,7 +1025,7 @@ namespace Opm { const double dt) { - Opm::DeferredLogger local_deferredLogger; + DeferredLogger local_deferredLogger; if (this->glift_debug) { const std::string msg = fmt::format( "assemble() : iteration {}" , iterationIdx); @@ -1084,7 +1084,7 @@ namespace Opm { template void BlackoilWellModel:: - maybeDoGasLiftOptimize(Opm::DeferredLogger& deferred_logger) + maybeDoGasLiftOptimize(DeferredLogger& deferred_logger) { this->wellState().enableGliftOptimization(); GLiftOptWells glift_wells; @@ -1111,7 +1111,7 @@ namespace Opm { template void BlackoilWellModel:: - gasLiftOptimizationStage2(Opm::DeferredLogger& deferred_logger, + gasLiftOptimizationStage2(DeferredLogger& deferred_logger, GLiftProdWells &prod_wells, GLiftOptWells &glift_wells, GLiftWellStateMap &glift_well_state_map) { @@ -1124,7 +1124,7 @@ namespace Opm { template void BlackoilWellModel:: - gliftDebugShowALQ(Opm::DeferredLogger& deferred_logger) + gliftDebugShowALQ(DeferredLogger& deferred_logger) { for (auto& well : this->well_container_) { if (well->isProducer()) { @@ -1139,7 +1139,7 @@ namespace Opm { template void BlackoilWellModel:: - assembleWellEq(const double dt, Opm::DeferredLogger& deferred_logger) + assembleWellEq(const double dt, DeferredLogger& deferred_logger) { for (auto& well : well_container_) { well->assembleWellEq(ebosSimulator_, dt, this->wellState(), this->groupState(), deferred_logger); @@ -1247,7 +1247,7 @@ namespace Opm { BlackoilWellModel:: recoverWellSolutionAndUpdateWellState(const BVector& x) { - Opm::DeferredLogger local_deferredLogger; + DeferredLogger local_deferredLogger; auto exc_type = ExceptionType::NONE; std::string exc_msg; try { @@ -1332,7 +1332,7 @@ namespace Opm { getWellConvergence(const std::vector& B_avg, bool checkGroupConvergence) const { - Opm::DeferredLogger local_deferredLogger; + DeferredLogger local_deferredLogger; // Get global (from all processes) convergence report. ConvergenceReport local_report; for (const auto& well : well_container_) { @@ -1340,7 +1340,7 @@ namespace Opm { local_report += well->getWellConvergence(this->wellState(), B_avg, local_deferredLogger); } } - Opm::DeferredLogger global_deferredLogger = gatherDeferredLogger(local_deferredLogger); + DeferredLogger global_deferredLogger = gatherDeferredLogger(local_deferredLogger); if (terminal_output_) { global_deferredLogger.logMessages(); } @@ -1374,7 +1374,7 @@ namespace Opm { template void BlackoilWellModel:: - calculateExplicitQuantities(Opm::DeferredLogger& deferred_logger) const + calculateExplicitQuantities(DeferredLogger& deferred_logger) const { // TODO: checking isOperable() ? for (auto& well : well_container_) { @@ -1389,7 +1389,7 @@ namespace Opm { template void BlackoilWellModel:: - updateWellControls(Opm::DeferredLogger& deferred_logger, const bool checkGroupControls) + updateWellControls(DeferredLogger& deferred_logger, const bool checkGroupControls) { // Even if there are no wells active locally, we cannot // return as the DeferredLogger uses global communication. @@ -1533,7 +1533,7 @@ namespace Opm { BlackoilWellModel:: updateWellTestState(const double& simulationTime, WellTestState& wellTestState) const { - Opm::DeferredLogger local_deferredLogger; + DeferredLogger local_deferredLogger; for (const auto& well : well_container_) { const auto wasClosed = wellTestState.hasWellClosed(well->name()); @@ -1544,7 +1544,7 @@ namespace Opm { } } - Opm::DeferredLogger global_deferredLogger = gatherDeferredLogger(local_deferredLogger); + DeferredLogger global_deferredLogger = gatherDeferredLogger(local_deferredLogger); if (terminal_output_) { global_deferredLogger.logMessages(); } @@ -1555,7 +1555,7 @@ namespace Opm { template void BlackoilWellModel:: - computeWellPotentials(std::vector& well_potentials, const int reportStepIdx, Opm::DeferredLogger& deferred_logger) + computeWellPotentials(std::vector& well_potentials, const int reportStepIdx, DeferredLogger& deferred_logger) { // number of wells and phases const int nw = numLocalWells(); @@ -1564,7 +1564,7 @@ namespace Opm { auto well_state = this->wellState(); - const Opm::SummaryConfig& summaryConfig = ebosSimulator_.vanguard().summaryConfig(); + const SummaryConfig& summaryConfig = ebosSimulator_.vanguard().summaryConfig(); const bool write_restart_file = ebosSimulator_.vanguard().schedule().write_rst_file(reportStepIdx); auto exc_type = ExceptionType::NONE; std::string exc_msg; @@ -1673,7 +1673,7 @@ namespace Opm { template void BlackoilWellModel:: - prepareTimeStep(Opm::DeferredLogger& deferred_logger) + prepareTimeStep(DeferredLogger& deferred_logger) { auto exc_type = ExceptionType::NONE; std::string exc_msg; @@ -1833,7 +1833,7 @@ namespace Opm { template void BlackoilWellModel:: - updatePrimaryVariables(Opm::DeferredLogger& deferred_logger) + updatePrimaryVariables(DeferredLogger& deferred_logger) { for (const auto& well : well_container_) { well->updatePrimaryVariables(this->wellState(), deferred_logger); @@ -1894,7 +1894,7 @@ namespace Opm { depth_.resize(numCells); for (unsigned cellIdx = 0; cellIdx < numCells; ++cellIdx) { - depth_[cellIdx] = Opm::UgGridHelpers::cellCenterDepth( grid, cellIdx ); + depth_[cellIdx] = UgGridHelpers::cellCenterDepth( grid, cellIdx ); } } @@ -2009,7 +2009,7 @@ namespace Opm { const int segment_index = segment_set.segmentNumberToIndex(segment.first); // recovering segment rates and pressure from the restart values - const auto pres_idx = Opm::data::SegmentPressures::Value::Pressure; + const auto pres_idx = data::SegmentPressures::Value::Pressure; well_state.segPress()[top_segment_index + segment_index] = segment.second.pressures[pres_idx]; const auto& segment_rates = segment.second.rates; @@ -2101,7 +2101,7 @@ namespace Opm { template void BlackoilWellModel:: - updateGroupIndividualControls(Opm::DeferredLogger& deferred_logger, std::set& switched_groups) + updateGroupIndividualControls(DeferredLogger& deferred_logger, std::set& switched_groups) { const int reportStepIdx = ebosSimulator_.episodeIndex(); @@ -2121,7 +2121,7 @@ namespace Opm { template void BlackoilWellModel:: - updateGroupIndividualControl(const Group& group, Opm::DeferredLogger& deferred_logger, std::set& switched_groups) { + updateGroupIndividualControl(const Group& group, DeferredLogger& deferred_logger, std::set& switched_groups) { const int reportStepIdx = ebosSimulator_.episodeIndex(); const bool skip = switched_groups.count(group.name()); @@ -2160,7 +2160,7 @@ namespace Opm { template bool BlackoilWellModel:: - checkGroupConstraints(const Group& group, Opm::DeferredLogger& deferred_logger) const { + checkGroupConstraints(const Group& group, DeferredLogger& deferred_logger) const { const int reportStepIdx = ebosSimulator_.episodeIndex(); if (group.isInjectionGroup()) { @@ -2196,7 +2196,7 @@ namespace Opm { template Group::ProductionCMode BlackoilWellModel:: - checkGroupProductionConstraints(const Group& group, Opm::DeferredLogger& deferred_logger) const { + checkGroupProductionConstraints(const Group& group, DeferredLogger& deferred_logger) const { const int reportStepIdx = ebosSimulator_.episodeIndex(); const auto& summaryState = ebosSimulator_.vanguard().summaryState(); @@ -2405,7 +2405,7 @@ namespace Opm { template void BlackoilWellModel:: - checkGconsaleLimits(const Group& group, WellState& well_state, Opm::DeferredLogger& deferred_logger) + checkGconsaleLimits(const Group& group, WellState& well_state, DeferredLogger& deferred_logger) { const int reportStepIdx = ebosSimulator_.episodeIndex(); // call recursively down the group hiearchy @@ -2525,7 +2525,7 @@ namespace Opm { template void BlackoilWellModel:: - actionOnBrokenConstraints(const Group& group, const Group::ExceedAction& exceed_action, const Group::ProductionCMode& newControl, Opm::DeferredLogger& deferred_logger) { + actionOnBrokenConstraints(const Group& group, const Group::ExceedAction& exceed_action, const Group::ProductionCMode& newControl, DeferredLogger& deferred_logger) { const Group::ProductionCMode oldControl = this->groupState().production_control(group.name()); @@ -2578,7 +2578,7 @@ namespace Opm { template void BlackoilWellModel:: - actionOnBrokenConstraints(const Group& group, const Group::InjectionCMode& newControl, const Phase& controlPhase, Opm::DeferredLogger& deferred_logger) { + actionOnBrokenConstraints(const Group& group, const Group::InjectionCMode& newControl, const Phase& controlPhase, DeferredLogger& deferred_logger) { auto oldControl = this->groupState().injection_control(group.name(), controlPhase); std::ostringstream ss; @@ -2601,7 +2601,7 @@ namespace Opm { template void BlackoilWellModel:: - updateGroupHigherControls(Opm::DeferredLogger& deferred_logger, std::set& switched_groups) + updateGroupHigherControls(DeferredLogger& deferred_logger, std::set& switched_groups) { const int reportStepIdx = ebosSimulator_.episodeIndex(); const Group& fieldGroup = schedule().getGroup("FIELD", reportStepIdx); @@ -2612,7 +2612,7 @@ namespace Opm { template void BlackoilWellModel:: - checkGroupHigherConstraints(const Group& group, Opm::DeferredLogger& deferred_logger, std::set& switched_groups) + checkGroupHigherConstraints(const Group& group, DeferredLogger& deferred_logger, std::set& switched_groups) { // Set up coefficients for RESV <-> surface rate conversion. // Use the pvtRegionIdx from the top cell of the first well. @@ -3138,8 +3138,8 @@ namespace Opm { gr[gname].production = this->getGuideRateValues(group); } - if (this->guideRate_->has(gname, Opm::Phase::WATER) - || this->guideRate_->has(gname, Opm::Phase::GAS)) { + if (this->guideRate_->has(gname, Phase::WATER) + || this->guideRate_->has(gname, Phase::GAS)) { gr[gname].injection = this->getGuideRateInjectionGroupValues(group); } @@ -3234,13 +3234,13 @@ namespace Opm { assert (this->guideRate_ != nullptr); const auto& gname = group.name(); - if (this->guideRate_->has(gname, Opm::Phase::GAS)) { + if (this->guideRate_->has(gname, Phase::GAS)) { grval.set(data::GuideRateValue::Item::Gas, - this->guideRate_->get(gname, Opm::Phase::GAS)); + this->guideRate_->get(gname, Phase::GAS)); } - if (this->guideRate_->has(gname, Opm::Phase::WATER)) { + if (this->guideRate_->has(gname, Phase::WATER)) { grval.set(data::GuideRateValue::Item::Water, - this->guideRate_->get(gname, Opm::Phase::WATER)); + this->guideRate_->get(gname, Phase::WATER)); } return grval; } diff --git a/opm/simulators/wells/GasLiftStage2.hpp b/opm/simulators/wells/GasLiftStage2.hpp index ff8e41e1d..9151f336b 100644 --- a/opm/simulators/wells/GasLiftStage2.hpp +++ b/opm/simulators/wells/GasLiftStage2.hpp @@ -59,9 +59,9 @@ namespace Opm class GasLiftStage2 { using Simulator = GetPropType; using WellState = WellStateFullyImplicitBlackoil; - using BlackoilWellModel = Opm::BlackoilWellModel; - using GasLiftSingleWell = Opm::GasLiftSingleWell; - using GLiftWellState = Opm::GasLiftWellState; + using BlackoilWellModel = ::Opm::BlackoilWellModel; + using GasLiftSingleWell = ::Opm::GasLiftSingleWell; + using GLiftWellState = ::Opm::GasLiftWellState; using GLiftOptWells = typename BlackoilWellModel::GLiftOptWells; using GLiftProdWells = typename BlackoilWellModel::GLiftProdWells; using GLiftWellStateMap = typename BlackoilWellModel::GLiftWellStateMap; @@ -98,26 +98,26 @@ namespace Opm void displayWarning_(const std::string &msg, const std::string &group_name); void displayWarning_(const std::string &msg); std::tuple getCurrentGroupRates_( - const Opm::Group &group); + const Group &group); std::array getCurrentGroupRatesRecursive_( - const Opm::Group &group); + const Group &group); std::tuple getCurrentWellRates_( const std::string &well_name, const std::string &group_name); std::vector getGroupGliftWells_( - const Opm::Group &group); + const Group &group); void getGroupGliftWellsRecursive_( - const Opm::Group &group, std::vector &wells); + const Group &group, std::vector &wells); std::pair getStdWellRates_(const WellInterface &well); - void optimizeGroup_(const Opm::Group &group); - void optimizeGroupsRecursive_(const Opm::Group &group); + void optimizeGroup_(const Group &group); + void optimizeGroupsRecursive_(const Group &group); void recalculateGradientAndUpdateData_( GradPairItr &grad_itr, bool increase, std::vector &grads, std::vector &other_grads); void redistributeALQ_( - std::vector &wells, const Opm::Group &group, + std::vector &wells, const Group &group, std::vector &inc_grads, std::vector &dec_grads); void removeSurplusALQ_( - const Opm::Group &group, + const Group &group, std::vector &inc_grads, std::vector &dec_grads); void saveGrad_(GradMap &map, const std::string &name, GradInfo &grad); void saveDecGrad_(const std::string &name, GradInfo &grad); @@ -152,13 +152,13 @@ namespace Opm int nonlinear_iteration_idx_; struct OptimizeState { - OptimizeState( GasLiftStage2 &parent_, const Opm::Group &group_ ) : + OptimizeState( GasLiftStage2 &parent_, const Group &group_ ) : parent{parent_}, group{group_}, it{0} {} GasLiftStage2 &parent; - const Opm::Group &group; + const Group &group; int it; using GradInfo = typename GasLiftStage2::GradInfo; @@ -184,7 +184,7 @@ namespace Opm }; struct SurplusState { - SurplusState( GasLiftStage2 &parent_, const Opm::Group &group_, + SurplusState( GasLiftStage2 &parent_, const Group &group_, double oil_rate_, double gas_rate_, double alq_, double min_eco_grad_, double oil_target_, double gas_target_, std::optional max_glift_) : @@ -200,7 +200,7 @@ namespace Opm it{0} {} GasLiftStage2 &parent; - const Opm::Group &group; + const Group &group; double oil_rate; double gas_rate; double alq; diff --git a/opm/simulators/wells/GasLiftStage2_impl.hpp b/opm/simulators/wells/GasLiftStage2_impl.hpp index 4760dc68c..9b8d75c73 100644 --- a/opm/simulators/wells/GasLiftStage2_impl.hpp +++ b/opm/simulators/wells/GasLiftStage2_impl.hpp @@ -283,7 +283,7 @@ displayDebugMessage_(const std::string &msg, const std::string &group_name) template std::tuple GasLiftStage2:: -getCurrentGroupRates_(const Opm::Group &group) +getCurrentGroupRates_(const Group &group) { auto rates = getCurrentGroupRatesRecursive_(group); const auto& comm = ebos_simulator_.vanguard().grid().comm(); @@ -302,7 +302,7 @@ getCurrentGroupRates_(const Opm::Group &group) template std::array GasLiftStage2:: -getCurrentGroupRatesRecursive_(const Opm::Group &group) +getCurrentGroupRatesRecursive_(const Group &group) { double oil_rate = 0.0; double gas_rate = 0.0; @@ -440,7 +440,7 @@ getStdWellRates_(const WellInterface &well) template std::vector *> GasLiftStage2:: -getGroupGliftWells_(const Opm::Group &group) +getGroupGliftWells_(const Group &group) { std::vector wells; getGroupGliftWellsRecursive_(group, wells); @@ -450,7 +450,7 @@ getGroupGliftWells_(const Opm::Group &group) template void GasLiftStage2:: -getGroupGliftWellsRecursive_(const Opm::Group &group, +getGroupGliftWellsRecursive_(const Group &group, std::vector &wells) { for (const std::string& group_name : group.groups()) { @@ -471,7 +471,7 @@ getGroupGliftWellsRecursive_(const Opm::Group &group, template void GasLiftStage2:: -optimizeGroup_(const Opm::Group &group) +optimizeGroup_(const Group &group) { const auto &gl_group = this->glo_.group(group.name()); const auto &max_glift = gl_group.max_lift_gas(); @@ -494,7 +494,7 @@ optimizeGroup_(const Opm::Group &group) template void GasLiftStage2:: -optimizeGroupsRecursive_(const Opm::Group &group) +optimizeGroupsRecursive_(const Group &group) { for (const std::string& group_name : group.groups()) { if(!this->schedule_.back().groups.has(group_name)) @@ -597,7 +597,7 @@ recalculateGradientAndUpdateData_( template void GasLiftStage2:: -redistributeALQ_(std::vector &wells, const Opm::Group &group, +redistributeALQ_(std::vector &wells, const Group &group, std::vector &inc_grads, std::vector &dec_grads) { OptimizeState state {*this, group}; @@ -652,7 +652,7 @@ redistributeALQ_(std::vector &wells, const Opm::Group &gro template void GasLiftStage2:: -removeSurplusALQ_(const Opm::Group &group, +removeSurplusALQ_(const Group &group, std::vector &inc_grads, std::vector &dec_grads) { if (dec_grads.size() == 0) { diff --git a/opm/simulators/wells/MSWellHelpers.hpp b/opm/simulators/wells/MSWellHelpers.hpp index 54e1ac780..f41060e05 100644 --- a/opm/simulators/wells/MSWellHelpers.hpp +++ b/opm/simulators/wells/MSWellHelpers.hpp @@ -68,7 +68,7 @@ namespace mswellhelpers if (std::isinf(y[i_block][i_elem]) || std::isnan(y[i_block][i_elem]) ) { const std::string msg{"nan or inf value found after UMFPack solve due to singular matrix"}; OpmLog::debug(msg); - OPM_THROW_NOLOG(Opm::NumericalIssue, msg); + OPM_THROW_NOLOG(NumericalIssue, msg); } } } @@ -123,7 +123,7 @@ namespace mswellhelpers // obtain y = D^-1 * x with a BICSSTAB iterative solver template VectorType - invDX(const MatrixType& D, VectorType x, Opm::DeferredLogger& deferred_logger) + invDX(const MatrixType& D, VectorType x, DeferredLogger& deferred_logger) { // the function will change the value of x, so we should not use reference of x here. @@ -160,7 +160,7 @@ namespace mswellhelpers linsolver.apply(y, x, res); if ( !res.converged ) { - OPM_DEFLOG_THROW(Opm::NumericalIssue, "the invDX did not converge ", deferred_logger); + OPM_DEFLOG_THROW(NumericalIssue, "the invDX did not converge ", deferred_logger); } return y; @@ -172,7 +172,7 @@ namespace mswellhelpers template inline ValueType haalandFormular(const ValueType& re, const double diameter, const double roughness) { - const ValueType value = -3.6 * Opm::log10(6.9 / re + std::pow(roughness / (3.7 * diameter), 10. / 9.) ); + const ValueType value = -3.6 * log10(6.9 / re + std::pow(roughness / (3.7 * diameter), 10. / 9.) ); // sqrt(1/f) should be non-positive assert(value >= 0.0); @@ -190,7 +190,7 @@ namespace mswellhelpers ValueType f = 0.; // Reynolds number - const ValueType re = Opm::abs( diameter * w / (area * mu)); + const ValueType re = abs( diameter * w / (area * mu)); if ( re == 0.0 ) { // make sure it is because the mass rate is zero @@ -265,7 +265,7 @@ namespace mswellhelpers const double max_visco_ratio) { const ValueType temp_value = 1. / (1. - (0.8415 / 0.7480 * water_liquid_fraction) ); - const ValueType viscosity_ratio = Opm::pow(temp_value, 2.5); + const ValueType viscosity_ratio = pow(temp_value, 2.5); if (viscosity_ratio <= max_visco_ratio) { return oil_viscosity * viscosity_ratio; @@ -284,7 +284,7 @@ namespace mswellhelpers const double max_visco_ratio) { const ValueType temp_value = 1. / (1. - (0.6019 / 0.6410) * (1. - water_liquid_fraction) ); - const ValueType viscosity_ratio = Opm::pow(temp_value, 2.5); + const ValueType viscosity_ratio = pow(temp_value, 2.5); if (viscosity_ratio <= max_visco_ratio) { return water_viscosity * viscosity_ratio; diff --git a/opm/simulators/wells/MultisegmentWell.hpp b/opm/simulators/wells/MultisegmentWell.hpp index b995bf5b1..e23b00050 100644 --- a/opm/simulators/wells/MultisegmentWell.hpp +++ b/opm/simulators/wells/MultisegmentWell.hpp @@ -28,6 +28,7 @@ namespace Opm { + class DeferredLogger; template class MultisegmentWell: public WellInterface @@ -139,15 +140,15 @@ namespace Opm const double dt, WellState& well_state, const GroupState& group_state, - Opm::DeferredLogger& deferred_logger) override; + DeferredLogger& deferred_logger) override; /// updating the well state based the current control mode void updateWellStateWithTarget(const Simulator& ebos_simulator, WellState& well_state, - Opm::DeferredLogger& deferred_logger) const; + DeferredLogger& deferred_logger) const; /// check whether the well equations get converged for this well - virtual ConvergenceReport getWellConvergence(const WellState& well_state, const std::vector& B_avg, Opm::DeferredLogger& deferred_logger, const bool relax_tolerance = false) const override; + virtual ConvergenceReport getWellConvergence(const WellState& well_state, const std::vector& B_avg, DeferredLogger& deferred_logger, const bool relax_tolerance = false) const override; /// Ax = Ax - C D^-1 B x virtual void apply(const BVector& x, BVector& Ax) const override; @@ -163,21 +164,21 @@ namespace Opm /// xw to update Well State virtual void recoverWellSolutionAndUpdateWellState(const BVector& x, WellState& well_state, - Opm::DeferredLogger& deferred_logger) const override; + DeferredLogger& deferred_logger) const override; /// computing the well potentials for group control virtual void computeWellPotentials(const Simulator& ebosSimulator, const WellState& well_state, std::vector& well_potentials, - Opm::DeferredLogger& deferred_logger) override; + DeferredLogger& deferred_logger) override; - virtual void updatePrimaryVariables(const WellState& well_state, Opm::DeferredLogger& deferred_logger) const override; + virtual void updatePrimaryVariables(const WellState& well_state, DeferredLogger& deferred_logger) const override; - virtual void solveEqAndUpdateWellState(WellState& well_state, Opm::DeferredLogger& deferred_logger) override; // const? + virtual void solveEqAndUpdateWellState(WellState& well_state, DeferredLogger& deferred_logger) override; // const? virtual void calculateExplicitQuantities(const Simulator& ebosSimulator, const WellState& well_state, - Opm::DeferredLogger& deferred_logger) override; // should be const? + DeferredLogger& deferred_logger) override; // should be const? virtual void updateProductivityIndex(const Simulator& ebosSimulator, const WellProdIndexCalculator& wellPICalc, @@ -345,7 +346,7 @@ namespace Opm // updating the well_state based on well solution dwells void updateWellState(const BVectorWell& dwells, WellState& well_state, - Opm::DeferredLogger& deferred_logger, + DeferredLogger& deferred_logger, const double relaxation_factor=1.0) const; @@ -380,13 +381,13 @@ namespace Opm EvalWell& perf_press, double& perf_dis_gas_rate, double& perf_vap_oil_rate, - Opm::DeferredLogger& deferred_logger) const; + DeferredLogger& deferred_logger) const; // convert a Eval from reservoir to contain the derivative related to wells EvalWell extendEval(const Eval& in) const; - double calculateThpFromBhp(const std::vector& rates, const double bhp, Opm::DeferredLogger& deferred_logger) const; - void updateThp(WellState& well_state, Opm::DeferredLogger& deferred_logger) const; + double calculateThpFromBhp(const std::vector& rates, const double bhp, DeferredLogger& deferred_logger) const; + void updateThp(WellState& well_state, DeferredLogger& deferred_logger) const; // compute the fluid properties, such as densities, viscosities, and so on, in the segments // They will be treated implicitly, so they need to be of Evaluation type @@ -407,24 +408,24 @@ namespace Opm void computeWellRatesAtBhpLimit(const Simulator& ebosSimulator, std::vector& well_flux, - Opm::DeferredLogger& deferred_logger) const; + DeferredLogger& deferred_logger) const; void computeWellRatesWithBhp(const Simulator& ebosSimulator, const Scalar bhp, std::vector& well_flux, - Opm::DeferredLogger& deferred_logger) const; + DeferredLogger& deferred_logger) const; std::vector computeWellPotentialWithTHP(const Simulator& ebos_simulator, - Opm::DeferredLogger& deferred_logger) const; + DeferredLogger& deferred_logger) const; void assembleControlEq(const WellState& well_state, const GroupState& group_state, - const Opm::Schedule& schedule, + const Schedule& schedule, const SummaryState& summaryState, const Well::InjectionControls& inj_controls, const Well::ProductionControls& prod_controls, - Opm::DeferredLogger& deferred_logger); + DeferredLogger& deferred_logger); void assemblePressureEq(const int seg, const UnitSystem& unit_system, WellState& well_state, DeferredLogger& deferred_logger) const; @@ -442,7 +443,7 @@ namespace Opm // handling the overshooting and undershooting of the fractions void processFractions(const int seg) const; - void updateWellStateFromPrimaryVariables(WellState& well_state, Opm::DeferredLogger& deferred_logger) const; + void updateWellStateFromPrimaryVariables(WellState& well_state, DeferredLogger& deferred_logger) const; virtual double getRefDensity() const override; @@ -456,7 +457,7 @@ namespace Opm const Well::ProductionControls& prod_controls, WellState& well_state, const GroupState& group_state, - Opm::DeferredLogger& deferred_logger) override; + DeferredLogger& deferred_logger) override; virtual void assembleWellEqWithoutIteration(const Simulator& ebosSimulator, const double dt, @@ -464,7 +465,7 @@ namespace Opm const Well::ProductionControls& prod_controls, WellState& well_state, const GroupState& group_state, - Opm::DeferredLogger& deferred_logger) override; + DeferredLogger& deferred_logger) override; virtual void updateWaterThroughput(const double dt, WellState& well_state) const override; @@ -524,13 +525,13 @@ namespace Opm WellState& well_state, DeferredLogger& deferred_logger) const; // check whether the well is operable under BHP limit with current reservoir condition - virtual void checkOperabilityUnderBHPLimitProducer(const WellState& well_state, const Simulator& ebos_simulator, Opm::DeferredLogger& deferred_logger) override; + virtual void checkOperabilityUnderBHPLimitProducer(const WellState& well_state, const Simulator& ebos_simulator, DeferredLogger& deferred_logger) override; // check whether the well is operable under THP limit with current reservoir condition - virtual void checkOperabilityUnderTHPLimitProducer(const Simulator& ebos_simulator, const WellState& well_state, Opm::DeferredLogger& deferred_logger) override; + virtual void checkOperabilityUnderTHPLimitProducer(const Simulator& ebos_simulator, const WellState& well_state, DeferredLogger& deferred_logger) override; // updating the inflow based on the current reservoir condition - virtual void updateIPR(const Simulator& ebos_simulator, Opm::DeferredLogger& deferred_logger) const override; + virtual void updateIPR(const Simulator& ebos_simulator, DeferredLogger& deferred_logger) const override; }; diff --git a/opm/simulators/wells/MultisegmentWell_impl.hpp b/opm/simulators/wells/MultisegmentWell_impl.hpp index 60d5b0f6e..bbca6517e 100644 --- a/opm/simulators/wells/MultisegmentWell_impl.hpp +++ b/opm/simulators/wells/MultisegmentWell_impl.hpp @@ -264,7 +264,7 @@ namespace Opm const double dt, WellState& well_state, const GroupState& group_state, - Opm::DeferredLogger& deferred_logger) + DeferredLogger& deferred_logger) { checkWellOperability(ebosSimulator, well_state, deferred_logger); @@ -289,7 +289,7 @@ namespace Opm MultisegmentWell:: updateWellStateWithTarget(const Simulator& ebos_simulator, WellState& well_state, - Opm::DeferredLogger& deferred_logger) const + DeferredLogger& deferred_logger) const { Base::updateWellStateWithTarget(ebos_simulator, well_state, deferred_logger); // scale segment rates based on the wellRates @@ -359,7 +359,7 @@ namespace Opm template ConvergenceReport MultisegmentWell:: - getWellConvergence(const WellState& well_state, const std::vector& B_avg, Opm::DeferredLogger& deferred_logger, const bool relax_tolerance) const + getWellConvergence(const WellState& well_state, const std::vector& B_avg, DeferredLogger& deferred_logger, const bool relax_tolerance) const { assert(int(B_avg.size()) == num_components_); @@ -542,7 +542,7 @@ namespace Opm MultisegmentWell:: recoverWellSolutionAndUpdateWellState(const BVector& x, WellState& well_state, - Opm::DeferredLogger& deferred_logger) const + DeferredLogger& deferred_logger) const { if (!this->isOperable() && !this->wellIsStopped()) return; @@ -561,7 +561,7 @@ namespace Opm computeWellPotentials(const Simulator& ebosSimulator, const WellState& well_state, std::vector& well_potentials, - Opm::DeferredLogger& deferred_logger) + DeferredLogger& deferred_logger) { const int np = number_of_phases_; well_potentials.resize(np, 0.0); @@ -575,12 +575,12 @@ namespace Opm /* { bool pressure_controlled_well = false; if (this->isInjector()) { - const Opm::Well::InjectorCMode& current = well_state.currentInjectionControls()[index_of_well_]; + const Well::InjectorCMode& current = well_state.currentInjectionControls()[index_of_well_]; if (current == Well::InjectorCMode::BHP || current == Well::InjectorCMode::THP) { pressure_controlled_well = true; } } else { - const Opm::Well::ProducerCMode& current = well_state.currentProductionControls()[index_of_well_]; + const Well::ProducerCMode& current = well_state.currentProductionControls()[index_of_well_]; if (current == Well::ProducerCMode::BHP || current == Well::ProducerCMode::THP) { pressure_controlled_well = true; } @@ -614,7 +614,7 @@ namespace Opm MultisegmentWell:: computeWellRatesAtBhpLimit(const Simulator& ebosSimulator, std::vector& well_flux, - Opm::DeferredLogger& deferred_logger) const + DeferredLogger& deferred_logger) const { if (well_ecl_.isInjector()) { const auto controls = well_ecl_.injectionControls(ebosSimulator.vanguard().summaryState()); @@ -633,7 +633,7 @@ namespace Opm computeWellRatesWithBhp(const Simulator& ebosSimulator, const Scalar bhp, std::vector& well_flux, - Opm::DeferredLogger& deferred_logger) const + DeferredLogger& deferred_logger) const { // creating a copy of the well itself, to avoid messing up the explicit informations // during this copy, the only information not copied properly is the well controls @@ -695,7 +695,7 @@ namespace Opm std::vector MultisegmentWell:: computeWellPotentialWithTHP(const Simulator& ebos_simulator, - Opm::DeferredLogger& deferred_logger) const + DeferredLogger& deferred_logger) const { std::vector potentials(number_of_phases_, 0.0); const auto& summary_state = ebos_simulator.vanguard().summaryState(); @@ -743,7 +743,7 @@ namespace Opm template void MultisegmentWell:: - updatePrimaryVariables(const WellState& well_state, Opm::DeferredLogger& /* deferred_logger */) const + updatePrimaryVariables(const WellState& well_state, DeferredLogger& /* deferred_logger */) const { // TODO: to test using rate conversion coefficients to see if it will be better than // this default one @@ -837,7 +837,7 @@ namespace Opm template void MultisegmentWell:: - solveEqAndUpdateWellState(WellState& well_state, Opm::DeferredLogger& deferred_logger) + solveEqAndUpdateWellState(WellState& well_state, DeferredLogger& deferred_logger) { if (!this->isOperable() && !this->wellIsStopped()) return; @@ -930,7 +930,7 @@ namespace Opm MultisegmentWell:: updateWellState(const BVectorWell& dwells, WellState& well_state, - Opm::DeferredLogger& deferred_logger, + DeferredLogger& deferred_logger, const double relaxation_factor) const { if (!this->isOperable() && !this->wellIsStopped()) return; @@ -991,7 +991,7 @@ namespace Opm MultisegmentWell:: calculateExplicitQuantities(const Simulator& ebosSimulator, const WellState& well_state, - Opm::DeferredLogger& deferred_logger) + DeferredLogger& deferred_logger) { updatePrimaryVariables(well_state, deferred_logger); initPrimaryVariablesEvaluation(); @@ -1256,7 +1256,7 @@ namespace Opm EvalWell& perf_press, double& perf_dis_gas_rate, double& perf_vap_oil_rate, - Opm::DeferredLogger& deferred_logger) const + DeferredLogger& deferred_logger) const { std::vector cmix_s(num_components_, 0.0); @@ -1347,7 +1347,7 @@ namespace Opm const EvalWell d = 1.0 - rv * rs; if (d.value() == 0.0) { - OPM_DEFLOG_THROW(Opm::NumericalIssue, "Zero d value obtained for well " << name() << " during flux calcuation" + OPM_DEFLOG_THROW(NumericalIssue, "Zero d value obtained for well " << name() << " during flux calcuation" << " with rs " << rs << " and rv " << rv, deferred_logger); } @@ -1783,11 +1783,11 @@ namespace Opm MultisegmentWell:: assembleControlEq(const WellState& well_state, const GroupState& group_state, - const Opm::Schedule& schedule, + const Schedule& schedule, const SummaryState& summaryState, const Well::InjectionControls& inj_controls, const Well::ProductionControls& prod_controls, - Opm::DeferredLogger& deferred_logger) + DeferredLogger& deferred_logger) { EvalWell control_eq(0.0); @@ -1864,7 +1864,7 @@ namespace Opm template void MultisegmentWell:: - updateThp(WellState& well_state, Opm::DeferredLogger& deferred_logger) const + updateThp(WellState& well_state, DeferredLogger& deferred_logger) const { // When there is no vaild VFP table provided, we set the thp to be zero. if (!this->isVFPActive(deferred_logger) || this->wellIsStopped()) { @@ -1875,7 +1875,7 @@ namespace Opm // the well is under other control types, we calculate the thp based on bhp and rates std::vector rates(3, 0.0); - const Opm::PhaseUsage& pu = phaseUsage(); + const PhaseUsage& pu = phaseUsage(); if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx)) { rates[ Water ] = well_state.wellRates()[index_of_well_ * number_of_phases_ + pu.phase_pos[ Water ] ]; } @@ -1899,7 +1899,7 @@ namespace Opm MultisegmentWell:: calculateThpFromBhp(const std::vector& rates, const double bhp, - Opm::DeferredLogger& deferred_logger) const + DeferredLogger& deferred_logger) const { assert(int(rates.size()) == 3); // the vfp related only supports three phases now. @@ -2163,7 +2163,7 @@ namespace Opm template void MultisegmentWell:: - checkOperabilityUnderBHPLimitProducer(const WellState& /*well_state*/, const Simulator& ebos_simulator, Opm::DeferredLogger& deferred_logger) + checkOperabilityUnderBHPLimitProducer(const WellState& /*well_state*/, const Simulator& ebos_simulator, DeferredLogger& deferred_logger) { const auto& summaryState = ebos_simulator.vanguard().summaryState(); const double bhp_limit = Base::mostStrictBhpFromBhpLimits(summaryState); @@ -2216,7 +2216,7 @@ namespace Opm template void MultisegmentWell:: - updateIPR(const Simulator& ebos_simulator, Opm::DeferredLogger& deferred_logger) const + updateIPR(const Simulator& ebos_simulator, DeferredLogger& deferred_logger) const { // TODO: not handling solvent related here for now @@ -2324,7 +2324,7 @@ namespace Opm template void MultisegmentWell:: - checkOperabilityUnderTHPLimitProducer(const Simulator& ebos_simulator, const WellState& /*well_state*/, Opm::DeferredLogger& deferred_logger) + checkOperabilityUnderTHPLimitProducer(const Simulator& ebos_simulator, const WellState& /*well_state*/, DeferredLogger& deferred_logger) { const auto& summaryState = ebos_simulator.vanguard().summaryState(); const auto obtain_bhp = computeBhpAtThpLimitProd(ebos_simulator, summaryState, deferred_logger); @@ -2364,7 +2364,7 @@ namespace Opm template void MultisegmentWell:: - updateWellStateFromPrimaryVariables(WellState& well_state, Opm::DeferredLogger& deferred_logger) const + updateWellStateFromPrimaryVariables(WellState& well_state, DeferredLogger& deferred_logger) const { const PhaseUsage& pu = phaseUsage(); assert( FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx) ); @@ -2455,7 +2455,7 @@ namespace Opm const Well::ProductionControls& prod_controls, WellState& well_state, const GroupState& group_state, - Opm::DeferredLogger& deferred_logger) + DeferredLogger& deferred_logger) { if (!this->isOperable() && !this->wellIsStopped()) return true; @@ -2574,7 +2574,7 @@ namespace Opm const Well::ProductionControls& prod_controls, WellState& well_state, const GroupState& group_state, - Opm::DeferredLogger& deferred_logger) + DeferredLogger& deferred_logger) { if (!this->isOperable() && !this->wellIsStopped()) return; @@ -2726,7 +2726,7 @@ namespace Opm // the fourth dequation, the pressure drop equation if (seg == 0) { // top segment, pressure equation is the control equation const auto& summaryState = ebosSimulator.vanguard().summaryState(); - const Opm::Schedule& schedule = ebosSimulator.vanguard().schedule(); + const Schedule& schedule = ebosSimulator.vanguard().schedule(); assembleControlEq(well_state, group_state, schedule, summaryState, inj_controls, prod_controls, deferred_logger); } else { const UnitSystem& unit_system = ebosSimulator.vanguard().eclState().getDeckUnitSystem(); @@ -2935,7 +2935,7 @@ namespace Opm << ", rv " << rv << " and pressure " << seg_pressure << " obtaining d " << d; OpmLog::debug(sstr.str()); - OPM_THROW_NOLOG(Opm::NumericalIssue, sstr.str()); + OPM_THROW_NOLOG(NumericalIssue, sstr.str()); } if (rs > 0.0) { // rs > 0.0? @@ -2981,7 +2981,7 @@ namespace Opm } } if (std::isnan(residual) || std::isinf(residual)) { - OPM_DEFLOG_THROW(Opm::NumericalIssue, "nan or inf value for residal get for well " << name() + OPM_DEFLOG_THROW(NumericalIssue, "nan or inf value for residal get for well " << name() << " segment " << seg << " eq_idx " << eq_idx, deferred_logger); } @@ -2995,7 +2995,7 @@ namespace Opm { const double control_residual = std::abs(resWell_[0][numWellEq - 1]); if (std::isnan(control_residual) || std::isinf(control_residual)) { - OPM_DEFLOG_THROW(Opm::NumericalIssue, "nan or inf value for control residal get for well " << name(), deferred_logger); + OPM_DEFLOG_THROW(NumericalIssue, "nan or inf value for control residal get for well " << name(), deferred_logger); } residuals[numWellEq] = control_residual; } @@ -3090,7 +3090,7 @@ namespace Opm const int well_index = index_of_well_; if (this->isInjector() ) { - const Opm::Well::InjectorCMode& current = well_state.currentInjectionControls()[well_index]; + const Well::InjectorCMode& current = well_state.currentInjectionControls()[well_index]; switch(current) { case Well::InjectorCMode::THP: control_tolerance = param_.tolerance_pressure_ms_wells_; @@ -3157,7 +3157,7 @@ namespace Opm const int well_index = index_of_well_; if (this->isInjector() ) { - const Opm::Well::InjectorCMode& current = well_state.currentInjectionControls()[well_index]; + const Well::InjectorCMode& current = well_state.currentInjectionControls()[well_index]; switch(current) { case Well::InjectorCMode::THP: ctrltype = CR::WellFailure::Type::ControlTHP; @@ -3892,7 +3892,7 @@ namespace Opm const auto volume_rate_icd = this->segment_mass_rates_[seg] * aicd.scalingFactor() / mixture_density; const double sign = volume_rate_icd <= 0. ? 1.0 : -1.0; // convert 1 unit volume rate - using M = Opm::UnitSystem::measure; + using M = UnitSystem::measure; const double unit_volume_rate = unit_system.to_si(M::geometric_volume_rate, 1.); // TODO: we did not consider the maximum allowed rate here @@ -4049,7 +4049,7 @@ namespace Opm phase_pos = pu.phase_pos[Water]; } else { - OPM_DEFLOG_THROW(Opm::NotImplemented, + OPM_DEFLOG_THROW(NotImplemented, "Unsupported Injector Type (" << static_cast(preferred_phase) << ") for well " << this->name() diff --git a/opm/simulators/wells/WellConnectionAuxiliaryModule.hpp b/opm/simulators/wells/WellConnectionAuxiliaryModule.hpp index 1a3fc64ef..4901ece8d 100644 --- a/opm/simulators/wells/WellConnectionAuxiliaryModule.hpp +++ b/opm/simulators/wells/WellConnectionAuxiliaryModule.hpp @@ -31,7 +31,7 @@ namespace Opm { template class WellConnectionAuxiliaryModule - : public Opm::BaseAuxiliaryModule + : public BaseAuxiliaryModule { using GlobalEqVector = GetPropType; using SparseMatrixAdapter = GetPropType; @@ -39,7 +39,7 @@ class WellConnectionAuxiliaryModule public: using NeighborSet = typename - Opm::BaseAuxiliaryModule::NeighborSet; + ::Opm::BaseAuxiliaryModule::NeighborSet; WellConnectionAuxiliaryModule(const Schedule& schedule, const Dune::CpGrid& grid)