CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How to resume a stopped simulation (http://www.cfd-online.com/Forums/openfoam-solving/90896-how-resume-stopped-simulation.html)

Pallav July 23, 2011 19:50

How to resume a stopped simulation
 
Hi,

I run my simulations in OF in parallel on a supercomputer (TACC). I have to submit the simulation job and ask for a defined period of time for the simulation to run.

TACC kills the simulation after the simulation has run for the requested amount of time.

In OF, is there a way to resume the simulation from where it stopped?

Please advise.

Thanks.

-Pallav

wyldckat July 23, 2011 20:04

Greetings Pallav,

What you are looking for is this option in controlDict:
Quote:

Originally Posted by http://www.openfoam.com/docs/user/controlDict.php
Code:

startFrom      latestTime;    //Most recent time step from the set of time directories.

Check the link in the quote for more informations on what you can do in controlDict ;)

Best regards,
Bruno

Pallav July 23, 2011 20:53

Thanks a lot Bruno.

lovecraft22 July 24, 2011 04:19

You'll have your simulation to be started with the runTimeModifiable option set to yes on your controlDict or no changes on that file will affect your simulation…

Bernhard July 24, 2011 05:32

Well, if the simulation was killed by the computer, then these changes will still take effect.

Pallav July 24, 2011 11:45

Lore and Bernhard,

Thank you for your inputs.

aujamal20 January 29, 2013 09:12

Dear
I am having a problem to resume the openFoam simulation after making manual changes in last time directory of previous run. For example if I run a simulation for 100 s and I have 0,20, 40 ...,100 time directories. Now I reverse the flow direction by changing inlet/outlet BC for 100/U , manually. From now onward I cant run the simulation from latestTime of 100.
While I set my controlDict properly but it shows an error. But If I remove the time directory 100 and want to run from any other directory like 80, which is not changed, then the simulation runs properly.
Please let me how to resolve this problem.

Regards

wyldckat January 29, 2013 18:57

Greetings Jamal,

A few questions:
  1. Which OpenFOAM version are you using? It's possible that you're triggering an old bug on an old version of OpenFOAM.
  2. What value do you have for "endTime" in "system/controlDict"?
  3. Are you using a stopping criteria based on residuals?
Best regards,
Bruno

aujamal20 January 30, 2013 18:17

Dear Bruno
1. I am using OF 2.1.0
2. When I start a simulation I set endTime in controlDict to 100 when simulation ends then I edit the last time directory 100/U and 100/T to reverse the flow by switching the BC for inlet/outlet & set endTime to say 200.
3. So I don't use any stopping criteria.

Thanks and regards,
Jamal

wyldckat January 30, 2013 18:23

Hi Jamal,

I can't remember very well... there was at least one bug in 2.1.0 that might be related: http://www.openfoam.org/mantisbt/view.php?id=382
So you might want to update to 2.1.1.

Nonetheless... do you change the "endTime" value in "controlDict" before continuing?
edit: OK, you updated your answer... so you did change...

Additionally, is "startFrom" set to "latestTime" for at least the second run?

Best regards,
Bruno

hpp10 April 16, 2014 04:04

Thanks a lot! I did parallel computing with mpi, when there was no space for my computing in my devices. So, I cleared some room, using your suggestion, I set in controlDict :startFrom latestTime; This didnot work. But with your suggesting website tutorial guide, I got the topic of the problem: the lastestTime cannot be used, when I set in the controlDict:sartFrom startTime; startTime 2140; It works well.(my latest time is 2150, I guess there must be some missing files in 2150, so latestTime didnot work)

jaydeepKhajure September 12, 2015 02:25

resume openfoam simulation
 
Hello everybody,

we can resume stopped openfoam simulation. just need some changes in system/controldict file as follows,

startFrom latestTime;

latestTime 0.xxx;


you will need to check the stopped time in the log file and enter that time as latestTime. it worked for me. if anybody has another better solution, please share.

Regards,

Jaydeep

sukratu October 2, 2015 05:35

Hello Jaydeep,

Are you sure it works without us considering the "write Interval" we
set for our flow fields? Please confirm or modify your post.

Best!

wyldckat October 4, 2015 15:41

Greetings to all,

OK, in order to make things perfectly clear, let's use the tutorial "incompressible/icoFoam/cavity" as a basis for demonstrating this issue.

The default settings in this tutorial are these:
Code:

startFrom      startTime;

startTime      0;

stopAt          endTime;

endTime        0.5;

If you want to continue from the latest time, you have at least 2 choices:
  1. Either you force the start and stop times:
    Code:

    startFrom      startTime;

    startTime      0.5;

    stopAt          endTime;

    endTime        1.0;

  2. Or you use the "latestTime" setting for "startFrom":
    Code:

    startFrom      latestTime;

    startTime      0;

    stopAt          endTime;

    endTime        1.0;

And if you don't believe be, I advise people to study again the very first tutorial case that is explained in the OpenFOAM User Guide, section 2.1. ;) More specifically:
  1. First choice, see sub-section: "2.1.5.4 Control adjustments"
  2. Second choice, see sub-section: "2.1.7.1 Pre-processing"

And for those who complain about this being a "needle in a haystack"... Well, this is OpenFOAM you're dealing with, you better train yourself to find these kinds of needles in your cases ;). One wrong decimal separator is all that it takes for you to be simulating a pipe as large as a river or as the Earth :D.

Best regards,
Bruno

ss32 April 23, 2016 19:50

Are there any special steps to resume a parallel case?

aee April 25, 2016 21:05

Parallel cases will resume the same way (using the same mpirun command). However, I find my self reconstructing and then deleting the decomposed directories between stages (to see results in case I want to change /constant files), so I have to re-decompose before resuming. I always have "startFrom latestTime;" in controlDict.


All times are GMT -4. The time now is 18:59.