From ce45a129188cc27483a979597975c8bbda52b32a Mon Sep 17 00:00:00 2001 From: Mark Olesen <Mark.Olesen@esi-group.com> Date: Mon, 8 Mar 2021 16:31:57 +0100 Subject: [PATCH] TUT: improve parameterization of squareBend geometry - orient blocks in global x/y/z. Provisioning for coarser/smaller geometries. --- .../rhoPimpleFoam/RAS/squareBendLiq/Allrun | 10 ++ .../RAS/squareBendLiq/system/blockMeshDict | 102 +++++++++++------- .../RAS/squareBendLiq/system/controlDict | 2 +- .../RAS/squareBendLiq/system/topoSetDict | 57 ++++++++++ .../rhoSimpleFoam/squareBendLiq/Allrun | 10 ++ .../squareBendLiq/system/blockMeshDict | 102 +++++++++++------- .../squareBendLiq/system/controlDict | 2 +- .../squareBendLiq/system/topoSetDict | 57 ++++++++++ .../squareBendLiqNoNewtonian/Allrun | 10 ++ .../system/blockMeshDict | 102 +++++++++++------- .../system/controlDict | 2 +- .../system/topoSetDict | 57 ++++++++++ .../simpleFoam/squareBend/Allrun | 10 ++ .../squareBend/system/blockMeshDict | 102 +++++++++++------- .../simpleFoam/squareBend/system/controlDict | 2 +- .../simpleFoam/squareBend/system/topoSetDict | 57 ++++++++++ 16 files changed, 520 insertions(+), 164 deletions(-) create mode 100755 tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/Allrun create mode 100644 tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/topoSetDict create mode 100755 tutorials/compressible/rhoSimpleFoam/squareBendLiq/Allrun create mode 100644 tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/topoSetDict create mode 100755 tutorials/compressible/rhoSimpleFoam/squareBendLiqNoNewtonian/Allrun create mode 100644 tutorials/compressible/rhoSimpleFoam/squareBendLiqNoNewtonian/system/topoSetDict create mode 100755 tutorials/incompressible/simpleFoam/squareBend/Allrun create mode 100644 tutorials/incompressible/simpleFoam/squareBend/system/topoSetDict diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/Allrun b/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/Allrun new file mode 100755 index 00000000000..9ed5ee1f12d --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/Allrun @@ -0,0 +1,10 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ + +runApplication blockMesh +runApplication topoSet +runApplication $(getApplication) + +#------------------------------------------------------------------------------ diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/blockMeshDict b/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/blockMeshDict index 41793732c11..05f716b2595 100644 --- a/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/blockMeshDict +++ b/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/blockMeshDict @@ -16,62 +16,85 @@ FoamFile scale 0.001; -zmin -25; -zmax 25; +xin -50; +xout -500; +rad0 25; +rad1 75; +zmax 25; + +nxin 20; +nxout 200; +nxbend 30; +ny 20; +nz 20; + +// Coarser and smaller +#if 0 +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) }; +#endif + +zmin #eval{ -$zmax }; +mrad0 #eval{ -$rad0 }; +mrad1 #eval{ -$rad1 }; vertices ( - // front-plane: + // back-plane: // inlet region - ( -50 25 $zmax) // pt 0 - ( 0 25 $zmax) // pt 1 - ( -50 75 $zmax) // pt 2 - ( 0 75 $zmax) // pt 3 + ( $xin $rad0 $zmin) // pt 0 + ( 0 $rad0 $zmin) // pt 1 + ( 0 $rad1 $zmin) // pt 2 + ( $xin $rad1 $zmin) // pt 3 // outlet region - ( -500 -75 $zmax) // pt 4 - ( 0 -75 $zmax) // pt 5 - ( -500 -25 $zmax) // pt 6 - ( 0 -25 $zmax) // pt 7 + ( $xout $mrad1 $zmin) // pt 4 + ( 0 $mrad1 $zmin) // pt 5 + ( 0 $mrad0 $zmin) // pt 6 + ( $xout $mrad0 $zmin) // pt 7 // bend mid-points - ( 25 0 $zmax) // pt 8 - ( 75 0 $zmax) // pt 9 - // back-plane: + ( $rad0 0 $zmin) // pt 8 + ( $rad1 0 $zmin) // pt 9 + // front-plane: // inlet region - ( -50 25 $zmin) // pt 0 + 10 - ( 0 25 $zmin) // pt 1 + 10 - ( -50 75 $zmin) // pt 2 + 10 - ( 0 75 $zmin) // pt 3 + 10 + ( $xin $rad0 $zmax) // pt 0 + 10 + ( 0 $rad0 $zmax) // pt 1 + 10 + ( 0 $rad1 $zmax) // pt 2 + 10 + ( $xin $rad1 $zmax) // pt 3 + 10 // outlet region - ( -500 -75 $zmin) // pt 4 + 10 - ( 0 -75 $zmin) // pt 5 + 10 - ( -500 -25 $zmin) // pt 7 + 10 - ( 0 -25 $zmin) // pt 8 + 10 + ( $xout $mrad1 $zmax) // pt 4 + 10 + ( 0 $mrad1 $zmax) // pt 5 + 10 + ( 0 $mrad0 $zmax) // pt 6 + 10 + ( $xout $mrad0 $zmax) // pt 7 + 10 // bend mid-points - ( 25 0 $zmin) // pt 8 + 10 - ( 75 0 $zmin) // pt 9 + 10 + ( $rad0 0 $zmax) // pt 8 + 10 + ( $rad1 0 $zmax) // pt 9 + 10 ); blocks ( - hex (0 1 11 10 2 3 13 12) inlet ( 20 20 20) simpleGrading (1 1 1) - hex (4 5 15 14 6 7 17 16) outlet (200 20 20) simpleGrading (1 1 1) - - hex (1 8 18 11 3 9 19 13) bend1 ( 30 20 20) simpleGrading (1 1 1) - hex (5 9 19 15 7 8 18 17) bend2 ( 30 20 20) simpleGrading (1 1 1) + hex (0 1 2 3 10 11 12 13) inlet ( $nxin $ny $nz) simpleGrading (1 1 1) + hex (4 5 6 7 14 15 16 17) outlet ( $nxout $ny $nz) simpleGrading (1 1 1) + hex (1 8 9 2 11 18 19 12) bend1 ( $nxbend $ny $nz) simpleGrading (1 1 1) + hex (5 9 8 6 15 19 18 16) bend2 ( $nxbend $ny $nz) simpleGrading (1 1 1) ); edges ( // block 2 - arc 1 8 origin (0 0 $zmax) - arc 3 9 origin (0 0 $zmax) - arc 11 18 origin (0 0 $zmin) - arc 13 19 origin (0 0 $zmin) + arc 1 8 origin (0 0 $zmin) + arc 2 9 origin (0 0 $zmin) + arc 11 18 origin (0 0 $zmax) + arc 12 19 origin (0 0 $zmax) // block 3 - arc 7 8 origin (0 0 $zmax) - arc 5 9 origin (0 0 $zmax) - arc 17 18 origin (0 0 $zmin) - arc 15 19 origin (0 0 $zmin) + arc 6 8 origin (0 0 $zmin) + arc 5 9 origin (0 0 $zmin) + arc 16 18 origin (0 0 $zmax) + arc 15 19 origin (0 0 $zmax) ); boundary @@ -81,7 +104,7 @@ boundary type patch; faces ( - (0 2 12 10) + (0 10 13 3) ); } @@ -90,7 +113,7 @@ boundary type patch; faces ( - (4 6 16 14) + (4 14 17 7) ); } ); @@ -99,7 +122,6 @@ mergePatchPairs ( ); - // The defaultFaces == outside "walls" defaultPatch { diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/controlDict b/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/controlDict index 40545e315fb..40791f57b93 100644 --- a/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/controlDict +++ b/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/controlDict @@ -32,7 +32,7 @@ writeInterval 10; purgeWrite 0; -writeFormat ascii; +writeFormat binary; writePrecision 6; diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/topoSetDict b/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/topoSetDict new file mode 100644 index 00000000000..f7c4777c15e --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/topoSetDict @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object topoSetDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +actions +( + { + name mid-plane; + type faceZoneSet; + action new; + source planeToFaceZone; + point (0 0 0); + normal (0 0 1); + } + { + name mid-plane; + type faceSet; + action new; + source zoneToFace; + zone mid-plane; + } + { + name mid-plane; + type faceSet; + action subset; + source boxToFace; + min (0 -1000 -1000); + max (1000 1000 1000); + } + { + name mid-plane; + type faceZoneSet; + action new; + source setToFaceZone; + faceSet mid-plane; + } + { + name mid-plane; + type faceSet; + action remove; + } +); + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoSimpleFoam/squareBendLiq/Allrun b/tutorials/compressible/rhoSimpleFoam/squareBendLiq/Allrun new file mode 100755 index 00000000000..9ed5ee1f12d --- /dev/null +++ b/tutorials/compressible/rhoSimpleFoam/squareBendLiq/Allrun @@ -0,0 +1,10 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ + +runApplication blockMesh +runApplication topoSet +runApplication $(getApplication) + +#------------------------------------------------------------------------------ diff --git a/tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/blockMeshDict b/tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/blockMeshDict index 41793732c11..05f716b2595 100644 --- a/tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/blockMeshDict +++ b/tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/blockMeshDict @@ -16,62 +16,85 @@ FoamFile scale 0.001; -zmin -25; -zmax 25; +xin -50; +xout -500; +rad0 25; +rad1 75; +zmax 25; + +nxin 20; +nxout 200; +nxbend 30; +ny 20; +nz 20; + +// Coarser and smaller +#if 0 +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) }; +#endif + +zmin #eval{ -$zmax }; +mrad0 #eval{ -$rad0 }; +mrad1 #eval{ -$rad1 }; vertices ( - // front-plane: + // back-plane: // inlet region - ( -50 25 $zmax) // pt 0 - ( 0 25 $zmax) // pt 1 - ( -50 75 $zmax) // pt 2 - ( 0 75 $zmax) // pt 3 + ( $xin $rad0 $zmin) // pt 0 + ( 0 $rad0 $zmin) // pt 1 + ( 0 $rad1 $zmin) // pt 2 + ( $xin $rad1 $zmin) // pt 3 // outlet region - ( -500 -75 $zmax) // pt 4 - ( 0 -75 $zmax) // pt 5 - ( -500 -25 $zmax) // pt 6 - ( 0 -25 $zmax) // pt 7 + ( $xout $mrad1 $zmin) // pt 4 + ( 0 $mrad1 $zmin) // pt 5 + ( 0 $mrad0 $zmin) // pt 6 + ( $xout $mrad0 $zmin) // pt 7 // bend mid-points - ( 25 0 $zmax) // pt 8 - ( 75 0 $zmax) // pt 9 - // back-plane: + ( $rad0 0 $zmin) // pt 8 + ( $rad1 0 $zmin) // pt 9 + // front-plane: // inlet region - ( -50 25 $zmin) // pt 0 + 10 - ( 0 25 $zmin) // pt 1 + 10 - ( -50 75 $zmin) // pt 2 + 10 - ( 0 75 $zmin) // pt 3 + 10 + ( $xin $rad0 $zmax) // pt 0 + 10 + ( 0 $rad0 $zmax) // pt 1 + 10 + ( 0 $rad1 $zmax) // pt 2 + 10 + ( $xin $rad1 $zmax) // pt 3 + 10 // outlet region - ( -500 -75 $zmin) // pt 4 + 10 - ( 0 -75 $zmin) // pt 5 + 10 - ( -500 -25 $zmin) // pt 7 + 10 - ( 0 -25 $zmin) // pt 8 + 10 + ( $xout $mrad1 $zmax) // pt 4 + 10 + ( 0 $mrad1 $zmax) // pt 5 + 10 + ( 0 $mrad0 $zmax) // pt 6 + 10 + ( $xout $mrad0 $zmax) // pt 7 + 10 // bend mid-points - ( 25 0 $zmin) // pt 8 + 10 - ( 75 0 $zmin) // pt 9 + 10 + ( $rad0 0 $zmax) // pt 8 + 10 + ( $rad1 0 $zmax) // pt 9 + 10 ); blocks ( - hex (0 1 11 10 2 3 13 12) inlet ( 20 20 20) simpleGrading (1 1 1) - hex (4 5 15 14 6 7 17 16) outlet (200 20 20) simpleGrading (1 1 1) - - hex (1 8 18 11 3 9 19 13) bend1 ( 30 20 20) simpleGrading (1 1 1) - hex (5 9 19 15 7 8 18 17) bend2 ( 30 20 20) simpleGrading (1 1 1) + hex (0 1 2 3 10 11 12 13) inlet ( $nxin $ny $nz) simpleGrading (1 1 1) + hex (4 5 6 7 14 15 16 17) outlet ( $nxout $ny $nz) simpleGrading (1 1 1) + hex (1 8 9 2 11 18 19 12) bend1 ( $nxbend $ny $nz) simpleGrading (1 1 1) + hex (5 9 8 6 15 19 18 16) bend2 ( $nxbend $ny $nz) simpleGrading (1 1 1) ); edges ( // block 2 - arc 1 8 origin (0 0 $zmax) - arc 3 9 origin (0 0 $zmax) - arc 11 18 origin (0 0 $zmin) - arc 13 19 origin (0 0 $zmin) + arc 1 8 origin (0 0 $zmin) + arc 2 9 origin (0 0 $zmin) + arc 11 18 origin (0 0 $zmax) + arc 12 19 origin (0 0 $zmax) // block 3 - arc 7 8 origin (0 0 $zmax) - arc 5 9 origin (0 0 $zmax) - arc 17 18 origin (0 0 $zmin) - arc 15 19 origin (0 0 $zmin) + arc 6 8 origin (0 0 $zmin) + arc 5 9 origin (0 0 $zmin) + arc 16 18 origin (0 0 $zmax) + arc 15 19 origin (0 0 $zmax) ); boundary @@ -81,7 +104,7 @@ boundary type patch; faces ( - (0 2 12 10) + (0 10 13 3) ); } @@ -90,7 +113,7 @@ boundary type patch; faces ( - (4 6 16 14) + (4 14 17 7) ); } ); @@ -99,7 +122,6 @@ mergePatchPairs ( ); - // The defaultFaces == outside "walls" defaultPatch { diff --git a/tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/controlDict b/tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/controlDict index 970b262b804..4d155ae5114 100644 --- a/tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/controlDict +++ b/tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/controlDict @@ -33,7 +33,7 @@ writeInterval 100; purgeWrite 0; -writeFormat ascii; +writeFormat binary; writePrecision 6; diff --git a/tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/topoSetDict b/tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/topoSetDict new file mode 100644 index 00000000000..f7c4777c15e --- /dev/null +++ b/tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/topoSetDict @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object topoSetDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +actions +( + { + name mid-plane; + type faceZoneSet; + action new; + source planeToFaceZone; + point (0 0 0); + normal (0 0 1); + } + { + name mid-plane; + type faceSet; + action new; + source zoneToFace; + zone mid-plane; + } + { + name mid-plane; + type faceSet; + action subset; + source boxToFace; + min (0 -1000 -1000); + max (1000 1000 1000); + } + { + name mid-plane; + type faceZoneSet; + action new; + source setToFaceZone; + faceSet mid-plane; + } + { + name mid-plane; + type faceSet; + action remove; + } +); + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoSimpleFoam/squareBendLiqNoNewtonian/Allrun b/tutorials/compressible/rhoSimpleFoam/squareBendLiqNoNewtonian/Allrun new file mode 100755 index 00000000000..9ed5ee1f12d --- /dev/null +++ b/tutorials/compressible/rhoSimpleFoam/squareBendLiqNoNewtonian/Allrun @@ -0,0 +1,10 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ + +runApplication blockMesh +runApplication topoSet +runApplication $(getApplication) + +#------------------------------------------------------------------------------ diff --git a/tutorials/compressible/rhoSimpleFoam/squareBendLiqNoNewtonian/system/blockMeshDict b/tutorials/compressible/rhoSimpleFoam/squareBendLiqNoNewtonian/system/blockMeshDict index 41793732c11..05f716b2595 100644 --- a/tutorials/compressible/rhoSimpleFoam/squareBendLiqNoNewtonian/system/blockMeshDict +++ b/tutorials/compressible/rhoSimpleFoam/squareBendLiqNoNewtonian/system/blockMeshDict @@ -16,62 +16,85 @@ FoamFile scale 0.001; -zmin -25; -zmax 25; +xin -50; +xout -500; +rad0 25; +rad1 75; +zmax 25; + +nxin 20; +nxout 200; +nxbend 30; +ny 20; +nz 20; + +// Coarser and smaller +#if 0 +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) }; +#endif + +zmin #eval{ -$zmax }; +mrad0 #eval{ -$rad0 }; +mrad1 #eval{ -$rad1 }; vertices ( - // front-plane: + // back-plane: // inlet region - ( -50 25 $zmax) // pt 0 - ( 0 25 $zmax) // pt 1 - ( -50 75 $zmax) // pt 2 - ( 0 75 $zmax) // pt 3 + ( $xin $rad0 $zmin) // pt 0 + ( 0 $rad0 $zmin) // pt 1 + ( 0 $rad1 $zmin) // pt 2 + ( $xin $rad1 $zmin) // pt 3 // outlet region - ( -500 -75 $zmax) // pt 4 - ( 0 -75 $zmax) // pt 5 - ( -500 -25 $zmax) // pt 6 - ( 0 -25 $zmax) // pt 7 + ( $xout $mrad1 $zmin) // pt 4 + ( 0 $mrad1 $zmin) // pt 5 + ( 0 $mrad0 $zmin) // pt 6 + ( $xout $mrad0 $zmin) // pt 7 // bend mid-points - ( 25 0 $zmax) // pt 8 - ( 75 0 $zmax) // pt 9 - // back-plane: + ( $rad0 0 $zmin) // pt 8 + ( $rad1 0 $zmin) // pt 9 + // front-plane: // inlet region - ( -50 25 $zmin) // pt 0 + 10 - ( 0 25 $zmin) // pt 1 + 10 - ( -50 75 $zmin) // pt 2 + 10 - ( 0 75 $zmin) // pt 3 + 10 + ( $xin $rad0 $zmax) // pt 0 + 10 + ( 0 $rad0 $zmax) // pt 1 + 10 + ( 0 $rad1 $zmax) // pt 2 + 10 + ( $xin $rad1 $zmax) // pt 3 + 10 // outlet region - ( -500 -75 $zmin) // pt 4 + 10 - ( 0 -75 $zmin) // pt 5 + 10 - ( -500 -25 $zmin) // pt 7 + 10 - ( 0 -25 $zmin) // pt 8 + 10 + ( $xout $mrad1 $zmax) // pt 4 + 10 + ( 0 $mrad1 $zmax) // pt 5 + 10 + ( 0 $mrad0 $zmax) // pt 6 + 10 + ( $xout $mrad0 $zmax) // pt 7 + 10 // bend mid-points - ( 25 0 $zmin) // pt 8 + 10 - ( 75 0 $zmin) // pt 9 + 10 + ( $rad0 0 $zmax) // pt 8 + 10 + ( $rad1 0 $zmax) // pt 9 + 10 ); blocks ( - hex (0 1 11 10 2 3 13 12) inlet ( 20 20 20) simpleGrading (1 1 1) - hex (4 5 15 14 6 7 17 16) outlet (200 20 20) simpleGrading (1 1 1) - - hex (1 8 18 11 3 9 19 13) bend1 ( 30 20 20) simpleGrading (1 1 1) - hex (5 9 19 15 7 8 18 17) bend2 ( 30 20 20) simpleGrading (1 1 1) + hex (0 1 2 3 10 11 12 13) inlet ( $nxin $ny $nz) simpleGrading (1 1 1) + hex (4 5 6 7 14 15 16 17) outlet ( $nxout $ny $nz) simpleGrading (1 1 1) + hex (1 8 9 2 11 18 19 12) bend1 ( $nxbend $ny $nz) simpleGrading (1 1 1) + hex (5 9 8 6 15 19 18 16) bend2 ( $nxbend $ny $nz) simpleGrading (1 1 1) ); edges ( // block 2 - arc 1 8 origin (0 0 $zmax) - arc 3 9 origin (0 0 $zmax) - arc 11 18 origin (0 0 $zmin) - arc 13 19 origin (0 0 $zmin) + arc 1 8 origin (0 0 $zmin) + arc 2 9 origin (0 0 $zmin) + arc 11 18 origin (0 0 $zmax) + arc 12 19 origin (0 0 $zmax) // block 3 - arc 7 8 origin (0 0 $zmax) - arc 5 9 origin (0 0 $zmax) - arc 17 18 origin (0 0 $zmin) - arc 15 19 origin (0 0 $zmin) + arc 6 8 origin (0 0 $zmin) + arc 5 9 origin (0 0 $zmin) + arc 16 18 origin (0 0 $zmax) + arc 15 19 origin (0 0 $zmax) ); boundary @@ -81,7 +104,7 @@ boundary type patch; faces ( - (0 2 12 10) + (0 10 13 3) ); } @@ -90,7 +113,7 @@ boundary type patch; faces ( - (4 6 16 14) + (4 14 17 7) ); } ); @@ -99,7 +122,6 @@ mergePatchPairs ( ); - // The defaultFaces == outside "walls" defaultPatch { diff --git a/tutorials/compressible/rhoSimpleFoam/squareBendLiqNoNewtonian/system/controlDict b/tutorials/compressible/rhoSimpleFoam/squareBendLiqNoNewtonian/system/controlDict index 970b262b804..4d155ae5114 100644 --- a/tutorials/compressible/rhoSimpleFoam/squareBendLiqNoNewtonian/system/controlDict +++ b/tutorials/compressible/rhoSimpleFoam/squareBendLiqNoNewtonian/system/controlDict @@ -33,7 +33,7 @@ writeInterval 100; purgeWrite 0; -writeFormat ascii; +writeFormat binary; writePrecision 6; diff --git a/tutorials/compressible/rhoSimpleFoam/squareBendLiqNoNewtonian/system/topoSetDict b/tutorials/compressible/rhoSimpleFoam/squareBendLiqNoNewtonian/system/topoSetDict new file mode 100644 index 00000000000..f7c4777c15e --- /dev/null +++ b/tutorials/compressible/rhoSimpleFoam/squareBendLiqNoNewtonian/system/topoSetDict @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object topoSetDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +actions +( + { + name mid-plane; + type faceZoneSet; + action new; + source planeToFaceZone; + point (0 0 0); + normal (0 0 1); + } + { + name mid-plane; + type faceSet; + action new; + source zoneToFace; + zone mid-plane; + } + { + name mid-plane; + type faceSet; + action subset; + source boxToFace; + min (0 -1000 -1000); + max (1000 1000 1000); + } + { + name mid-plane; + type faceZoneSet; + action new; + source setToFaceZone; + faceSet mid-plane; + } + { + name mid-plane; + type faceSet; + action remove; + } +); + +// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/squareBend/Allrun b/tutorials/incompressible/simpleFoam/squareBend/Allrun new file mode 100755 index 00000000000..9ed5ee1f12d --- /dev/null +++ b/tutorials/incompressible/simpleFoam/squareBend/Allrun @@ -0,0 +1,10 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ + +runApplication blockMesh +runApplication topoSet +runApplication $(getApplication) + +#------------------------------------------------------------------------------ diff --git a/tutorials/incompressible/simpleFoam/squareBend/system/blockMeshDict b/tutorials/incompressible/simpleFoam/squareBend/system/blockMeshDict index 41793732c11..05f716b2595 100644 --- a/tutorials/incompressible/simpleFoam/squareBend/system/blockMeshDict +++ b/tutorials/incompressible/simpleFoam/squareBend/system/blockMeshDict @@ -16,62 +16,85 @@ FoamFile scale 0.001; -zmin -25; -zmax 25; +xin -50; +xout -500; +rad0 25; +rad1 75; +zmax 25; + +nxin 20; +nxout 200; +nxbend 30; +ny 20; +nz 20; + +// Coarser and smaller +#if 0 +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) }; +#endif + +zmin #eval{ -$zmax }; +mrad0 #eval{ -$rad0 }; +mrad1 #eval{ -$rad1 }; vertices ( - // front-plane: + // back-plane: // inlet region - ( -50 25 $zmax) // pt 0 - ( 0 25 $zmax) // pt 1 - ( -50 75 $zmax) // pt 2 - ( 0 75 $zmax) // pt 3 + ( $xin $rad0 $zmin) // pt 0 + ( 0 $rad0 $zmin) // pt 1 + ( 0 $rad1 $zmin) // pt 2 + ( $xin $rad1 $zmin) // pt 3 // outlet region - ( -500 -75 $zmax) // pt 4 - ( 0 -75 $zmax) // pt 5 - ( -500 -25 $zmax) // pt 6 - ( 0 -25 $zmax) // pt 7 + ( $xout $mrad1 $zmin) // pt 4 + ( 0 $mrad1 $zmin) // pt 5 + ( 0 $mrad0 $zmin) // pt 6 + ( $xout $mrad0 $zmin) // pt 7 // bend mid-points - ( 25 0 $zmax) // pt 8 - ( 75 0 $zmax) // pt 9 - // back-plane: + ( $rad0 0 $zmin) // pt 8 + ( $rad1 0 $zmin) // pt 9 + // front-plane: // inlet region - ( -50 25 $zmin) // pt 0 + 10 - ( 0 25 $zmin) // pt 1 + 10 - ( -50 75 $zmin) // pt 2 + 10 - ( 0 75 $zmin) // pt 3 + 10 + ( $xin $rad0 $zmax) // pt 0 + 10 + ( 0 $rad0 $zmax) // pt 1 + 10 + ( 0 $rad1 $zmax) // pt 2 + 10 + ( $xin $rad1 $zmax) // pt 3 + 10 // outlet region - ( -500 -75 $zmin) // pt 4 + 10 - ( 0 -75 $zmin) // pt 5 + 10 - ( -500 -25 $zmin) // pt 7 + 10 - ( 0 -25 $zmin) // pt 8 + 10 + ( $xout $mrad1 $zmax) // pt 4 + 10 + ( 0 $mrad1 $zmax) // pt 5 + 10 + ( 0 $mrad0 $zmax) // pt 6 + 10 + ( $xout $mrad0 $zmax) // pt 7 + 10 // bend mid-points - ( 25 0 $zmin) // pt 8 + 10 - ( 75 0 $zmin) // pt 9 + 10 + ( $rad0 0 $zmax) // pt 8 + 10 + ( $rad1 0 $zmax) // pt 9 + 10 ); blocks ( - hex (0 1 11 10 2 3 13 12) inlet ( 20 20 20) simpleGrading (1 1 1) - hex (4 5 15 14 6 7 17 16) outlet (200 20 20) simpleGrading (1 1 1) - - hex (1 8 18 11 3 9 19 13) bend1 ( 30 20 20) simpleGrading (1 1 1) - hex (5 9 19 15 7 8 18 17) bend2 ( 30 20 20) simpleGrading (1 1 1) + hex (0 1 2 3 10 11 12 13) inlet ( $nxin $ny $nz) simpleGrading (1 1 1) + hex (4 5 6 7 14 15 16 17) outlet ( $nxout $ny $nz) simpleGrading (1 1 1) + hex (1 8 9 2 11 18 19 12) bend1 ( $nxbend $ny $nz) simpleGrading (1 1 1) + hex (5 9 8 6 15 19 18 16) bend2 ( $nxbend $ny $nz) simpleGrading (1 1 1) ); edges ( // block 2 - arc 1 8 origin (0 0 $zmax) - arc 3 9 origin (0 0 $zmax) - arc 11 18 origin (0 0 $zmin) - arc 13 19 origin (0 0 $zmin) + arc 1 8 origin (0 0 $zmin) + arc 2 9 origin (0 0 $zmin) + arc 11 18 origin (0 0 $zmax) + arc 12 19 origin (0 0 $zmax) // block 3 - arc 7 8 origin (0 0 $zmax) - arc 5 9 origin (0 0 $zmax) - arc 17 18 origin (0 0 $zmin) - arc 15 19 origin (0 0 $zmin) + arc 6 8 origin (0 0 $zmin) + arc 5 9 origin (0 0 $zmin) + arc 16 18 origin (0 0 $zmax) + arc 15 19 origin (0 0 $zmax) ); boundary @@ -81,7 +104,7 @@ boundary type patch; faces ( - (0 2 12 10) + (0 10 13 3) ); } @@ -90,7 +113,7 @@ boundary type patch; faces ( - (4 6 16 14) + (4 14 17 7) ); } ); @@ -99,7 +122,6 @@ mergePatchPairs ( ); - // The defaultFaces == outside "walls" defaultPatch { diff --git a/tutorials/incompressible/simpleFoam/squareBend/system/controlDict b/tutorials/incompressible/simpleFoam/squareBend/system/controlDict index cc8cbebd952..b16ec491b75 100644 --- a/tutorials/incompressible/simpleFoam/squareBend/system/controlDict +++ b/tutorials/incompressible/simpleFoam/squareBend/system/controlDict @@ -33,7 +33,7 @@ writeInterval 50; purgeWrite 0; -writeFormat ascii; +writeFormat binary; writePrecision 6; diff --git a/tutorials/incompressible/simpleFoam/squareBend/system/topoSetDict b/tutorials/incompressible/simpleFoam/squareBend/system/topoSetDict new file mode 100644 index 00000000000..f7c4777c15e --- /dev/null +++ b/tutorials/incompressible/simpleFoam/squareBend/system/topoSetDict @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object topoSetDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +actions +( + { + name mid-plane; + type faceZoneSet; + action new; + source planeToFaceZone; + point (0 0 0); + normal (0 0 1); + } + { + name mid-plane; + type faceSet; + action new; + source zoneToFace; + zone mid-plane; + } + { + name mid-plane; + type faceSet; + action subset; + source boxToFace; + min (0 -1000 -1000); + max (1000 1000 1000); + } + { + name mid-plane; + type faceZoneSet; + action new; + source setToFaceZone; + faceSet mid-plane; + } + { + name mid-plane; + type faceSet; + action remove; + } +); + +// ************************************************************************* // -- GitLab