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

How to resume a stopped simulation

Register Blogs Community New Posts Updated Threads Search

Like Tree9Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 23, 2011, 19:50
Default How to resume a stopped simulation
  #1
New Member
 
Pallav Jha
Join Date: Apr 2011
Posts: 17
Rep Power: 15
Pallav is on a distinguished road
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
Pallav is offline   Reply With Quote

Old   July 23, 2011, 20:04
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
hpp10, febriyan91 and Gi0rdan0 like this.
__________________
wyldckat is offline   Reply With Quote

Old   July 23, 2011, 20:53
Default
  #3
New Member
 
Pallav Jha
Join Date: Apr 2011
Posts: 17
Rep Power: 15
Pallav is on a distinguished road
Thanks a lot Bruno.
Pallav is offline   Reply With Quote

Old   July 24, 2011, 04:19
Default
  #4
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 460
Rep Power: 18
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
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…
lovecraft22 is offline   Reply With Quote

Old   July 24, 2011, 05:32
Default
  #5
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 21
Bernhard is on a distinguished road
Well, if the simulation was killed by the computer, then these changes will still take effect.
Bernhard is offline   Reply With Quote

Old   July 24, 2011, 11:45
Default
  #6
New Member
 
Pallav Jha
Join Date: Apr 2011
Posts: 17
Rep Power: 15
Pallav is on a distinguished road
Lore and Bernhard,

Thank you for your inputs.
Pallav is offline   Reply With Quote

Old   January 29, 2013, 08:12
Default
  #7
Member
 
Jamal
Join Date: May 2012
Location: Freiburg
Posts: 54
Rep Power: 12
aujamal20 is an unknown quantity at this point
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
aujamal20 is offline   Reply With Quote

Old   January 29, 2013, 17:57
Default
  #8
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
__________________
wyldckat is offline   Reply With Quote

Old   January 30, 2013, 17:17
Default
  #9
Member
 
Jamal
Join Date: May 2012
Location: Freiburg
Posts: 54
Rep Power: 12
aujamal20 is an unknown quantity at this point
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
aujamal20 is offline   Reply With Quote

Old   January 30, 2013, 17:23
Default
  #10
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
__________________

Last edited by wyldckat; January 30, 2013 at 17:27. Reason: see "edit:"
wyldckat is offline   Reply With Quote

Old   April 16, 2014, 04:04
Default
  #11
New Member
 
胡丕
Join Date: Apr 2014
Posts: 2
Rep Power: 0
hpp10 is on a distinguished road
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)
hpp10 is offline   Reply With Quote

Old   September 12, 2015, 02:25
Default resume openfoam simulation
  #12
New Member
 
jaydeep
Join Date: Sep 2015
Location: Pune, Maharashtra, India
Posts: 7
Rep Power: 10
jaydeepKhajure is on a distinguished road
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
amolkumar, ashisha and faiazk like this.
jaydeepKhajure is offline   Reply With Quote

Old   October 2, 2015, 05:35
Default
  #13
New Member
 
Sukratu Barve
Join Date: Mar 2009
Posts: 16
Rep Power: 17
sukratu is on a distinguished road
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!
sukratu is offline   Reply With Quote

Old   October 4, 2015, 15:41
Default
  #14
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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 .

Best regards,
Bruno
Kittipos, faiazk and Shitiz like this.
wyldckat is offline   Reply With Quote

Old   April 23, 2016, 19:50
Default
  #15
Member
 
Join Date: Apr 2016
Posts: 39
Rep Power: 10
ss32 is on a distinguished road
Are there any special steps to resume a parallel case?
ss32 is offline   Reply With Quote

Old   April 25, 2016, 21:05
Default
  #16
aee
Member
 
Andrew Eisenhawer
Join Date: Nov 2012
Location: Alberta, Canada
Posts: 35
Rep Power: 13
aee is on a distinguished road
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.
aee is offline   Reply With Quote

Old   June 6, 2018, 07:51
Default
  #17
New Member
 
Srikrishnan Balasubramanian
Join Date: Jul 2017
Location: Erlangen
Posts: 7
Rep Power: 8
srikrishnan_balasubramani is on a distinguished road
Hi
I have some problem restarting the simulation from the stopped time ( stopped due to system time out). The thing is my write intervals are quite high. When I try to reconstruct the files, I am not able to. I think so because there is only 0 and constant folders in each processor. So when I use

---> reconstructPar -latestTime
I get error message "no time selected"


Is there any way to restart the simulation from the stopped time ?
srikrishnan_balasubramani is offline   Reply With Quote

Old   June 6, 2018, 15:13
Default
  #18
New Member
 
Join Date: Nov 2016
Posts: 15
Rep Power: 9
mitti is on a distinguished road
As far as I know: No
mitti is offline   Reply With Quote

Old   August 14, 2020, 14:44
Default
  #19
Member
 
Muhammad Kashif Jawad
Join Date: Oct 2019
Location: Pakistan
Posts: 48
Rep Power: 5
mkjmalik is an unknown quantity at this point
Hi all,

I want to know that how to resume the simulation with log file..
I lose my log file starting data if i run my simulation from latest time.. the new log file is written from latest time.
mkjmalik is offline   Reply With Quote

Old   August 14, 2020, 15:14
Default
  #20
Senior Member
 
cdegroot's Avatar
 
Chris DeGroot
Join Date: Nov 2011
Location: Canada
Posts: 414
Rep Power: 17
cdegroot is on a distinguished road
Quote:
Originally Posted by mkjmalik View Post
Hi all,

I want to know that how to resume the simulation with log file..
I lose my log file starting data if i run my simulation from latest time.. the new log file is written from latest time.
Normally, you should just copy your log file to a different filename, or write to a new filename upon restarting. The log file is just the screen output piped to a file, so it will not continue writing in the same file.
__________________
Chris DeGroot, PhD, PEng
CEO, Maple Key Labs
www.maplekeylabs.com
cdegroot 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
How to pause a transient simulation and resume without time step advancement? aleisia Main CFD Forum 33 June 12, 2017 11:41
velocity profile export from a simulation onto another sudhirlv STAR-CCM+ 1 September 12, 2010 18:57
continue LES simulation after it stopped holand_us OpenFOAM 9 April 5, 2010 12:52
continue LES simulation after it stopped holand_us OpenFOAM Running, Solving & CFD 1 March 29, 2010 03:50
strange simulation error Ralf Schmidt FLUENT 2 May 4, 2007 13:02


All times are GMT -4. The time now is 16:02.