CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

Restarting simulation on where it had stopped

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 27, 2009, 11:37
Default Restarting simulation on where it had stopped
  #1
New Member
 
Ulisses
Join Date: Mar 2009
Location: Brazil
Posts: 24
Rep Power: 17
ulisses is on a distinguished road
Hi people,

Someone knows how could I restart my simulation (at OpenFOAM) on where it had stopped?

Thanks for help.
ulisses is offline   Reply With Quote

Old   May 28, 2009, 15:41
Default
  #2
Senior Member
 
Rishi .
Join Date: Mar 2009
Posts: 149
Rep Power: 17
hellorishi is on a distinguished road
HI,

OpenFOAM writes out file at "writeIntervals" specified by you. Check your cse folder and see if you some folders with some number e.g. 0.001, 1e-5, 10, 1000, etc. If you see this then your intermediate results were stored. Otherwise your writeinterval was large and nothing was saved.

If you find such files then you can restart by using "latestTime" . Refer to pg 39 User Guide

"We can now run this case by restarting from the solution at the end of the cavity case run. To do this we can use the option of setting the startFrom keyword to latestTime so that icoFoam takes as its initial data the values stored in the directory corresponding to the most recent time, i.e.0.5. The endTime should be set to 2 s."

Last edited by hellorishi; May 29, 2009 at 04:19. Reason: typo
hellorishi is offline   Reply With Quote

Old   May 28, 2009, 18:03
Default
  #3
New Member
 
Ulisses
Join Date: Mar 2009
Location: Brazil
Posts: 24
Rep Power: 17
ulisses is on a distinguished road
Hi hellorishi,

I've tried to select the option latestTime but when the simulation started the data (p and U) that it was put into the last paste it was the initial conditions. So the program started at the last time but it didn't read the last data (that it was available into the paste).

Thanks for the answer.
ulisses is offline   Reply With Quote

Old   May 29, 2009, 04:23
Default
  #4
Senior Member
 
Rishi .
Join Date: Mar 2009
Posts: 149
Rep Power: 17
hellorishi is on a distinguished road
I did not understand what you meant by "last paste" ?
= last result directory? (0.01, etc)
Did you visualize your data, to check if something was written out in the last time step?
Sometime if your disk is full during computation, your "last time" directory will exist, but it will not have correct data. Hence you will have to use "last -1" data directory and delete the last directory.

Last edited by hellorishi; May 29, 2009 at 13:46.
hellorishi is offline   Reply With Quote

Old   May 29, 2009, 13:33
Default
  #5
New Member
 
Ulisses
Join Date: Mar 2009
Location: Brazil
Posts: 24
Rep Power: 17
ulisses is on a distinguished road
Quote:
Originally Posted by hellorishi View Post
I did not understand what you meant by "last paste" ?
= last result directory? (0.01, etc)
Did you visualize your data, to check if something was written out in the last time step?
Sometime if your disk is full during computation, your "last time" directory will be exist, but it will not have correct data. Hence in that you will have to use "last -1" data directory and delete the last directory.
Yes, last paste means last result directory.
I visualized my data and checked that there were something in the last time step.
What I think that it's strange is the fact that the OpenFOAM writes the initial conditions in the last result directory and starts the simulation from that.
But I'll try to use last -1 data directory.

Thanks a lot.
ulisses is offline   Reply With Quote

Old   May 29, 2009, 13:49
Default
  #6
Senior Member
 
Rishi .
Join Date: Mar 2009
Posts: 149
Rep Power: 17
hellorishi is on a distinguished road
To the best of my knowledge OF, does not write initial BC in last time step. You can check it with the standard icoFoam tutorials. I guess there might be some variable in your controlDict file, which is causing this abnormal behviour.
hellorishi is offline   Reply With Quote

Old   June 2, 2009, 04:09
Default
  #7
Member
 
Leonardo Giampani Morita
Join Date: Apr 2009
Location: Paris, France
Posts: 58
Rep Power: 17
leonardo.morita is on a distinguished road
Hi Ulisses,

I think it would be useful if you could send us a copy of your controlDict file.

Regards,

Leonardo
leonardo.morita is offline   Reply With Quote

Old   June 2, 2009, 05:14
Default
  #8
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by hellorishi View Post
To the best of my knowledge OF, does not write initial BC in last time step. You can check it with the standard icoFoam tutorials. I guess there might be some variable in your controlDict file, which is causing this abnormal behviour.
In OpenFOAM, each field file (eg, U, T, k, epsilon, etc) contains both an internalField and a boundaryField. The internalField is either initial conditions or results, depending on how you view it. At the initial iteration (often 0/), you'll have defined the values yourself and thus they can be termed initial values. At subsequent iterations, internalField contains the calculated results. If you resume the calculation from the calculated results, I suppose you could term them initial-values for a restart.

BTW: startFrom latestTime is also the default that you should get if you've left this entry blank in the controlDict.
olesen is offline   Reply With Quote

Old   June 4, 2009, 14:42
Default
  #9
New Member
 
Ulisses
Join Date: Mar 2009
Location: Brazil
Posts: 24
Rep Power: 17
ulisses is on a distinguished road
Quote:
Originally Posted by leonardo.morita View Post
Hi Ulisses,

I think it would be useful if you could send us a copy of your controlDict file.

Regards,

Leonardo
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4.1 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

// FoamX Case Dictionary.

FoamFile
{
version 2.0;
format ascii;

root "/home/delio/OpenFOAM/delio-1.4.1/run";
case "icoValv05";
instance "system";
local "";

class dictionary;
object controlDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application icoFoam;

startFrom startTime;

startTime 0;

stopAt endTime;

endTime 0.5;

deltaT 1e-08;

writeControl runTime;

writeInterval 0.001;

purgeWrite 0;

writeFormat ascii;

writePrecision 6;

writeCompression uncompressed;

timeFormat general;

timePrecision 6;

graphFormat raw;

runTimeModifiable yes;

functions
(
);


// ************************************************** *********************** //

I've tried to continue from the simulation was stopped but I hadn't success.

Thanks for help.
ulisses is offline   Reply With Quote

Old   June 4, 2009, 16:47
Default
  #10
Member
 
Leonardo Giampani Morita
Join Date: Apr 2009
Location: Paris, France
Posts: 58
Rep Power: 17
leonardo.morita is on a distinguished road
Hello,

Well...if this is the controlDict you used to restart your simulation, one important thing is missing...you should change "startFrom startTime" to "startFrom latestTime"...
In the case you sent us the wrong file, I suggest you to detail a little more about your system, solver etc, so we can understand it as well and it will be easier to find the reason of your problem.
One question: how do you know OF doesn't continue the iterations from the last time folder? What exactly you've checked? It's just a stupid question, but...

Quoting Rishi and adding one point to what Mark said, boundary conditions are allways written as a boundaryField in the time folders, from the first until the last time, and usually are fixed, i.e., this field is the same in all files (exceptions: mapped, cyclic, unstationnary BC).

Regards,

Leonardo
leonardo.morita is offline   Reply With Quote

Old   June 5, 2009, 14:23
Default
  #11
New Member
 
Ulisses
Join Date: Mar 2009
Location: Brazil
Posts: 24
Rep Power: 17
ulisses is on a distinguished road
Quote:
Originally Posted by leonardo.morita View Post
Well...if this is the controlDict you used to restart your simulation, one important thing is missing...you should change "startFrom startTime" to "startFrom latestTime"...
In the case you sent us the wrong file, I suggest you to detail a little more about your system, solver etc, so we can understand it as well and it will be easier to find the reason of your problem.
One question: how do you know OF doesn't continue the iterations from the last time folder? What exactly you've checked? It's just a stupid question, but...
Hello Leonardo,

I quoted the ControlDict with the data that I've filled out in the beginning. When I tried to restart my simulation I puted "startFrom latestTime", but what happened was that when the simulation started again the last result directory (and this directory already contains data of pressure and velocity) was overwritten with the data from the inicial conditions.
I've used OF 1.4.1 and the the solver is the icoFoam.

Quote:
Originally Posted by leonardo.morita View Post
Quoting Rishi and adding one point to what Mark said, boundary conditions are allways written as a boundaryField in the time folders, from the first until the last time, and usually are fixed, i.e., this field is the same in all files (exceptions: mapped, cyclic, unstationnary BC).
Yes I understand that initial conditions are always written as a bondaryField in the time folders.
I'll gave you an example. At my case I have some time folders. Inside these folders there are three files and one more folder (except the first time folder (time=zero) that contains four files), and the first file is U, the second phi, the third is p and the folder is called uniform (this contains a file called time that contains informations about deltaT and deltaTo). In these files there are vector fields that were generated in that time folder. What it has happened with me is that when I restart simulation using the option "startFrom latestTime " the simulation starts in the lastest time folder but the old fields are erased and the initial conditions are written in the lastest time folder. Because of this I think that OF doesn't consider my latest data.

Thanks for helping.
ulisses is offline   Reply With Quote

Old   June 5, 2009, 15:25
Default
  #12
Member
 
Leonardo Giampani Morita
Join Date: Apr 2009
Location: Paris, France
Posts: 58
Rep Power: 17
leonardo.morita is on a distinguished road
Ok. Could you attach your files here? (I think there're instructions somewhere in the forum about how to send files)
Or if you prefer, you could send me by e-mail...I'll try to run your case on monday.

Nice weekend!
leonardo.morita is offline   Reply With Quote

Old   June 10, 2009, 07:18
Default
  #13
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 21
wolle1982 will become famous soon enough
leonardo is right,

the control dict must have

startFrom latestTime; in it, and no other "start"-lines. if you only are interested in the last result anyway and want to avoid an enormous increase of the folder number, use the purge-write function. purgeWrite 1; and writeInterval 1; for each timestep to be written out. In that case you will get each timestep to be written into a folder and the folder is replaced with the new one. to make sure that while writing out no error deletes youtr results, increase the purgeWrite to 2;

greets
wolle1982 is offline   Reply With Quote

Old   June 10, 2009, 08:23
Default
  #14
Member
 
Leonardo Giampani Morita
Join Date: Apr 2009
Location: Paris, France
Posts: 58
Rep Power: 17
leonardo.morita is on a distinguished road
Actually, I think if we put startFrom latestTime, we can leave startTime X there, it won't be read anyway...
leonardo.morita is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Restarting a InterFoam Simulation asaha OpenFOAM Running, Solving & CFD 2 April 11, 2008 16:08
Restarting simulation with a Backup file. Mohammad Faridul Alam CFX 3 November 2, 2007 16:53
restarting lagrange (particle tracking) simulation dbdias CFX 0 September 22, 2007 20:26
Restarting KIVA simulation Tomislav Main CFD Forum 2 April 5, 2006 04:22
3-D Contaminant Dispersal Simulation Apple L S Chan Main CFD Forum 1 December 23, 1998 11:06


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