-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchangeBoundaryCyclicToPatch.sh
36 lines (30 loc) · 1.26 KB
/
changeBoundaryCyclicToPatch.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
#!/bin/bash
# ------------------------------------------------------------------------------ #
# Substitute to OpenFOAM's `changeDictionary`. Such tool is deprecated and the
# use of `foamDictionary` is now encouraged. This function gets the direction of
# the flow and changes the boundary file information.
#
# Input: $inflowDir
# Output: changes patch information in `constant/polyMesh/boundary` from `cyclic`
# to `patch`
#
#
# Regis Thedin
# April 29, 2020
# ------------------------------------------------------------------------------- #
changeBoundaryCyclicToPatch(){
declare -a dir
case $1 in
north|south) dir=(north south);;
east|west) dir=(east west);;
*) dir=(north south east west);;
esac
for d in "${dir[@]}"; do
foamDictionary -entry entry0.$d.type -set "patch" constant/polyMesh/boundary
foamDictionary -entry entry0.$d.inGroups -remove constant/polyMesh/boundary
foamDictionary -entry entry0.$d.matchTolerance -remove constant/polyMesh/boundary
foamDictionary -entry entry0.$d.transform -remove constant/polyMesh/boundary
foamDictionary -entry entry0.$d.neighbourPatch -remove constant/polyMesh/boundary
done
}