mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #101 from GitPaean/adding_startup_message_flow_polymer
Adding startup message flow polymer and accpting single deck filename as command line argument.
This commit is contained in:
commit
997dc27484
@ -91,16 +91,37 @@ try
|
|||||||
{
|
{
|
||||||
using namespace Opm;
|
using namespace Opm;
|
||||||
|
|
||||||
std::cout << "\n================ Test program for fully implicit three-phase black-oil-polymer flow ===============\n\n";
|
std::cout << "*********************************************************************************************\n";
|
||||||
parameter::ParameterGroup param(argc, argv, false);
|
std::cout << "* *\n";
|
||||||
std::cout << "--------------- Reading parameters ---------------" << std::endl;
|
std::cout << "* This is Flow-Polymer (version 2015.04) *\n";
|
||||||
|
std::cout << "* *\n";
|
||||||
|
std::cout << "* Flow-Polymer is a simulator for three-phase black-oil-polymer flow that is a part of OPM. *\n";
|
||||||
|
std::cout << "* For more information see: *\n";
|
||||||
|
std::cout << "* http://opm-project.org *\n";
|
||||||
|
std::cout << "* *\n";
|
||||||
|
std::cout << "*********************************************************************************************\n\n";
|
||||||
|
|
||||||
// If we have a "deck_filename", grid and props will be read from that.
|
// Read parameters, see if a deck was specified on the command line.
|
||||||
bool use_deck = param.has("deck_filename");
|
std::cout << "--------------- Reading parameters ---------------" << std::endl;
|
||||||
if (!use_deck) {
|
parameter::ParameterGroup param(argc, argv, false);
|
||||||
OPM_THROW(std::runtime_error, "This program must be run with an input deck. "
|
if (!param.unhandledArguments().empty()) {
|
||||||
"Specify the deck with deck_filename=deckname.data (for example).");
|
if (param.unhandledArguments().size() != 1) {
|
||||||
|
OPM_THROW(std::runtime_error, "You can only specify a single input deck on the command line.");
|
||||||
|
} else {
|
||||||
|
param.insertParameter("deck_filename", param.unhandledArguments()[0]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We must have an input deck. Grid and props will be read from that.
|
||||||
|
if (!param.has("deck_filename")) {
|
||||||
|
std::cerr << "This program must be run with an input deck.\n"
|
||||||
|
"Specify the deck filename either\n"
|
||||||
|
" a) as a command line argument by itself\n"
|
||||||
|
" b) as a command line parameter with the syntax deck_filename=<path to your deck>, or\n"
|
||||||
|
" c) as a parameter in a parameter file (.param or .xml) passed to the program.\n";
|
||||||
|
OPM_THROW(std::runtime_error, "Input deck required.");
|
||||||
|
}
|
||||||
|
|
||||||
std::shared_ptr<GridManager> grid;
|
std::shared_ptr<GridManager> grid;
|
||||||
std::shared_ptr<BlackoilPropertiesInterface> props;
|
std::shared_ptr<BlackoilPropertiesInterface> props;
|
||||||
std::shared_ptr<BlackoilPropsAdFromDeck> new_props;
|
std::shared_ptr<BlackoilPropsAdFromDeck> new_props;
|
||||||
@ -239,7 +260,7 @@ try
|
|||||||
if (use_wpolymer) {
|
if (use_wpolymer) {
|
||||||
OPM_MESSAGE("Warning: use WPOLYMER in a non-polymer scenario.");
|
OPM_MESSAGE("Warning: use WPOLYMER in a non-polymer scenario.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool use_local_perm = param.getDefault("use_local_perm", true);
|
bool use_local_perm = param.getDefault("use_local_perm", true);
|
||||||
Opm::DerivedGeology geology(*grid->c_grid(), *new_props, eclipseState, use_local_perm, grav);
|
Opm::DerivedGeology geology(*grid->c_grid(), *new_props, eclipseState, use_local_perm, grav);
|
||||||
|
Loading…
Reference in New Issue
Block a user