diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/Allrun b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/Allrun index 4f55fd7efa..2343237660 100755 --- a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/Allrun +++ b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/Allrun @@ -1,10 +1,8 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory -m4 system/blockMeshDict.m4 > system/blockMeshDict - # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions -runApplication blockMesh +runApplication blockMesh -dict $FOAM_TUTORIALS/resources/blockMesh/angledDuct runApplication $(getApplication) diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/system/blockMeshDict.m4 b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/system/blockMeshDict.m4 deleted file mode 100644 index a92ecd2086..0000000000 --- a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/system/blockMeshDict.m4 +++ /dev/null @@ -1,148 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - `format' ascii; - class dictionary; - object blockMeshDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// block definition for a porosity with an angled inlet/outlet -// the porosity is not aligned with the main axes -// -dnl> ----------------------------------------------------------------- -dnl> -dnl> -changecom(//)changequote([,]) dnl> -define(calc, [esyscmd(perl -e 'print ($1)')]) dnl> -define(VCOUNT, 0) dnl> -define(vlabel, [[// ]pt VCOUNT ($1) define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))]) dnl> -dnl> -define(hex2D, hex ($1b $2b $3b $4b $1f $2f $3f $4f)) dnl> -define(quad2D, ($1f $1b $2b $2f)) dnl> -define(frontQuad, ($1f $2f $3f $4f)) dnl> -define(backQuad, ($4b $3b $2b $1b)) dnl> -dnl> -dnl> -dnl> ----------------------------------------------------------------- -dnl> -define(ncells, 20) dnl> -define(ninlet, 15) dnl> -define(nporo, 20) dnl> -define(noutlet, 20) dnl> -dnl> -define(x0,0) dnl> -define(y0,0) dnl> -define(y0,0) dnl> -define(Cos,0.7071067812) dnl> == cos(45) -define(Sin,0.7071067812) dnl> == sin(45) -dnl> -define(width,50) dnl> -define(zBack,calc(-width/2)) dnl> -define(zFront,calc(width/2)) dnl> -define(leninlet,150)dnl> -define(lenporo,100)dnl> -define(lenoutlet,100)dnl> -dnl> -define(xhyp,calc(Sin*width)) dnl> -define(yhyp,calc(Cos*width)) dnl> -define(xinlet,leninlet)dnl> -define(xporo,calc(Cos*lenporo)) dnl> -define(yporo,calc(Sin*lenporo)) dnl> -define(xoutlet,calc(xporo + Cos*lenoutlet)) dnl> -define(youtlet,calc(yporo + Sin*lenoutlet)) dnl> -dnl> - -convertToMeters 0.001; - -vertices -( - // inlet region - ( -xinlet y0 zBack ) vlabel(in1b) - ( -xinlet yhyp zBack ) vlabel(in2b) - ( -xinlet y0 zFront ) vlabel(in1f) - ( -xinlet yhyp zFront ) vlabel(in2f) - - // join inlet->outlet - ( x0 y0 zBack ) vlabel(join1b) - ( -xhyp yhyp zBack ) vlabel(join2b) - ( x0 y0 zFront ) vlabel(join1f) - ( -xhyp yhyp zFront ) vlabel(join2f) - - // porosity ends ->outlet - ( xporo yporo zBack ) vlabel(poro1b) - ( calc(xporo - xhyp) calc(yporo + yhyp) zBack ) vlabel(poro2b) - ( xporo yporo zFront ) vlabel(poro1f) - ( calc(xporo - xhyp) calc(yporo + yhyp) zFront ) vlabel(poro2f) - - // outlet - ( xoutlet youtlet zBack ) vlabel(out1b) - ( calc(xoutlet - xhyp) calc(youtlet + yhyp) zBack ) vlabel(out2b) - ( xoutlet youtlet zFront ) vlabel(out1f) - ( calc(xoutlet - xhyp) calc(youtlet + yhyp) zFront ) vlabel(out2f) -); - -blocks -( - // inlet block - hex2D(in1, join1, join2, in2) - inlet ( ninlet ncells ncells ) simpleGrading (1 1 1) - - // porosity block - hex2D(join1, poro1, poro2, join2) - porosity ( nporo ncells ncells ) simpleGrading (1 1 1) - - // outlet block - hex2D(poro1, out1, out2, poro2) - outlet ( noutlet ncells ncells ) simpleGrading (1 1 1) -); - -defaultPatch -{ - name walls; - type wall; -} - -boundary -( - porosityWall - { - type wall; - faces - ( - // porosity block - frontQuad(join1, poro1, poro2, join2) - // porosity block - backQuad(join1, poro1, poro2, join2) - // porosity block - quad2D(join1, poro1) - quad2D(poro2, join2) - ); - } - - inlet - { - type patch; - faces - ( - quad2D(in2, in1) - ); - } - - outlet - { - type patch; - faces - ( - quad2D(out2, out1) - ); - } -); - -// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/Allrun b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/Allrun index 4f55fd7efa..2343237660 100755 --- a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/Allrun +++ b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/Allrun @@ -1,10 +1,8 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory -m4 system/blockMeshDict.m4 > system/blockMeshDict - # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions -runApplication blockMesh +runApplication blockMesh -dict $FOAM_TUTORIALS/resources/blockMesh/angledDuct runApplication $(getApplication) diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/system/blockMeshDict.m4 b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/system/blockMeshDict.m4 deleted file mode 100644 index 9789b3d2a8..0000000000 --- a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/system/blockMeshDict.m4 +++ /dev/null @@ -1,136 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - `format' ascii; - class dictionary; - object blockMeshDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// block definition for a porosity with an angled inlet/outlet -// the porosity is not aligned with the main axes -// -dnl> ----------------------------------------------------------------- -dnl> -dnl> -changecom(//)changequote([,]) dnl> -define(calc, [esyscmd(perl -e 'print ($1)')]) dnl> -define(VCOUNT, 0) dnl> -define(vlabel, [[// ]pt VCOUNT ($1) define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))]) dnl> -dnl> -define(hex2D, hex ($1b $2b $3b $4b $1f $2f $3f $4f)) dnl> -define(quad2D, ($1f $1b $2b $2f)) dnl> -define(frontQuad, ($1f $2f $3f $4f)) dnl> -define(backQuad, ($4b $3b $2b $1b)) dnl> -dnl> -dnl> -dnl> ----------------------------------------------------------------- -dnl> -define(ncells, 20) dnl> -define(ninlet, 15) dnl> -define(nporo, 20) dnl> -define(noutlet, 20) dnl> -dnl> -define(x0,0) dnl> -define(y0,0) dnl> -define(y0,0) dnl> -define(Cos,0.7071067812) dnl> == cos(45) -define(Sin,0.7071067812) dnl> == sin(45) -dnl> -define(width,50) dnl> -define(zBack,calc(-width/2)) dnl> -define(zFront,calc(width/2)) dnl> -define(leninlet,150)dnl> -define(lenporo,100)dnl> -define(lenoutlet,100)dnl> -dnl> -define(xhyp,calc(Sin*width)) dnl> -define(yhyp,calc(Cos*width)) dnl> -define(xinlet,leninlet)dnl> -define(xporo,calc(Cos*lenporo)) dnl> -define(yporo,calc(Sin*lenporo)) dnl> -define(xoutlet,calc(xporo + Cos*lenoutlet)) dnl> -define(youtlet,calc(yporo + Sin*lenoutlet)) dnl> -dnl> - -convertToMeters 0.001; - -vertices -( - // inlet region - ( -xinlet y0 zBack ) vlabel(in1b) - ( -xinlet yhyp zBack ) vlabel(in2b) - ( -xinlet y0 zFront ) vlabel(in1f) - ( -xinlet yhyp zFront ) vlabel(in2f) - - // join inlet->outlet - ( x0 y0 zBack ) vlabel(join1b) - ( -xhyp yhyp zBack ) vlabel(join2b) - ( x0 y0 zFront ) vlabel(join1f) - ( -xhyp yhyp zFront ) vlabel(join2f) - - // porosity ends ->outlet - ( xporo yporo zBack ) vlabel(poro1b) - ( calc(xporo - xhyp) calc(yporo + yhyp) zBack ) vlabel(poro2b) - ( xporo yporo zFront ) vlabel(poro1f) - ( calc(xporo - xhyp) calc(yporo + yhyp) zFront ) vlabel(poro2f) - - // outlet - ( xoutlet youtlet zBack ) vlabel(out1b) - ( calc(xoutlet - xhyp) calc(youtlet + yhyp) zBack ) vlabel(out2b) - ( xoutlet youtlet zFront ) vlabel(out1f) - ( calc(xoutlet - xhyp) calc(youtlet + yhyp) zFront ) vlabel(out2f) -); - -blocks -( - // inlet block - hex2D(in1, join1, join2, in2) - inlet ( ninlet ncells ncells ) simpleGrading (1 1 1) - - // porosity block - hex2D(join1, poro1, poro2, join2) - porosity ( nporo ncells ncells ) simpleGrading (1 1 1) - - // outlet block - hex2D(poro1, out1, out2, poro2) - outlet ( noutlet ncells ncells ) simpleGrading (1 1 1) -); - -defaultPatch -{ - name walls; - type wall; -} - -patches -( - wall porosityWall - ( - // porosity block - frontQuad(join1, poro1, poro2, join2) - // porosity block - backQuad(join1, poro1, poro2, join2) - // porosity block - quad2D(join1, poro1) - quad2D(poro2, join2) - ) - - patch inlet - ( - quad2D(in2, in1) - ) - - patch outlet - ( - quad2D(out2, out1) - ) -); - -// ************************************************************************* // diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/system/blockMeshDict.m4 b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/system/blockMeshDict.m4 deleted file mode 120000 index baa86f23b9..0000000000 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/system/blockMeshDict.m4 +++ /dev/null @@ -1 +0,0 @@ -../../angledDuctImplicit/system/blockMeshDict.m4 \ No newline at end of file diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/Allrun b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/Allrun index bb18fc3feb..b1ec4b5486 100755 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/Allrun +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/Allrun @@ -1,14 +1,12 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory -m4 system/blockMeshDict.m4 > system/blockMeshDict - # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions application=$(getApplication) -runApplication blockMesh +runApplication blockMesh -dict $FOAM_TUTORIALS/resources/blockMesh/angledDuct runApplication $application #------------------------------------------------------------------------------ diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/system/blockMeshDict.m4 b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/system/blockMeshDict.m4 deleted file mode 100644 index 9789b3d2a8..0000000000 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/system/blockMeshDict.m4 +++ /dev/null @@ -1,136 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - `format' ascii; - class dictionary; - object blockMeshDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// block definition for a porosity with an angled inlet/outlet -// the porosity is not aligned with the main axes -// -dnl> ----------------------------------------------------------------- -dnl> -dnl> -changecom(//)changequote([,]) dnl> -define(calc, [esyscmd(perl -e 'print ($1)')]) dnl> -define(VCOUNT, 0) dnl> -define(vlabel, [[// ]pt VCOUNT ($1) define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))]) dnl> -dnl> -define(hex2D, hex ($1b $2b $3b $4b $1f $2f $3f $4f)) dnl> -define(quad2D, ($1f $1b $2b $2f)) dnl> -define(frontQuad, ($1f $2f $3f $4f)) dnl> -define(backQuad, ($4b $3b $2b $1b)) dnl> -dnl> -dnl> -dnl> ----------------------------------------------------------------- -dnl> -define(ncells, 20) dnl> -define(ninlet, 15) dnl> -define(nporo, 20) dnl> -define(noutlet, 20) dnl> -dnl> -define(x0,0) dnl> -define(y0,0) dnl> -define(y0,0) dnl> -define(Cos,0.7071067812) dnl> == cos(45) -define(Sin,0.7071067812) dnl> == sin(45) -dnl> -define(width,50) dnl> -define(zBack,calc(-width/2)) dnl> -define(zFront,calc(width/2)) dnl> -define(leninlet,150)dnl> -define(lenporo,100)dnl> -define(lenoutlet,100)dnl> -dnl> -define(xhyp,calc(Sin*width)) dnl> -define(yhyp,calc(Cos*width)) dnl> -define(xinlet,leninlet)dnl> -define(xporo,calc(Cos*lenporo)) dnl> -define(yporo,calc(Sin*lenporo)) dnl> -define(xoutlet,calc(xporo + Cos*lenoutlet)) dnl> -define(youtlet,calc(yporo + Sin*lenoutlet)) dnl> -dnl> - -convertToMeters 0.001; - -vertices -( - // inlet region - ( -xinlet y0 zBack ) vlabel(in1b) - ( -xinlet yhyp zBack ) vlabel(in2b) - ( -xinlet y0 zFront ) vlabel(in1f) - ( -xinlet yhyp zFront ) vlabel(in2f) - - // join inlet->outlet - ( x0 y0 zBack ) vlabel(join1b) - ( -xhyp yhyp zBack ) vlabel(join2b) - ( x0 y0 zFront ) vlabel(join1f) - ( -xhyp yhyp zFront ) vlabel(join2f) - - // porosity ends ->outlet - ( xporo yporo zBack ) vlabel(poro1b) - ( calc(xporo - xhyp) calc(yporo + yhyp) zBack ) vlabel(poro2b) - ( xporo yporo zFront ) vlabel(poro1f) - ( calc(xporo - xhyp) calc(yporo + yhyp) zFront ) vlabel(poro2f) - - // outlet - ( xoutlet youtlet zBack ) vlabel(out1b) - ( calc(xoutlet - xhyp) calc(youtlet + yhyp) zBack ) vlabel(out2b) - ( xoutlet youtlet zFront ) vlabel(out1f) - ( calc(xoutlet - xhyp) calc(youtlet + yhyp) zFront ) vlabel(out2f) -); - -blocks -( - // inlet block - hex2D(in1, join1, join2, in2) - inlet ( ninlet ncells ncells ) simpleGrading (1 1 1) - - // porosity block - hex2D(join1, poro1, poro2, join2) - porosity ( nporo ncells ncells ) simpleGrading (1 1 1) - - // outlet block - hex2D(poro1, out1, out2, poro2) - outlet ( noutlet ncells ncells ) simpleGrading (1 1 1) -); - -defaultPatch -{ - name walls; - type wall; -} - -patches -( - wall porosityWall - ( - // porosity block - frontQuad(join1, poro1, poro2, join2) - // porosity block - backQuad(join1, poro1, poro2, join2) - // porosity block - quad2D(join1, poro1) - quad2D(poro2, join2) - ) - - patch inlet - ( - quad2D(in2, in1) - ) - - patch outlet - ( - quad2D(out2, out1) - ) -); - -// ************************************************************************* // diff --git a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/Allrun b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/Allrun index bb18fc3feb..b1ec4b5486 100755 --- a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/Allrun +++ b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/Allrun @@ -1,14 +1,12 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory -m4 system/blockMeshDict.m4 > system/blockMeshDict - # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions application=$(getApplication) -runApplication blockMesh +runApplication blockMesh -dict $FOAM_TUTORIALS/resources/blockMesh/angledDuct runApplication $application #------------------------------------------------------------------------------ diff --git a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/blockMeshDict.m4 b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/blockMeshDict.m4 deleted file mode 100644 index 9789b3d2a8..0000000000 --- a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/blockMeshDict.m4 +++ /dev/null @@ -1,136 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - `format' ascii; - class dictionary; - object blockMeshDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// block definition for a porosity with an angled inlet/outlet -// the porosity is not aligned with the main axes -// -dnl> ----------------------------------------------------------------- -dnl> -dnl> -changecom(//)changequote([,]) dnl> -define(calc, [esyscmd(perl -e 'print ($1)')]) dnl> -define(VCOUNT, 0) dnl> -define(vlabel, [[// ]pt VCOUNT ($1) define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))]) dnl> -dnl> -define(hex2D, hex ($1b $2b $3b $4b $1f $2f $3f $4f)) dnl> -define(quad2D, ($1f $1b $2b $2f)) dnl> -define(frontQuad, ($1f $2f $3f $4f)) dnl> -define(backQuad, ($4b $3b $2b $1b)) dnl> -dnl> -dnl> -dnl> ----------------------------------------------------------------- -dnl> -define(ncells, 20) dnl> -define(ninlet, 15) dnl> -define(nporo, 20) dnl> -define(noutlet, 20) dnl> -dnl> -define(x0,0) dnl> -define(y0,0) dnl> -define(y0,0) dnl> -define(Cos,0.7071067812) dnl> == cos(45) -define(Sin,0.7071067812) dnl> == sin(45) -dnl> -define(width,50) dnl> -define(zBack,calc(-width/2)) dnl> -define(zFront,calc(width/2)) dnl> -define(leninlet,150)dnl> -define(lenporo,100)dnl> -define(lenoutlet,100)dnl> -dnl> -define(xhyp,calc(Sin*width)) dnl> -define(yhyp,calc(Cos*width)) dnl> -define(xinlet,leninlet)dnl> -define(xporo,calc(Cos*lenporo)) dnl> -define(yporo,calc(Sin*lenporo)) dnl> -define(xoutlet,calc(xporo + Cos*lenoutlet)) dnl> -define(youtlet,calc(yporo + Sin*lenoutlet)) dnl> -dnl> - -convertToMeters 0.001; - -vertices -( - // inlet region - ( -xinlet y0 zBack ) vlabel(in1b) - ( -xinlet yhyp zBack ) vlabel(in2b) - ( -xinlet y0 zFront ) vlabel(in1f) - ( -xinlet yhyp zFront ) vlabel(in2f) - - // join inlet->outlet - ( x0 y0 zBack ) vlabel(join1b) - ( -xhyp yhyp zBack ) vlabel(join2b) - ( x0 y0 zFront ) vlabel(join1f) - ( -xhyp yhyp zFront ) vlabel(join2f) - - // porosity ends ->outlet - ( xporo yporo zBack ) vlabel(poro1b) - ( calc(xporo - xhyp) calc(yporo + yhyp) zBack ) vlabel(poro2b) - ( xporo yporo zFront ) vlabel(poro1f) - ( calc(xporo - xhyp) calc(yporo + yhyp) zFront ) vlabel(poro2f) - - // outlet - ( xoutlet youtlet zBack ) vlabel(out1b) - ( calc(xoutlet - xhyp) calc(youtlet + yhyp) zBack ) vlabel(out2b) - ( xoutlet youtlet zFront ) vlabel(out1f) - ( calc(xoutlet - xhyp) calc(youtlet + yhyp) zFront ) vlabel(out2f) -); - -blocks -( - // inlet block - hex2D(in1, join1, join2, in2) - inlet ( ninlet ncells ncells ) simpleGrading (1 1 1) - - // porosity block - hex2D(join1, poro1, poro2, join2) - porosity ( nporo ncells ncells ) simpleGrading (1 1 1) - - // outlet block - hex2D(poro1, out1, out2, poro2) - outlet ( noutlet ncells ncells ) simpleGrading (1 1 1) -); - -defaultPatch -{ - name walls; - type wall; -} - -patches -( - wall porosityWall - ( - // porosity block - frontQuad(join1, poro1, poro2, join2) - // porosity block - backQuad(join1, poro1, poro2, join2) - // porosity block - quad2D(join1, poro1) - quad2D(poro2, join2) - ) - - patch inlet - ( - quad2D(in2, in1) - ) - - patch outlet - ( - quad2D(out2, out1) - ) -); - -// ************************************************************************* // diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/system/blockMeshDict.m4 b/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/system/blockMeshDict.m4 deleted file mode 120000 index baa86f23b9..0000000000 --- a/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/system/blockMeshDict.m4 +++ /dev/null @@ -1 +0,0 @@ -../../angledDuctImplicit/system/blockMeshDict.m4 \ No newline at end of file diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/Allrun b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/Allrun index 45b119cf09..5c2a3127e0 100755 --- a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/Allrun +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/Allrun @@ -1,11 +1,9 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory -m4 system/blockMeshDict.m4 > system/blockMeshDict - # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions -runApplication blockMesh +runApplication blockMesh -dict $FOAM_TUTORIALS/resources/blockMesh/angledDuct runApplication $(getApplication) diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/system/blockMeshDict.m4 b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/system/blockMeshDict.m4 deleted file mode 100644 index ae1d953f1f..0000000000 --- a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/system/blockMeshDict.m4 +++ /dev/null @@ -1,137 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - `format' ascii; - class dictionary; - object blockMeshDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// block definition for a porosity with an angled inlet/outlet -// the porosity is not aligned with the main axes -// -dnl> ----------------------------------------------------------------- -dnl> -dnl> -changecom(//)changequote([,]) dnl> -define(calc, [esyscmd(perl -e 'print ($1)')]) dnl> -define(VCOUNT, 0) dnl> -define(vlabel, [[// ]pt VCOUNT ($1) define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))]) dnl> -dnl> -define(hex2D, hex ($1b $2b $3b $4b $1f $2f $3f $4f)) dnl> -define(quad2D, ($1f $1b $2b $2f)) dnl> -define(frontQuad, ($1f $2f $3f $4f)) dnl> -define(backQuad, ($4b $3b $2b $1b)) dnl> -dnl> -dnl> -dnl> ----------------------------------------------------------------- -dnl> -define(ncells, 20) dnl> -define(ninlet, 15) dnl> -define(nporo, 20) dnl> -define(noutlet, 20) dnl> -dnl> -define(x0,0) dnl> -define(y0,0) dnl> -define(y0,0) dnl> -define(Cos,0.7071067812) dnl> == cos(45) -define(Sin,0.7071067812) dnl> == sin(45) -dnl> -define(width,50) dnl> -define(zBack,calc(-width/2)) dnl> -define(zFront,calc(width/2)) dnl> -define(leninlet,150)dnl> -define(lenporo,100)dnl> -define(lenoutlet,100)dnl> -dnl> -define(xhyp,calc(Sin*width)) dnl> -define(yhyp,calc(Cos*width)) dnl> -define(xinlet,leninlet)dnl> -define(xporo,calc(Cos*lenporo)) dnl> -define(yporo,calc(Sin*lenporo)) dnl> -define(xoutlet,calc(xporo + Cos*lenoutlet)) dnl> -define(youtlet,calc(yporo + Sin*lenoutlet)) dnl> -dnl> - -convertToMeters 0.001; - -vertices -( - // inlet region - ( -xinlet y0 zBack ) vlabel(in1b) - ( -xinlet yhyp zBack ) vlabel(in2b) - ( -xinlet y0 zFront ) vlabel(in1f) - ( -xinlet yhyp zFront ) vlabel(in2f) - - // join inlet->outlet - ( x0 y0 zBack ) vlabel(join1b) - ( -xhyp yhyp zBack ) vlabel(join2b) - ( x0 y0 zFront ) vlabel(join1f) - ( -xhyp yhyp zFront ) vlabel(join2f) - - // porosity ends ->outlet - ( xporo yporo zBack ) vlabel(poro1b) - ( calc(xporo - xhyp) calc(yporo + yhyp) zBack ) vlabel(poro2b) - ( xporo yporo zFront ) vlabel(poro1f) - ( calc(xporo - xhyp) calc(yporo + yhyp) zFront ) vlabel(poro2f) - - // outlet - ( xoutlet youtlet zBack ) vlabel(out1b) - ( calc(xoutlet - xhyp) calc(youtlet + yhyp) zBack ) vlabel(out2b) - ( xoutlet youtlet zFront ) vlabel(out1f) - ( calc(xoutlet - xhyp) calc(youtlet + yhyp) zFront ) vlabel(out2f) -); - -blocks -( - // inlet block - hex2D(in1, join1, join2, in2) - inlet ( ninlet ncells ncells ) simpleGrading (1 1 1) - - // porosity block - hex2D(join1, poro1, poro2, join2) - porosity ( nporo ncells ncells ) simpleGrading (1 1 1) - - // outlet block - hex2D(poro1, out1, out2, poro2) - outlet ( noutlet ncells ncells ) simpleGrading (1 1 1) -); - - -defaultPatch -{ - name walls; - type wall; -} - -patches -( - wall porosityWall - ( - // porosity block - frontQuad(join1, poro1, poro2, join2) - // porosity block - backQuad(join1, poro1, poro2, join2) - // porosity block - quad2D(join1, poro1) - quad2D(poro2, join2) - ) - - patch inlet - ( - quad2D(in2, in1) - ) - - patch outlet - ( - quad2D(out2, out1) - ) -); - -// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/RAS/angledDuct/Allrun b/tutorials/multiphase/interFoam/RAS/angledDuct/Allrun index 4f55fd7efa..2343237660 100755 --- a/tutorials/multiphase/interFoam/RAS/angledDuct/Allrun +++ b/tutorials/multiphase/interFoam/RAS/angledDuct/Allrun @@ -1,10 +1,8 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory -m4 system/blockMeshDict.m4 > system/blockMeshDict - # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions -runApplication blockMesh +runApplication blockMesh -dict $FOAM_TUTORIALS/resources/blockMesh/angledDuct runApplication $(getApplication) diff --git a/tutorials/multiphase/interFoam/RAS/angledDuct/system/blockMeshDict.m4 b/tutorials/multiphase/interFoam/RAS/angledDuct/system/blockMeshDict.m4 deleted file mode 100644 index a92ecd2086..0000000000 --- a/tutorials/multiphase/interFoam/RAS/angledDuct/system/blockMeshDict.m4 +++ /dev/null @@ -1,148 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - `format' ascii; - class dictionary; - object blockMeshDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// block definition for a porosity with an angled inlet/outlet -// the porosity is not aligned with the main axes -// -dnl> ----------------------------------------------------------------- -dnl> -dnl> -changecom(//)changequote([,]) dnl> -define(calc, [esyscmd(perl -e 'print ($1)')]) dnl> -define(VCOUNT, 0) dnl> -define(vlabel, [[// ]pt VCOUNT ($1) define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))]) dnl> -dnl> -define(hex2D, hex ($1b $2b $3b $4b $1f $2f $3f $4f)) dnl> -define(quad2D, ($1f $1b $2b $2f)) dnl> -define(frontQuad, ($1f $2f $3f $4f)) dnl> -define(backQuad, ($4b $3b $2b $1b)) dnl> -dnl> -dnl> -dnl> ----------------------------------------------------------------- -dnl> -define(ncells, 20) dnl> -define(ninlet, 15) dnl> -define(nporo, 20) dnl> -define(noutlet, 20) dnl> -dnl> -define(x0,0) dnl> -define(y0,0) dnl> -define(y0,0) dnl> -define(Cos,0.7071067812) dnl> == cos(45) -define(Sin,0.7071067812) dnl> == sin(45) -dnl> -define(width,50) dnl> -define(zBack,calc(-width/2)) dnl> -define(zFront,calc(width/2)) dnl> -define(leninlet,150)dnl> -define(lenporo,100)dnl> -define(lenoutlet,100)dnl> -dnl> -define(xhyp,calc(Sin*width)) dnl> -define(yhyp,calc(Cos*width)) dnl> -define(xinlet,leninlet)dnl> -define(xporo,calc(Cos*lenporo)) dnl> -define(yporo,calc(Sin*lenporo)) dnl> -define(xoutlet,calc(xporo + Cos*lenoutlet)) dnl> -define(youtlet,calc(yporo + Sin*lenoutlet)) dnl> -dnl> - -convertToMeters 0.001; - -vertices -( - // inlet region - ( -xinlet y0 zBack ) vlabel(in1b) - ( -xinlet yhyp zBack ) vlabel(in2b) - ( -xinlet y0 zFront ) vlabel(in1f) - ( -xinlet yhyp zFront ) vlabel(in2f) - - // join inlet->outlet - ( x0 y0 zBack ) vlabel(join1b) - ( -xhyp yhyp zBack ) vlabel(join2b) - ( x0 y0 zFront ) vlabel(join1f) - ( -xhyp yhyp zFront ) vlabel(join2f) - - // porosity ends ->outlet - ( xporo yporo zBack ) vlabel(poro1b) - ( calc(xporo - xhyp) calc(yporo + yhyp) zBack ) vlabel(poro2b) - ( xporo yporo zFront ) vlabel(poro1f) - ( calc(xporo - xhyp) calc(yporo + yhyp) zFront ) vlabel(poro2f) - - // outlet - ( xoutlet youtlet zBack ) vlabel(out1b) - ( calc(xoutlet - xhyp) calc(youtlet + yhyp) zBack ) vlabel(out2b) - ( xoutlet youtlet zFront ) vlabel(out1f) - ( calc(xoutlet - xhyp) calc(youtlet + yhyp) zFront ) vlabel(out2f) -); - -blocks -( - // inlet block - hex2D(in1, join1, join2, in2) - inlet ( ninlet ncells ncells ) simpleGrading (1 1 1) - - // porosity block - hex2D(join1, poro1, poro2, join2) - porosity ( nporo ncells ncells ) simpleGrading (1 1 1) - - // outlet block - hex2D(poro1, out1, out2, poro2) - outlet ( noutlet ncells ncells ) simpleGrading (1 1 1) -); - -defaultPatch -{ - name walls; - type wall; -} - -boundary -( - porosityWall - { - type wall; - faces - ( - // porosity block - frontQuad(join1, poro1, poro2, join2) - // porosity block - backQuad(join1, poro1, poro2, join2) - // porosity block - quad2D(join1, poro1) - quad2D(poro2, join2) - ); - } - - inlet - { - type patch; - faces - ( - quad2D(in2, in1) - ); - } - - outlet - { - type patch; - faces - ( - quad2D(out2, out1) - ); - } -); - -// ************************************************************************* // diff --git a/tutorials/resources/blockMesh/angledDuct b/tutorials/resources/blockMesh/angledDuct new file mode 100644 index 0000000000..6f3fd8ced8 --- /dev/null +++ b/tutorials/resources/blockMesh/angledDuct @@ -0,0 +1,129 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Block definition for a porosity with an angled inlet/outlet +// the porosity is not aligned with the main axes + +convertToMeters 0.001; + +angle 45; + +width 50; +lenInlet 150; +lenPoro 100; +lenOutlet 100; + +yzCells 20; +nInletCells 15; +nPoroCells 20; +nOutletCells 20; + +vertices #codeStream +{ + codeInclude + #{ + #include "pointField.H" + #include "transformField.H" + #}; + + code + #{ + const scalar halfWidth = ($width)/2.0; + + // Length between the bend and outlet + const scalar distOutlet = $lenPoro + $lenOutlet; + + pointField points + ({ + point(0, 0, -halfWidth), // pt 0 + point($lenPoro, 0, -halfWidth), // pt 1 + point(distOutlet, 0, -halfWidth), // pt 2 + point(0, $width, -halfWidth), // pt 3 + point($lenPoro, $width, -halfWidth), // pt 4 + point(distOutlet, $width, -halfWidth) // pt 5 + }); + + // Rotate points around z-axis + points = transform(Rz(-degToRad($angle)), points); + + // Append points 6 and 7 + points.append(points[0]); // pt 6 + points.append(points[3]); // pt 7 + + points[6].x() = -$lenInlet; + points[7].x() = -$lenInlet; + + // Duplicate z points + points.append(cmptMultiply(points, vector(1, 1, -1))); + + os << points; + #}; +}; + +blocks +( + // Inlet block + hex (6 0 3 7 14 8 11 15) + inlet ($nInletCells $yzCells $yzCells) simpleGrading (1 1 1) + + // Porosity block + hex (0 1 4 3 8 9 12 11) + porosity ($nPoroCells $yzCells $yzCells) simpleGrading (1 1 1) + + // Outlet block + hex (1 2 5 4 9 10 13 12) + outlet ($nOutletCells $yzCells $yzCells) simpleGrading (1 1 1) +); + +defaultPatch +{ + name walls; + type wall; +} + +boundary +( + porosityWall + { + type wall; + faces + ( + (8 9 12 11) + (0 3 4 1) + (0 1 9 8) + (3 11 12 4) + ); + } + + inlet + { + type patch; + faces + ( + (14 15 7 6) + ); + } + + outlet + { + type patch; + faces + ( + (2 5 13 10) + ); + } +); + +// ************************************************************************* //