Time: Added run-time selectable userTime option

replacing the virtual functions overridden in engineTime.

Now the userTime conversion function in Time is specified in system/controlDict
such that the solver as well as all pre- and post-processing tools also operate
correctly with the chosen user-time.

For example the user-time and rpm in the tutorials/combustion/XiEngineFoam/kivaTest case are
now specified in system/controlDict:

userTime
{
    type     engine;
    rpm      1500;
}

The default specification is real-time:

userTime
{
    type     real;
}

but this entry can be omitted as the real-time class is instantiated
automatically if the userTime entry is not present in system/controlDict.
This commit is contained in:
Henry Weller
2021-10-19 09:09:01 +01:00
parent 0a54efe189
commit 3ef3e96c3f
129 changed files with 849 additions and 198 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -51,7 +51,7 @@ int main(int argc, char *argv[])
while (runTime.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
Info<< "Time = " << runTime.userTimeName() << nl << endl;
dsmc.evolve();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -70,7 +70,7 @@ int main(int argc, char *argv[])
{
nAveragingSteps++;
Info<< "Time = " << runTime.timeName() << endl;
Info<< "Time = " << runTime.userTimeName() << endl;
molecules.evolve();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -55,7 +55,7 @@ int main(int argc, char *argv[])
{
nAveragingSteps++;
Info<< "Time = " << runTime.timeName() << endl;
Info<< "Time = " << runTime.userTimeName() << endl;
molecules.evolve();