File size: 1,120 Bytes
9092cb3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
# rising_bubble Allrun 脚本
# 参考: Hysing, S. et al. (2009), Int. J. Numer. Meth. Fluids, 60(11), 1259-1288.

cd "$(dirname "${BASH_SOURCE[0]}")" || exit 1

N_PROCS=${1:-1}

echo "=== rising_bubble: blockMesh ==="
blockMesh > log.blockMesh 2>&1
if [ $? -ne 0 ]; then
    echo "ERROR: blockMesh failed, see log.blockMesh"
    exit 1
fi

if [ "$N_PROCS" -gt 1 ]; then
    echo "=== rising_bubble: decomposePar (np=$N_PROCS) ==="
    decomposePar -force > log.decomposePar 2>&1
    if [ $? -ne 0 ]; then
        echo "ERROR: decomposePar failed"
        exit 1
    fi

    echo "=== rising_bubble: interFoam (parallel, np=$N_PROCS) ==="
    mpirun -np "$N_PROCS" interFoam -parallel > log.interFoam 2>&1
    if [ $? -ne 0 ]; then
        echo "ERROR: interFoam failed"
        exit 1
    fi

    echo "=== rising_bubble: reconstructPar ==="
    reconstructPar > log.reconstructPar 2>&1
else
    echo "=== rising_bubble: interFoam (serial) ==="
    interFoam > log.interFoam 2>&1
    if [ $? -ne 0 ]; then
        echo "ERROR: interFoam failed"
        exit 1
    fi
fi

echo "=== rising_bubble 完成 ==="