From 7f1df40b74de117075945c56c3eb3a6909e1fa55 Mon Sep 17 00:00:00 2001 From: "Franz G. Fuchs" Date: Mon, 21 Jan 2019 08:26:28 +0100 Subject: [PATCH] fixed naming conventions, messages and comments --- opm/autodiff/BlackoilWellModel_impl.hpp | 7 +++-- opm/autodiff/MultisegmentWell.hpp | 2 +- opm/autodiff/MultisegmentWell_impl.hpp | 2 +- opm/autodiff/StandardWell.hpp | 2 +- opm/autodiff/StandardWellV.hpp | 2 +- opm/autodiff/StandardWellV_impl.hpp | 4 +-- opm/autodiff/StandardWell_impl.hpp | 4 +-- opm/autodiff/WellInterface.hpp | 12 ++++----- opm/autodiff/WellInterface_impl.hpp | 34 ++++++++++++------------- 9 files changed, 34 insertions(+), 35 deletions(-) diff --git a/opm/autodiff/BlackoilWellModel_impl.hpp b/opm/autodiff/BlackoilWellModel_impl.hpp index 0bf50368f..ca01e944c 100644 --- a/opm/autodiff/BlackoilWellModel_impl.hpp +++ b/opm/autodiff/BlackoilWellModel_impl.hpp @@ -939,10 +939,9 @@ namespace Opm { BlackoilWellModel:: updateWellControls() { - // Even if there no wells active locally, we cannot - // return as the Destructor of the DeferredLogger - // uses global communication. For no well active globally - // we simply return. + // Even if there are no wells active locally, we cannot + // return as the DeferredLogger uses global communication. + // For no well active globally we simply return. if( !wellsActive() ) return ; Opm::DeferredLogger local_deferredLogger; diff --git a/opm/autodiff/MultisegmentWell.hpp b/opm/autodiff/MultisegmentWell.hpp index 4f64216be..18848f869 100644 --- a/opm/autodiff/MultisegmentWell.hpp +++ b/opm/autodiff/MultisegmentWell.hpp @@ -352,7 +352,7 @@ namespace Opm virtual void wellTestingPhysical(Simulator& simulator, const std::vector& B_avg, const double simulation_time, const int report_step, - WellState& well_state, WellTestState& welltest_state, Opm::DeferredLogger& deferredLogger) override; + WellState& well_state, WellTestState& welltest_state, Opm::DeferredLogger& deferred_logger) override; virtual void updateWaterThroughput(const double dt, WellState& well_state) const override; }; diff --git a/opm/autodiff/MultisegmentWell_impl.hpp b/opm/autodiff/MultisegmentWell_impl.hpp index 4c31a415e..fc11379c8 100644 --- a/opm/autodiff/MultisegmentWell_impl.hpp +++ b/opm/autodiff/MultisegmentWell_impl.hpp @@ -1897,7 +1897,7 @@ namespace Opm MultisegmentWell:: wellTestingPhysical(Simulator& simulator, const std::vector& B_avg, const double simulation_time, const int report_step, - WellState& well_state, WellTestState& welltest_state, Opm::DeferredLogger& deferredLogger) + WellState& well_state, WellTestState& welltest_state, Opm::DeferredLogger& deferred_logger) { const std::string msg = "Support of well testing for physical limits for multisegment wells is not " "implemented yet, wellTestingPhysical() for " + name() + " will do nothing"; diff --git a/opm/autodiff/StandardWell.hpp b/opm/autodiff/StandardWell.hpp index 34f8ec89a..b83080532 100644 --- a/opm/autodiff/StandardWell.hpp +++ b/opm/autodiff/StandardWell.hpp @@ -414,7 +414,7 @@ namespace Opm virtual void wellTestingPhysical(Simulator& simulator, const std::vector& B_avg, const double simulation_time, const int report_step, - WellState& well_state, WellTestState& welltest_state, Opm::DeferredLogger& deferredLogger) override; + WellState& well_state, WellTestState& welltest_state, Opm::DeferredLogger& deferred_logger) override; virtual void updateWaterThroughput(const double dt, WellState& well_state) const override; }; diff --git a/opm/autodiff/StandardWellV.hpp b/opm/autodiff/StandardWellV.hpp index 897aa4203..fcaafeb9b 100644 --- a/opm/autodiff/StandardWellV.hpp +++ b/opm/autodiff/StandardWellV.hpp @@ -419,7 +419,7 @@ namespace Opm virtual void wellTestingPhysical(Simulator& simulator, const std::vector& B_avg, const double simulation_time, const int report_step, - WellState& well_state, WellTestState& welltest_state, Opm::DeferredLogger& deferredLogger) override; + WellState& well_state, WellTestState& welltest_state, Opm::DeferredLogger& deferred_logger) override; // calculate the skin pressure based on water velocity, throughput and polymer concentration. // throughput is used to describe the formation damage during water/polymer injection. diff --git a/opm/autodiff/StandardWellV_impl.hpp b/opm/autodiff/StandardWellV_impl.hpp index a79d0f390..5dc152d27 100644 --- a/opm/autodiff/StandardWellV_impl.hpp +++ b/opm/autodiff/StandardWellV_impl.hpp @@ -2868,7 +2868,7 @@ namespace Opm StandardWellV:: wellTestingPhysical(Simulator& ebos_simulator, const std::vector& B_avg, const double simulation_time, const int report_step, - WellState& well_state, WellTestState& welltest_state, Opm::DeferredLogger& deferredLogger) + WellState& well_state, WellTestState& welltest_state, Opm::DeferredLogger& deferred_logger) { OpmLog::debug(" well " + name() + " is being tested for physical limits"); @@ -2903,7 +2903,7 @@ namespace Opm updatePrimaryVariables(well_state_copy); initPrimaryVariablesEvaluation(); - const bool converged = this->solveWellEqUntilConverged(ebos_simulator, B_avg, well_state_copy, deferredLogger); + const bool converged = this->solveWellEqUntilConverged(ebos_simulator, B_avg, well_state_copy, deferred_logger); if (!converged) { const std::string msg = " well " + name() + " did not get converged during well testing for physical reason"; diff --git a/opm/autodiff/StandardWell_impl.hpp b/opm/autodiff/StandardWell_impl.hpp index 110cdf45e..66cabb0ed 100644 --- a/opm/autodiff/StandardWell_impl.hpp +++ b/opm/autodiff/StandardWell_impl.hpp @@ -2748,7 +2748,7 @@ namespace Opm StandardWell:: wellTestingPhysical(Simulator& ebos_simulator, const std::vector& B_avg, const double simulation_time, const int report_step, - WellState& well_state, WellTestState& welltest_state, Opm::DeferredLogger& deferredLogger) + WellState& well_state, WellTestState& welltest_state, Opm::DeferredLogger& deferred_logger) { OpmLog::debug(" well " + name() + " is being tested for physical limits"); @@ -2783,7 +2783,7 @@ namespace Opm updatePrimaryVariables(well_state_copy); initPrimaryVariablesEvaluation(); - const bool converged = this->solveWellEqUntilConverged(ebos_simulator, B_avg, well_state_copy, deferredLogger); + const bool converged = this->solveWellEqUntilConverged(ebos_simulator, B_avg, well_state_copy, deferred_logger); if (!converged) { const std::string msg = " well " + name() + " did not get converged during well testing for physical reason"; diff --git a/opm/autodiff/WellInterface.hpp b/opm/autodiff/WellInterface.hpp index e6002c610..ebbf3c10f 100644 --- a/opm/autodiff/WellInterface.hpp +++ b/opm/autodiff/WellInterface.hpp @@ -183,7 +183,7 @@ namespace Opm void updateWellControl(/* const */ Simulator& ebos_simulator, WellState& well_state, - Opm::DeferredLogger& deferredLogger) /* const */; + Opm::DeferredLogger& deferred_logger) /* const */; virtual void updatePrimaryVariables(const WellState& well_state) const = 0; @@ -229,7 +229,7 @@ namespace Opm const double simulation_time, const int report_step, const WellTestConfig::Reason testing_reason, /* const */ WellState& well_state, WellTestState& welltest_state, - Opm::DeferredLogger& deferredLogger); + Opm::DeferredLogger& deferred_logger); void updatePerforatedCell(std::vector& is_cell_perforated); @@ -375,11 +375,11 @@ namespace Opm void wellTestingEconomic(Simulator& simulator, const std::vector& B_avg, const double simulation_time, const int report_step, - const WellState& well_state, WellTestState& welltest_state, Opm::DeferredLogger& deferredLogger); + const WellState& well_state, WellTestState& welltest_state, Opm::DeferredLogger& deferred_logger); virtual void wellTestingPhysical(Simulator& simulator, const std::vector& B_avg, const double simulation_time, const int report_step, - WellState& well_state, WellTestState& welltest_state, Opm::DeferredLogger& deferredLogger) = 0; + WellState& well_state, WellTestState& welltest_state, Opm::DeferredLogger& deferred_logger) = 0; void updateWellTestStateEconomic(const WellState& well_state, const double simulation_time, @@ -393,12 +393,12 @@ namespace Opm void solveWellForTesting(Simulator& ebosSimulator, WellState& well_state, const std::vector& B_avg, - Opm::DeferredLogger& deferredLogger); + Opm::DeferredLogger& deferred_logger); bool solveWellEqUntilConverged(Simulator& ebosSimulator, const std::vector& B_avg, WellState& well_state, - Opm::DeferredLogger& deferredLogger); + Opm::DeferredLogger& deferred_logger); void scaleProductivityIndex(const int perfIdx, double& productivity_index); diff --git a/opm/autodiff/WellInterface_impl.hpp b/opm/autodiff/WellInterface_impl.hpp index 51d6abf29..ac046e66d 100644 --- a/opm/autodiff/WellInterface_impl.hpp +++ b/opm/autodiff/WellInterface_impl.hpp @@ -431,7 +431,7 @@ namespace Opm WellInterface:: updateWellControl(/* const */ Simulator& ebos_simulator, WellState& well_state, - Opm::DeferredLogger& deferredLogger) /* const */ + Opm::DeferredLogger& deferred_logger) /* const */ { auto cc = Dune::MPIHelper::getCollectiveCommunication(); const int np = number_of_phases_; @@ -472,11 +472,11 @@ namespace Opm } else { // before we figure out to handle it, we give some debug information here if ( well_controls_iget_type(wc, ctrl_index) == BHP && !operability_status_.isOperableUnderBHPLimit() ) { - OpmLog::debug("well " + name() + " breaks the BHP limit, while it is not operable under BHP limit"); + deferred_logger.debug("well " + name() + " breaks the BHP limit, while it is not operable under BHP limit"); } if ( well_controls_iget_type(wc, ctrl_index) == THP && !operability_status_.isOperableUnderTHPLimit() ) { - OpmLog::debug("well " + name() + " breaks the THP limit, while it is not operable under THP limit"); + deferred_logger.debug("well " + name() + " breaks the THP limit, while it is not operable under THP limit"); } } } @@ -501,10 +501,10 @@ namespace Opm ss << " Switching control mode for well " << name() << " from " << modestring[from] << " to " << modestring[to]; - if (cc.size()>1) { + if (cc.size() > 1) { ss << " on rank " << cc.rank(); } - deferredLogger.info(ss.str()); + deferred_logger.info(ss.str()); } if (updated_control_index != old_control_index) { // || well_collection_->groupControlActive()) { @@ -937,16 +937,16 @@ namespace Opm const WellTestConfig::Reason testing_reason, /* const */ WellState& well_state, WellTestState& well_test_state, - Opm::DeferredLogger& deferredLogger) + Opm::DeferredLogger& deferred_logger) { if (testing_reason == WellTestConfig::Reason::PHYSICAL) { wellTestingPhysical(simulator, B_avg, simulation_time, report_step, - well_state, well_test_state, deferredLogger); + well_state, well_test_state, deferred_logger); } if (testing_reason == WellTestConfig::Reason::ECONOMIC) { wellTestingEconomic(simulator, B_avg, simulation_time, report_step, - well_state, well_test_state, deferredLogger); + well_state, well_test_state, deferred_logger); } } @@ -959,9 +959,9 @@ namespace Opm WellInterface:: wellTestingEconomic(Simulator& simulator, const std::vector& B_avg, const double simulation_time, const int report_step, - const WellState& well_state, WellTestState& welltest_state, Opm::DeferredLogger& deferredLogger) + const WellState& well_state, WellTestState& welltest_state, Opm::DeferredLogger& deferred_logger) { - OpmLog::debug(" well " + name() + " is being tested for economic limits"); + deferred_logger.debug(" well " + name() + " is being tested for economic limits"); WellState well_state_copy = well_state; @@ -977,7 +977,7 @@ namespace Opm // untill the number of closed completions do not increase anymore. while (testWell) { const size_t original_number_closed_completions = welltest_state_temp.sizeCompletions(); - solveWellForTesting(simulator, well_state_copy, B_avg, deferredLogger); + solveWellForTesting(simulator, well_state_copy, B_avg, deferred_logger); updateWellTestState(well_state_copy, simulation_time, /*writeMessageToOPMLog=*/ false, welltest_state_temp); closeCompletions(welltest_state_temp); @@ -1165,7 +1165,7 @@ namespace Opm solveWellEqUntilConverged(Simulator& ebosSimulator, const std::vector& B_avg, WellState& well_state, - Opm::DeferredLogger& deferredLogger) + Opm::DeferredLogger& deferred_logger) { const int max_iter = param_.max_welleq_iter_; int it = 0; @@ -1184,7 +1184,7 @@ namespace Opm ++it; solveEqAndUpdateWellState(well_state); - updateWellControl(ebosSimulator, well_state, deferredLogger); + updateWellControl(ebosSimulator, well_state, deferred_logger); initPrimaryVariablesEvaluation(); } while (it < max_iter); @@ -1235,16 +1235,16 @@ namespace Opm WellInterface:: solveWellForTesting(Simulator& ebosSimulator, WellState& well_state, const std::vector& B_avg, - Opm::DeferredLogger& deferredLogger) + Opm::DeferredLogger& deferred_logger) { // keep a copy of the original well state const WellState well_state0 = well_state; - const bool converged = solveWellEqUntilConverged(ebosSimulator, B_avg, well_state, deferredLogger); + const bool converged = solveWellEqUntilConverged(ebosSimulator, B_avg, well_state, deferred_logger); if (converged) { - OpmLog::debug("WellTest: Well equation for well " + name() + " solution gets converged"); + deferred_logger.debug("WellTest: Well equation for well " + name() + " converged"); } else { const int max_iter = param_.max_welleq_iter_; - OpmLog::debug("WellTest: Well equation for well" +name() + " solution failed in getting converged with " + deferred_logger.debug("WellTest: Well equation for well " +name() + " failed converging in " + std::to_string(max_iter) + " iterations"); well_state = well_state0; }