write well related information into OpmLog.

This commit is contained in:
Liu Ming 2016-05-20 16:14:16 +08:00
parent b7f7352b6d
commit 341472456a
3 changed files with 22 additions and 19 deletions

View File

@ -146,7 +146,7 @@ namespace Opm {
}
OpmLog::warning("WARNING: Too many assignements (' "
+ ID_delimiter_assignment
+ "') detected in argument " + to_string(i) +);
+ "') detected in argument " + to_string(i));
}
for (int i = 0; i < int(files.size()); ++i) {
std::pair<std::string, std::string> file_type = filename_split(files[i]);

View File

@ -345,9 +345,10 @@ namespace Opm
mode);
if (my_rate > target_rate) {
std::cout << "Group " << mode<<" target not met for group " << name() << std::endl;
std::cout << "target = " << target_rate << '\n'
<< "rate = " << my_rate << std::endl;
OpmLog::warning("Group " + injSpec().ControlMode2String(mode)
+ " target not met for group " + name() + "\n"
+ "target = " + std::to_string(target_rate) + "\n"
+ "rate = " + std::to_string(my_rate));
applyInjGroupControl(mode, target_rate, true);
injSpec().control_mode_ = mode;
return false;
@ -377,9 +378,10 @@ namespace Opm
child_phases_summed.surf_prod_rates,
mode);
if (std::fabs(my_rate) > target_rate) {
std::cout << "Group" << mode << " target not met for group " << name() << std::endl;
std::cout << "target = " << target_rate << '\n'
<< "rate = " << my_rate << std::endl;
OpmLog::warning("Group" + prodSpec().ControlMode2String(mode)
+ " target not met for group " + name() + "\n"
+ "target = " + std::to_string(target_rate) + '\n'
+ "rate = " + std::to_string(my_rate));
production_violated = true;
production_mode_violated = mode;
break;
@ -677,9 +679,9 @@ namespace Opm
ctrl_violated = is_producer ? (my_target_bhp > my_well_bhp)
: (my_target_bhp < my_well_bhp);
if (ctrl_violated) {
std::cout << "BHP limit violated for well " << name() << ":\n";
std::cout << "BHP limit = " << my_target_bhp << std::endl;
std::cout << "BHP = " << my_well_bhp << std::endl;
OpmLog::info("BHP limit violated for well " + name() + ":\n"
+ "BHP limit = " + std::to_string(my_target_bhp)
+ "BHP = " + std::to_string(my_well_bhp));
}
break;
}
@ -698,9 +700,9 @@ namespace Opm
const double my_rate_target = well_controls_iget_target(ctrls , ctrl_index);
ctrl_violated = std::fabs(my_rate) - std::fabs(my_rate_target)> std::max(std::abs(my_rate), std::abs(my_rate_target))*1e-6;
if (ctrl_violated) {
std::cout << "RESERVOIR_RATE limit violated for well " << name() << ":\n";
std::cout << "rate limit = " << my_rate_target << std::endl;
std::cout << "rate = " << my_rate << std::endl;
OpmLog::info("RESERVOIR_RATE limit violated for well " + name() + ":\n"
+ "rate limit = " + std::to_string(my_rate_target)
+ "rate = " + std::to_string(my_rate));
}
break;
}
@ -714,9 +716,9 @@ namespace Opm
const double my_rate_target = well_controls_iget_target(ctrls , ctrl_index);
ctrl_violated = std::fabs(my_rate) > std::fabs(my_rate_target);
if (ctrl_violated) {
std::cout << "SURFACE_RATE limit violated for well " << name() << ":\n";
std::cout << "rate limit = " << my_rate_target << std::endl;
std::cout << "rate = " << my_rate << std::endl;
OpmLog::info("SURFACE_RATE limit violated for well " + name() + ":\n"
+ "rate limit = " + std::to_string(my_rate_target)
+ "rate = " + std::to_string(my_rate));
}
break;
}

View File

@ -2,6 +2,7 @@
#include <opm/core/grid/GridHelpers.hpp>
#include <opm/common/ErrorMacros.hpp>
#include <opm/common/OpmLog/OpmLog.hpp>
#include <opm/core/utility/compressedToCartesian.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/CompletionSet.hpp>
@ -233,9 +234,9 @@ void WellsManager::createWellsFromSpecs(std::vector<WellConstPtr>& wells, size_t
// Check that the complete well is on this process
if ( sum_completions_on_proc < completionSet->size() )
{
std::cout<< "Well "<< well->name() << " does not seem to be"
<< "completely in the disjoint partition of "
<< "process. Therefore we deactivate it here." << std::endl;
OpmLog::warning("Well " + well->name() + " does not seem to be"
+ "completely in the disjoint partition of "
+ "process. Therefore we deactivate it here.");
// Mark well as not existent on this process
wells_on_proc[wellIter-wells.begin()] = 0;
wellperf_data[well_index_on_proc].clear();