From 1e5919f8b00079a9dafb7161270a782d54eda69d Mon Sep 17 00:00:00 2001 From: Andrew Heather Date: Tue, 26 Jun 2018 11:16:24 +0100 Subject: [PATCH] TUT: Updates - see #856 --- .../lumpedPointMotion/building/Allrun | 4 +- .../building/steady/system/controlDict | 2 +- .../building/steady/system/fvSolution | 21 +++++----- .../LES/surfaceMountedCube/fullCase/Allrun | 22 +++++++--- .../LES/surfaceMountedCube/fullCase/plot | 41 +++++++++---------- .../simpleFoam/turbulentFlatPlate/Allrun | 1 - 6 files changed, 50 insertions(+), 41 deletions(-) diff --git a/tutorials/incompressible/lumpedPointMotion/building/Allrun b/tutorials/incompressible/lumpedPointMotion/building/Allrun index 6fe2bac652..d51034a0de 100755 --- a/tutorials/incompressible/lumpedPointMotion/building/Allrun +++ b/tutorials/incompressible/lumpedPointMotion/building/Allrun @@ -77,7 +77,7 @@ copyParallelPointDisplacement() if notTest $@ then - latestTime=$(cd steady && foamListTimes -noZero -latestTime -processor) + latestTime=$(\cd steady && foamListTimes -noZero -latestTime -processor) # Clone the steady-state case to transient cloneParallelCase steady transient 0 $latestTime @@ -86,7 +86,7 @@ then # Do the transient case \cp files/Allrun.transient transient/Allrun - (cd transient && foamRunTutorials) + (\cd transient && foamRunTutorials) fi #------------------------------------------------------------------------------ diff --git a/tutorials/incompressible/lumpedPointMotion/building/steady/system/controlDict b/tutorials/incompressible/lumpedPointMotion/building/steady/system/controlDict index c725103ef9..7be2d444e2 100644 --- a/tutorials/incompressible/lumpedPointMotion/building/steady/system/controlDict +++ b/tutorials/incompressible/lumpedPointMotion/building/steady/system/controlDict @@ -14,7 +14,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -libs ("liblumpedPointMotion.so"); +libs ("libmeshTools.so" "liblumpedPointMotion.so"); application pimpleFoam; diff --git a/tutorials/incompressible/lumpedPointMotion/building/steady/system/fvSolution b/tutorials/incompressible/lumpedPointMotion/building/steady/system/fvSolution index d0c9c144aa..2d66a0612b 100644 --- a/tutorials/incompressible/lumpedPointMotion/building/steady/system/fvSolution +++ b/tutorials/incompressible/lumpedPointMotion/building/steady/system/fvSolution @@ -16,18 +16,19 @@ FoamFile solvers { + "pcorr.*" + { + solver GAMG; + tolerance 1e-2; + relTol 0; + smoother GaussSeidel; + } + p { - solver GAMG; - tolerance 1e-7; - relTol 0.01; - smoother GaussSeidel; - nPreSweeps 0; - nPostSweeps 2; - cacheAgglomeration true; - agglomerator faceAreaPair; - nCellsInCoarsestLevel 10; - mergeLevels 1; + $pcorr; + tolerance 1e-7; + relTol 0.01; } "(cellDisplacement)" diff --git a/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/fullCase/Allrun b/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/fullCase/Allrun index 3f0efd4886..1b2ddd2cad 100755 --- a/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/fullCase/Allrun +++ b/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/fullCase/Allrun @@ -17,13 +17,25 @@ channelDataDir=$channelCase/postProcessing/surfaces/inlet mkdir -p constant/boundaryData/inlet/0 channelTimeDir=$(foamListTimes -case $channelCase -latestTime) -\cp -rf $channelDataDir/points constant/boundaryData/inlet -\cp -rf $channelDataDir/$channelTimeDir/turbulenceProperties:R constant/boundaryData/inlet/0/R -\cp -rf $channelDataDir/$channelTimeDir/turbulenceProperties:L constant/boundaryData/inlet/0/L -\cp -rf $channelDataDir/$channelTimeDir/turbulenceProperties:nuTilda constant/boundaryData/inlet/0/nuTilda -\cp -rf $channelDataDir/$channelTimeDir/U constant/boundaryData/inlet/0/U +\cp -f $channelDataDir/points constant/boundaryData/inlet +\cp -f $channelDataDir/$channelTimeDir/turbulenceProperties:R constant/boundaryData/inlet/0/R +\cp -f $channelDataDir/$channelTimeDir/turbulenceProperties:L constant/boundaryData/inlet/0/L +\cp -f $channelDataDir/$channelTimeDir/turbulenceProperties:nuTilda constant/boundaryData/inlet/0/nuTilda +\cp -f $channelDataDir/$channelTimeDir/U constant/boundaryData/inlet/0/U runApplication blockMesh runApplication decomposePar runParallel $(getApplication) +if notTest $@ +then + # create validation plot + # Test if gnuplot exists on the system + command -v gnuplot >/dev/null 2>&1 || { + echo "gnuplot not found - skipping graph creation" 1>&2 + exit 1 + } + + # Plot the mean velocity profiles + ./plot $(foamListTimes -processor -latestTime) +fi diff --git a/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/fullCase/plot b/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/fullCase/plot index 63f008e3c1..4ca8996123 100755 --- a/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/fullCase/plot +++ b/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/fullCase/plot @@ -2,6 +2,7 @@ cd ${0%/*} || exit 1 # run from this directory time=$1 +resultsDir="postProcessing/sample1/$time" gnuplot<