|
[Sponsors] |
February 7, 2018, 12:51 |
Restart simulation at certain time step
|
#1 |
New Member
Join Date: Feb 2018
Posts: 7
Rep Power: 8 |
Hello,
I'm quite new to OpenFOAM so for some of you the question might seem a bit trivial. I run my simulation parallel on 8 processors. My simulation stops at a certain point, so what I want to do now is start my simluation at that time step (with other setting) thus not having to begin at 0 again. I tried using latestTime in my controlDict but my simulation still begins with 0. Do I have to decomomposePar or delete any directories before restart or what am I doing wrong? Thanks in advance! |
|
February 7, 2018, 17:55 |
|
#2 |
Member
Arvind Jay
Join Date: Sep 2012
Posts: 97
Rep Power: 15 |
When did you write data when you stop the solution, if so you can restart from latestTime else there is no solution to restart from.
Code:
writeControl timeStep; writeInterval 200; Jay :-) |
|
February 7, 2018, 20:04 |
|
#3 |
New Member
Join Date: Feb 2018
Posts: 7
Rep Power: 8 |
Thanks for your reply! I do write my data, part of my controlDict entry looks like this:
Code:
startFrom latestTime; startTime 0; stopAt endTime; endTime 0.3; deltaT 1e-6; writeControl adjustableRunTime; writeInterval 0.01; |
|
February 7, 2018, 20:41 |
|
#4 |
Member
Arvind Jay
Join Date: Sep 2012
Posts: 97
Rep Power: 15 |
You can restart from 0.01s only if the 0.01 data is already written. see inside the processor0 folder.
To view parallel results without reconstructing, open paraFoam with the following option Code:
paraFoam -builtin |
|
February 7, 2018, 21:21 |
|
#5 |
New Member
Join Date: Feb 2018
Posts: 7
Rep Power: 8 |
Actually there are folders with the time steps within the processor* folders (in my case 0.01, 0.02 and 0.03). After running my simulation to the point it stopped I reconstructed all the data. And now I want to restart at 0.03. So I must not to delete my processor* folders?
|
|
February 7, 2018, 21:29 |
|
#6 |
Member
Arvind Jay
Join Date: Sep 2012
Posts: 97
Rep Power: 15 |
If you have reconstructed the data, you can go ahead and delete the processor* folders.
suppose you have data at 0.01 0.02 0.03s you can either use "decomposePar -time 0.02", assuming you want to start at 0.02s and then start your runs. |
|
February 9, 2018, 13:02 |
|
#7 |
New Member
Join Date: Feb 2018
Posts: 7
Rep Power: 8 |
Thanks for your help so far. I do follow your steps mentioned above. Furthermore I have an Allrun script which I use for starting the simulation after meshing, which is shown below:
Code:
#!/bin/sh rm -r 0.* rm -r processor* rm -r logs setFields | tee log.setfields rm -r constant/polyMesh/refine* rm -r patchtext rm -r log* decomposePar | tee log.decom mpirun -np 8 interFoam -parallel > log #interDyMPatchFoam > log & #reconstructParMesh #reconstructPar #rm -r processor* #paraFoam Code:
rm -r 0.* |
|
February 9, 2018, 13:21 |
|
#8 |
Member
Arvind Jay
Join Date: Sep 2012
Posts: 97
Rep Power: 15 |
Below are the comments on what the Allrun script does.
Code:
#!/bin/sh # rm -r 0.* // This removes all data folder starting with "0." # rm -r processor* // This removes all decomposed mesh and data folders, if you are restarting you need the data from these folders rm -r logs rm -r logs setFields | tee log.setfields rm -r constant/polyMesh/refine* rm -r patchtext rm -r log* // This removes logs rm -r logs # decomposePar | tee log.decom mpirun -np 8 interFoam -parallel > log #interDyMPatchFoam > log & #reconstructParMesh #reconstructPar #rm -r processor* #paraFoam [CODE] |
|
February 9, 2018, 13:32 |
|
#9 |
New Member
Join Date: Feb 2018
Posts: 7
Rep Power: 8 |
Actually I'm clear about the commands you commented on in my Allrun script. But if I need the data in my processor* directories to restart at my desired time step, I should not follow your advice and delete the processor* folders, right? And deleting all my 0.* folders won't be good either as far as I understand?
So what I want to know is if I can use the Allrun script as it is to resume my simulation. I think not, but if I remove lines that remove the dircetories processor* and 0.* the code won't really function. |
|
February 9, 2018, 13:45 |
|
#10 | |
Member
Arvind Jay
Join Date: Sep 2012
Posts: 97
Rep Power: 15 |
Quote:
I am not clear what you are trying to achieve. Assuming, you plan to restart: You don't have to delete the 0.* folders and processor* (I have commented them out "#" in my previous post) Also, you don't have to decompose the already decomposed case/data. So comment out the depcomposePar also. Cheers:- Jay Last edited by arvindpj; February 9, 2018 at 15:49. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
p_rgh initial residual no change with different settings | manuc | OpenFOAM Running, Solving & CFD | 3 | June 26, 2018 16:53 |
Star cd es-ice solver error | ernarasimman | STAR-CD | 2 | September 12, 2014 01:01 |
AMI interDyMFoam for mixer nu problem | danny123 | OpenFOAM Programming & Development | 8 | September 6, 2013 03:34 |
mixerVesselAMI2D's mass is not balancing | sharonyue | OpenFOAM Running, Solving & CFD | 6 | June 10, 2013 10:34 |
Could anybody help me see this error and give help | liugx212 | OpenFOAM Running, Solving & CFD | 3 | January 4, 2006 19:07 |