Herein we assume that the OpenFOAM environment is created and that the steps in the icoFoam tutorial example are performed.
Sequential batch job on Vuori server
Copy an example file for sequential run of the OpenFOAM cavity flow tutorial in to the run directory
cp /v/linux26_x86_64/appl/fluid/foam_instfiles/batchfiles/seqjob $FOAM_RUN/cavity
Move to the run directory and check that the memory and execution time limits etc., as well as the paths are ok in the job file.
Notice that in the jobfile, the module add openfoam command is not used.
The job is send to the batch environment by giving the command
sbatch seqjob
Parallel batch job on Vuori server
Here we execute the cavity flow tutorial with 4 processors. First we have to increase the mesh size up to 200 x 200 cells. Edit the icoFoam/cavity/system/constant/polyMesh/blockMeshDict file in following way.
Change these lines to look as
convertToMeters 1.0;
hex (0 1 2 3 4 5 6 7) (200 200 1) simpleGrading (1 1 1)
Save the file. Make following copy
cp $FOAM_TUTORIALS/interFoam/damBreak/system/decomposeParDict $FOAM_RUN/cavity/system
In decomposeParDict file you may set the parameters for the domain decomposition, i.e. for the partitioning of the fluid domain for different processors. The decomposeParDict file in damBreak tutorial case is usable as it is for this example.
Next make a copy of the example file of Vuori parallel batch job:
cp /v/linux26_x86_64/appl/fluid/foam_instfiles/batchfiles/parjob $FOAM_RUN/cavity
and edit it into proper shape.
Notice that in the jobfile, the module add openfoam command is not used.
Next, in the cavity directory, create the new mesh and decompose it to 2 x 2 domains
blockMesh
decomposePar
and send the parallel job for processing
sbatch parjob
The results are written into cavity/processors* directories. For to combine the results of the different domains, give the command
reconstructPar
The final results are the available in the cavity/0.* directories.
Parallel batch job on Louhi server
Proceed in similar way as instructed above for Vuori server. A sample batch job file for parallel batch run on Louhi can be copied with commandcp /fs/local/linux26_x86_64/appl/fluid/foam_instfiles/batchfiles/parjob $FOAM_RUN/cavity
Move to cavity directory and edit parjob file to fit your own case. The sample file is for a run of 256 processes.
The job is send to the batch environment by giving the command
qsub parjob