Stopping OpenFoam

Hi guys,happy new year for 2018.

In the past year,I learned very much from Ladybug discourse forum. Thank you for everyone.

When I am using Butterfly,sometimes I did some incorrect setting and start the running then. I wanted to save the result and stop the OpenFOAM running. I try to shutdown the command windows of OpenFOAM,but the result is not saved.

Is there any method or function component can save the result and stop the openfoam running?


Hi @minggangyin and happy new year!

Unless it’s an optimization study the Grasshopper interfaces stays interactive while you’re running Butterfly solution. You can set up the write Interval to 1 which will make OpenFOAM to save the results for each iteration and once the results is saved you can stop the solution. Also a clean way to do that is to set _run to False instead of closing the cmd window. I have seen cases that closing the cmd doesn’t stop the job in the background in VM.

Yeah,I got it.I will try it in next simulation.Thanks, @mostapha

Hi everyone.

I’ve stumbled in a similar situation and was wondering:
If I stop a decomposed simulation (on 10 cores) prematurely, would I have to reconstruct the solution manually in OpenFOAM or is Butterfly smart enough to do so automatically?

Thank you!

@youresogreat As I know, you should use reconstructPar command to compose the 10 processors.

Hi @minggangyin thank you for your quick and helpful reply!
Unfortunately, I am not very experienced with OpenFOAM yet, could you point me out, where and how I’d execute this command? Would I do it with blueCFD?
It’s not possible directly from the GH/Butterfly interface, right?

Edit: I just discovered, that it is possible to change the case type in ParaView to “Decomposed”, which already kind of helps.


This setting is also right for visualization.

You can learn basic setting of OpenFOAM from YouTube channel.

Yeah.Butterfly is the grasshooper compotents which is not easy to edit/modify it. But we can use OpenFOAM command in BlueCFD terminal.

1 Like

hi @youresogreat

Following @minggangyin 's comments, indeed you can write a case using butterfly and then execute commands in the BlueCFD terminal.
Here are the usual commands I execute manually in the terminal. (XX is the number of processors)

mpirun -np XX snappyHexMesh -parallel
mpirun -np XX renumberMesh -latestTime -parallel
reconstructParMesh -latestTime
mv 3/polyMesh/ constant/polyMesh/*
rm -r processor*
rm -r 3
mpirun -np XX simpleFoam -parallel
reconstructPar -latestTime

If your case was decomposed already and running and then you stopped, you can resume it with
mpirun -np XX simpleFoam -parallel -latestTime

1 Like