File: Allrun-pre

package info (click to toggle)
openfoam 4.1%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 163,028 kB
  • ctags: 58,990
  • sloc: cpp: 830,760; sh: 10,227; ansic: 8,215; xml: 745; lex: 437; awk: 194; sed: 91; makefile: 77; python: 18
file content (104 lines) | stat: -rwxr-xr-x 2,867 bytes parent folder | download | duplicates (2)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/sh
cd ${0%/*} || exit 1    # Run from this directory

# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions

intersectSurfaces()
{
    outputName1=$(basename $1)
    outputName1=${outputName1%.*}

    outputName2=$(basename $2)
    outputName2=${outputName2%.*}

    runApplication -s $outputName1:$outputName2 \
        surfaceBooleanFeatures intersection "$@"
}

# Set application name
application=$(getApplication)

rm -rf 0


# Run the surface preparation script
./constant/triSurface/surfaceProcess.sh > log.surfaceProcess 2>&1


# Surface intersections
intersectSurfaces                           \
    constant/triSurface/vessel.stl          \
    constant/triSurface/spargerShaft.stl    \
    -perturb

intersectSurfaces                           \
    constant/triSurface/vessel.stl          \
    constant/triSurface/shaft.stl           \
    -perturb

intersectSurfaces                           \
    constant/triSurface/spargerShaft.stl    \
    constant/triSurface/spargerInlet.stl    \
    -perturb

intersectSurfaces                           \
    constant/triSurface/stirrer.stl         \
    constant/triSurface/shaftRotating.stl   \
    -perturb

intersectSurfaces                           \
    constant/triSurface/stirrer_baffles.stl \
    constant/triSurface/stirrer.stl         \
    -surf1Baffle                            \
    -perturb

intersectSurfaces                           \
    constant/triSurface/rotating.stl        \
    constant/triSurface/shaft.stl           \
    -surf1Baffle                            \
    -perturb

# Intersect blades with the plate
for bladeI in $(seq 1 6);
do
    intersectSurfaces                                   \
        constant/triSurface/stirrer_baffles_$bladeI.obj \
        constant/triSurface/stirrer_baffles_plate.obj   \
        -surf1Baffle                                    \
        -surf2Baffle
done


# Meshing
cp system/controlDict.mesh system/controlDict

runApplication blockMesh -region backgroundMeshDecomposition

runApplication -s backgroundMeshDecomposition \
    decomposePar -region backgroundMeshDecomposition

runApplication surfaceFeatureExtract

runParallel foamyHexMesh

runParallel -s faces \
    collapseEdges -collapseFaces -latestTime \
                  -dict system/collapseDict.collapseFaces

#runParallel -s faceSet  \
#    collapseEdges -collapseFaceSet indirectPatchFaces -latestTime \
#                  -dict system/collapseDict.indirectPatchFaces

runParallel checkMesh -allTopology -allGeometry -latestTime

runApplication reconstructParMesh -latestTime

# Copy the mesh from the latest time folder into polyMesh and delete that
# latest time folder
latestTime=$(foamListTimes -latestTime)
cp -r $latestTime/polyMesh constant
rm -rf $latestTime


#------------------------------------------------------------------------------