Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
b299bad9
Commit
b299bad9
authored
Jul 24, 2015
by
Henry Weller
Browse files
fvSchemes: Handle merging of fluxRequired settings
during re-reading of the fvSchemes dictionary
parent
37cfc3ab
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/finiteVolume/finiteVolume/fvSchemes/fvSchemes.C
View file @
b299bad9
...
...
@@ -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
())
{
//
persist
ent settings
across reads is incorrect
//
Clear curr
ent settings
except fluxRequired
clear
();
read
(
schemesDict
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment