Commit b299bad9 authored by Henry Weller's avatar Henry Weller
Browse files

fvSchemes: Handle merging of fluxRequired settings

during re-reading of the fvSchemes dictionary
parent 37cfc3ab
......@@ -50,8 +50,7 @@ void Foam::fvSchemes::clear()
defaultSnGradScheme_.clear();
laplacianSchemes_.clear();
defaultLaplacianScheme_.clear();
fluxRequired_.clear();
defaultFluxRequired_ = false;
// Do not clear fluxRequired settings
}
......@@ -61,42 +60,6 @@ void Foam::fvSchemes::read(const dictionary& dict)
{
ddtSchemes_ = dict.subDict("ddtSchemes");
}
else if (dict.found("timeScheme"))
{
// For backward compatibility.
// The timeScheme will be deprecated with warning or removed
WarningIn("fvSchemes::read()")
<< "Using deprecated 'timeScheme' instead of 'ddtSchemes'"
<< nl << endl;
word schemeName(dict.lookup("timeScheme"));
if (schemeName == "EulerImplicit")
{
schemeName = "Euler";
}
else if (schemeName == "BackwardDifferencing")
{
schemeName = "backward";
}
else if (schemeName == "SteadyState")
{
schemeName = "steadyState";
}
else
{
FatalIOErrorIn("fvSchemes::read()", dict.lookup("timeScheme"))
<< "\n Only EulerImplicit, BackwardDifferencing and "
"SteadyState\n are supported by the old timeScheme "
"specification.\n Please use ddtSchemes instead."
<< exit(FatalIOError);
}
ddtSchemes_.set("default", schemeName);
ddtSchemes_.lookup("default")[0].lineNumber() =
dict.lookup("timeScheme").lineNumber();
}
else
{
ddtSchemes_.set("default", "none");
......@@ -121,30 +84,6 @@ void Foam::fvSchemes::read(const dictionary& dict)
{
d2dt2Schemes_ = dict.subDict("d2dt2Schemes");
}
else if (dict.found("timeScheme"))
{
// For backward compatibility.
// The timeScheme will be deprecated with warning or removed
WarningIn("fvSchemes::read()")
<< "Using deprecated 'timeScheme' instead of 'd2dt2Schemes'"
<< nl << endl;
word schemeName(dict.lookup("timeScheme"));
if (schemeName == "EulerImplicit")
{
schemeName = "Euler";
}
else if (schemeName == "SteadyState")
{
schemeName = "steadyState";
}
d2dt2Schemes_.set("default", schemeName);
d2dt2Schemes_.lookup("default")[0].lineNumber() =
dict.lookup("timeScheme").lineNumber();
}
else
{
d2dt2Schemes_.set("default", "none");
......@@ -237,7 +176,7 @@ void Foam::fvSchemes::read(const dictionary& dict)
if (dict.found("fluxRequired"))
{
fluxRequired_ = dict.subDict("fluxRequired");
fluxRequired_.merge(dict.subDict("fluxRequired"));
if
(
......@@ -373,9 +312,6 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr)
defaultFluxRequired_(false),
steady_(false)
{
// persistent settings across reads is incorrect
clear();
if
(
readOpt() == IOobject::MUST_READ
......@@ -394,7 +330,7 @@ bool Foam::fvSchemes::read()
{
if (regIOobject::read())
{
// persistent settings across reads is incorrect
// Clear current settings except fluxRequired
clear();
read(schemesDict());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment