mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-26 03:00:17 -06:00
Merge pull request #756 from qilicun/missing-features-handle
Diagnostics keywords that not supported by flow.
This commit is contained in:
commit
f54e3ebe38
@ -50,6 +50,7 @@ list (APPEND MAIN_SOURCE_FILES
|
||||
opm/autodiff/MultisegmentWells.cpp
|
||||
opm/autodiff/BlackoilSolventState.cpp
|
||||
opm/autodiff/ThreadHandle.hpp
|
||||
opm/autodiff/MissingFeatures.cpp
|
||||
opm/polymer/PolymerState.cpp
|
||||
opm/polymer/PolymerBlackoilState.cpp
|
||||
opm/polymer/CompressibleTpfaPolymer.cpp
|
||||
@ -210,6 +211,7 @@ list (APPEND PUBLIC_HEADER_FILES
|
||||
opm/autodiff/StandardWells_impl.hpp
|
||||
opm/autodiff/StandardWellsSolvent.hpp
|
||||
opm/autodiff/StandardWellsSolvent_impl.hpp
|
||||
opm/autodiff/MissingFeatures.hpp
|
||||
opm/polymer/CompressibleTpfaPolymer.hpp
|
||||
opm/polymer/GravityColumnSolverPolymer.hpp
|
||||
opm/polymer/GravityColumnSolverPolymer_impl.hpp
|
||||
|
@ -67,6 +67,7 @@
|
||||
#include <opm/autodiff/BlackoilPropsAdFromDeck.hpp>
|
||||
#include <opm/autodiff/RedistributeDataHandles.hpp>
|
||||
#include <opm/autodiff/moduleVersion.hpp>
|
||||
#include <opm/autodiff/MissingFeatures.hpp>
|
||||
|
||||
#include <opm/core/utility/share_obj.hpp>
|
||||
#include <opm/core/utility/initHydroCarbonState.hpp>
|
||||
@ -76,10 +77,10 @@
|
||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/checkDeck.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/IOConfig/IOConfig.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/InitConfig/InitConfig.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/checkDeck.hpp>
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
@ -412,6 +413,7 @@ namespace Opm
|
||||
ParseContext parseContext({{ ParseContext::PARSE_RANDOM_SLASH , InputError::IGNORE }});
|
||||
deck_ = parser->parseFile(deck_filename, parseContext);
|
||||
checkDeck(deck_, parser);
|
||||
MissingFeatures::checkKeywords(*deck_);
|
||||
eclipse_state_.reset(new EclipseState(deck_, parseContext));
|
||||
auto ioConfig = eclipse_state_->getIOConfig();
|
||||
ioConfig->setOutputDir(output_dir_);
|
||||
|
72
opm/autodiff/MissingFeatures.cpp
Normal file
72
opm/autodiff/MissingFeatures.cpp
Normal file
@ -0,0 +1,72 @@
|
||||
/*
|
||||
Copyright 2016 Statoil ASA.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
|
||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||
#include <opm/autodiff/MissingFeatures.hpp>
|
||||
#include <unordered_set>
|
||||
#include <string>
|
||||
|
||||
|
||||
namespace Opm {
|
||||
|
||||
namespace MissingFeatures {
|
||||
|
||||
void checkKeywords(const Deck& deck)
|
||||
{
|
||||
// These keywords are supported by opm-parser, but are not supported
|
||||
// by flow. For some of them, only part of the options are supported.
|
||||
// The list is used to output messages only.
|
||||
std::unordered_set<std::string> unsupported_keywords = {
|
||||
"ADSALNOD", "API", "AQUCON", "AQUNUM"
|
||||
"COMPLUMP", "COMPSEGS", "CONNECTION", "CPR",
|
||||
"DATE", "ECHO", "EDITNNC", "ENDNUM",
|
||||
"ENDSKIP", "ENKSRVD", "ENPTVD", "EQLNUM", "EQUALREG",
|
||||
"EXCEL", "EXTRAPMS", "FILLEPS", "FIPNUM",
|
||||
"FULLIMP", "GDORIENT", "GECON", "GEFAC", "GRIDUNIT",
|
||||
"GRUPNET", "IMKRVD", "IMPES", "IMPTVD", "MAPUNITS",
|
||||
"MAXVALUE", "MESSAGES", "MINVALUE", "MONITOR", "MSGFILE",
|
||||
"MULT_XYZ", "NETBALAN", "NEXTSTEP", "NOCASC", "NOECHO",
|
||||
"NOGGF", "NOINSPEC", "NOMONITO", "NONNC", "NORSSPEC", "NOSIM",
|
||||
"NSTACK", "NUMRES", "NUPCOL", "OILVISCT", "OLDTRAN", "OPTIONS",
|
||||
"PARALLEL", "PBVD", "PCG", "PERMXY", "PERMYZ",
|
||||
"PERMZX", "PIMULTAB", "PLMIXPAR", "PLYADSS", "PLYDHFLF",
|
||||
"RADFIN4", "RKTRMDIR", "ROCKCOMP", "ROCKOPTS",
|
||||
"ROCKTAB", "RPTGRID", "RPTONLY", "RPTONLYO", "RPTPROS", "PRTRST", "RPTRUNSP",
|
||||
"RPTSCHED", "RPTSOL", "RTEMPVD", "RUNSUM", "SATOPTS", "SAVE", "SEPARATE",
|
||||
"SKIP", "SKIP100", "SKIP300", "SKIPREST", "SPECGRID", "SSOL",
|
||||
"SUMTHIN", "TEMP", "THCONR", "TRACER", "TRACERS",
|
||||
"VAPPARS", "VISCREF", "WATVISCT",
|
||||
"WPAVE", "WPIMULT", "WPITAB", "WTEMP",
|
||||
"WTEST", "WTRACER", "ZIPPY2" };
|
||||
|
||||
// check deck and keyword for flow and parser.
|
||||
for (size_t idx = 0; idx < deck.size(); ++idx) {
|
||||
const auto& keyword = deck.getKeyword(idx);
|
||||
std::unordered_set<std::string>::const_iterator it;
|
||||
it = unsupported_keywords.find(keyword.name());
|
||||
if (it != unsupported_keywords.end()) {
|
||||
std::string msg = "Keyword '" + keyword.name() + "' is not supported by flow.\n"
|
||||
+ "In file " + keyword.getFileName() + ", line " + std::to_string(keyword.getLineNumber()) + "\n";
|
||||
OpmLog::error(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace MissingFeatures
|
||||
} // namespace Opm
|
34
opm/autodiff/MissingFeatures.hpp
Normal file
34
opm/autodiff/MissingFeatures.hpp
Normal file
@ -0,0 +1,34 @@
|
||||
/*
|
||||
Copyright 2016 Statoil ASA.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPM_MISSINGFEATURES_HEADER_INCLUDED
|
||||
#define OPM_MISSINGFEATURES_HEADER_INCLUDED
|
||||
|
||||
namespace Opm {
|
||||
|
||||
namespace MissingFeatures {
|
||||
|
||||
void checkKeywords(const Deck& deck);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif // OPM_MISSINGFEATURES_HEADER_INCLUDED
|
Loading…
Reference in New Issue
Block a user