tutorials/*/DTCHull, propeller: Clone meshes, if available

These cases now check for a mesh in geometrically identical cases and
copy rather than re-generate if possible. This reduces the run-time of
the test loop by about 20 minutes.
This commit is contained in:
Will Bainbridge
2019-11-04 09:32:37 +00:00
parent 6cc02fc0f9
commit 5f22607df3
22 changed files with 244 additions and 196 deletions

View File

@ -154,17 +154,45 @@ compileApplication()
cloneCase()
{
if [ -d $2 ]
from=$1
to=$2
if [ ! -d $from ]
then
echo "Case already cloned: remove case directory $2 to clone"
echo "Case $from does not exist"
return 1
elif [ -d $to ]
then
echo "Case already cloned: remove case directory $to to clone"
return 1
else
echo "Cloning $2 case from $1"
mkdir $2
cpfiles="0 system constant"
for f in $cpfiles
echo "Cloning $to case from $from"
mkdir -p $to
for f in 0 system constant
do
cp -r $1/$f $2
cp -r $from/$f $to
done
return 0
fi
}
cloneMesh()
{
from=$1/constant/polyMesh
to=$2/constant/polyMesh
if [ ! -d $from ]
then
echo "Mesh $from does not exist"
return 1
elif [ -d $to ]
then
echo "Mesh already cloned: remove mesh directory $to to clone"
return 1
else
echo "Cloning $to mesh from $from"
cp -pr $from $to
return 0
fi
}

View File

@ -4,7 +4,11 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
./Allmesh
# Mesh if necessary
if ! cloneMesh ../../../../multiphase/interPhaseChangeFoam/propeller .
then
./Allmesh
fi
runApplication decomposePar
runParallel $(getApplication)

View File

@ -0,0 +1,27 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Copy DTC hull surface from resources folder
cp $FOAM_TUTORIALS/resources/geometry/DTC-scaled.stl.gz constant/triSurface/
runApplication surfaceFeatures
runApplication blockMesh
for i in 1 2 3 4 5 6
do
runApplication -s $i \
topoSet -dict system/topoSetDict.${i}
runApplication -s $i \
refineMesh -dict system/refineMeshDict -overwrite
done
runApplication snappyHexMesh -overwrite
runApplication renumberMesh -noFields -overwrite
#------------------------------------------------------------------------------

View File

@ -4,25 +4,11 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# copy DTC hull surface from resources folder
cp $FOAM_TUTORIALS/resources/geometry/DTC-scaled.stl.gz constant/triSurface/
runApplication surfaceFeatures
runApplication blockMesh
for i in 1 2 3 4 5 6
do
runApplication -s $i \
topoSet -dict system/topoSetDict.${i}
runApplication -s $i \
refineMesh -dict system/refineMeshDict -overwrite
done
runApplication snappyHexMesh -overwrite
runApplication renumberMesh -noFields -overwrite
# Mesh if necessary
if ! cloneMesh ../DTCHullMoving . && ! cloneMesh ../DTCHullWave .
then
./Allmesh
fi
runApplication setFields

View File

@ -5,54 +5,19 @@
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object decomposeParDict;
version 2.0;
format ascii;
class dictionary;
location "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 8;
method scotch;
simpleCoeffs
{
n (2 1 1);
delta 0.001;
}
hierarchicalCoeffs
{
n (1 1 1);
delta 0.001;
order xyz;
}
metisCoeffs
{
}
manualCoeffs
{
dataFile "";
}
distributed no;
roots
(
);
// ************************************************************************* //

View File

@ -0,0 +1,27 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Copy DTC hull surface from resources folder
cp $FOAM_TUTORIALS/resources/geometry/DTC-scaled.stl.gz constant/triSurface/
runApplication surfaceFeatures
runApplication blockMesh
for i in 1 2 3 4 5 6
do
runApplication -s $i \
topoSet -dict system/topoSetDict.${i}
runApplication -s $i \
refineMesh -dict system/refineMeshDict -overwrite
done
runApplication snappyHexMesh -overwrite
runApplication renumberMesh -noFields -overwrite
#------------------------------------------------------------------------------

View File

@ -4,25 +4,11 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# copy DTC hull surface from resources folder
cp $FOAM_TUTORIALS/resources/geometry/DTC-scaled.stl.gz constant/triSurface/
runApplication surfaceFeatures
runApplication blockMesh
for i in 1 2 3 4 5 6
do
runApplication -s $i \
topoSet -dict system/topoSetDict.${i}
runApplication -s $i \
refineMesh -dict system/refineMeshDict -overwrite
done
runApplication snappyHexMesh -overwrite
runApplication renumberMesh -noFields -overwrite
# Mesh if necessary
if ! cloneMesh ../DTCHull . && ! cloneMesh ../DTCHullWave .
then
./Allmesh
fi
runApplication setFields

View File

@ -5,54 +5,19 @@
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object decomposeParDict;
version 2.0;
format ascii;
class dictionary;
location "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 8;
method scotch;
simpleCoeffs
{
n (2 1 1);
delta 0.001;
}
hierarchicalCoeffs
{
n (1 1 1);
delta 0.001;
order xyz;
}
metisCoeffs
{
}
manualCoeffs
{
dataFile "";
}
distributed no;
roots
(
);
// ************************************************************************* //

View File

@ -4,13 +4,12 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
# remove surface
# Remove surface
rm -f constant/triSurface/DTC-scaled.stl.gz > /dev/null 2>&1
rm -rf constant/extendedFeatureEdgeMesh > /dev/null 2>&1
rm -f constant/triSurface/DTC-scaled.eMesh > /dev/null 2>&1
cleanCase
rm constant/polyMesh/boundary > /dev/null 2>&1
rm system/topoSetDict > /dev/null 2>&1
#------------------------------------------------------------------------------

View File

@ -0,0 +1,27 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Copy DTC hull surface from resources folder
cp $FOAM_TUTORIALS/resources/geometry/DTC-scaled.stl.gz constant/triSurface/
runApplication surfaceFeatures
runApplication blockMesh
for i in 1 2 3 4 5 6
do
runApplication -s $i \
topoSet -dict system/topoSetDict.${i}
runApplication -s $i \
refineMesh -dict system/refineMeshDict -overwrite
done
runApplication snappyHexMesh -overwrite
runApplication renumberMesh -noFields -overwrite
#------------------------------------------------------------------------------

View File

@ -1,29 +1,14 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# copy DTC hull surface from resources folder
cp $FOAM_TUTORIALS/resources/geometry/DTC-scaled.stl.gz constant/triSurface/
runApplication surfaceFeatures
runApplication blockMesh
for i in 1 2 3 4 5 6
do
runApplication -s $i \
topoSet -dict system/topoSetDict.${i}
runApplication -s $i \
refineMesh -dict system/refineMeshDict -overwrite
done
runApplication snappyHexMesh -overwrite
runApplication renumberMesh -noFields -overwrite
# Mesh if necessary
if ! cloneMesh ../DTCHull . && ! cloneMesh ../DTCHullMoving .
then
./Allmesh
fi
runApplication setWaves

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "system";
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -19,50 +18,50 @@ convertToMeters 1;
vertices
(
(-20 -10 -10)
(10 -10 -10)
(10 0 -10)
(-20 0 -10)
(-26 -19 -16)
(16 -19 -16)
(16 0 -16)
(-26 0 -16)
(-20 -10 -1.112)
(10 -10 -1.112)
(10 0 -1.112)
(-20 0 -1.112)
(-26 -19 -1)
(16 -19 -1)
(16 0 -1)
(-26 0 -1)
(-20 -10 0.188)
(10 -10 0.188)
(10 0 0.188)
(-20 0 0.188)
(-26 -19 0.185)
(16 -19 0.185)
(16 0 0.185)
(-26 0 0.185)
(-20 -10 0.244)
(10 -10 0.244)
(10 0 0.244)
(-20 0 0.244)
(-26 -19 0.244)
(16 -19 0.244)
(16 0 0.244)
(-26 0 0.244)
(-20 -10 0.3)
(10 -10 0.3)
(10 0 0.3)
(-20 0 0.3)
(-26 -19 0.3)
(16 -19 0.3)
(16 0 0.3)
(-26 0 0.3)
(-20 -10 1.6)
(10 -10 1.6)
(10 0 1.6)
(-20 0 1.6)
(-26 -19 1.6)
(16 -19 1.6)
(16 0 1.6)
(-26 0 1.6)
(-20 -10 4)
(10 -10 4)
(10 0 4)
(-20 0 4)
(-26 -19 4)
(16 -19 4)
(16 0 4)
(-26 0 4)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (30 10 30) simpleGrading (1 1 0.05)
hex (4 5 6 7 8 9 10 11) (30 10 40) simpleGrading (1 1 1)
hex (8 9 10 11 12 13 14 15) (30 10 4) simpleGrading (1 1 1)
hex (12 13 14 15 16 17 18 19) (30 10 4) simpleGrading (1 1 1)
hex (16 17 18 19 20 21 22 23) (30 10 40) simpleGrading (1 1 1)
hex (20 21 22 23 24 25 26 27) (30 10 10) simpleGrading (1 1 20)
hex (0 1 2 3 4 5 6 7) (42 19 50) simpleGrading (1 1 0.05)
hex (4 5 6 7 8 9 10 11) (42 19 50) simpleGrading (1 1 1)
hex (8 9 10 11 12 13 14 15) (42 19 4) simpleGrading (1 1 1)
hex (12 13 14 15 16 17 18 19) (42 19 4) simpleGrading (1 1 1)
hex (16 17 18 19 20 21 22 23) (42 19 40) simpleGrading (1 1 1)
hex (20 21 22 23 24 25 26 27) (42 19 20) simpleGrading (1 1 5)
);
edges

View File

@ -38,7 +38,6 @@ solvers
"pcorr.*"
{
solver GAMG;
smoother DIC;
tolerance 1e-3;
@ -48,7 +47,6 @@ solvers
p_rgh
{
solver GAMG;
smoother DIC;
tolerance 5e-8;
@ -64,10 +62,9 @@ solvers
"(U|k|omega).*"
{
solver smoothSolver;
smoother symGaussSeidel;
nSweeps 1;
nSweeps 1;
tolerance 1e-7;
relTol 0;
minIter 1;

View File

@ -0,0 +1,49 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defaultFieldValues
(
volScalarFieldValue alpha.water 0
);
regions
(
// Set cell values
// (does zerogradient on boundaries)
boxToCell
{
box (-999 -999 -999) (999 999 0.244);
fieldValues
(
volScalarFieldValue alpha.water 1
);
}
// Set patch values (using ==)
boxToFace
{
box (-999 -999 -999) (999 999 0.244);
fieldValues
(
volScalarFieldValue alpha.water 1
);
}
);
// ************************************************************************* //

View File

@ -10,9 +10,9 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "system";
object snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Which of the steps to run

View File

@ -24,7 +24,7 @@ actions
source boxToCell;
sourceInfo
{
box (-4 -5 -3) (10 0 3);
box (-10 -6 -3) (10 0 3);
}
}
);

View File

@ -24,7 +24,7 @@ actions
source boxToCell;
sourceInfo
{
box (-3 -3 -2.5) (10 0 2);
box (-5 -3 -2.5) (9 0 2);
}
}
);

View File

@ -24,7 +24,7 @@ actions
source boxToCell;
sourceInfo
{
box (-2 -1.5 -1) (10 0 1.5);
box (-3 -1.5 -1) (8 0 1.5);
}
}
);

View File

@ -24,7 +24,7 @@ actions
source boxToCell;
sourceInfo
{
box (-1 -1 -0.6) (10 0 1);
box (-2 -1 -0.6) (7 0 1);
}
}
);

View File

@ -24,7 +24,7 @@ actions
source boxToCell;
sourceInfo
{
box (-0.5 -0.6 -0.3) (10 0 0.8);
box (-1 -0.6 -0.3) (6.5 0 0.8);
}
}
);

View File

@ -24,7 +24,7 @@ actions
source boxToCell;
sourceInfo
{
box (-0.25 -0.55 -0.15) (6.25 0 0.65);
box (-0.5 -0.55 -0.15) (6.25 0 0.65);
}
}
);

View File

@ -4,7 +4,11 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
./Allmesh
# Mesh if necessary
if ! cloneMesh ../../../incompressible/pimpleFoam/RAS/propeller .
then
./Allmesh
fi
runApplication decomposePar