Skip to content
Snippets Groups Projects
Commit 1a27c8dd authored by Henry's avatar Henry
Browse files

fvSchemes: check for ddtScheme default being steadyState and provide steady()...

fvSchemes: check for ddtScheme default being steadyState and provide steady() and transient() access functions
parent cbbfa574
Branches
Tags
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -25,6 +25,7 @@ License ...@@ -25,6 +25,7 @@ License
#include "fvSchemes.H" #include "fvSchemes.H"
#include "Time.H" #include "Time.H"
#include "steadyStateDdtScheme.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
...@@ -108,6 +109,11 @@ void Foam::fvSchemes::read(const dictionary& dict) ...@@ -108,6 +109,11 @@ void Foam::fvSchemes::read(const dictionary& dict)
) )
{ {
defaultDdtScheme_ = ddtSchemes_.lookup("default"); defaultDdtScheme_ = ddtSchemes_.lookup("default");
steady_ =
(
word(defaultDdtScheme_)
== fv::steadyStateDdtScheme<scalar>::typeName
);
} }
...@@ -364,7 +370,8 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr) ...@@ -364,7 +370,8 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr)
tokenList() tokenList()
)() )()
), ),
defaultFluxRequired_(false) defaultFluxRequired_(false),
steady_(false)
{ {
// persistent settings across reads is incorrect // persistent settings across reads is incorrect
clear(); clear();
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -78,6 +78,10 @@ class fvSchemes ...@@ -78,6 +78,10 @@ class fvSchemes
dictionary fluxRequired_; dictionary fluxRequired_;
bool defaultFluxRequired_; bool defaultFluxRequired_;
//- Steady-state run indicator
// Set true if the default ddtScheme is steadyState
bool steady_;
// Private Member Functions // Private Member Functions
...@@ -128,6 +132,18 @@ public: ...@@ -128,6 +132,18 @@ public:
bool fluxRequired(const word& name) const; bool fluxRequired(const word& name) const;
//- Return true if the default ddtScheme is steadyState
bool steady() const
{
return steady_;
}
//- Return true if the default ddtScheme is not steadyState
bool transient() const
{
return !steady_;
}
// Read // Read
......
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