diff --git a/openfoam2012/.gitignore b/openfoam2012/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..eb4ce36dfebef0f843e5a4a73ed0fbeb7cac3438 --- /dev/null +++ b/openfoam2012/.gitignore @@ -0,0 +1 @@ +wrong_velocities diff --git a/openfoam2012/freeCylinderFlow/continue.sh b/openfoam2012/freeCylinderFlow/continue.sh new file mode 100755 index 0000000000000000000000000000000000000000..df6e6dc9310daee0cae2d0575b8e3d6fbaf035bb --- /dev/null +++ b/openfoam2012/freeCylinderFlow/continue.sh @@ -0,0 +1,15 @@ +#! /usr/bin/env sh +set -e +# f = force = do not error on nonexisting files +rm -rf 'postProcessing/patchAverage(name=cylinder,mag(grad(T)))' +rm -rf '0/grad(T)' +rm -rf '0/mag(grad(T))' + +decomposePar -force +foamJob -wait -p buoyantBoussinesqPimpleFoam +reconstructPar + +# Calculate the average of the magnitude of the temperature gradient +postProcess -func 'grad(T)' +postProcess -func 'mag(grad(T))' +postProcess -func 'patchAverage(name=cylinder,mag(grad(T)))' diff --git a/openfoam2012/runmany.sh b/openfoam2012/runmany.sh old mode 100644 new mode 100755 index e5c155bdaf41b0c856cf91463fbd83f949f070a1..09c532fbaca21fb95dace80857c0a9368fbd656a --- a/openfoam2012/runmany.sh +++ b/openfoam2012/runmany.sh @@ -1,15 +1,26 @@ #! /usr/bin/env sh set -e -top="${pwd}" +echo "" >> runmany.archive +touch runmany.log +cat runmany.log >> runmany.archive 2> /dev/null +echo "" > runmany.log +top="$(pwd)" for n in 1 2 do - for logu in -1 0 1 2 + for logu in -2 -1 0 1 do + cd "${top}" new="freeCylinderFlow-N${n}-u${logu}" + if test -d "${new}" + then + echo "skip ${new}" >> runmany.log + continue # done in previous run, hopefully + fi + echo "copy and run ${new}" >> runmany.log cp -r freeCylinderFlow ${new} cd "${new}" - sed -i 's#^inVelocity .*;$#inVelocity 2e'"${logu}"';' parameters - grep --quiet "2e${logu}" parameters # should crash script if grep does not find it + sed -i 's#^inVelocity .*;$#inVelocity 5e'"${logu}"';#' parameters + grep --quiet "5e${logu}" parameters # should crash script if grep does not find it ./run.sh $n done done