TUT: add parallel version for various squareBend cases

- adjust commented-out evaluation to avoid warnings.

  With code like this
  ```
  #if 0
  nxin    #eval{ round($nxin / 5) };
  #endif
  ```

  The handling of the "#if 0 / #endif" clause uses the plain ISstream
  parser to tokenize. This means that the "round(" is parsed as a word
  with a mismatched closing ')', whereas the "#eval" parser will slurp
  everything in until the closing brace and send it off as a string
  to the expression parser.
This commit is contained in:
Mark Olesen 2021-06-17 10:20:10 +02:00
parent a3d90ae9b9
commit 096b9dc52e
25 changed files with 151 additions and 100 deletions

View File

@ -3,10 +3,8 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
cleanCase
cleanCase0
rm -f constant/polyMesh/boundary
rm -f constant/polyMesh/zoneID
rm -rf 0
#------------------------------------------------------------------------------

View File

@ -1,6 +1,7 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
cleanCase

View File

@ -1,8 +1,10 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
cleanCase
rm constant/polyMesh/boundary
rm -f constant/polyMesh/boundary
#------------------------------------------------------------------------------

View File

@ -1,6 +1,7 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
runApplication blockMesh
runApplication extrudeMesh

View File

@ -1,8 +0,0 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
cleanCase0
#------------------------------------------------------------------------------

View File

@ -3,11 +3,7 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
restore0Dir
runApplication blockMesh
runApplication topoSet
./Allrun.pre
runApplication $(getApplication)

View File

@ -1,8 +1,12 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
cleanCase0
./Allrun.pre
runApplication decomposePar
runParallel $(getApplication)
#------------------------------------------------------------------------------

View File

@ -1,10 +1,12 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
cleanCase0
restore0Dir
rm -rf constant/triSurface
runApplication blockMesh
runApplication topoSet
#------------------------------------------------------------------------------

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2012 |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -34,9 +34,9 @@ xin #eval{ $xin / 5 };
xout #eval{ $xout / 5 };
zmax #eval{ $zmax / 5 };
nxin #eval{ round($nxin / 5) };
nxout #eval{ round($nxout / 5) };
nz #eval{ round($nz / 5) };
nxin #eval{ round ($nxin / 5) };
nxout #eval{ round ($nxout / 5) };
nz #eval{ round ($nz / 5) };
#endif
zmin #eval{ -$zmax };

View File

@ -3,30 +3,7 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
restore0Dir
cp -rf \
"$FOAM_TUTORIALS"/resources/geometry/squareBend \
constant/triSurface
runApplication blockMesh
# Extract some faces for sampling
runApplication surfaceMeshExtract \
-patches inlet -time 0 \
constant/triSurface/inlet_sample0.obj
# Recentre and inflate
runApplication surfaceTransformPoints \
-recentre \
-scale 3.5 \
constant/triSurface/inlet_sample0.obj \
constant/triSurface/inlet_sample1.obj
# Finer mesh
runApplication surfaceRefineRedGreen \
constant/triSurface/inlet_sample1.obj \
constant/triSurface/oversized_sample.obj
./Allrun.pre
runApplication $(getApplication)

View File

@ -0,0 +1,12 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
./Allrun.pre
runApplication decomposePar
runParallel $(getApplication)
#------------------------------------------------------------------------------

View File

@ -0,0 +1,32 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
restore0Dir
cp -rf \
"$FOAM_TUTORIALS"/resources/geometry/squareBend \
constant/triSurface
runApplication blockMesh
# Extract some faces for sampling
runApplication surfaceMeshExtract \
-patches inlet -time 0 \
constant/triSurface/inlet_sample0.obj
# Recentre and inflate
runApplication surfaceTransformPoints \
-recentre \
-scale 3.5 \
constant/triSurface/inlet_sample0.obj \
constant/triSurface/inlet_sample1.obj
# Finer mesh
runApplication surfaceRefineRedGreen \
constant/triSurface/inlet_sample1.obj \
constant/triSurface/oversized_sample.obj
#------------------------------------------------------------------------------

View File

@ -3,11 +3,7 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
restore0Dir
runApplication blockMesh
runApplication topoSet
./Allrun.pre
runApplication $(getApplication)

View File

@ -0,0 +1,12 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
./Allrun.pre
runApplication decomposePar
runParallel $(getApplication)
#------------------------------------------------------------------------------

View File

@ -1,10 +1,12 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
cleanCase0
restore0Dir
rm -rf constant/triSurface
runApplication blockMesh
runApplication topoSet
#------------------------------------------------------------------------------

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2012 |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -34,9 +34,9 @@ xin #eval{ $xin / 5 };
xout #eval{ $xout / 5 };
zmax #eval{ $zmax / 5 };
nxin #eval{ round($nxin / 5) };
nxout #eval{ round($nxout / 5) };
nz #eval{ round($nz / 5) };
nxin #eval{ round ($nxin / 5) };
nxout #eval{ round ($nxout / 5) };
nz #eval{ round ($nz / 5) };
#endif
zmin #eval{ -$zmax };

View File

@ -3,11 +3,7 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
restore0Dir
runApplication blockMesh
runApplication topoSet
./Allrun.pre
runApplication $(getApplication)

View File

@ -0,0 +1,12 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
./Allrun.pre
runApplication decomposePar
runParallel $(getApplication)
#------------------------------------------------------------------------------

View File

@ -1,8 +1,12 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
cleanCase0
restore0Dir
runApplication blockMesh
runApplication topoSet
#------------------------------------------------------------------------------

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2012 |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -34,9 +34,9 @@ xin #eval{ $xin / 5 };
xout #eval{ $xout / 5 };
zmax #eval{ $zmax / 5 };
nxin #eval{ round($nxin / 5) };
nxout #eval{ round($nxout / 5) };
nz #eval{ round($nz / 5) };
nxin #eval{ round ($nxin / 5) };
nxout #eval{ round ($nxout / 5) };
nz #eval{ round ($nz / 5) };
#endif
zmin #eval{ -$zmax };

View File

@ -1,8 +0,0 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
cleanCase
#------------------------------------------------------------------------------

View File

@ -3,17 +3,7 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
mkdir -p constant/triSurface
cp -f \
"$FOAM_TUTORIALS"/resources/geometry/angledPlane.obj.gz \
constant/triSurface
restore0Dir
runApplication blockMesh
runApplication topoSet
./Allrun.pre
runApplication $(getApplication)

View File

@ -0,0 +1,12 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
./Allrun.pre
runApplication decomposePar
runParallel $(getApplication)
#------------------------------------------------------------------------------

View File

@ -0,0 +1,18 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
mkdir -p constant/triSurface
cp -f \
"$FOAM_TUTORIALS"/resources/geometry/angledPlane.obj.gz \
constant/triSurface
restore0Dir
runApplication blockMesh
runApplication topoSet
#------------------------------------------------------------------------------

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2012 |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -34,9 +34,9 @@ xin #eval{ $xin / 5 };
xout #eval{ $xout / 5 };
zmax #eval{ $zmax / 5 };
nxin #eval{ round($nxin / 5) };
nxout #eval{ round($nxout / 5) };
nz #eval{ round($nz / 5) };
nxin #eval{ round ($nxin / 5) };
nxout #eval{ round ($nxout / 5) };
nz #eval{ round ($nz / 5) };
#endif
zmin #eval{ -$zmax };