forked from hystrath/hyStrath
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-CFD.sh
executable file
·97 lines (71 loc) · 2.31 KB
/
install-CFD.sh
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
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
set -e
userName=`whoami`
currentDir=`pwd`
sendingDir="$WM_PROJECT_USER_DIR"
nProcs=1
if [ $# -ne 0 ]
then nProcs=$1;
fi
mkdir -p $sendingDir
# copy new files --------------------------------------------------------------
foldersSrc="thermophysicalModels TurbulenceModels hTCModels finiteVolume fvOptions functionObjects/forces functionObjects/field-cfdStrath"
filesInFolderSrc="functionObjects"
foldersApp="solvers/compressible/hy2Foam utilities/mesh/generation/makeAxialMesh utilities/mesh/generation/blockMeshDG"
for folder in $foldersSrc
do
mkdir -p $sendingDir/src/$folder
cp -r $currentDir/src/$folder $sendingDir/src/`dirname $folder`
done
for filesInFolder in $filesInFolderSrc
do
find $currentDir/src/$filesInFolder/ -maxdepth 1 -type f | xargs cp -t $sendingDir/src/$filesInFolder
done
for folder in $foldersApp
do
mkdir -p $sendingDir/applications/$folder
cp -r $currentDir/applications/$folder $sendingDir/applications/`dirname $folder`
done
cp -r $currentDir/run $sendingDir/
# compile new libraries -------------------------------------------------------
cd $sendingDir/src/thermophysicalModels/strath/
wclean all
./Allwmake -j$nProcs
cd $sendingDir/src/TurbulenceModels/
wclean all
./Allwmake -j$nProcs
cd $sendingDir/src/thermophysicalModels/strath/
./AllwmakeBis -j$nProcs
cd $sendingDir/src/hTCModels
wclean libso
wmake -j$nProcs libso
cd $sendingDir/src/finiteVolume
wclean libso
wmake -j$nProcs libso
cd $sendingDir/src/functionObjects/forces
wclean libso
cd $sendingDir/src/functionObjects/field-cfdStrath
wclean libso
cd $sendingDir/src/functionObjects
./Allwmake-cfdStrath -j$nProcs
cd $sendingDir/src/fvOptions
wclean libso
wmake -j$nProcs libso
# compile new executables ------------------------------------------------------
#---- solvers ----
cd $sendingDir/applications/solvers/compressible/hy2Foam/
./Allwclean
./Allwmake -j$nProcs
#---- utilities ----
cd $sendingDir/applications/utilities/mesh/generation/makeAxialMesh
wclean
wmake -j$nProcs
cd $sendingDir/applications/utilities/mesh/generation/blockMeshDG
wclean all
./Allwmake -j$nProcs
# re-set to the initial directory ---------------------------------------------
cd $currentDir
echo "
CFD module $WM_PROJECT_VERSION compiled successfully. Hope you'll enjoy it, $userName :)
"