2 # Source tutorial run functions
3 .
$WM_PROJECT_DIR/bin
/tools
/RunFunctions
5 # Get application name from directory
6 application
=`basename $PWD`
8 cavityCases
="cavity cavityFine cavityGrade cavityHighRe cavityClipped"
12 echo "Running mapFields from $1 to $2"
13 mapFields
$1 -case $2 -sourceTime latestTime
> $2/log.mapFields
2>&1
16 runMapFieldsConsistent
()
18 echo "Running mapFields from $1 to $2"
19 mapFields
$1 -case $2 -sourceTime latestTime
-consistent > $2/log.mapFields
2>&1
22 runFluentMeshToFoam
()
24 echo "fluentMeshToFoam: converting mesh $2"
25 fluentMeshToFoam
$2 -case $1 > $1/log.fluentMeshToFoam
2>&1
30 echo "Copying $2/0* directory to $1"
36 blockMeshDict
="$case/constant/polyMesh/blockMeshDict"
37 controlDict
="$case/system/controlDict"
38 sed s
/"20 20 1"/"41 41 1"/g
$blockMeshDict > temp.$$
39 mv temp.$$
$blockMeshDict
41 -e s
/"\(startTime[ \t]*\) 0;"/"\1 0.5;"/g \
42 -e s
/"\(endTime[ \t]*\) 0.5;"/"\1 0.7;"/g \
43 -e s
/"\(deltaT[ \t]*\) 0.005;"/"\1 0.0025;"/g \
44 -e s
/"\(writeControl[ \t]*\) timeStep;"/"\1 runTime;"/g \
45 -e s
/"\(writeInterval[ \t]*\) 20;"/"\1 0.1;"/g \
46 $controlDict > temp.$$
47 mv temp.$$
$controlDict
52 echo "Setting cavityHighRe to generate a secondary vortex"
53 controlDict
="$case/system/controlDict"
54 transportProperties
="$case/constant/transportProperties"
56 -e s
/"\(startFrom[ \t]*\) startTime;"/"\1 latestTime;"/g \
57 -e s
/"\(endTime[ \t]*\) 0.5;"/"\1 2.0;"/g \
58 $controlDict > temp.$$
59 mv temp.$$
$controlDict
60 sed s
/"0.01"/"0.001"/g
$transportProperties > temp.$$
61 mv temp.$$
$transportProperties
64 for case in $cavityCases
66 if [ "$case" = "cavityFine" ]
68 cloneCase cavity
$case
72 if [ "$case" = "cavityHighRe" ]
74 cloneCase cavity
$case
76 copySolutionDirs
$case cavity
79 (cd $case && runApplication blockMesh
)
81 if [ "$case" = "cavityFine" -o "$case" = "cavityGrade" ]
83 runMapFieldsConsistent
$previousCase $case
86 if [ "$case" = "cavityClipped" ]
88 cp -r $case/0 $case/0.5
89 runMapFields cavity
$case
90 if [ ".`grep nonuniform $case/0.5/U`" != "." ]
92 sed -f resetFixedWallsScr
$case/0.5/U
> $case/0.5/U.temp
93 mv $case/0.5/U.temp
$case/0.5/U
99 (cd $case && runApplication
$application)
102 # elbow case for testing Fluent-FOAM conversion tools
104 runFluentMeshToFoam elbow elbow
/elbow.msh
105 (cd elbow
&& runApplication
$application)
106 (cd elbow
&& runApplication foamMeshToFluent
)
107 (cd elbow
&& runApplication foamDataToFluent
)