diff --git a/Allwmake b/Allwmake index a75a1d46..4877a891 100755 --- a/Allwmake +++ b/Allwmake @@ -5,6 +5,9 @@ cd "${0%/*}" || exit # Run from this directory #------------------------------------------------------------------------------ foamv=${WM_PROJECT_VERSION} +curr_branch=$(git branch --show-current) +if [[ $curr_branch == "master" || $curr_branch == "v2212" ]]; then +# Switch branches if necessary if [[ $foamv =~ ^v([0-9]{4})$ ]]; then ver=${BASH_REMATCH[1]} if [ "${ver}" -eq "2106" ]; then @@ -22,6 +25,7 @@ else echo "${WM_PROJECT}-${foamv} is not supported, this toolkit only works with OpenCFD's releases of OpenFOAM." exit 1 fi +fi #------------------------------------------------------------------------------ diff --git a/src/errorEstimators/gradientRange/gradientRange.C b/src/errorEstimators/gradientRange/gradientRange.C index c968c509..98b0c071 100644 --- a/src/errorEstimators/gradientRange/gradientRange.C +++ b/src/errorEstimators/gradientRange/gradientRange.C @@ -115,4 +115,3 @@ void gradientEstimator::update(const bool scale) } // End namespace Foam // ************************************************************************* // - diff --git a/tutorials/damBreak2D/Allrun b/tutorials/damBreak2D/Allrun index 4ddb69a8..c9fe9403 100755 --- a/tutorials/damBreak2D/Allrun +++ b/tutorials/damBreak2D/Allrun @@ -3,6 +3,7 @@ cd "${0%/*}" || exit # Run from this directory . ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions #------------------------------------------------------------------------------ +set -e restore0Dir runApplication blockMesh @@ -21,6 +22,6 @@ for i in $(seq 1 $maxRef); do done cp -rT 0/polyMesh constant/polyMesh runApplication decomposePar -constant -#mpirun -np 8 --output-filename log interFoam -parallel +mpirun -np 4 --output-filename log interFoam -parallel #------------------------------------------------------------------------------ diff --git a/tutorials/damBreak2D/system/controlDict b/tutorials/damBreak2D/system/controlDict index 8325d4dd..fab83d50 100644 --- a/tutorials/damBreak2D/system/controlDict +++ b/tutorials/damBreak2D/system/controlDict @@ -60,6 +60,9 @@ maxAlphaCo 1; maxDeltaT 1; -//#sinclude "sampling" +functions +{ + #include "sampling" +} // ************************************************************************* // diff --git a/tutorials/damBreak2D/system/sampling b/tutorials/damBreak2D/system/sampling index f1d86f91..e23ae96d 100644 --- a/tutorials/damBreak2D/system/sampling +++ b/tutorials/damBreak2D/system/sampling @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v2012 | +| \\ / O peration | Version: v2112 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -14,41 +14,69 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -functions +__surfaceFieldValue { - sampleSets + type surfaceFieldValue; + libs (fieldFunctionObjects); + log on; + enabled true; + writeControl timeStep; + writeInterval 1; + writeFields false; + surfaceFormat vtk; +} + + +// * * * * * * * * * * * * * * * * Sampling * * * * * * * * * * * * * * * * // + +// Sample volume fields to surfaces and hold on registry. +sampled +{ + type surfaces; + libs (sampling); + log true; + + executeControl timeStep; + executeInterval 1; + writeControl none; + sampleOnExecute true; + surfaceFormat none; + fields ( p U ); + surfaces + { + walls + { + type patch; + patches ( ".*Wall" ); + // triangulate false; + } + } +} + + +// * * * * * * * * * * * * * * * Calculations * * * * * * * * * * * * * * * // + +nonWeightedAreaAverage +{ + ${__surfaceFieldValue} + enabled true; + + regionType sampledSurface; + name sampledTriSurf; + sampledSurfaceDict { - type sets; - libs (sampling); - - writeControl timeStep; - writeInterval 1; - - setFormat vtk; - interpolationScheme cellPointFace; - fields ( alpha.water ); - - sets - ( - gauge_1 - { - type face; - axis y; - start (0.02 0.20 0.005); - end (0.02 0.25 0.005); - nPoints 100; - } - - gauge_2 - { - type face; - axis y; - start (0.2 0.03 0.005); - end (0.2 0.55 0.005); - nPoints 100; - } - ); + type patch; + patches ( ".*Wall" ); + interpolate true; } + + operation areaAverage; + fields ( p U ); } +// * * * * * * * * * * * * * * * * * Cleanup * * * * * * * * * * * * * * * * // + +#remove "__.*" + + // ************************************************************************* //