fvSchemes: check for ddtScheme default being steadyState and provide steady() and transient() access functions

This commit is contained in:
Henry 2014-01-02 17:33:30 +00:00
parent cbbfa57430
commit 1a27c8dd76
2 changed files with 26 additions and 3 deletions

View File

@ -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
#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)
) )
{ {
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)
tokenList() tokenList()
)() )()
), ),
defaultFluxRequired_(false) defaultFluxRequired_(false),
steady_(false)
{ {
// persistent settings across reads is incorrect // persistent settings across reads is incorrect
clear(); clear();

View File

@ -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
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:
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