23 #ifndef OPM_FLOWMAIN_HEADER_INCLUDED 24 #define OPM_FLOWMAIN_HEADER_INCLUDED 26 #include <opm/common/utility/platform_dependent/disable_warnings.h> 29 #include <dune/common/version.hh> 30 #include <dune/common/parallel/mpihelper.hh> 32 #include <opm/common/utility/platform_dependent/reenable_warnings.h> 35 #include <opm/core/grid/GridManager.hpp> 36 #include <opm/autodiff/GridHelpers.hpp> 37 #include <opm/autodiff/createGlobalCellArray.hpp> 38 #include <opm/autodiff/GridInit.hpp> 39 #include <opm/simulators/ParallelFileMerger.hpp> 40 #include <opm/simulators/ensureDirectoryExists.hpp> 42 #include <opm/core/wells.h> 43 #include <opm/core/wells/WellsManager.hpp> 44 #include <opm/common/ErrorMacros.hpp> 45 #include <opm/core/simulator/initState.hpp> 46 #include <opm/core/simulator/initStateEquil.hpp> 47 #include <opm/core/simulator/SimulatorReport.hpp> 48 #include <opm/simulators/timestepping/SimulatorTimer.hpp> 49 #include <opm/core/utility/miscUtilities.hpp> 50 #include <opm/core/utility/parameters/ParameterGroup.hpp> 51 #include <opm/simulators/thresholdPressures.hpp> 53 #include <opm/material/fluidmatrixinteractions/EclMaterialLawManager.hpp> 54 #include <opm/core/props/BlackoilPropertiesBasic.hpp> 55 #include <opm/core/props/BlackoilPropertiesFromDeck.hpp> 56 #include <opm/core/props/rock/RockCompressibility.hpp> 57 #include <opm/core/props/satfunc/RelpermDiagnostics.hpp> 58 #include <opm/core/linalg/LinearSolverFactory.hpp> 59 #include <opm/autodiff/NewtonIterationBlackoilSimple.hpp> 60 #include <opm/autodiff/NewtonIterationBlackoilCPR.hpp> 61 #include <opm/autodiff/NewtonIterationBlackoilInterleaved.hpp> 63 #include <opm/autodiff/WellStateFullyImplicitBlackoil.hpp> 65 #include <opm/autodiff/BlackoilPropsAdFromDeck.hpp> 66 #include <opm/autodiff/RedistributeDataHandles.hpp> 67 #include <opm/autodiff/moduleVersion.hpp> 68 #include <opm/autodiff/MissingFeatures.hpp> 70 #include <opm/core/utility/share_obj.hpp> 71 #include <opm/core/utility/initHydroCarbonState.hpp> 72 #include <opm/common/OpmLog/OpmLog.hpp> 73 #include <opm/common/OpmLog/EclipsePRTLog.hpp> 74 #include <opm/common/OpmLog/LogUtil.hpp> 75 #include <opm/parser/eclipse/Deck/Deck.hpp> 76 #include <opm/parser/eclipse/Parser/Parser.hpp> 77 #include <opm/parser/eclipse/Parser/ParseContext.hpp> 78 #include <opm/parser/eclipse/EclipseState/EclipseState.hpp> 79 #include <opm/parser/eclipse/EclipseState/IOConfig/IOConfig.hpp> 80 #include <opm/parser/eclipse/EclipseState/InitConfig/InitConfig.hpp> 81 #include <opm/parser/eclipse/EclipseState/checkDeck.hpp> 82 #include <opm/common/ResetLocale.hpp> 84 #include <boost/filesystem.hpp> 85 #include <boost/algorithm/string.hpp> 110 boost::filesystem::path simulationCaseName(
const std::string& casename );
111 int64_t convertMessageType(
const Message::type& mtype);
121 template <
class Implementation,
class Gr
id,
class Simulator>
139 asImpl().setupParallelism(argc, argv);
140 asImpl().printStartupMessage();
141 const bool ok = asImpl().setupParameters(argc, argv);
145 asImpl().readDeckInput();
146 asImpl().setupOutput();
147 asImpl().setupLogging();
148 asImpl().extractMessages();
149 asImpl().setupGridAndProps();
150 asImpl().runDiagnostics();
151 asImpl().setupState();
152 asImpl().writeInit();
153 asImpl().distributeData();
154 asImpl().setupOutputWriter();
155 asImpl().setupLinearSolver();
156 asImpl().createSimulator();
159 auto ret = asImpl().runSimulator();
161 asImpl().mergeParallelLogFiles();
165 catch (
const std::exception &e) {
166 std::ostringstream message;
167 message <<
"Program threw an exception: " << e.what();
173 if (OpmLog::hasBackend(
"STREAMLOG")) {
174 OpmLog::error(message.str());
177 std::cout << message.str() <<
"\n";
195 typedef BlackoilPropsAdFromDeck FluidProps;
196 typedef FluidProps::MaterialLawManager MaterialLawManager;
197 typedef typename Simulator::ReservoirState ReservoirState;
198 typedef typename Simulator::OutputWriter OutputWriter;
209 bool output_cout_ =
false;
210 bool must_distribute_ =
false;
212 ParameterGroup param_;
214 bool output_to_files_ =
false;
215 std::string output_dir_ = std::string(
".");
217 std::shared_ptr<Deck> deck_;
218 std::shared_ptr<EclipseState> eclipse_state_;
220 std::unique_ptr<GridInit<Grid>> grid_init_;
221 std::shared_ptr<MaterialLawManager> material_law_manager_;
222 std::unique_ptr<FluidProps> fluidprops_;
223 std::unique_ptr<RockCompressibility> rock_comp_;
224 std::array<double, 3> gravity_;
225 bool use_local_perm_ =
true;
226 std::unique_ptr<DerivedGeology> geoprops_;
228 std::unique_ptr<ReservoirState> state_;
230 std::vector<double> threshold_pressures_;
232 boost::any parallel_information_;
234 std::unique_ptr<EclipseIO> eclipse_writer_;
235 std::unique_ptr<OutputWriter> output_writer_;
237 std::unique_ptr<NewtonIterationBlackoilInterface> fis_solver_;
239 std::unique_ptr<Simulator> simulator_;
241 std::string logFile_;
244 std::unordered_set<std::string> defunct_well_names_;
252 void setupParallelism(
int argc,
char** argv)
258 const Dune::MPIHelper& mpi_helper = Dune::MPIHelper::instance(argc, argv);
259 mpi_rank_ = mpi_helper.rank();
260 const int mpi_size = mpi_helper.size();
261 output_cout_ = ( mpi_rank_ == 0 );
262 must_distribute_ = ( mpi_size > 1 );
266 if (!getenv(
"OMP_NUM_THREADS")) {
269 int num_cores = omp_get_num_procs();
270 int num_threads = std::min(4, num_cores);
271 omp_set_num_threads(num_threads);
274 if (omp_get_thread_num() == 0) {
276 const int num_omp_threads = omp_get_num_threads();
278 std::cout <<
"OpenMP using " << num_omp_threads <<
" threads." << std::endl;
280 std::cout <<
"OpenMP using " << num_omp_threads <<
" threads on MPI rank " << mpi_rank_ <<
"." << std::endl;
289 using namespace UgGridHelpers;
291 int diff = std::abs(g1 - g2);
293 const int * dimens = cartDims(grid);
296 if (diff == dimens[0])
298 if (diff == dimens[0] * dimens[1])
305 void printStartupMessage()
309 std::cout <<
"**********************************************************************\n";
310 std::cout <<
"* *\n";
311 std::cout <<
"* This is flow_legacy (version " << version <<
")" 312 << std::string(26 - version.size(),
' ') <<
"*\n";
313 std::cout <<
"* *\n";
314 std::cout <<
"* Flow is a simulator for fully implicit three-phase black-oil flow, *\n";
315 std::cout <<
"* and is part of OPM. For more information see: *\n";
316 std::cout <<
"* http://opm-project.org *\n";
317 std::cout <<
"* *\n";
318 std::cout <<
"**********************************************************************\n\n";
327 bool setupParameters(
int argc,
char** argv)
329 param_ = ParameterGroup(argc, argv,
false, output_cout_);
332 if (!param_.unhandledArguments().empty()) {
333 if (param_.unhandledArguments().size() != 1) {
334 std::cerr <<
"You can only specify a single input deck on the command line.\n";
337 const auto casename = detail::simulationCaseName( param_.unhandledArguments()[ 0 ] );
338 param_.insertParameter(
"deck_filename", casename.string() );
343 if (!param_.has(
"deck_filename")) {
344 std::cerr <<
"This program must be run with an input deck.\n" 345 "Specify the deck filename either\n" 346 " a) as a command line argument by itself\n" 347 " b) as a command line parameter with the syntax deck_filename=<path to your deck>, or\n" 348 " c) as a parameter in a parameter file (.param or .xml) passed to the program.\n";
365 output_to_files_ = output_cout_ && param_.getDefault(
"output",
true);
368 auto& ioConfig = eclipse_state_->getIOConfig();
370 const std::string default_output_dir = ioConfig.getOutputDir();
371 output_dir_ = param_.getDefault(
"output_dir", default_output_dir);
373 ioConfig.setOutputDir(output_dir_);
376 if (output_to_files_) {
380 param_.writeParam(output_dir_ +
"/simulation.param");
391 std::string deck_filename = param_.get<std::string>(
"deck_filename");
393 using boost::filesystem::path;
394 path fpath(deck_filename);
395 std::string baseName;
396 std::ostringstream debugFileStream;
397 std::ostringstream logFileStream;
399 if (boost::to_upper_copy(path(fpath.extension()).
string()) ==
".DATA") {
400 baseName = path(fpath.stem()).
string();
402 baseName = path(fpath.filename()).
string();
405 logFileStream << output_dir_ <<
"/" << baseName;
406 debugFileStream << output_dir_ <<
"/" <<
"." << baseName;
408 if ( must_distribute_ && mpi_rank_ != 0 )
412 debugFileStream <<
"."<< mpi_rank_;
414 logFileStream <<
"." << mpi_rank_;
416 logFileStream <<
".PRT";
417 debugFileStream <<
".DEBUG";
419 std::string debugFile = debugFileStream.str();
420 logFile_ = logFileStream.str();
422 std::shared_ptr<EclipsePRTLog> prtLog = std::make_shared<EclipsePRTLog>(logFile_ , Log::NoDebugMessageTypes,
false, output_cout_);
423 const bool all_to_terminal = param_.getDefault(
"all_messages_to_terminal",
false);
424 const auto terminal_msg_types = all_to_terminal ? Log::DefaultMessageTypes : Log::StdoutMessageTypes;
425 std::shared_ptr<StreamLog> streamLog = std::make_shared<StreamLog>(std::cout, terminal_msg_types);
426 OpmLog::addBackend(
"ECLIPSEPRTLOG" , prtLog );
427 OpmLog::addBackend(
"STREAMLOG", streamLog);
428 std::shared_ptr<StreamLog> debugLog = std::make_shared<EclipsePRTLog>(debugFile, Log::DefaultMessageTypes,
false, output_cout_);
429 OpmLog::addBackend(
"DEBUGLOG" , debugLog);
430 const auto& msgLimits = eclipse_state_->getSchedule().getMessageLimits();
431 const std::map<int64_t, int> limits = {{Log::MessageType::Note, msgLimits.getCommentPrintLimit(0)},
432 {Log::MessageType::Info, msgLimits.getMessagePrintLimit(0)},
433 {Log::MessageType::Warning, msgLimits.getWarningPrintLimit(0)},
434 {Log::MessageType::Error, msgLimits.getErrorPrintLimit(0)},
435 {Log::MessageType::Problem, msgLimits.getProblemPrintLimit(0)},
436 {Log::MessageType::Bug, msgLimits.getBugPrintLimit(0)}};
437 prtLog->setMessageLimiter(std::make_shared<MessageLimiter>());
438 prtLog->setMessageFormatter(std::make_shared<SimpleMessageFormatter>(
false));
439 streamLog->setMessageLimiter(std::make_shared<MessageLimiter>(10, limits));
440 streamLog->setMessageFormatter(std::make_shared<SimpleMessageFormatter>(
true));
445 OpmLog::debug(
"\n--------------- Reading parameters ---------------\n");
453 void mergeParallelLogFiles()
456 OpmLog::removeAllBackends();
458 if( mpi_rank_ != 0 || !must_distribute_ || !output_to_files_ )
463 namespace fs = boost::filesystem;
464 fs::path output_path(
".");
465 if ( param_.has(
"output_dir") )
467 output_path = fs::path(output_dir_);
470 fs::path deck_filename(param_.get<std::string>(
"deck_filename"));
472 std::for_each(fs::directory_iterator(output_path),
473 fs::directory_iterator(),
474 detail::ParallelFileMerger(output_path, deck_filename.stem().string()));
484 std::string deck_filename = param_.get<std::string>(
"deck_filename");
491 ParseContext parseContext({ { ParseContext::PARSE_RANDOM_SLASH , InputError::IGNORE },
492 { ParseContext::PARSE_MISSING_DIMS_KEYWORD, InputError::WARN },
493 { ParseContext::SUMMARY_UNKNOWN_WELL, InputError::WARN },
494 { ParseContext::SUMMARY_UNKNOWN_GROUP, InputError::WARN }});
495 deck_ = std::make_shared< Deck >( parser.parseFile(deck_filename, parseContext) );
496 checkDeck(*deck_, parser);
500 MissingFeatures::checkKeywords(*deck_);
503 eclipse_state_.reset(
new EclipseState(*deck_, parseContext));
505 catch (
const std::invalid_argument& e) {
506 std::cerr <<
"Failed to create valid EclipseState object. See logfile: " << logFile_ << std::endl;
507 std::cerr <<
"Exception caught: " << e.what() << std::endl;
512 if (param_.has(
"output_interval")) {
513 const int output_interval = param_.get<
int>(
"output_interval");
514 eclipse_state_->getRestartConfig().overrideRestartWriteInterval(
size_t( output_interval ) );
518 if (param_.has(
"nosim")) {
519 const bool nosim = param_.get<
bool>(
"nosim");
520 auto& ioConfig = eclipse_state_->getIOConfig();
521 ioConfig.overrideNOSIM( nosim );
538 void setupGridAndProps()
541 const std::vector<double>& porv =
542 eclipse_state_->get3DProperties().getDoubleGridProperty(
"PORV").getData();
543 grid_init_.reset(
new GridInit<Grid>(*eclipse_state_, porv));
544 const Grid& grid = grid_init_->grid();
547 std::vector<int> compressedToCartesianIdx;
549 material_law_manager_.reset(
new MaterialLawManager());
550 material_law_manager_->initFromDeck(*deck_, *eclipse_state_, compressedToCartesianIdx);
553 fluidprops_.reset(
new BlackoilPropsAdFromDeck(*deck_, *eclipse_state_, material_law_manager_, grid));
556 rock_comp_.reset(
new RockCompressibility(*eclipse_state_, output_cout_));
559 assert(UgGridHelpers::dimensions(grid) == 3);
561 gravity_[2] = deck_->hasKeyword(
"NOGRAV")
562 ? param_.getDefault(
"gravity", 0.0)
563 : param_.getDefault(
"gravity", unit::gravity);
566 use_local_perm_ = param_.getDefault(
"use_local_perm", use_local_perm_);
567 geoprops_.reset(
new DerivedGeology(grid, *fluidprops_, *eclipse_state_, use_local_perm_, gravity_.data()));
581 const PhaseUsage pu = Opm::phaseUsageFromDeck(*deck_);
582 const Grid& grid = grid_init_->grid();
585 BlackoilPropertiesFromDeck props( *deck_, *eclipse_state_, material_law_manager_,
586 Opm::UgGridHelpers::numCells(grid),
587 Opm::UgGridHelpers::globalCell(grid),
588 Opm::UgGridHelpers::cartDims(grid),
593 if (param_.has(
"init_saturation")) {
594 state_.reset(
new ReservoirState( Opm::UgGridHelpers::numCells(grid),
595 Opm::UgGridHelpers::numFaces(grid),
596 props.numPhases() ));
598 initStateBasic(Opm::UgGridHelpers::numCells(grid),
599 Opm::UgGridHelpers::globalCell(grid),
600 Opm::UgGridHelpers::cartDims(grid),
601 Opm::UgGridHelpers::numFaces(grid),
602 Opm::UgGridHelpers::faceCells(grid),
603 Opm::UgGridHelpers::beginFaceCentroids(grid),
604 Opm::UgGridHelpers::beginCellCentroids(grid),
605 Opm::UgGridHelpers::dimensions(grid),
606 props, param_, gravity_[2], *state_);
608 initBlackoilSurfvol(Opm::UgGridHelpers::numCells(grid), props, *state_);
610 enum { Oil = BlackoilPhases::Liquid, Gas = BlackoilPhases::Vapour };
611 if (pu.phase_used[Oil] && pu.phase_used[Gas]) {
612 const int numPhases = props.numPhases();
613 const int numCells = Opm::UgGridHelpers::numCells(grid);
616 auto& gor = state_->getCellData( BlackoilState::GASOILRATIO );
617 const auto& surface_vol = state_->getCellData( BlackoilState::SURFACEVOL );
618 for (
int c = 0; c < numCells; ++c) {
620 gor[c] = surface_vol[ c * numPhases + pu.phase_pos[Gas]] / surface_vol[ c * numPhases + pu.phase_pos[Oil]];
623 }
else if (deck_->hasKeyword(
"EQUIL")) {
625 state_.reset(
new ReservoirState( Opm::UgGridHelpers::numCells(grid),
626 Opm::UgGridHelpers::numFaces(grid),
629 initStateEquil(grid, props, *deck_, *eclipse_state_, gravity_[2], *state_);
632 state_.reset(
new ReservoirState( Opm::UgGridHelpers::numCells(grid),
633 Opm::UgGridHelpers::numFaces(grid),
635 initBlackoilStateFromDeck(Opm::UgGridHelpers::numCells(grid),
636 Opm::UgGridHelpers::globalCell(grid),
637 Opm::UgGridHelpers::numFaces(grid),
638 Opm::UgGridHelpers::faceCells(grid),
639 Opm::UgGridHelpers::beginFaceCentroids(grid),
640 Opm::UgGridHelpers::beginCellCentroids(grid),
641 Opm::UgGridHelpers::dimensions(grid),
642 props, *deck_, gravity_[2], *state_);
646 std::map<std::pair<int, int>,
double> maxDp;
647 computeMaxDp(maxDp, *deck_, *eclipse_state_, grid_init_->grid(), *state_, props, gravity_[2]);
649 std::vector<double> threshold_pressures_nnc =
thresholdPressuresNNC(*eclipse_state_, geoprops_->nnc(), maxDp);
650 threshold_pressures_.insert(threshold_pressures_.end(), threshold_pressures_nnc.begin(), threshold_pressures_nnc.end());
653 if (deck_->hasKeyword(
"SWATINIT")) {
654 const int numCells = Opm::UgGridHelpers::numCells(grid);
655 std::vector<int> cells(numCells);
656 for (
int c = 0; c < numCells; ++c) { cells[c] = c; }
657 std::vector<double> pc = state_->saturation();
658 props.capPress(numCells, state_->saturation().data(), cells.data(), pc.data(),
nullptr);
659 fluidprops_->setSwatInitScaling(state_->saturation(), pc);
661 initHydroCarbonState(*state_, pu, Opm::UgGridHelpers::numCells(grid), deck_->hasKeyword(
"DISGAS"), deck_->hasKeyword(
"VAPOIL"));
678 void distributeData()
683 if (must_distribute_) {
684 defunct_well_names_ =
685 distributeGridAndData(grid_init_->grid(), *deck_, *eclipse_state_,
686 *state_, *fluidprops_, *geoprops_,
687 material_law_manager_, threshold_pressures_,
688 parallel_information_, use_local_perm_);
699 void extractMessages()
706 auto extractMessage = [](
const Message& msg) {
707 auto log_type = detail::convertMessageType(msg.mtype);
708 const auto& location = msg.location;
710 OpmLog::addTaggedMessage(log_type,
"Parser message", Log::fileMessage(location.filename, location.lineno, msg.message));
712 OpmLog::addTaggedMessage(log_type,
"Parser message", msg.message);
717 for(
const auto& msg : deck_->getMessageContainer()) {
722 for (
const auto& msg : eclipse_state_->getMessageContainer()) {
734 void runDiagnostics()
742 RelpermDiagnostics diagnostic;
743 diagnostic.diagnosis(*eclipse_state_, *deck_, grid_init_->grid());
749 bool output = param_.getDefault(
"output",
true);
750 bool output_ecl = param_.getDefault(
"output_ecl",
true);
751 const Grid& grid = grid_init_->grid();
752 if( output && output_ecl && output_cout_)
754 const EclipseGrid& inputGrid = eclipse_state_->getInputGrid();
755 eclipse_writer_.reset(
new EclipseIO(*eclipse_state_, UgGridHelpers::createEclipseGrid( grid , inputGrid )));
756 eclipse_writer_->writeInitial(geoprops_->simProps(grid),
757 geoprops_->nonCartesianConnections());
765 void setupOutputWriter()
770 output_writer_.reset(
new OutputWriter(grid_init_->grid(),
773 std::move(eclipse_writer_),
774 Opm::phaseUsageFromDeck(*deck_)));
784 void setupLinearSolver()
786 const std::string cprSolver =
"cpr";
787 const std::string interleavedSolver =
"interleaved";
788 const std::string directSolver =
"direct";
789 std::string flowDefaultSolver = interleavedSolver;
791 if (!param_.has(
"solver_approach")) {
792 if (eclipse_state_->getSimulationConfig().useCPR()) {
793 flowDefaultSolver = cprSolver;
797 const std::string solver_approach = param_.getDefault(
"solver_approach", flowDefaultSolver);
799 if (solver_approach == cprSolver) {
800 fis_solver_.reset(
new NewtonIterationBlackoilCPR(param_, parallel_information_));
801 }
else if (solver_approach == interleavedSolver) {
802 fis_solver_.reset(
new NewtonIterationBlackoilInterleaved(param_, parallel_information_));
803 }
else if (solver_approach == directSolver) {
804 fis_solver_.reset(
new NewtonIterationBlackoilSimple(param_, parallel_information_));
806 OPM_THROW( std::runtime_error ,
"Internal error - solver approach " << solver_approach <<
" not recognized.");
818 const auto& schedule = eclipse_state_->getSchedule();
819 const auto& timeMap = schedule.getTimeMap();
820 auto& ioConfig = eclipse_state_->getIOConfig();
821 SimulatorTimer simtimer;
824 const auto& initConfig = eclipse_state_->getInitConfig();
825 simtimer.init(timeMap, (
size_t)initConfig.getRestartStep());
827 if (!ioConfig.initOnly()) {
830 msg =
"\n\n================ Starting main simulation loop ===============\n";
834 SimulatorReport fullReport = simulator_->run(simtimer, *state_);
837 std::ostringstream ss;
838 ss <<
"\n\n================ End of simulation ===============\n\n";
839 fullReport.reportFullyImplicit(ss);
840 OpmLog::info(ss.str());
841 if (param_.anyUnused()) {
844 std::cout <<
"-------------------- Unused parameters: --------------------\n";
845 param_.displayUsage();
846 std::cout <<
"----------------------------------------------------------------" << std::endl;
850 if (output_to_files_) {
851 std::string filename = output_dir_ +
"/walltime.txt";
852 std::fstream tot_os(filename.c_str(), std::fstream::trunc | std::fstream::out);
853 fullReport.reportParam(tot_os);
857 std::cout <<
"\n\n================ Simulation turned off ===============\n" << std::flush;
870 Implementation& asImpl()
872 return static_cast<Implementation&
>(*this);
884 template <
class Gr
id,
class Simulator>
894 void createSimulator()
897 Base::simulator_.reset(
new Simulator(Base::param_,
898 Base::grid_init_->grid(),
901 Base::rock_comp_->isActive() ? Base::rock_comp_.
get() :
nullptr,
903 Base::gravity_.data(),
904 Base::deck_->hasKeyword(
"DISGAS"),
905 Base::deck_->hasKeyword(
"VAPOIL"),
906 Base::eclipse_state_,
907 *Base::output_writer_,
908 Base::threshold_pressures_,
909 Base::defunct_well_names_));
921 boost::filesystem::path simulationCaseName(
const std::string& casename ) {
922 namespace fs = boost::filesystem;
924 const auto exists = [](
const fs::path& f ) ->
bool {
925 if( !fs::exists( f ) )
return false;
927 if( fs::is_regular_file( f ) )
return true;
929 return fs::is_symlink( f )
930 && fs::is_regular_file( fs::read_symlink( f ) );
933 auto simcase = fs::path( casename );
935 if( exists( simcase ) ) {
939 for(
const auto& ext : { std::string(
"data"), std::string(
"DATA") } ) {
940 if( exists( simcase.replace_extension( ext ) ) ) {
945 throw std::invalid_argument(
"Cannot find input case " + casename );
952 int64_t convertMessageType(
const Message::type& mtype)
955 case Message::type::Debug:
956 return Log::MessageType::Debug;
957 case Message::type::Info:
958 return Log::MessageType::Info;
959 case Message::type::Warning:
960 return Log::MessageType::Warning;
961 case Message::type::Error:
962 return Log::MessageType::Error;
963 case Message::type::Problem:
964 return Log::MessageType::Problem;
965 case Message::type::Bug:
966 return Log::MessageType::Bug;
967 case Message::type::Note:
968 return Log::MessageType::Note;
970 throw std::logic_error(
"Invalid messages type!\n");
979 #endif // OPM_FLOWMAIN_HEADER_INCLUDED std::string moduleVersionName()
Return the version name of the module, for example "2015.10" (for a release branch) or "2016...
Definition: moduleVersion.cpp:28
This class encapsulates the setup and running of a simulator based on an input deck.
Definition: FlowMain.hpp:122
Definition: FlowMain.hpp:885
bool cartesianAdjacent(const Grid &grid, int g1, int g2)
checks cartesian adjacency of global indices g1 and g2
Definition: FlowMain.hpp:287
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: AdditionalObjectDeleter.hpp:22
void ensureDirectoryExists(const boost::filesystem::path &dirpath)
The directory pointed to by 'dirpath' will be created if it does not already exist.
Definition: ensureDirectoryExists.cpp:30
int execute(int argc, char **argv)
This is the main function of Flow.
Definition: FlowMain.hpp:132
void computeMaxDp(std::map< std::pair< int, int >, double > &maxDp, const Deck &deck, const EclipseState &eclipseState, const Grid &grid, const BlackoilState &initialState, const BlackoilPropertiesFromDeck &props, const double gravity)
Compute the maximum gravity corrected pressure difference of all equilibration regions given a reserv...
Definition: thresholdPressures.hpp:47
void createGlobalCellArray(const Grid &grid, std::vector< int > &dest)
Create a mapping from a global cell index of a grid to the logically Cartesian index of the ECL deck...
Definition: createGlobalCellArray.hpp:31
std::vector< double > thresholdPressuresNNC(const EclipseState &eclipseState, const NNC &nnc, const std::map< std::pair< int, int >, double > &maxDp)
Get a vector of pressure thresholds from either EclipseState or maxDp (for defaulted values) for all ...
Definition: thresholdPressures.hpp:383
std::vector< double > thresholdPressures(const Deck &, const EclipseState &eclipseState, const Grid &grid, const std::map< std::pair< int, int >, double > &maxDp)
Get a vector of pressure thresholds from EclipseState.
Definition: thresholdPressures.hpp:321