From 34ca200725005c62b978a2c867f1ef1040e89934 Mon Sep 17 00:00:00 2001 From: UnnamedMoose Date: Tue, 10 Jul 2018 19:42:40 +0100 Subject: [PATCH] Reorganised the tutorials to use Allwmake and Allwclean scripts for compiling, making each one require the same commands for execution. Added an automated testing script. Checked OpenFOAM 6 compatibility --- OFtutorial00_helloWorld/Allwclean | 3 + OFtutorial00_helloWorld/Allwmake | 3 + OFtutorial01_inputOutput/Allwclean | 3 + OFtutorial01_inputOutput/Allwmake | 3 + .../Allwclean | 3 + .../Allwmake | 3 + OFtutorial03_understandingTheMesh/Allwclean | 3 + OFtutorial03_understandingTheMesh/Allwmake | 3 + OFtutorial04_basicFieldOperations/Allwclean | 3 + OFtutorial04_basicFieldOperations/Allwmake | 3 + OFtutorial05_basicParallelComputing/Allwclean | 3 + OFtutorial05_basicParallelComputing/Allwmake | 3 + OFtutorial06_customClasses/Allwclean | 3 + OFtutorial06_customClasses/Allwmake | 3 + OFtutorial08_customBC/testCase/Allrun | 4 +- .../Allwclean | 3 + .../Allwmake | 3 + OFtutorial10_transportEquation/Allwclean | 3 + OFtutorial10_transportEquation/Allwmake | 3 + .../testCase/Allrun | 2 +- OFtutorial11_modifyingTheMesh/Allwclean | 3 + OFtutorial11_modifyingTheMesh/Allwmake | 3 + OFtutorial11_modifyingTheMesh/testCase/Allrun | 2 +- .../testCase/viewGrid.pvsm | 9627 +++++++++-------- OFtutorial12_momentumSource/Allwclean | 3 + OFtutorial12_momentumSource/Allwmake | 3 + OFtutorial12_momentumSource/testCase/Allrun | 2 +- README.md | 122 +- testAll | 41 + 29 files changed, 4958 insertions(+), 4908 deletions(-) create mode 100755 OFtutorial00_helloWorld/Allwclean create mode 100755 OFtutorial00_helloWorld/Allwmake create mode 100755 OFtutorial01_inputOutput/Allwclean create mode 100755 OFtutorial01_inputOutput/Allwmake create mode 100755 OFtutorial02_commandLineArgumentsAndOptions/Allwclean create mode 100755 OFtutorial02_commandLineArgumentsAndOptions/Allwmake create mode 100755 OFtutorial03_understandingTheMesh/Allwclean create mode 100755 OFtutorial03_understandingTheMesh/Allwmake create mode 100755 OFtutorial04_basicFieldOperations/Allwclean create mode 100755 OFtutorial04_basicFieldOperations/Allwmake create mode 100755 OFtutorial05_basicParallelComputing/Allwclean create mode 100755 OFtutorial05_basicParallelComputing/Allwmake create mode 100755 OFtutorial06_customClasses/Allwclean create mode 100755 OFtutorial06_customClasses/Allwmake create mode 100755 OFtutorial09_runtimePostprocessingUtility/Allwclean create mode 100755 OFtutorial09_runtimePostprocessingUtility/Allwmake create mode 100755 OFtutorial10_transportEquation/Allwclean create mode 100755 OFtutorial10_transportEquation/Allwmake create mode 100755 OFtutorial11_modifyingTheMesh/Allwclean create mode 100755 OFtutorial11_modifyingTheMesh/Allwmake create mode 100755 OFtutorial12_momentumSource/Allwclean create mode 100755 OFtutorial12_momentumSource/Allwmake create mode 100755 testAll diff --git a/OFtutorial00_helloWorld/Allwclean b/OFtutorial00_helloWorld/Allwclean new file mode 100755 index 0000000..54329d4 --- /dev/null +++ b/OFtutorial00_helloWorld/Allwclean @@ -0,0 +1,3 @@ +#!/bin/bash + +wclean diff --git a/OFtutorial00_helloWorld/Allwmake b/OFtutorial00_helloWorld/Allwmake new file mode 100755 index 0000000..a0b61c2 --- /dev/null +++ b/OFtutorial00_helloWorld/Allwmake @@ -0,0 +1,3 @@ +#!/bin/bash + +wmake diff --git a/OFtutorial01_inputOutput/Allwclean b/OFtutorial01_inputOutput/Allwclean new file mode 100755 index 0000000..54329d4 --- /dev/null +++ b/OFtutorial01_inputOutput/Allwclean @@ -0,0 +1,3 @@ +#!/bin/bash + +wclean diff --git a/OFtutorial01_inputOutput/Allwmake b/OFtutorial01_inputOutput/Allwmake new file mode 100755 index 0000000..a0b61c2 --- /dev/null +++ b/OFtutorial01_inputOutput/Allwmake @@ -0,0 +1,3 @@ +#!/bin/bash + +wmake diff --git a/OFtutorial02_commandLineArgumentsAndOptions/Allwclean b/OFtutorial02_commandLineArgumentsAndOptions/Allwclean new file mode 100755 index 0000000..54329d4 --- /dev/null +++ b/OFtutorial02_commandLineArgumentsAndOptions/Allwclean @@ -0,0 +1,3 @@ +#!/bin/bash + +wclean diff --git a/OFtutorial02_commandLineArgumentsAndOptions/Allwmake b/OFtutorial02_commandLineArgumentsAndOptions/Allwmake new file mode 100755 index 0000000..a0b61c2 --- /dev/null +++ b/OFtutorial02_commandLineArgumentsAndOptions/Allwmake @@ -0,0 +1,3 @@ +#!/bin/bash + +wmake diff --git a/OFtutorial03_understandingTheMesh/Allwclean b/OFtutorial03_understandingTheMesh/Allwclean new file mode 100755 index 0000000..54329d4 --- /dev/null +++ b/OFtutorial03_understandingTheMesh/Allwclean @@ -0,0 +1,3 @@ +#!/bin/bash + +wclean diff --git a/OFtutorial03_understandingTheMesh/Allwmake b/OFtutorial03_understandingTheMesh/Allwmake new file mode 100755 index 0000000..a0b61c2 --- /dev/null +++ b/OFtutorial03_understandingTheMesh/Allwmake @@ -0,0 +1,3 @@ +#!/bin/bash + +wmake diff --git a/OFtutorial04_basicFieldOperations/Allwclean b/OFtutorial04_basicFieldOperations/Allwclean new file mode 100755 index 0000000..54329d4 --- /dev/null +++ b/OFtutorial04_basicFieldOperations/Allwclean @@ -0,0 +1,3 @@ +#!/bin/bash + +wclean diff --git a/OFtutorial04_basicFieldOperations/Allwmake b/OFtutorial04_basicFieldOperations/Allwmake new file mode 100755 index 0000000..a0b61c2 --- /dev/null +++ b/OFtutorial04_basicFieldOperations/Allwmake @@ -0,0 +1,3 @@ +#!/bin/bash + +wmake diff --git a/OFtutorial05_basicParallelComputing/Allwclean b/OFtutorial05_basicParallelComputing/Allwclean new file mode 100755 index 0000000..54329d4 --- /dev/null +++ b/OFtutorial05_basicParallelComputing/Allwclean @@ -0,0 +1,3 @@ +#!/bin/bash + +wclean diff --git a/OFtutorial05_basicParallelComputing/Allwmake b/OFtutorial05_basicParallelComputing/Allwmake new file mode 100755 index 0000000..a0b61c2 --- /dev/null +++ b/OFtutorial05_basicParallelComputing/Allwmake @@ -0,0 +1,3 @@ +#!/bin/bash + +wmake diff --git a/OFtutorial06_customClasses/Allwclean b/OFtutorial06_customClasses/Allwclean new file mode 100755 index 0000000..54329d4 --- /dev/null +++ b/OFtutorial06_customClasses/Allwclean @@ -0,0 +1,3 @@ +#!/bin/bash + +wclean diff --git a/OFtutorial06_customClasses/Allwmake b/OFtutorial06_customClasses/Allwmake new file mode 100755 index 0000000..a0b61c2 --- /dev/null +++ b/OFtutorial06_customClasses/Allwmake @@ -0,0 +1,3 @@ +#!/bin/bash + +wmake diff --git a/OFtutorial08_customBC/testCase/Allrun b/OFtutorial08_customBC/testCase/Allrun index 24d09be..8ad1890 100755 --- a/OFtutorial08_customBC/testCase/Allrun +++ b/OFtutorial08_customBC/testCase/Allrun @@ -14,8 +14,8 @@ mpirun -np 4 simpleFoam -parallel > log.run 2>&1 reconstructPar -latestTime > log.reconstruct 2>&1 -yPlus -latestTime > log.yPlus -sample -latestTime > log.sample +simpleFoam -postProcess -func yPlus -latestTime > log.yPlus +simpleFoam -postProcess -func sample -latestTime > log.sample rm -r processor* diff --git a/OFtutorial09_runtimePostprocessingUtility/Allwclean b/OFtutorial09_runtimePostprocessingUtility/Allwclean new file mode 100755 index 0000000..b67815e --- /dev/null +++ b/OFtutorial09_runtimePostprocessingUtility/Allwclean @@ -0,0 +1,3 @@ +#!/bin/bash + +wclean libso diff --git a/OFtutorial09_runtimePostprocessingUtility/Allwmake b/OFtutorial09_runtimePostprocessingUtility/Allwmake new file mode 100755 index 0000000..ca4a742 --- /dev/null +++ b/OFtutorial09_runtimePostprocessingUtility/Allwmake @@ -0,0 +1,3 @@ +#!/bin/bash + +wmake libso diff --git a/OFtutorial10_transportEquation/Allwclean b/OFtutorial10_transportEquation/Allwclean new file mode 100755 index 0000000..54329d4 --- /dev/null +++ b/OFtutorial10_transportEquation/Allwclean @@ -0,0 +1,3 @@ +#!/bin/bash + +wclean diff --git a/OFtutorial10_transportEquation/Allwmake b/OFtutorial10_transportEquation/Allwmake new file mode 100755 index 0000000..a0b61c2 --- /dev/null +++ b/OFtutorial10_transportEquation/Allwmake @@ -0,0 +1,3 @@ +#!/bin/bash + +wmake diff --git a/OFtutorial10_transportEquation/testCase/Allrun b/OFtutorial10_transportEquation/testCase/Allrun index 12f5e47..c1274ff 100755 --- a/OFtutorial10_transportEquation/testCase/Allrun +++ b/OFtutorial10_transportEquation/testCase/Allrun @@ -2,4 +2,4 @@ blockMesh > log.blockMesh ofTutorial10 -paraview --state=viewData.pvsm +echo "Now run: paraview --state=viewData.pvsm" diff --git a/OFtutorial11_modifyingTheMesh/Allwclean b/OFtutorial11_modifyingTheMesh/Allwclean new file mode 100755 index 0000000..54329d4 --- /dev/null +++ b/OFtutorial11_modifyingTheMesh/Allwclean @@ -0,0 +1,3 @@ +#!/bin/bash + +wclean diff --git a/OFtutorial11_modifyingTheMesh/Allwmake b/OFtutorial11_modifyingTheMesh/Allwmake new file mode 100755 index 0000000..a0b61c2 --- /dev/null +++ b/OFtutorial11_modifyingTheMesh/Allwmake @@ -0,0 +1,3 @@ +#!/bin/bash + +wmake diff --git a/OFtutorial11_modifyingTheMesh/testCase/Allrun b/OFtutorial11_modifyingTheMesh/testCase/Allrun index 3f6e0e0..01cd852 100755 --- a/OFtutorial11_modifyingTheMesh/testCase/Allrun +++ b/OFtutorial11_modifyingTheMesh/testCase/Allrun @@ -3,4 +3,4 @@ blockMesh > log.blockMesh ofTutorial11 checkMesh -constant -allTopology -allGeometry -paraview --state=viewGrid.pvsm +echo "Now run: paraview --state=viewGrid.pvsm" diff --git a/OFtutorial11_modifyingTheMesh/testCase/viewGrid.pvsm b/OFtutorial11_modifyingTheMesh/testCase/viewGrid.pvsm index 65ffc51..875e7fc 100644 --- a/OFtutorial11_modifyingTheMesh/testCase/viewGrid.pvsm +++ b/OFtutorial11_modifyingTheMesh/testCase/viewGrid.pvsm @@ -55,7 +55,7 @@ - + @@ -99,21 +99,21 @@ - - + + - + - - + + - + @@ -121,11 +121,11 @@ - + - + - + @@ -151,34 +151,34 @@ - + - - + + - + - + - + - + - + - + - + - + @@ -216,24 +216,24 @@ - + - + - + - + - + - + - + - + @@ -243,51 +243,51 @@ - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + @@ -297,873 +297,513 @@ - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - + + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + @@ -1179,22 +819,22 @@ - - + + - + - - - + + + - - + + - + - + @@ -1204,53 +844,53 @@ - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1258,907 +898,907 @@ - + - - - - - - - + + + + + + + - + - + - + - + - - + + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - - + + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + @@ -2174,22 +1814,22 @@ - - + + - + - - - + + + - - + + - + - + @@ -2199,53 +1839,53 @@ - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -2253,907 +1893,907 @@ - + - - - - - - - + + + + + + + - + - + - + - + - - + + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - - + + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + @@ -3169,22 +2809,22 @@ - - + + - + - - - + + + - - + + - + - + @@ -3194,53 +2834,53 @@ - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -3248,907 +2888,907 @@ - + - - - - - - - + + + + + + + - + - + - + - + - - + + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - - + + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + @@ -4164,22 +3804,22 @@ - - + + - + - - - + + + - - + + - + - + @@ -4189,53 +3829,53 @@ - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -4243,907 +3883,907 @@ - + - - - - - - - + + + + + + + - + - + - + - + - - + + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - - + + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + @@ -5159,22 +4799,22 @@ - - + + - + - - - + + + - - + + - + - + @@ -5184,53 +4824,53 @@ - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -5238,907 +4878,907 @@ - + - - - - - - - + + + + + + + - + - + - + - + - - + + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - - + + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + @@ -6154,22 +5794,22 @@ - - + + - + - - - + + + - - + + - + - + @@ -6179,481 +5819,841 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - + - + - - - + + + - + - + - - - - - - - + + + - - - + + + + + - - - + + + + + + + - - - + + + - + - + - + - + - + - - - - - + - + - + - + - + - - - + - - - + + + + + + + - - - + + + - - + + + - + + - - - - - - - + + + - - - + + + - + + - + - - - - - + + + + + - - - + + + - - - + + + - + - - - + - + - + - - - + + + - - - + + + + + - - - + + + + + + + - - - + + + - + - + - - - + + + - + - + - - - + + + + + + + + + - + - + - + - + - - - + + + - + + + + + - - + + + + - + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - - - + + + - - - + + + - - + + - + - - - + + + + - - - + + + - - - + + + + + + + + + + + + + + + + + - + - - - - + + + + + + + + + + + + + + + + + + - - + + + - - - + + + + + + + + + + - + - + - + - - - - - + - - - + + + - - + + + + + - + - - - + + + + - - - - - - - + + + - - - + + + - + - - - + - - - - - - - - - + + + - - - - - + + + - - - + + + + + - - - - - - + + + + + + - - - + + + - + - + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - + + + + + - - - - - + + + + + - - - - + + + + - + - + @@ -6662,7 +6662,7 @@ - + @@ -6670,51 +6670,51 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -6724,25 +6724,25 @@ - - + + - + - - - + + + - + - + @@ -6751,345 +6751,345 @@ - + - + - + - + - + - + - + - + - - - - - - - - - - - - + + + + + + + + + + + + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - - - - - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + @@ -7108,28 +7108,28 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - + - + @@ -7138,7 +7138,7 @@ - + @@ -7146,51 +7146,51 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -7200,25 +7200,25 @@ - - + + - + - - - + + + - + - + @@ -7227,345 +7227,345 @@ - + - + - + - + - + - + - + - + - - - - + + + + + + + + - - - - - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - - - - - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + @@ -7584,28 +7584,28 @@ - - - - - + + + + + - - - - - + + + + + - - - - + + + + - + - + @@ -7614,7 +7614,7 @@ - + @@ -7622,51 +7622,51 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -7676,25 +7676,25 @@ - - + + - + - - - + + + - + - + @@ -7703,345 +7703,345 @@ - + - + - + - + - + - + - + - + - - - - - - - - - - - - + + + + + + + + + + + + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - - - - - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + @@ -8060,28 +8060,28 @@ - - - - - + + + + + - - - - - + + + + + - - - - + + + + - + - + @@ -8090,7 +8090,7 @@ - + @@ -8098,51 +8098,51 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -8152,25 +8152,25 @@ - - + + - + - - - + + + - + - + @@ -8179,345 +8179,345 @@ - + - + - + - + - + - + - + - + - - - - - - - - - - - - + + + + + + + + + + + + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - - - - - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + @@ -8536,28 +8536,28 @@ - - - - - + + + + + - - - - - + + + + + - - - - + + + + - + - + @@ -8566,7 +8566,7 @@ - + @@ -8574,51 +8574,51 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -8628,25 +8628,25 @@ - - + + - + - - - + + + - + - + @@ -8655,345 +8655,345 @@ - + - + - + - + - + - + - + - + - - - - - - - - - - - - + + + + + + + + + + + + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - - - - - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + @@ -9012,28 +9012,28 @@ - - - - - + + + + + - - - - - + + + + + - - - - + + + + - + - + @@ -9042,7 +9042,7 @@ - + @@ -9050,51 +9050,51 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -9104,25 +9104,25 @@ - - + + - + - - - + + + - + - + @@ -9131,345 +9131,345 @@ - + - + - + - + - + - + - + - + - - - - - - - - - - - - + + + + + + + + + + + + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - - - - - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + @@ -9488,209 +9488,209 @@ - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -9701,194 +9701,213 @@ - - + + - + - - - - + + + + - + - + - + - + - - + + - + - - - - + + + + - + - + - + - + - - + + - + - - - - + + + + - + - + - + - + - - + + - + - - - - + + + + - + - + - + - + - - + + - + - - - - + + + + - + - + - + - + - - + + - + - - - + + + - + - + - - - - - - - + + + + + + + - + + + + + + + - + - - - - - - - - - + + + + + + + + + - + - + + + + + + + + + - + + - - - + + + - - - + + + + + + - + + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - - - + + + @@ -9905,88 +9924,88 @@ - - - - - - + + + + + + - + - - + + - + - + - + - + - + - + - + - + - + - - - - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - + - + @@ -9996,7 +10015,7 @@ - + @@ -10005,11 +10024,11 @@ - + - + - + @@ -10019,7 +10038,7 @@ - + @@ -10029,250 +10048,250 @@ - + - + - + - + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - + + + + + + + + - + - + - + - + - + - - + + - + @@ -10286,26 +10305,26 @@ - + - + - + - + - - + + - + - + - + - + - + @@ -10318,104 +10337,102 @@ - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -10423,246 +10440,246 @@ - + - + - + - - + + - - + + + + + + + + + + + + - - - - - - - - - - - - + + - - - - - + + + + + + - - - - - - + + + + + - - + + + + + + + + + + + + - - - - - - - - - - - - + + - - + + + + + + + + + + + + - - - - - - - - - - - - + + - - + + + + + + + + + + + + - - - - - - - - - - - - + + - - + + + + + + + + + + + + - - - - - - - - - - - - + + - - - - - - + + + + + + - + - - - - - - + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OFtutorial12_momentumSource/Allwclean b/OFtutorial12_momentumSource/Allwclean new file mode 100755 index 0000000..b67815e --- /dev/null +++ b/OFtutorial12_momentumSource/Allwclean @@ -0,0 +1,3 @@ +#!/bin/bash + +wclean libso diff --git a/OFtutorial12_momentumSource/Allwmake b/OFtutorial12_momentumSource/Allwmake new file mode 100755 index 0000000..ca4a742 --- /dev/null +++ b/OFtutorial12_momentumSource/Allwmake @@ -0,0 +1,3 @@ +#!/bin/bash + +wmake libso diff --git a/OFtutorial12_momentumSource/testCase/Allrun b/OFtutorial12_momentumSource/testCase/Allrun index d2a4458..8fa0574 100755 --- a/OFtutorial12_momentumSource/testCase/Allrun +++ b/OFtutorial12_momentumSource/testCase/Allrun @@ -2,4 +2,4 @@ blockMesh > log.blockMesh simpleFoam -paraview --state=viewData.pvsm +echo "Now run: paraview --state=viewData.pvsm" diff --git a/README.md b/README.md index 854764b..c7f3fac 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,14 @@ approachable than most of the materials available on-line, which tend to assume that the user is proficient in the C++ programming language. Please see below for a brief summary of what each individual tutorial covers and how to use it. -The tutorials were originally developed for OpenFOAM 3.0.1 but have since been -upgraded to work with OpenFOAM 5.x from the https://openfoam.org/ branch. +Current version of the tutorials is compatibile with the following OpenFOAM versions +from the https://openfoam.org/ branch: +- OpenFOAM 5.x +- OpenFOAM 6 version 6 The "OldReleases" folder contains versions of the tutorials compatibile with past -OpenFOAM versions. Complete backwards compatibility has been dropped, however, +OpenFOAM versions, namely: +- OpenFOAM 3.0.1 +Complete backwards compatibility has been dropped, however, and hence the older tutorials will be lacking in content (they should still all work though!). @@ -42,12 +46,25 @@ offering of tutorials. Instead, each tutorial is a separate, stand-alone piece of code illustrating functionality of OpenFOAM from a programmer's perspective. They are, however, organised in an approximately increasing level of complexity so for new users it's advisable to make your way from start to finish. More experienced -users on the other hand may wish to pick up bits and pieces here and there. +users, on the other hand, may wish to pick up bits and pieces here and there. Each tutorial consists of code and a simple test case that demonstrates its -functionality. Most of them can be simply compiled with ```wmake``` and the test -case executed with ```Allrun``` but the list below explains the detail for each -particular case. +functionality. Most of the tutorials can be simply compiled with ```wmake``` and +the test case executed with ```Allrun```. Deviations from this occur when compiling +libraries and hence compilation and clean-up ```Allwmake``` and ```Allwclean``` +scripts are contained in each tutorial directory to make their structure identical. +Therefore, to run each tutorial simply execute the following from its top-level +directory: + +``` +./Allwmake +cd testCase +./Allrun +``` + +There is also a ```testAll``` scripts that sequentially builds and tests each of +the tutorials while supressing all screen output. This is useful mostly for +checking version compatibility. As there is no written narrative aside from the brief summaries below, all of the explanations are given in the form of comments in the code and in the test @@ -69,63 +86,28 @@ OPENFOAM® and OpenCFD® trade marks. Presents a basic OpenFOAM executable which prints a simple, yet important, message. -To run: -``` -wmake -cd testCase -./Allrun -``` - --------- ## Tutorial 1 - Input and output Shows how to read information from dictionaries and output it into files. -To run: -``` -wmake -cd testCase -./Allrun -``` - --------- ## Tutorial 2 - Command line arguments Shows how to pass arguments and options to custom applications. -To run: -``` -wmake -cd testCase -./Allrun -``` - --------- ## Tutorial 3 - Understanding the mesh Discusses how the OpenFOAM mesh description works and introduces the code interface used to interact with the grid. -To run: -``` -wmake -cd testCase -./Allrun -``` - --------- ## Tutorial 4 - Basic field operations Introduces the idea of a field object, reading values from OF-native files using built-in operators, as well as calculating field values by hand. -To run: -``` -wmake -cd testCase -./Allrun -``` - --------- ## Tutorial 5 - Basic parallel computing @@ -135,13 +117,6 @@ OpenFOAM handles parallel domain decomposition is described, basic operators used for communication between parallel nodes are shown, and the basic solver is upgraded to work in parallel. -To run: -``` -wmake -cd testCase -./Allrun -``` - --------- ## Tutorial 6 - Custom classes @@ -151,13 +126,6 @@ object. This is done by extending from the IOdictionary, with the aim of adding a custom method which lists the contents of the dict file, while keeping all of the baseline functionality. -To run: -``` -wmake -cd testCase -./Allrun -``` - --------- ## Tutorial 7 - Custom libraries @@ -166,13 +134,6 @@ done by moving the key functionality of the "solver" from Tutorials 4 and 5 into an independent library, and then linking that against the rest of the solver code. -To run: -``` -./Allwmake -cd testCase -./Allrun -``` - --------- ## Tutorial 8 - Custom boundary condition @@ -195,13 +156,6 @@ a low-end machine. The effect of the boundary condition may be visualised by plotting the x-velocity through the pipe and noting the incident boundary layer profile at the inlet and how it affects the solution. -To run: -``` -./Allwmake -cd testCase -./Allrun -``` - --------- ## Tutorial 9 - Runtime post processing utility @@ -227,13 +181,6 @@ visualised by selecting "Include zones" in paraview and applying the "Extract block" filter. As the simpleFoam solver is run, the output file gets created by the utility in the postProcessing directory. -To run: -``` -wmake libso -cd testCase -./Allrun -``` - --------- ## Tutorial 10 - Transport equation @@ -256,13 +203,6 @@ field convecting away from the beta inlets. Once the case is run, it is best to visualise the initial conditions in the "beta" field and the solution to the transport equation saved as the "result" field. -To run: -``` -wmake -cd testCase -./Allrun -``` - Recommended reading: - Wikipedia is always a good start: https://en.wikipedia.org/wiki/Convection%E2%80%93diffusion_equation @@ -281,13 +221,6 @@ Recommended reading: Demonstrates how to use points to generate different cell types, patches, and export the finished grid to an OpenFOAM case. -To run: -``` -wmake -cd testCase -./Allrun -``` - Also recommended to view the 'meshPoints.pdf' or Gmsh files to get a better idea of how the mesh is actually constructed from points. @@ -307,11 +240,4 @@ object is structured and how it may be modified to suit ones needs. It is a bit more applied than the previous ones but hopefully will be useful to at least a few people. -To run: -``` -wmake -cd testCase -./Allrun -``` - ![Alt text](OFtutorial12_momentumSource/testCase/Umagnitude.png?raw=true "Tutorial 12 - velocity affected by a momentum source") diff --git a/testAll b/testAll new file mode 100755 index 0000000..0bdc081 --- /dev/null +++ b/testAll @@ -0,0 +1,41 @@ +#!/bin/bash + +# === +# Script for automatically compiling, running and testing all of the tutorials. +# === + +# run a command and redirect outputs to /dev/null, only print PASS or FAIL +# depending on whether errors occured or not +run () { + # run the command and get rid of the outputs + $1 >/dev/null 2>&1 + # check return code, 0 indicates success + if [ $? -eq 0 ]; then + echo " PASS: "$1 + else + echo " FAIL: "$1 + fi +} + +# go over all tutorial directories +for tutorialDir in */ ; do + if [[ $tutorialDir = *OFtutorial* ]]; then + echo "Checking:" $tutorialDir + + # navigate to the tutorial + cd $tutorialDir + # no need to test cleaning the code + ./Allwclean >/dev/null 2>&1 + + # test building and running + run ./Allwmake + cd testCase + run ./Allrun + + # no need to test cleaning the test case + ./Allclean >/dev/null 2>&1 + + # go back to main directory + cd ../.. + fi +done