fixed naming conventions, messages and comments

This commit is contained in:
Franz G. Fuchs 2019-01-21 08:26:28 +01:00
parent 26bc063a0c
commit 7f1df40b74
9 changed files with 34 additions and 35 deletions

View File

@ -939,10 +939,9 @@ namespace Opm {
BlackoilWellModel<TypeTag>:: BlackoilWellModel<TypeTag>::
updateWellControls() updateWellControls()
{ {
// Even if there no wells active locally, we cannot // Even if there are no wells active locally, we cannot
// return as the Destructor of the DeferredLogger // return as the DeferredLogger uses global communication.
// uses global communication. For no well active globally // For no well active globally we simply return.
// we simply return.
if( !wellsActive() ) return ; if( !wellsActive() ) return ;
Opm::DeferredLogger local_deferredLogger; Opm::DeferredLogger local_deferredLogger;

View File

@ -352,7 +352,7 @@ namespace Opm
virtual void wellTestingPhysical(Simulator& simulator, const std::vector<double>& B_avg, virtual void wellTestingPhysical(Simulator& simulator, const std::vector<double>& B_avg,
const double simulation_time, const int report_step, 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; virtual void updateWaterThroughput(const double dt, WellState& well_state) const override;
}; };

View File

@ -1897,7 +1897,7 @@ namespace Opm
MultisegmentWell<TypeTag>:: MultisegmentWell<TypeTag>::
wellTestingPhysical(Simulator& simulator, const std::vector<double>& B_avg, wellTestingPhysical(Simulator& simulator, const std::vector<double>& B_avg,
const double simulation_time, const int report_step, 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 " const std::string msg = "Support of well testing for physical limits for multisegment wells is not "
"implemented yet, wellTestingPhysical() for " + name() + " will do nothing"; "implemented yet, wellTestingPhysical() for " + name() + " will do nothing";

View File

@ -414,7 +414,7 @@ namespace Opm
virtual void wellTestingPhysical(Simulator& simulator, const std::vector<double>& B_avg, virtual void wellTestingPhysical(Simulator& simulator, const std::vector<double>& B_avg,
const double simulation_time, const int report_step, 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; virtual void updateWaterThroughput(const double dt, WellState& well_state) const override;
}; };

View File

@ -419,7 +419,7 @@ namespace Opm
virtual void wellTestingPhysical(Simulator& simulator, const std::vector<double>& B_avg, virtual void wellTestingPhysical(Simulator& simulator, const std::vector<double>& B_avg,
const double simulation_time, const int report_step, 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. // calculate the skin pressure based on water velocity, throughput and polymer concentration.
// throughput is used to describe the formation damage during water/polymer injection. // throughput is used to describe the formation damage during water/polymer injection.

View File

@ -2868,7 +2868,7 @@ namespace Opm
StandardWellV<TypeTag>:: StandardWellV<TypeTag>::
wellTestingPhysical(Simulator& ebos_simulator, const std::vector<double>& B_avg, wellTestingPhysical(Simulator& ebos_simulator, const std::vector<double>& B_avg,
const double simulation_time, const int report_step, 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"); OpmLog::debug(" well " + name() + " is being tested for physical limits");
@ -2903,7 +2903,7 @@ namespace Opm
updatePrimaryVariables(well_state_copy); updatePrimaryVariables(well_state_copy);
initPrimaryVariablesEvaluation(); 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) { if (!converged) {
const std::string msg = " well " + name() + " did not get converged during well testing for physical reason"; const std::string msg = " well " + name() + " did not get converged during well testing for physical reason";

View File

@ -2748,7 +2748,7 @@ namespace Opm
StandardWell<TypeTag>:: StandardWell<TypeTag>::
wellTestingPhysical(Simulator& ebos_simulator, const std::vector<double>& B_avg, wellTestingPhysical(Simulator& ebos_simulator, const std::vector<double>& B_avg,
const double simulation_time, const int report_step, 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"); OpmLog::debug(" well " + name() + " is being tested for physical limits");
@ -2783,7 +2783,7 @@ namespace Opm
updatePrimaryVariables(well_state_copy); updatePrimaryVariables(well_state_copy);
initPrimaryVariablesEvaluation(); 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) { if (!converged) {
const std::string msg = " well " + name() + " did not get converged during well testing for physical reason"; const std::string msg = " well " + name() + " did not get converged during well testing for physical reason";

View File

@ -183,7 +183,7 @@ namespace Opm
void updateWellControl(/* const */ Simulator& ebos_simulator, void updateWellControl(/* const */ Simulator& ebos_simulator,
WellState& well_state, WellState& well_state,
Opm::DeferredLogger& deferredLogger) /* const */; Opm::DeferredLogger& deferred_logger) /* const */;
virtual void updatePrimaryVariables(const WellState& well_state) const = 0; virtual void updatePrimaryVariables(const WellState& well_state) const = 0;
@ -229,7 +229,7 @@ namespace Opm
const double simulation_time, const int report_step, const double simulation_time, const int report_step,
const WellTestConfig::Reason testing_reason, const WellTestConfig::Reason testing_reason,
/* const */ WellState& well_state, WellTestState& welltest_state, /* const */ WellState& well_state, WellTestState& welltest_state,
Opm::DeferredLogger& deferredLogger); Opm::DeferredLogger& deferred_logger);
void updatePerforatedCell(std::vector<bool>& is_cell_perforated); void updatePerforatedCell(std::vector<bool>& is_cell_perforated);
@ -375,11 +375,11 @@ namespace Opm
void wellTestingEconomic(Simulator& simulator, const std::vector<double>& B_avg, void wellTestingEconomic(Simulator& simulator, const std::vector<double>& B_avg,
const double simulation_time, const int report_step, 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<double>& B_avg, virtual void wellTestingPhysical(Simulator& simulator, const std::vector<double>& B_avg,
const double simulation_time, const int report_step, 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, void updateWellTestStateEconomic(const WellState& well_state,
const double simulation_time, const double simulation_time,
@ -393,12 +393,12 @@ namespace Opm
void solveWellForTesting(Simulator& ebosSimulator, WellState& well_state, void solveWellForTesting(Simulator& ebosSimulator, WellState& well_state,
const std::vector<double>& B_avg, const std::vector<double>& B_avg,
Opm::DeferredLogger& deferredLogger); Opm::DeferredLogger& deferred_logger);
bool solveWellEqUntilConverged(Simulator& ebosSimulator, bool solveWellEqUntilConverged(Simulator& ebosSimulator,
const std::vector<double>& B_avg, const std::vector<double>& B_avg,
WellState& well_state, WellState& well_state,
Opm::DeferredLogger& deferredLogger); Opm::DeferredLogger& deferred_logger);
void scaleProductivityIndex(const int perfIdx, double& productivity_index); void scaleProductivityIndex(const int perfIdx, double& productivity_index);

View File

@ -431,7 +431,7 @@ namespace Opm
WellInterface<TypeTag>:: WellInterface<TypeTag>::
updateWellControl(/* const */ Simulator& ebos_simulator, updateWellControl(/* const */ Simulator& ebos_simulator,
WellState& well_state, WellState& well_state,
Opm::DeferredLogger& deferredLogger) /* const */ Opm::DeferredLogger& deferred_logger) /* const */
{ {
auto cc = Dune::MPIHelper::getCollectiveCommunication(); auto cc = Dune::MPIHelper::getCollectiveCommunication();
const int np = number_of_phases_; const int np = number_of_phases_;
@ -472,11 +472,11 @@ namespace Opm
} else { } else {
// before we figure out to handle it, we give some debug information here // 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() ) { 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() ) { 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() ss << " Switching control mode for well " << name()
<< " from " << modestring[from] << " from " << modestring[from]
<< " to " << modestring[to]; << " to " << modestring[to];
if (cc.size()>1) { if (cc.size() > 1) {
ss << " on rank " << cc.rank(); ss << " on rank " << cc.rank();
} }
deferredLogger.info(ss.str()); deferred_logger.info(ss.str());
} }
if (updated_control_index != old_control_index) { // || well_collection_->groupControlActive()) { if (updated_control_index != old_control_index) { // || well_collection_->groupControlActive()) {
@ -937,16 +937,16 @@ namespace Opm
const WellTestConfig::Reason testing_reason, const WellTestConfig::Reason testing_reason,
/* const */ WellState& well_state, /* const */ WellState& well_state,
WellTestState& well_test_state, WellTestState& well_test_state,
Opm::DeferredLogger& deferredLogger) Opm::DeferredLogger& deferred_logger)
{ {
if (testing_reason == WellTestConfig::Reason::PHYSICAL) { if (testing_reason == WellTestConfig::Reason::PHYSICAL) {
wellTestingPhysical(simulator, B_avg, simulation_time, report_step, 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) { if (testing_reason == WellTestConfig::Reason::ECONOMIC) {
wellTestingEconomic(simulator, B_avg, simulation_time, report_step, 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<TypeTag>:: WellInterface<TypeTag>::
wellTestingEconomic(Simulator& simulator, const std::vector<double>& B_avg, wellTestingEconomic(Simulator& simulator, const std::vector<double>& B_avg,
const double simulation_time, const int report_step, 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; WellState well_state_copy = well_state;
@ -977,7 +977,7 @@ namespace Opm
// untill the number of closed completions do not increase anymore. // untill the number of closed completions do not increase anymore.
while (testWell) { while (testWell) {
const size_t original_number_closed_completions = welltest_state_temp.sizeCompletions(); 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); updateWellTestState(well_state_copy, simulation_time, /*writeMessageToOPMLog=*/ false, welltest_state_temp);
closeCompletions(welltest_state_temp); closeCompletions(welltest_state_temp);
@ -1165,7 +1165,7 @@ namespace Opm
solveWellEqUntilConverged(Simulator& ebosSimulator, solveWellEqUntilConverged(Simulator& ebosSimulator,
const std::vector<double>& B_avg, const std::vector<double>& B_avg,
WellState& well_state, WellState& well_state,
Opm::DeferredLogger& deferredLogger) Opm::DeferredLogger& deferred_logger)
{ {
const int max_iter = param_.max_welleq_iter_; const int max_iter = param_.max_welleq_iter_;
int it = 0; int it = 0;
@ -1184,7 +1184,7 @@ namespace Opm
++it; ++it;
solveEqAndUpdateWellState(well_state); solveEqAndUpdateWellState(well_state);
updateWellControl(ebosSimulator, well_state, deferredLogger); updateWellControl(ebosSimulator, well_state, deferred_logger);
initPrimaryVariablesEvaluation(); initPrimaryVariablesEvaluation();
} while (it < max_iter); } while (it < max_iter);
@ -1235,16 +1235,16 @@ namespace Opm
WellInterface<TypeTag>:: WellInterface<TypeTag>::
solveWellForTesting(Simulator& ebosSimulator, WellState& well_state, solveWellForTesting(Simulator& ebosSimulator, WellState& well_state,
const std::vector<double>& B_avg, const std::vector<double>& B_avg,
Opm::DeferredLogger& deferredLogger) Opm::DeferredLogger& deferred_logger)
{ {
// keep a copy of the original well state // keep a copy of the original well state
const WellState well_state0 = 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) { if (converged) {
OpmLog::debug("WellTest: Well equation for well " + name() + " solution gets converged"); deferred_logger.debug("WellTest: Well equation for well " + name() + " converged");
} else { } else {
const int max_iter = param_.max_welleq_iter_; 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"); + std::to_string(max_iter) + " iterations");
well_state = well_state0; well_state = well_state0;
} }