Completed the replacement of setSet with topoSet
topoSet is a more flexible and extensible replacement for setSet using standard OpenFOAM dictionary input format rather than the limited command-line input format developed specifically for setSet. This replacement allows for the removal of a significant amount of code simplifying maintenance and the addition of more topoSet sources.
This commit is contained in:
@ -2,10 +2,7 @@
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
runApplication blockMesh
|
||||
|
||||
#runApplication setSet -batch wallFilmRegion.setSet
|
||||
runApplication topoSet
|
||||
|
||||
runApplication extrudeToRegionMesh -overwrite
|
||||
|
||||
paraFoam -touch
|
||||
|
||||
@ -13,10 +13,10 @@ runApplication topoSet
|
||||
# Create the obstacles - add obstacle patches to wallFilm patch
|
||||
runApplication subsetMesh c0 -patch wallFilm -overwrite -noFields
|
||||
|
||||
# Split the obstacle patches into cube[1-6]_patch[1-6]
|
||||
runApplication ./patchifyObstacles
|
||||
# Create a wallFilmRegion faceZone from the obstacles and floor
|
||||
runApplication -s wallFilmRegion topoSet -dict topoSetDict.wallFilmRegion
|
||||
|
||||
# Create the wall film region via extrusion
|
||||
# Create the wall film region from the wallFilmRegion faceZone via extrusion
|
||||
runApplication extrudeToRegionMesh -overwrite
|
||||
|
||||
paraFoam -touch
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
cellSet c0 new
|
||||
cellSet c0 invert
|
||||
cellSet c0 delete boxToCell (0.4 0.1 0.1) (0.6 0.3 0.3)
|
||||
cellSet c0 delete boxToCell (0.4 0.1 0.4) (0.6 0.3 0.6)
|
||||
cellSet c0 delete boxToCell (0.4 0.4 0.1) (0.6 0.6 0.3)
|
||||
cellSet c0 delete boxToCell (0.4 0.4 0.4) (0.6 0.6 0.6)
|
||||
@ -1,2 +0,0 @@
|
||||
faceSet wallFilmFaces new patchToFace wallFilm
|
||||
faceZoneSet wallFilmFaces new setToFaceZone wallFilmFaces
|
||||
@ -1,30 +0,0 @@
|
||||
faceSet cubeFaceSet clear
|
||||
faceSet cubeFaceSet add boxToFace (0.399 0.099 0.299) (0.601 0.301 0.301)
|
||||
faceSet cubeFaceSet add boxToFace (0.599 0.099 0.099) (0.601 0.301 0.301)
|
||||
faceSet cubeFaceSet add boxToFace (0.399 0.099 0.099) (0.601 0.301 0.101)
|
||||
faceSet cubeFaceSet add boxToFace (0.399 0.099 0.099) (0.401 0.301 0.301)
|
||||
faceSet cubeFaceSet add boxToFace (0.399 0.299 0.099) (0.601 0.301 0.301)
|
||||
faceSet cubeFaceSet add boxToFace (0.399 0.099 0.099) (0.601 0.101 0.301)
|
||||
faceSet cubeFaceSet add boxToFace (0.399 0.099 0.599) (0.601 0.301 0.601)
|
||||
faceSet cubeFaceSet add boxToFace (0.599 0.099 0.399) (0.601 0.301 0.601)
|
||||
faceSet cubeFaceSet add boxToFace (0.399 0.099 0.399) (0.601 0.301 0.401)
|
||||
faceSet cubeFaceSet add boxToFace (0.399 0.099 0.399) (0.401 0.301 0.601)
|
||||
faceSet cubeFaceSet add boxToFace (0.399 0.299 0.399) (0.601 0.301 0.601)
|
||||
faceSet cubeFaceSet add boxToFace (0.399 0.099 0.399) (0.601 0.101 0.601)
|
||||
faceSet cubeFaceSet add boxToFace (0.399 0.399 0.299) (0.601 0.601 0.301)
|
||||
faceSet cubeFaceSet add boxToFace (0.599 0.399 0.099) (0.601 0.601 0.301)
|
||||
faceSet cubeFaceSet add boxToFace (0.399 0.399 0.099) (0.601 0.601 0.101)
|
||||
faceSet cubeFaceSet add boxToFace (0.399 0.399 0.099) (0.401 0.601 0.301)
|
||||
faceSet cubeFaceSet add boxToFace (0.399 0.599 0.099) (0.601 0.601 0.301)
|
||||
faceSet cubeFaceSet add boxToFace (0.399 0.399 0.099) (0.601 0.401 0.301)
|
||||
faceSet cubeFaceSet add boxToFace (0.399 0.399 0.599) (0.601 0.601 0.601)
|
||||
faceSet cubeFaceSet add boxToFace (0.599 0.399 0.399) (0.601 0.601 0.601)
|
||||
faceSet cubeFaceSet add boxToFace (0.399 0.399 0.399) (0.601 0.601 0.401)
|
||||
faceSet cubeFaceSet add boxToFace (0.399 0.399 0.399) (0.401 0.601 0.601)
|
||||
faceSet cubeFaceSet add boxToFace (0.399 0.599 0.399) (0.601 0.601 0.601)
|
||||
faceSet cubeFaceSet add boxToFace (0.399 0.399 0.399) (0.601 0.401 0.601)
|
||||
cellSet cubeFacesCells new faceToCell cubeFaceSet owner
|
||||
faceZoneSet cubeFaces new setsToFaceZone cubeFaceSet cubeFacesCells
|
||||
faceSet FloorFaces new boxToFace (-0.001 -0.001 -0.001) (1.001 1.001 0.001)
|
||||
cellSet floorCells new faceToCell FloorFaces owner
|
||||
faceZoneSet floorFaces new setsToFaceZone FloorFaces floorCells
|
||||
@ -1,158 +0,0 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Stop on first error
|
||||
set -e
|
||||
|
||||
x0=0.4
|
||||
y0=0.1
|
||||
z0=0.1
|
||||
l=0.2
|
||||
offset=0.3
|
||||
tol=0.001
|
||||
|
||||
nx=1
|
||||
ny=2
|
||||
nz=2
|
||||
|
||||
|
||||
tmpSetSet='patchify.setSet'
|
||||
rm -f patchify.setSet >/dev/null 2>&1
|
||||
|
||||
|
||||
initialiseFaceSet()
|
||||
{
|
||||
echo "faceSet cubeFaceSet clear" >> $tmpSetSet;
|
||||
}
|
||||
|
||||
addToFaceSet()
|
||||
{
|
||||
name=$1
|
||||
x1=$2
|
||||
x2=$3
|
||||
y1=$4
|
||||
y2=$5
|
||||
z1=$6
|
||||
z2=$7
|
||||
|
||||
echo "faceSet cubeFaceSet add boxToFace ($x1 $y1 $z1) ($x2 $y2 $z2)" >> $tmpSetSet
|
||||
echo " $name: (x1=$x1 y1=$y1 z1=$z1) (x2=$x2 y2=$y2 z2=$z2)"
|
||||
}
|
||||
|
||||
createSetsAndZone()
|
||||
{
|
||||
name=$1
|
||||
x1=$2
|
||||
x2=$3
|
||||
y1=$4
|
||||
y2=$5
|
||||
z1=$6
|
||||
z2=$7
|
||||
|
||||
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
|
||||
x=$x0
|
||||
for xi in $(seq 1 1 $nx); do
|
||||
y=$y0
|
||||
for yi in $(seq 1 1 $ny); do
|
||||
z=$z0
|
||||
for zi in $(seq 1 1 $nz); do
|
||||
echo "processing cube $n"
|
||||
|
||||
pad=""
|
||||
if [ $n -lt 10 ]; then
|
||||
pad="0"
|
||||
fi
|
||||
|
||||
# side 1
|
||||
side=1
|
||||
x1=`echo $x $tol | awk '{print $1 - $2}'`
|
||||
x2=`echo $x $l $tol | awk '{print $1 + $2 + $3}'`
|
||||
y1=`echo $y $tol | awk '{print $1 - $2}'`
|
||||
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}'`
|
||||
addToFaceSet cube${pad}${n}_side${side} $x1 $x2 $y1 $y2 $z1 $z2
|
||||
|
||||
# side 2
|
||||
side=2
|
||||
x1=`echo $x $l $tol | awk '{print $1 + $2 - $3}'`
|
||||
x2=`echo $x $l $tol | awk '{print $1 + $2 + $3}'`
|
||||
y1=`echo $y $tol | awk '{print $1 - $2}'`
|
||||
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}'`
|
||||
addToFaceSet cube${pad}${n}_side${side} $x1 $x2 $y1 $y2 $z1 $z2
|
||||
|
||||
# side 3
|
||||
side=3
|
||||
x1=`echo $x $tol | awk '{print $1 - $2}'`
|
||||
x2=`echo $x $l $tol | awk '{print $1 + $2 + $3}'`
|
||||
y1=`echo $y $tol | awk '{print $1 - $2}'`
|
||||
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}'`
|
||||
addToFaceSet cube${pad}${n}_side${side} $x1 $x2 $y1 $y2 $z1 $z2
|
||||
|
||||
# side 4
|
||||
side=4
|
||||
x1=`echo $x $tol | awk '{print $1 - $2}'`
|
||||
x2=`echo $x $tol | awk '{print $1 + $2}'`
|
||||
y1=`echo $y $tol | awk '{print $1 - $2}'`
|
||||
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}'`
|
||||
addToFaceSet cube${pad}${n}_side${side} $x1 $x2 $y1 $y2 $z1 $z2
|
||||
|
||||
# side 5
|
||||
side=5
|
||||
x1=`echo $x $tol | awk '{print $1 - $2}'`
|
||||
x2=`echo $x $l $tol | awk '{print $1 + $2 + $3}'`
|
||||
y1=`echo $y $l $tol | awk '{print $1 + $2 - $3}'`
|
||||
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}'`
|
||||
addToFaceSet cube${pad}${n}_side${side} $x1 $x2 $y1 $y2 $z1 $z2
|
||||
|
||||
# side 6
|
||||
side=6
|
||||
x1=`echo $x $tol | awk '{print $1 - $2}'`
|
||||
x2=`echo $x $l $tol | awk '{print $1 + $2 + $3}'`
|
||||
y1=`echo $y $tol | awk '{print $1 - $2}'`
|
||||
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}'`
|
||||
addToFaceSet cube${pad}${n}_side${side} $x1 $x2 $y1 $y2 $z1 $z2
|
||||
|
||||
n=$((n+1))
|
||||
|
||||
z=`echo $z $offset | awk '{print $1 + $2}'`
|
||||
done
|
||||
|
||||
y=`echo $y $offset | awk '{print $1 + $2}'`
|
||||
done
|
||||
|
||||
x=`echo $x $offset | awk '{print $1 + $2}'`
|
||||
done
|
||||
|
||||
echo "cellSet cubeFacesCells new faceToCell cubeFaceSet owner" >> $tmpSetSet
|
||||
echo "faceZoneSet cubeFaces new setsToFaceZone cubeFaceSet 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 2>&1
|
||||
|
||||
echo "End"
|
||||
|
||||
# *************************************************************************
|
||||
@ -15,11 +15,7 @@ FoamFile
|
||||
|
||||
region wallFilmRegion;
|
||||
|
||||
faceZones
|
||||
(
|
||||
cubeFaces
|
||||
floorFaces
|
||||
);
|
||||
faceZones (wallFilmFaces);
|
||||
|
||||
oneD false;
|
||||
|
||||
|
||||
@ -0,0 +1,41 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object topoSetDict;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
actions
|
||||
(
|
||||
{
|
||||
name wallFilmFaceSet;
|
||||
type faceSet;
|
||||
action new;
|
||||
source patchToFace;
|
||||
sourceInfo
|
||||
{
|
||||
name wallFilm;
|
||||
}
|
||||
}
|
||||
{
|
||||
name wallFilmFaces;
|
||||
type faceZoneSet;
|
||||
action new;
|
||||
source setToFaceZone;
|
||||
sourceInfo
|
||||
{
|
||||
faceSet wallFilmFaceSet;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,10 +2,7 @@
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
runApplication blockMesh
|
||||
|
||||
#runApplication setSet -batch wallFilmRegion.setSet
|
||||
runApplication topoSet -dict wallFilmRegion.topoSet
|
||||
|
||||
runApplication extrudeToRegionMesh -overwrite
|
||||
|
||||
paraFoam -touch
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
# Create face sets
|
||||
faceSet sideFaces1 new boxToFace (-0.00001 -0.00001 -1) (0.10001 0.00001 1)
|
||||
faceSet sideFaces2 new boxToFace ( 0.09999 -0.00001 -1) (0.10001 0.05001 1)
|
||||
faceSet sideFaces3 new boxToFace (-0.00001 0.04999 -1) (1.00001 0.05001 1)
|
||||
faceSet sideFaces4 new boxToFace (-0.00001 -0.00001 -1) (0.00001 0.05001 1)
|
||||
@ -1,3 +0,0 @@
|
||||
# Create face set
|
||||
faceSet wallFilmFaces new patchToFace filmWalls
|
||||
faceZoneSet wallFilmFaces new setToFaceZone wallFilmFaces
|
||||
@ -1,44 +0,0 @@
|
||||
2013-10-01 Meshing the angledDuct geometry.
|
||||
|
||||
constant/geometry/angledDuct.stl
|
||||
outer geometry
|
||||
|
||||
constant/geometry/boundaryAndFaceZones.stl
|
||||
boundary and faceZones to extract feature
|
||||
edges from.
|
||||
|
||||
(in angledDuctImplicit:
|
||||
setSet:
|
||||
cellSet porosity new zoneToCell porosity
|
||||
cellSet other new cellToCell porosity
|
||||
cellSet other invert
|
||||
faceSet porosityFaces new cellToFace other all
|
||||
faceSet porosityFaces subset cellToFace porosity all
|
||||
faceZoneSet porosityFaces new setToFaceZone porosityFaces
|
||||
|
||||
surfaceMeshTriangulate -faceZones '(porosityFaces)' boundaryAndFaceZones.stl
|
||||
)
|
||||
|
||||
surfaceFeatures
|
||||
|
||||
|
||||
|
||||
constant/geometry/porosity_inflated.stl
|
||||
block around porosity
|
||||
(slightly inflated)
|
||||
|
||||
Done paraview:
|
||||
- start off from porosity.stl
|
||||
- rotate to align with x axis and translate so symmetric in y:
|
||||
Filter->transform
|
||||
- translate (0 -0.025 0)
|
||||
- rotate (0 0 -45)
|
||||
- inflate y and z:
|
||||
Filter->transform
|
||||
- scale (1 1.5 1.5)
|
||||
- translate back:
|
||||
Filter->transform
|
||||
- translate (0 0.025 0)
|
||||
- rotate back:
|
||||
Filter->transform
|
||||
- rotate (0 0 45)
|
||||
@ -2,10 +2,7 @@
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
runApplication blockMesh
|
||||
|
||||
#runApplication setSet -batch wallFilmRegion.setSet
|
||||
runApplication topoSet
|
||||
|
||||
runApplication extrudeToRegionMesh -overwrite
|
||||
|
||||
paraFoam -touch
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
cellSet c0 new
|
||||
cellSet c0 invert
|
||||
cellSet c0 delete boxToCell (0.375 0.375 0) (0.625 0.625 0.25)
|
||||
Reference in New Issue
Block a user