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