mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
ECL problem: return the stem of the name of the deck file in the name() method
this causes output files to have the expected names, e.g. "SPE9" or "NORNE" instead of "ECL"...
This commit is contained in:
@@ -103,9 +103,11 @@ public:
|
||||
: ParentType(simulator)
|
||||
{
|
||||
std::string fileName = EWOMS_GET_PARAM(TypeTag, std::string, EclipseDeckFileName);
|
||||
boost::filesystem::path deckPath(fileName);
|
||||
caseName_ = boost::to_upper_copy(deckPath.stem().string());
|
||||
|
||||
Opm::ParserPtr parser(new Opm::Parser());
|
||||
deck_ = parser->parseFile(fileName);
|
||||
deck_ = parser->parseFile(deckPath.string());
|
||||
|
||||
schedule_.reset(new Opm::Schedule(deck_));
|
||||
|
||||
@@ -159,7 +161,17 @@ public:
|
||||
Opm::EclipseGridConstPtr eclipseGrid() const
|
||||
{ return eclipseGrid_; }
|
||||
|
||||
/*!
|
||||
* \brief Returns the name of the case.
|
||||
*
|
||||
* i.e., the all-uppercase version of the file name from which the
|
||||
* deck is loaded with the ".DATA" suffix removed.
|
||||
*/
|
||||
const std::string &caseName() const
|
||||
{ return caseName_; }
|
||||
|
||||
private:
|
||||
std::string caseName_;
|
||||
GridPointer grid_;
|
||||
Opm::DeckConstPtr deck_;
|
||||
Opm::ScheduleConstPtr schedule_;
|
||||
|
||||
@@ -63,9 +63,6 @@ NEW_TYPE_TAG(EclBaseProblem, INHERITS_FROM(EclGridManager));
|
||||
// The temperature inside the reservoir
|
||||
NEW_PROP_TAG(Temperature);
|
||||
|
||||
// The name of the simulation
|
||||
NEW_PROP_TAG(SimulationName);
|
||||
|
||||
// Set the problem property
|
||||
SET_TYPE_PROP(EclBaseProblem, Problem, Ewoms::EclProblem<TypeTag>);
|
||||
|
||||
@@ -100,7 +97,6 @@ SET_BOOL_PROP(EclBaseProblem, EnablePartialRelinearization, true);
|
||||
|
||||
// set the defaults for some problem specific properties
|
||||
SET_SCALAR_PROP(EclBaseProblem, Temperature, 293.15);
|
||||
SET_STRING_PROP(EclBaseProblem, SimulationName, "ecl");
|
||||
|
||||
// The default for the end time of the simulation [s]
|
||||
//
|
||||
@@ -180,9 +176,6 @@ public:
|
||||
|
||||
EWOMS_REGISTER_PARAM(TypeTag, Scalar, Temperature,
|
||||
"The temperature [K] in the reservoir");
|
||||
EWOMS_REGISTER_PARAM(TypeTag, std::string, SimulationName,
|
||||
"The name of the simulation used for the output "
|
||||
"files");
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -284,7 +277,7 @@ public:
|
||||
* \copydoc FvBaseProblem::name
|
||||
*/
|
||||
std::string name() const
|
||||
{ return EWOMS_GET_PARAM(TypeTag, std::string, SimulationName); }
|
||||
{ return this->simulator().gridManager().caseName(); }
|
||||
|
||||
/*!
|
||||
* \copydoc FvBaseMultiPhaseProblem::temperature
|
||||
|
||||
Reference in New Issue
Block a user