Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
mattijs
2011-06-06 17:42:32 +01:00
16 changed files with 90 additions and 54 deletions

View File

@ -21,6 +21,27 @@ nz=2
tmpSetSet='patchify.setSet'
rm -f patchify.setSet >/dev/null 2>&1
initialiseFaceSet()
{
echo "faceSet cubeFaces clear" >> $tmpSetSet;
}
addToFaceSet()
{
name=$1
x1=$2
x2=$3
y1=$4
y2=$5
z1=$6
z2=$7
echo "faceSet cubeFaces add boxToFace ($x1 $y1 $z1) ($x2 $y2 $z2)" >> $tmpSetSet
echo " $name: (x1=$x1 y1=$y1 z1=$z1) (x2=$x2 y2=$y2 z2=$z2)"
}
createSetsAndZone()
{
@ -32,13 +53,12 @@ createSetsAndZone()
z1=$6
z2=$7
echo "faceSet ${name} new boxToFace ($x1 $y1 $z1) ($x2 $y2 $z2)" >> $tmpSetSet
echo "cellSet ${name}Cells new faceToCell ${name} owner" >> $tmpSetSet
echo "faceZoneSet ${name} new setsToFaceZone ${name} ${name}Cells" >> $tmpSetSet
echo "faceSet ${name}Faces new boxToFace ($x1 $y1 $z1) ($x2 $y2 $z2)" >> $tmpSetSet
echo " $name: (x1=$x1 y1=$y1 z1=$z1) (x2=$x2 y2=$y2 z2=$z2)"
}
initialiseFaceSet
# loop over cubes
n=1
@ -63,7 +83,7 @@ for xi in $(seq 1 1 $nx); do
y2=`echo $y $l $tol | awk '{print $1 + $2 + $3}'`
z1=`echo $z $l $tol | awk '{print $1 + $2 - $3}'`
z2=`echo $z $l $tol | awk '{print $1 + $2 + $3}'`
createSetsAndZone cube${pad}${n}_side${side} $x1 $x2 $y1 $y2 $z1 $z2
addToFaceSet cube${pad}${n}_side${side} $x1 $x2 $y1 $y2 $z1 $z2
# side 2
side=2
@ -73,7 +93,7 @@ for xi in $(seq 1 1 $nx); do
y2=`echo $y $l $tol | awk '{print $1 + $2 + $3}'`
z1=`echo $z $tol | awk '{print $1 - $2}'`
z2=`echo $z $l $tol | awk '{print $1 + $2 + $3}'`
createSetsAndZone cube${pad}${n}_side${side} $x1 $x2 $y1 $y2 $z1 $z2
addToFaceSet cube${pad}${n}_side${side} $x1 $x2 $y1 $y2 $z1 $z2
# side 3
side=3
@ -83,7 +103,7 @@ for xi in $(seq 1 1 $nx); do
y2=`echo $y $l $tol | awk '{print $1 + $2 + $3}'`
z1=`echo $z $tol | awk '{print $1 - $2}'`
z2=`echo $z $tol | awk '{print $1 + $2}'`
createSetsAndZone cube${pad}${n}_side${side} $x1 $x2 $y1 $y2 $z1 $z2
addToFaceSet cube${pad}${n}_side${side} $x1 $x2 $y1 $y2 $z1 $z2
# side 4
side=4
@ -93,7 +113,7 @@ for xi in $(seq 1 1 $nx); do
y2=`echo $y $l $tol | awk '{print $1 + $2 + $3}'`
z1=`echo $z $tol | awk '{print $1 - $2}'`
z2=`echo $z $l $tol | awk '{print $1 + $2 + $3}'`
createSetsAndZone cube${pad}${n}_side${side} $x1 $x2 $y1 $y2 $z1 $z2
addToFaceSet cube${pad}${n}_side${side} $x1 $x2 $y1 $y2 $z1 $z2
# side 5
side=5
@ -103,7 +123,7 @@ for xi in $(seq 1 1 $nx); do
y2=`echo $y $l $tol | awk '{print $1 + $2 + $3}'`
z1=`echo $z $tol | awk '{print $1 - $2}'`
z2=`echo $z $l $tol | awk '{print $1 + $2 + $3}'`
createSetsAndZone cube${pad}${n}_side${side} $x1 $x2 $y1 $y2 $z1 $z2
addToFaceSet cube${pad}${n}_side${side} $x1 $x2 $y1 $y2 $z1 $z2
# side 6
side=6
@ -113,7 +133,7 @@ for xi in $(seq 1 1 $nx); do
y2=`echo $y $tol | awk '{print $1 + $2}'`
z1=`echo $z $tol | awk '{print $1 - $2}'`
z2=`echo $z $l $tol | awk '{print $1 + $2 + $3}'`
createSetsAndZone cube${pad}${n}_side${side} $x1 $x2 $y1 $y2 $z1 $z2
addToFaceSet cube${pad}${n}_side${side} $x1 $x2 $y1 $y2 $z1 $z2
let n+=1
@ -126,12 +146,16 @@ for xi in $(seq 1 1 $nx); do
x=`echo $x $offset | awk '{print $1 + $2}'`
done
echo "cellSet cubeFacesCells new faceToCell cubeFaces owner" >> $tmpSetSet
echo "faceZoneSet cubeFaces new setsToFaceZone cubeFaces cubeFacesCells" >> $tmpSetSet
echo "processing floor"
floorMax=`echo 1 $tol | awk '{print $1 + $2}'`
createSetsAndZone floor -$tol $floorMax -$tol $floorMax -$tol $tol
echo "cellSet floorCells new faceToCell floorFaces owner" >> $tmpSetSet
echo "faceZoneSet floorFaces new setsToFaceZone floorFaces floorCells" >> $tmpSetSet
setSet -batch $tmpSetSet >> log.setSet.patchifyObstacles
rm -f $tmpSetSet
setSet -batch $tmpSetSet > log.setSet.patchifyObstacles >/dev/null 2>&1
# *************************************************************************

View File

@ -18,11 +18,8 @@ region wallFilmRegion;
faceZones
(
cube01_side1 cube01_side2 cube01_side3 cube01_side4 cube01_side5 cube01_side6
cube02_side1 cube02_side2 cube02_side3 cube02_side4 cube02_side5 cube02_side6
cube03_side1 cube03_side2 cube03_side3 cube03_side4 cube03_side5 cube03_side6
cube04_side1 cube04_side2 cube04_side3 cube04_side4 cube04_side5 cube04_side6
floor
cubeFaces
floorFaces
);
oneD false;