CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Value of old time step (https://www.cfd-online.com/Forums/openfoam-solving/59818-value-old-time-step.html)

litonx February 16, 2007 09:57

Hi In OpenFoam is it possible
 
Hi
In OpenFoam is it possible to know the old time step value of any variable. I know it is pobbile to write the value in the disk in each time-step. My question is, how to handle with those?

-Liton

alberto February 16, 2007 10:12

You can store old time field u
 
You can store old time field using:

fieldName.storeOldTime();

and recover it using:

fieldName.oldTime();

Look here for further information:

http://foam.sourceforge.net/doc/Doxygen/html/de/d5c/classFoam_1_1GeometricField. html#a25

Regards,
A.

litonx February 16, 2007 10:54

Thanks Alberto. The fieldName
 
Thanks Alberto.
The fieldName.oldTime() returns only the value of previous time step. Is it possible to return any specific old time step value like time step 5, 11 .. etc.

-Regards Liton

alberto February 16, 2007 19:59

Why do you need them? The o
 
Why do you need them?

The old time fields are removed from memory and lost if not written to disk.

If you need them the only way I could think to, is to store them on the disk and to recover them from there

Regards,
A.

openfoammaofnepo February 6, 2015 16:18

Dear Alberto,

Do you know when the current density (from the current time step) is stored using the "storeOldTime" function in fireFOAM.C from OF2.1.x. The codes are given below. This action means that the density from the previous time step is removed from the memory while the Field which is used for the current step is vacated for the next time step. Thank you.

[\code]
#include "readTimeControls.H"
#include "compressibleCourantNo.H"
#include "solidRegionDiffusionNo.H"
#include "setMultiRegionDeltaT.H"
#include "setDeltaT.H"

runTime++;

Info<< "Time = " << runTime.timeName() << nl << endl;

parcels.evolve();

surfaceFilm.evolve();

pyrolysis.evolve();

if (solvePrimaryRegion)
{
#include "rhoEqn.H"

// --- PIMPLE loop
while (pimple.loop())
{
#include "UEqn.H"
#include "YhsEqn.H"

// --- Pressure corrector loop
while (pimple.correct())
{
#include "pEqn.H"
}

if (pimple.turbCorr())
{
turbulence->correct();
}
}

rho = thermo.rho();
}

runTime.write();

Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}

Info<< "End" << endl;

return(0);
[\code]

Quote:

Originally Posted by alberto (Post 193144)
You can store old time field using:

fieldName.storeOldTime();

and recover it using:

fieldName.oldTime();

Look here for further information:

http://foam.sourceforge.net/doc/Doxygen/html/de/d5c/classFoam_1_1GeometricField. html#a25

Regards,
A.



All times are GMT -4. The time now is 00:30.