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

Best practice for smooth restart in parallel run of OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By HPE
  • 1 Post By yek_irani

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 1, 2020, 15:53
Default Best practice for smooth restart in parallel run of OpenFOAM
  #1
New Member
 
Maziar
Join Date: Jul 2019
Posts: 15
Rep Power: 6
yek_irani is on a distinguished road
Hello,

I am performing a simulation with the pimpleFoam solver using OpenFOAM v1912. The calculation is running on several processors. I am wondering what is the best practice for a smooth restart. In system/controlDict I am writing out data in binary format, and the variable startFrom is set to “latestTime”.

My main question is whether it makes a difference if I:

1) reconstruct the data from all "processor" subfolders using reconstructPar, delete the aforementioned data subfolders and then rerun the decomposePar, renumberMesh followed by pimpleFoam. This approach is recommended in this post

OR,

2) leave the data decomposed in the separate processor subfolders and imply invoke pimpleFoam.

Option #2 seems like less work to me.

Thank you for your thoughts.
yek_irani is offline   Reply With Quote

Old   May 1, 2020, 17:57
Default
  #2
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12
HPE is on a distinguished road
Could you explain further what `smooth` restart is?

Otherwise, the second option will be enough to restart whatever computation you have.
Sun likes this.
HPE is offline   Reply With Quote

Old   May 1, 2020, 19:10
Default
  #3
New Member
 
Maziar
Join Date: Jul 2019
Posts: 15
Rep Power: 6
yek_irani is on a distinguished road
Thank you HPE for your (hopefully "herpes free") response.
"Smooth" to me means minimizing the extent of initial transient blips in the solution achieved thus far.
tonnykz likes this.
yek_irani is offline   Reply With Quote

Old   May 2, 2020, 03:59
Default
  #4
Member
 
Thomas Sprich
Join Date: Mar 2015
Posts: 76
Rep Power: 11
Swift is on a distinguished road
Hi,


I agree with HPE and would resume from the previously decomposed state just because it is less work. I haven't verified this, but I don't think that it should make any difference if you resume from a decomposed state or decompose a time step and then resume.


The decomposed result and the reconstructed result both contain the same information, it should not make any difference to how the solution proceeds.



Are you seeing strange results when you resume a solution? Can you plot the residuals?



Regards,
Thomas
Swift is offline   Reply With Quote

Old   May 2, 2020, 12:28
Default
  #5
New Member
 
Maziar
Join Date: Jul 2019
Posts: 15
Rep Power: 6
yek_irani is on a distinguished road
Hello,

Thank you for your response. I haven't compared the two options. My primary intention was to get feedback on what experienced users felt was 'best practice'.

Cheers.
yek_irani is offline   Reply With Quote

Old   May 2, 2020, 16:20
Default
  #6
Senior Member
 
Claudio Boezio
Join Date: May 2020
Location: Europe
Posts: 137
Rep Power: 6
Ship Designer is on a distinguished road
Hi all,

this is not strictly an answer to the original question, but might sitlll be useful.

I've experienced fatal errors after restarting interrupted decomposed cases solved by interFoam. I don't remember the exact error message right now. To correct the problem, I deleted all field files other than those located in "0" from each processor folder, e.g. alphaPhi0.water, phi. After that, interFoam restarted the solution at the latest time without complaints. After restarting the solution, the residuals are not the same as prior to the interuption, but seem to recover after a few time steps.
Ship Designer is offline   Reply With Quote

Old   May 2, 2020, 18:11
Default
  #7
New Member
 
Maziar
Join Date: Jul 2019
Posts: 15
Rep Power: 6
yek_irani is on a distinguished road
Hi Claudio,

How was the job interrupted? I try to use the stopAtWriteNowSignal variable to ensure the time step completes before stopping, as per the description here:
https://openfoam.org/release/2-1-0/r...-write-timing/

Being a bit of a beginner to OpenFOAM, I am somewhat puzzled by the approach or workaround you employed. If you "deleted all field files other than those located in "0" from each processor folder", what solution are you left with to restart from? Did you reconstruct the data before deleting?
yek_irani is offline   Reply With Quote

Old   May 3, 2020, 12:21
Default
  #8
Senior Member
 
Claudio Boezio
Join Date: May 2020
Location: Europe
Posts: 137
Rep Power: 6
Ship Designer is on a distinguished road
Hello Maziar,


I believe in those instances I aborted the calculations manually for some reason. I admit that's probably not the best way to do it. Maybe I should make sure that interFoam ends naturally, like setting endTime to the next ordinary write and let it write all the files properly, like you suggest. Thanks.



By deleting those field files I did, interFoam will restart and continue the solution based on the same files which are initially contained in the 0 directory, i.e. U, p_rgh, alpha.water and any turbulence model fields, but with the values of the solution so far. I'm sure it's not the best way to do it, but given the fatal error I got, it was the only way I found to continue solution without having to waste hours and start over again. It's just a solution to a unique problem you're unlikely to encounter. I apologize if this was off-topic and caused confusion. Nevermind.



Cheers
Ship Designer is offline   Reply With Quote

Old   November 17, 2022, 10:58
Default
  #9
New Member
 
Nilotpal Dhar
Join Date: Nov 2022
Location: United Kingdom
Posts: 4
Rep Power: 3
ndhar is on a distinguished road
I was asked to do the same with the latest time step of the simulation which I think I have been able to do (fingers crossed), being a new OpenFOAM user it was hard for me to figure that out.
ndhar is offline   Reply With Quote

Old   August 9, 2023, 11:19
Default Possible solution
  #10
New Member
 
Carl Kohrs
Join Date: Sep 2019
Posts: 17
Rep Power: 6
cckohrs is on a distinguished road
When I tried to restart buoyantReactingFoam I got errors that the processor#/0/p etc. are missing. So the following commands works for successful restart of a buoyantReactingFoam cases:

decomposePar -latestTime -time 0 -force
mpirun -np 7 buoyantReactingFoam -parallel
reconstructPar

Change 7 and possibly the solver to suit your case. I also add the following to clean up the processor folders.
rm -rf processor*
cckohrs is offline   Reply With Quote

Reply

Tags
best practice, openfoam 1912, restart


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
Error running openfoam in parallel fede32 OpenFOAM Programming & Development 5 October 4, 2018 16:38
[OpenFOAM] Questions about Paraview to show Parallel run of OpenFOAM padian ParaView 20 September 24, 2018 12:52
Problem in parallel run with OpenFOAM Gitesh P OpenFOAM Running, Solving & CFD 2 June 1, 2014 06:05
parallel Grief: BoundaryFields ok in single CPU but NOT in Parallel JR22 OpenFOAM Running, Solving & CFD 2 April 19, 2013 16:49
Parallel run of OpenFOAM in linux and windows side by side m2montazari OpenFOAM Running, Solving & CFD 5 June 24, 2011 03:26


All times are GMT -4. The time now is 20:24.