Commit 8bf98e74 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

TUT: added tutorial files (issue #671)

- also cleanup by using 0.orig/ directory.
- use foamListRegions to obtain region names
parent 5713efed
......@@ -2,23 +2,11 @@
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions
cleanCase
cleanCase0
rm -rf comms
rm -rf VTK
rm -rf constant/cellToRegion
rm -rf 0/bottomWater
rm -rf 0/topAir
rm -rf 0/heater
rm -rf 0/leftSolid
rm -rf 0/rightSolid
rm -f 0/cellToRegion
rm -rf constant/bottomWater/polyMesh
rm -rf constant/topAir/polyMesh
rm -rf constant/heater/polyMesh
rm -rf constant/leftSolid/polyMesh
rm -rf constant/rightSolid/polyMesh
rm -rf constant/*/polyMesh # region meshes
#------------------------------------------------------------------------------
......@@ -4,18 +4,22 @@ cd ${0%/*} || exit 1 # Run from this directory
runApplication blockMesh
runApplication topoSet
# Restore initial fields
restore0Dir
runApplication splitMeshRegions -cellZones -overwrite
# remove fluid fields from solid regions (important for post-processing)
for i in heater leftSolid rightSolid
# Remove fluid fields from solid regions (important for post-processing)
for region in $(foamListRegions solid)
do
rm -f 0*/$i/{nut,alphat,epsilon,k,U,p_rgh}
rm -f 0/$region/{nut,alphat,epsilon,k,U,p_rgh}
rm -f processor*/0/$region/{nut,alphat,epsilon,k,U,p_rgh}
done
for i in bottomWater topAir heater leftSolid rightSolid
for region in $(foamListRegions)
do
changeDictionary -region $i > log.changeDictionary.$i 2>&1
runApplication -s $region changeDictionary -region $region
done
# Create coupling geometry
......@@ -23,8 +27,7 @@ runApplication createExternalCoupledPatchGeometry \
-regions '(topAir heater)' coupleGroup
echo
echo "creating files for paraview post-processing"
echo "Use paraFoam -touch-all to create files for paraview post-processing"
echo
paraFoam -touchAll 2>/dev/null
#------------------------------------------------------------------------------
......@@ -6,11 +6,7 @@ cleanCase0
rm -rf VTK
rm -rf constant/cellToRegion
rm -rf constant/air/polyMesh
rm -rf constant/solid/polyMesh
rm -rf constant/floor/polyMesh
rm -rf constant/triSurface
rm -rf constant/*/polyMesh # region meshes
rm -f constant/air/F
rm -f constant/air/constructMap*
......@@ -19,11 +15,4 @@ rm -f constant/air/globalFaceFaces
rm -f constant/air/mapDist
rm -f constant/air/visibleFaceFaces
rm -f 0/air/facesAgglomeration
rm -f 0/air/viewFactorField
rm -f 0/air/cellToRegion
rm -f 0/floor/cellToRegion
rm -f 0/solid/cellToRegion
rm -f 0/cellToRegion
#------------------------------------------------------------------------------
......@@ -8,24 +8,23 @@ cd ${0%/*} || exit 1 # Run from this directory
#-- Run on single processor
# Agglomerate patch faces
for i in air
for region in air
do
runApplication -s $i \
faceAgglomerate -region $i -dict constant/viewFactorsDict
runApplication -s $region \
faceAgglomerate -region $region -dict constant/viewFactorsDict
done
# Generate view factors
for i in air
for region in air
do
runApplication -s $i \
viewFactorsGen -region $i
runApplication -s $region \
viewFactorsGen -region $region
done
runApplication $(getApplication)
echo
echo "Creating files for paraview post-processing"
echo "Use paraFoam -touch-all to create files for paraview post-processing"
echo
paraFoam -touchAll
#------------------------------------------------------------------------------
......@@ -11,17 +11,17 @@ cd ${0%/*} || exit 1 # Run from this directory
runApplication decomposePar -allRegions -constant
# Agglomerate patch faces
for i in air
for region in air
do
runParallel -s $i \
faceAgglomerate -region $i -dict constant/viewFactorsDict
runParallel -s $region \
faceAgglomerate -region $region -dict constant/viewFactorsDict
done
# Generate view factors
for i in air
for region in air
do
runParallel -s $i \
viewFactorsGen -region $i
runParallel -s $region \
viewFactorsGen -region $region
done
# Set the initial fields
......@@ -33,8 +33,7 @@ runParallel $(getApplication)
runApplication reconstructPar -allRegions
echo
echo "Creating files for paraview post-processing"
echo "Use paraFoam -touch-all to create files for paraview post-processing"
echo
paraFoam -touchAll
#------------------------------------------------------------------------------
......@@ -10,18 +10,19 @@ runApplication splitMeshRegions -cellZones -overwrite
rm -rf 0/domain3 constant/domain3 system/domain3
# Remove fluid fields from solid regions (important for post-processing)
for i in solid floor
for region in $(foamListRegions solid)
do
rm -f 0*/$i/{rho,mut,alphat,epsilon,k,U,p_rgh,qr,G,IDefault}
rm -f 0/$region/{rho,mut,alphat,epsilon,k,U,p_rgh,qr,G,IDefault}
rm -f processor*/0/$region/{rho,mut,alphat,epsilon,k,U,p_rgh,qr,G,IDefault}
done
# Set the initial fields
restore0Dir
for i in air solid floor
for region in $(foamListRegions)
do
runApplication -s $i changeDictionary \
-region $i -subDict dictionaryReplacement
runApplication -s $region changeDictionary \
-region $region -subDict dictionaryReplacement
done
#------------------------------------------------------------------------------
......@@ -6,11 +6,6 @@ cleanCase0
rm -rf VTK
rm -rf constant/cellToRegion
rm -rf constant/bottomWater/polyMesh
rm -rf constant/topAir/polyMesh
rm -rf constant/heater/polyMesh
rm -rf constant/leftSolid/polyMesh
rm -rf constant/rightSolid/polyMesh
rm -rf constant/*/polyMesh # region meshes
#------------------------------------------------------------------------------
......@@ -14,6 +14,7 @@ runApplication splitMeshRegions -cellZones -overwrite
for region in $(foamListRegions solid)
do
rm -f 0/$region/{nut,alphat,epsilon,k,U,p_rgh}
rm -f processor*/0/$region/{nut,alphat,epsilon,k,U,p_rgh}
done
for region in $(foamListRegions)
......
......@@ -9,11 +9,6 @@ rm -f constant/triSurface/*.eMesh > /dev/null 2>&1
rm -rf VTK
rm -rf constant/cellToRegion
rm -rf constant/bottomAir/polyMesh
rm -rf constant/topAir/polyMesh
rm -rf constant/heater/polyMesh
rm -rf constant/leftSolid/polyMesh
rm -rf constant/rightSolid/polyMesh
rm -rf constant/*/polyMesh # region meshes
#------------------------------------------------------------------------------
......@@ -18,6 +18,7 @@ runApplication splitMeshRegions -cellZones -overwrite
for region in $(foamListRegions solid)
do
rm -f 0/$region/{nut,alphat,epsilon,k,U,p_rgh}
rm -f processor*/0/$region/{nut,alphat,epsilon,k,U,p_rgh}
done
for region in $(foamListRegions)
......
......@@ -4,7 +4,6 @@ cd ${0%/*} || exit 1 # Run from this directory
cleanCase0
rm -rf constant/windshield/polyMesh
rm -rf constant/cabin/polyMesh
rm -rf constant/*/polyMesh # region meshes
#------------------------------------------------------------------------------
......@@ -30,8 +30,7 @@ runParallel $(getApplication)
runApplication reconstructPar -allRegions
echo
echo "creating files for paraview post-processing"
echo "Use paraFoam -touch-all to create files for paraview post-processing"
echo
paraFoam -touchAll
#------------------------------------------------------------------------------
......@@ -4,8 +4,6 @@ cd ${0%/*} || exit 1 # Run from this directory
cleanCase0
rm -rf constant/exterior/polyMesh
rm -rf constant/ice/polyMesh
rm -rf constant/cabin/polyMesh
rm -rf constant/*/polyMesh # region meshes
#------------------------------------------------------------------------------
......@@ -16,5 +16,4 @@ runApplication -s cabin reconstructPar -region cabin
runApplication -s ice reconstructPar -region ice
runApplication -s exterior reconstructPar -region exterior
#------------------------------------------------------------------------------
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment