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:
@ -139,7 +139,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
runTime.setTime(timeDirs[timeI], timeI);
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
Info<< "Time = " << runTime.userTimeName() << endl;
|
||||
|
||||
autoPtr<polyMeshFilter> meshFilterPtr;
|
||||
|
||||
|
||||
@ -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
|
||||
@ -448,7 +448,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
runTime.setTime(timeDirs[timeI], timeI);
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
Info<< "Time = " << runTime.userTimeName() << endl;
|
||||
|
||||
polyMesh::readUpdateState state = mesh.readUpdate();
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@ adaptiveLinear::adaptiveLinear
|
||||
relaxationModel(typeName, relaxationDict, runTime),
|
||||
relaxationStart_(coeffDict().lookup<scalar>("relaxationStart")),
|
||||
relaxationEnd_(coeffDict().lookup<scalar>("relaxationEnd")),
|
||||
lastTimeValue_(runTime_.time().userTime()),
|
||||
lastTimeValue_(runTime_.time().userTimeValue()),
|
||||
relaxation_(relaxationStart_)
|
||||
{}
|
||||
|
||||
@ -56,7 +56,7 @@ adaptiveLinear::adaptiveLinear
|
||||
|
||||
scalar adaptiveLinear::relaxation()
|
||||
{
|
||||
if (runTime_.time().userTime() > lastTimeValue_)
|
||||
if (runTime_.time().userTimeValue() > lastTimeValue_)
|
||||
{
|
||||
scalar currentRelaxation = relaxation_;
|
||||
|
||||
@ -65,13 +65,13 @@ scalar adaptiveLinear::relaxation()
|
||||
/(
|
||||
(
|
||||
runTime_.time().endTime().value()
|
||||
- runTime_.time().userTime()
|
||||
- runTime_.time().userTimeValue()
|
||||
)
|
||||
/(runTime_.time().userTime() - lastTimeValue_)
|
||||
/(runTime_.time().userTimeValue() - lastTimeValue_)
|
||||
+ 1
|
||||
);
|
||||
|
||||
lastTimeValue_ = runTime_.time().userTime();
|
||||
lastTimeValue_ = runTime_.time().userTimeValue();
|
||||
|
||||
return currentRelaxation;
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ rampHoldFall::rampHoldFall
|
||||
|
||||
scalar rampHoldFall::relaxation()
|
||||
{
|
||||
scalar t = runTime_.time().userTime();
|
||||
scalar t = runTime_.time().userTimeValue();
|
||||
|
||||
scalar tStart = runTime_.time().startTime().value();
|
||||
scalar tEnd = runTime_.time().endTime().value();
|
||||
|
||||
@ -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
|
||||
@ -56,7 +56,7 @@ int main(int argc, char *argv[])
|
||||
runTime++;
|
||||
}
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << nl
|
||||
Info<< "Time = " << runTime.userTimeName() << nl
|
||||
<< "Attaching sliding interface" << endl;
|
||||
|
||||
attachPolyTopoChanger(mesh).attach();
|
||||
|
||||
@ -188,7 +188,7 @@ int main(int argc, char *argv[])
|
||||
|| state == polyMesh::TOPO_PATCH_CHANGE
|
||||
)
|
||||
{
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
||||
|
||||
// Reconstruct globalMeshData
|
||||
mesh.globalData();
|
||||
@ -238,7 +238,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else if (state == polyMesh::POINTS_MOVED)
|
||||
{
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
Info<< "Time = " << runTime.userTimeName() << nl << endl;
|
||||
|
||||
label nFailedChecks = checkGeometry
|
||||
(
|
||||
|
||||
@ -63,7 +63,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
runTime.setTime(Times[timeI], timeI);
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
Info<< "Time = " << runTime.userTimeName() << endl;
|
||||
|
||||
typeIOobject<volVectorField> Uheader
|
||||
(
|
||||
|
||||
@ -97,7 +97,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
while (runTime.loop())
|
||||
{
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
Info<< "Time = " << runTime.userTimeName() << endl;
|
||||
|
||||
while (pimple.loop())
|
||||
{
|
||||
|
||||
@ -59,7 +59,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
while (runTime.loop())
|
||||
{
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
Info<< "Time = " << runTime.userTimeName() << endl;
|
||||
|
||||
mesh.movePoints(motionPtr->newPoints());
|
||||
|
||||
|
||||
@ -115,7 +115,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
runTime.setTime(timeDirs[timeI], timeI);
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
Info<< "Time = " << runTime.userTimeName() << endl;
|
||||
|
||||
// Search for list of objects for this time
|
||||
IOobjectList objects(mesh, runTime.timeName());
|
||||
|
||||
@ -221,7 +221,7 @@ int main(int argc, char *argv[])
|
||||
forAll(timeDirs, timei)
|
||||
{
|
||||
runTime.setTime(timeDirs[timei], timei);
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
Info<< "Time = " << runTime.userTimeName() << endl;
|
||||
|
||||
// Optionally re-read mesh
|
||||
meshReadUpdate(mesh);
|
||||
|
||||
Reference in New Issue
Block a user