Commit 7d17c400 authored by Mark Olesen's avatar Mark Olesen

TUT: consistency in scripts, cleanup etc.

The tutorials cartesianMesh/bunnyOctree, cartesianMesh/sBendOctree
do not run through very smoothly, so tagged as 'Optional' for now
parent 4ab43afb
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
echo "--------"
echo "Cleaning tutorials ..."
echo "Removing backup files"
find . \( \
-name '*~' -o -name '*.bak' \
-name core -o -name 'core.[1-9]*' \
-name '*.pvs' -o -name '*.OpenFOAM' -name '*.foam' \
\) -type f -delete
rm -f logs testLoopReport > /dev/null 2>&1
foamCleanTutorials cases
echo "--------"
#------------------------------------------------------------------------------
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# Allrun
#
# Description
# Runs tutorial cases and summarizes the outcome as 'testLoopReport'
#
#------------------------------------------------------------------------------
cd ${0%/*} || exit 1 # Run from this directory
usage()
{
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION]
options:
-collect Collect logs only. Can be useful for aborted runs.
-help print the usage
* Runs tutorial cases and summarizes the outcome as 'testLoopReport'
USAGE
exit 1
}
#------------------------------------------------------------------------------
unset optCollectOnly
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-collect)
optCollectOnly=true
;;
-test) # Known options that should be passed through
break
;;
-*)
usage "unknown option: $1"
;;
*)
break
;;
esac
shift
done
#------------------------------------------------------------------------------
# logReport <logfile>
# Extracts useful info from log file.
logReport()
{
local logfile=$1
# logfile is path/to/case/log.application
caseName=$(dirname $logfile | sed -e 's/\(.*\)\.\///g')
app=$(echo $logfile | sed -e 's/\(.*\)log\.//g')
appAndCase="Application $app - case $caseName"
if grep -q "FOAM FATAL" $logfile
then
echo "$appAndCase: ** FOAM FATAL ERROR **"
return 1
fi
# Check for solution singularity on U equation
for eqn in Ux Uy Uz
do
if grep -q -E "${eqn}[:| ]*solution singularity" $logfile
then
if [ "$eqn" = Uz ]
then
# Can only get here if Ux,Uy,Uz all failed
echo "$appAndCase: ** Solution singularity **"
return 1
fi
else
break
fi
done
if grep -q -E "^[\t ]*[Ee]nd" $logfile
then
# Extract time from this type of content
## ExecutionTime = 60.2 s ClockTime = 63 s --> "60.2 s"
completionTime=$(tail -10 $logfile | \
sed -n -e '/Execution/{s/^[^=]*=[ \t]*//; s/\( s\) .*$/\1/; p}')
echo "$appAndCase: completed${completionTime:+ in }$completionTime"
else
echo "$appAndCase: unconfirmed completion"
fi
}
if [ -z "$optCollectOnly" ]
then
# Recursively run all tutorials
foamRunTutorials -skipFirst $*
fi
# Analyse all log files
echo "Collecting log files..." 1>&2
rm -f logs testLoopReport > /dev/null 2>&1
touch logs testLoopReport
for appDir in *
do
[ -d $appDir ] || continue
echo -n " $appDir..." 1>&2
logs=$(find -L $appDir -name 'log.*' -type f)
if [ -n "$logs" ]
then
echo 1>&2
else
echo " (no logs)" 1>&2
continue
fi
# Sort logs by time-stamp
for log in $(echo $logs | xargs ls -rt)
do
# Concatenate and summarize logs
cat "$log" >> logs 2>/dev/null
logReport $log
done
echo
done > testLoopReport
#------------------------------------------------------------------------------
# Ignore everything in this directory
*
# Except this file
!.gitignore
\ No newline at end of file
#!/bin/bash
# Klas Jareteg, 2012-10-13
# Description:
# Script to run comparative case between coupled and segregated solvers.
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions
cleanCase
rm -r constant/polyMesh
rmdir constant 2>/dev/null
#------------------------------------------------------------------------------
#!/bin/sh
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions
runApplication cartesian2DMesh
runApplication checkMesh
#------------------------------------------------------------------------------
Please run cartesian2DMesh to generate a 2D mesh.
# Ignore everything in this directory
*
# Except this file
!.gitignore
\ No newline at end of file
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / O peration | |
| \\ / A nd | Author: Franjo Juretic |
| \\ / A nd | Author: Franjo Juretic |
| \\/ M anipulation | E-mail: franjo.juretic@c-fields.com |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object meshDict;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application ;
deltaT 1;
endTime 50;
graphFormat raw;
purgeWrite 0;
runTimeModifiable yes;
startFrom startTime;
startTime 0;
stopAt endTime;
timeFormat general;
timePrecision 6;
writeCompression uncompressed;
writeControl timeStep;
writeFormat ascii;
writeInterval 20;
writePrecision 6;
// ************************************************************************* //
\ No newline at end of file
application cartesian2DMesh;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 50;
deltaT 1;
writeControl timeStep;
writeInterval 20;
writeFormat ascii;
runTimeModifiable yes;
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / O peration | |
| \\ / A nd | Author: Franjo Juretic |
| \\ / A nd | Author: Franjo Juretic |
| \\/ M anipulation | E-mail: franjo.juretic@c-fields.com |
\*---------------------------------------------------------------------------*/
......
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / O peration | |
| \\ / A nd | Author: Franjo Juretic |
| \\ / A nd | Author: Franjo Juretic |
| \\/ M anipulation | E-mail: franjo.juretic@c-fields.com |
\*---------------------------------------------------------------------------*/
......
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM GUI Project: creativeFields |
| \\ / O peration | Version: 0.8.9.0 |
| \\ / A nd | Web: www.c-fields.com |
| \\/ M anipulation | |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / O peration | |
| \\ / A nd | Author: Franjo Juretic |
| \\/ M anipulation | E-mail: franjo.juretic@c-fields.com |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2;
format ascii;
class dictionary;
location "system";
object meshDict;
version 2.0;
format ascii;
class dictionary;
object meshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
maxCellSize 0.01;
maxCellSize 0.01;
surfaceFile "geom.fms";
surfaceFile "geom.fms";
boundaryLayers
{
......
# Ignore everything in this directory
*
# Except this file
!.gitignore
\ No newline at end of file
#!/bin/bash
# Klas Jareteg, 2012-10-13
# Description:
# Script to run comparative case between coupled and segregated solvers.
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions
cleanCase
rm -r constant/polyMesh
rmdir constant 2>/dev/null
#------------------------------------------------------------------------------
#!/bin/sh
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions
runApplication cartesianMesh
runApplication checkMesh
#------------------------------------------------------------------------------
Please run cartesianMesh to generate the mesh
# Ignore everything in this directory
*
# Except this file
!.gitignore
\ No newline at end of file
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / O peration | |
| \\ / A nd | Author: Franjo Juretic |
| \\ / A nd | Author: Franjo Juretic |
| \\/ M anipulation | E-mail: franjo.juretic@c-fields.com |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object meshDict;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Foam Application Class
applicationClass ;
application cartesianMesh;
// Start point of run
startFrom latestTime;
// Calculation start time
startTime 0;
// End point of run
stopAt endTime;
// Calculation end time
endTime 20;
// Calculation time step
deltaT 1;
// Type of write output control
writeControl timeStep;
// Interval with which the results are output
writeInterval 550;
writeInterval 50;
// Limits number of time directories before overwriting
cycleWrite 0;
// Write Format
writeFormat ascii;
// Significant figures of written ASCII data
writePrecision 6;
// Write Compression
writeCompression compressed;
// Time directories name format
timeFormat general;
// Decimal precision of time directory names
timePrecision 6;
// Can parameters be modified during run time?
runTimeModifiable no;
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / O peration | |
| \\ / A nd | Author: Franjo Juretic |
| \\ / A nd | Author: Franjo Juretic |
| \\/ M anipulation | E-mail: franjo.juretic@c-fields.com |
\*---------------------------------------------------------------------------*/
......
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / O peration | |
| \\ / A nd | Author: Franjo Juretic |
| \\ / A nd | Author: Franjo Juretic |
| \\/ M anipulation | E-mail: franjo.juretic@c-fields.com |
\*---------------------------------------------------------------------------*/
......@@ -13,6 +13,7 @@ FoamFile
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
......
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / O peration | |
| \\ / A nd | Author: Franjo Juretic |
| \\ / A nd | Author: Franjo Juretic |
| \\/ M anipulation | E-mail: franjo.juretic@c-fields.com |
\*---------------------------------------------------------------------------*/
......@@ -38,5 +38,5 @@ localRefinement
cellSize 0.005;
}
}
// ************************************************************************* //
# Ignore everything in this directory
*
# Except this file
!.gitignore
\ No newline at end of file
#!/bin/bash
# Klas Jareteg, 2012-10-13
# Description:
# Script to run comparative case between coupled and segregated solvers.
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions
cleanCase
rm -r constant/polyMesh
rmdir constant 2>/dev/null
#------------------------------------------------------------------------------
#!/bin/sh
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication cartesianMesh
runApplication checkMesh
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions
runApplication cartesianMesh
runApplication checkMesh
#------------------------------------------------------------------------------
# Ignore everything in this directory
*
# Except this file
!.gitignore
\ No newline at end of file
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / O peration | |
| \\ / A nd | Author: Franjo Juretic |
| \\ / A nd | Author: Franjo Juretic |
| \\/ M anipulation | E-mail: franjo.juretic@c-fields.com |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object meshDict;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application ;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 10;
deltaT 0.05;
writeControl timeStep;
application true; // Optional : no default application to run
writeInterval 20;
startFrom latestTime;
purgeWrite 0;
startTime 0;
writeFormat ascii;
stopAt endTime;
writePrecision 6;
endTime 10;
writeCompression uncompressed;
deltaT 1;
timeFormat general;
writeControl timeStep;
timePrecision 6;
writeInterval 20;
runTimeModifiable yes;
writeFormat ascii;
runTimeModifiable yes;
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 3.0 |
| \\ / A nd | Web: http://www.extend-project.de |
| \\/ M anipulation | |
| ========= | |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / O peration | |
| \\ / A nd | Author: Franjo Juretic |
| \\/ M anipulation | E-mail: franjo.juretic@c-fields.com |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
note "mesh decomposition control dictionary";
location "system";
object decomposeParDict;
}
......
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / O peration | |
| \\ / A nd | Author: Franjo Juretic |
| \\ / A nd | Author: Franjo Juretic |
| \\/ M anipulation | E-mail: franjo.juretic@c-fields.com |
\*---------------------------------------------------------------------------*/
......
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / O peration | |
| \\ / A nd | Author: Franjo Juretic |
| \\ / A nd | Author: Franjo Juretic |
| \\/ M anipulation | E-mail: franjo.juretic@c-fields.com |
\*---------------------------------------------------------------------------*/
......
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / F ield | cfMesh: A library for mesh generation |
| \\ / O peration | |
| \\ / A nd | Author: Franjo Juretic |
| \\ / A nd | Author: Franjo Juretic |
| \\/ M anipulation | E-mail: franjo.juretic@c-fields.com |
\*---------------------------------------------------------------------------*/
......@@ -27,52 +27,52 @@ objectRefinements
{
ear1
{
cellSize 10;
type cone;
p0 (-100 1873 -320);
radius0 200;
p1 (-560 1400 0);
radius1 200;