Cell Data: Don't Warn About Supported Output Directives

This commit ensures that we don't issue misleading warning about
output creation directives such as

    BASIC
    FREQ
    RESTART

that could be, and typically are, put into keywords like RPTRST and
RPTSCHED.  Previously, we would interpret these directives as names
of cell vectors and we would get very confusing diagnostic messages
of the form

    Keyword 'BASIC' is unhandled for output to file

which suggests that 'BASIC' is unsupported despite the output system
supporting the directive for quite some time.  While here, also
apply the same reasoning to the vectors we always output such as
SWAT, SGAS, or PRESSURE.
This commit is contained in:
Bård Skaflestad 2020-03-25 11:15:35 +01:00
parent af413f474c
commit 8c8635d221

View File

@ -221,8 +221,16 @@ public:
// Only output RESTART_AUXILIARY asked for by the user.
const Opm::RestartConfig& restartConfig = simulator_.vanguard().schedule().restart();
std::map<std::string, int> rstKeywords = restartConfig.getRestartKeywords(reportStepNum);
for (auto& keyValue: rstKeywords) {
keyValue.second = restartConfig.getKeyword(keyValue.first, reportStepNum);
for (auto& [keyword, should_write] : rstKeywords) {
if (this->isOutputCreationDirective_(keyword)) {
// 'BASIC', 'FREQ' and similar. Don't attempt to create
// cell-based output for these keywords and don't warn about
// not being able to create such cell-based result vectors.
should_write = 0;
}
else {
should_write = restartConfig.getKeyword(keyword, reportStepNum);
}
}
outputFipRestart_ = false;
@ -300,11 +308,24 @@ public:
}
// and oil pressure
oilPressure_.resize(bufferSize, 0.0);
rstKeywords["PRES"] = 0;
rstKeywords["PRESSURE"] = 0;
if (FluidSystem::enableDissolvedGas())
if (FluidSystem::phaseIsActive(oilPhaseIdx))
rstKeywords["SOIL"] = 0;
if (FluidSystem::phaseIsActive(gasPhaseIdx))
rstKeywords["SGAS"] = 0;
if (FluidSystem::phaseIsActive(waterPhaseIdx))
rstKeywords["SWAT"] = 0;
if (FluidSystem::enableDissolvedGas()) {
rs_.resize(bufferSize, 0.0);
if (FluidSystem::enableVaporizedOil())
rstKeywords["RS"] = 0;
}
if (FluidSystem::enableVaporizedOil()) {
rv_.resize(bufferSize, 0.0);
rstKeywords["RV"] = 0;
}
if (GET_PROP_VALUE(TypeTag, EnableSolvent))
sSol_.resize(bufferSize, 0.0);
@ -325,8 +346,10 @@ public:
krnSwMdcGo_.resize(bufferSize, 0.0);
}
if (simulator_.vanguard().eclState().fieldProps().has_double("SWATINIT"))
if (simulator_.vanguard().eclState().fieldProps().has_double("SWATINIT")) {
ppcw_.resize(bufferSize, 0.0);
rstKeywords["PPCW"] = 0;
}
if (FluidSystem::enableDissolvedGas() && rstKeywords["RSSAT"] > 0) {
rstKeywords["RSSAT"] = 0;
@ -2094,6 +2117,13 @@ private:
return "ERROR";
}
bool isOutputCreationDirective_(const std::string& keyword) const
{
return (keyword == "BASIC") || (keyword == "FREQ")
|| (keyword == "RESTART") // From RPTSCHED
|| (keyword == "SAVE") || (keyword == "SFREQ"); // Not really supported
}
const Simulator& simulator_;
bool outputFipRestart_;