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/)
-   -   Multiple consecutive runs batch/script (http://www.cfd-online.com/Forums/openfoam-solving/99417-multiple-consecutive-runs-batch-script.html)

Cav April 3, 2012 06:26

Multiple consecutive runs batch/script
 
Hello,

I'm wondering if there's a way of setting up multiple OpenFOAM runs to run consecutively with one starting upon the completion of another.

I know you can write multiple commands in the terminal with && etc but this starts all the OpenFOAM runs in the command without waiting for the initial one to complete, so they all end up running at the same time.

Hope someone can help.

Thanks.

akidess April 3, 2012 06:51

You can write a bash script as follows:
Code:

#!/bin/bash
foamSolver1 > out1.log
foamSolver2 > out2.log
foamSolver3 > out3.log

There's more sophisticated ways to do this - look at the Allrun script of the dambreak / dambreakfine tutorial.

Cav April 3, 2012 07:31

Thanks a lot Anton


All times are GMT -4. The time now is 23:15.