diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/Allrun b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/Allrun index 922b280b7c26e8aad75c1628f931bfe2d49c6ca2..5f30e6c3bbff0d738d32641422fb6e6d2253eb9d 100755 --- a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/Allrun +++ b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/Allrun @@ -5,7 +5,6 @@ cd "${0%/*}" || exit # Run from this directory restore0Dir -m4 system/blockMeshDict.m4 > system/blockMeshDict runApplication blockMesh runApplication $(getApplication) diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/system/blockMeshDict b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/system/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..7b03b48105d6d9e7f3a73cffec9f0d4f64188740 --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/system/blockMeshDict @@ -0,0 +1,129 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ 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 + +scale 0.001; + +transform +{ + origin (0 0 0); + rotation + { + type axisAngle; + axis (0 0 1); + angle 45; + } +} + +// Geometric parameters +lenInlet 150; +lenPoro 100; +lenOutlet 100; +h2 25; // Channel half-height (in y) +w2 25; // Channel half-height (in z) +bendAngle 135; // Bend: inclusive angle [approx 120..240 deg] + +// Divisions +cellWidth 5; +nInlet #eval #{ round($lenInlet / $cellWidth) #}; +nPoro #eval #{ round($lenPoro / $cellWidth) #}; +nOutlet #eval #{ round($lenOutlet / $cellWidth) #}; +nHeight #eval #{ round(4 * $h2 / $cellWidth) #}; // finer in cross direction +nWidth #eval #{ round(4 * $w2 / $cellWidth) #}; // finer in cross direction + + +// Calculations: +cosBend #eval #{ cos(degToRad($bendAngle)) #}; +sinBend #eval #{ sin(degToRad($bendAngle)) #}; + +// Ensure inlet walls remain parallel +shrink #eval #{ sin(mag(degToRad($bendAngle - 90))) #}; + +x0 #eval #{ ($lenInlet)*$cosBend - ($h2 * $shrink) * $sinBend #}; +x1 #eval #{ ($lenInlet)*$cosBend - (-$h2 * $shrink) * $sinBend #}; +y0 #eval #{ ($lenInlet)*$sinBend + ($h2 * $shrink) * $cosBend #}; +y1 #eval #{ ($lenInlet)*$sinBend + (-$h2 * $shrink) * $cosBend #}; + +xOutlet #eval #{ $lenPoro + $lenOutlet #}; + +vertices +( + // inlet region + ( $x0 $y0 -$w2 ) + ( 0 -$h2 -$w2 ) + ( 0 $h2 -$w2 ) + ( $x1 $y1 -$w2 ) + + ( $x0 $y0 $w2 ) + ( 0 -$h2 $w2 ) + ( 0 $h2 $w2 ) + ( $x1 $y1 $w2 ) + + // End of porosity + ( $lenPoro -$h2 -$w2 ) + ( $lenPoro $h2 -$w2 ) + ( $lenPoro -$h2 $w2 ) + ( $lenPoro $h2 $w2 ) + + // End of outlet + ( $xOutlet -$h2 -$w2 ) + ( $xOutlet $h2 -$w2 ) + ( $xOutlet -$h2 $w2 ) + ( $xOutlet $h2 $w2 ) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) inlet + ($nInlet $nHeight $nWidth) grading (1 1 1) + + hex (1 8 9 2 5 10 11 6) porosity + ($nPoro $nHeight $nWidth) grading (1 1 1) + + hex (8 12 13 9 10 14 15 11) outlet + ($nPoro $nHeight $nWidth) grading (1 1 1) +); + +boundary +( + inlet + { + type patch; + faces ( (0 0) ); + } + + outlet + { + type patch; + faces ( (2 1) ); + } + + porosityWall + { + type wall; + faces ( (1 2) (1 3) (1 4) (1 5) ); + } +); + +// The defaultFaces == outside "walls" +defaultPatch +{ + type wall; + name walls; +} + +// ************************************************************************* // 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 19aa15a6ad66b83d6ff3401d4d5471f279f96e13..0000000000000000000000000000000000000000 --- a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/system/blockMeshDict.m4 +++ /dev/null @@ -1,189 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v2106 | -| \\ / A nd | Website: www.openfoam.com | -| \\/ 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> <STANDARD DEFINTIONS> -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> </STANDARD DEFINTIONS> -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> - -scale 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) -); - -edges -( -); - -boundary -( - // is there no way of defining all my 'defaultFaces' to be 'wall'? - front - { - type wall; - faces - ( - // inlet block - frontQuad(in1, join1, join2, in2) - // outlet block - frontQuad(poro1, out1, out2, poro2) - ); - } - - back - { - type wall; - faces - ( - // inlet block - backQuad(in1, join1, join2, in2) - // outlet block - backQuad(poro1, out1, out2, poro2) - ); - } - - walls - { - type wall; - faces - ( - // inlet block - quad2D(in1, join1) - quad2D(join2, in2) - // outlet block - quad2D(poro1, out1) - quad2D(out2, poro2) - ); - } - - 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) - ); - } -); - -mergePatchPairs -( -); - -// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/Allrun b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/Allrun index 922b280b7c26e8aad75c1628f931bfe2d49c6ca2..5f30e6c3bbff0d738d32641422fb6e6d2253eb9d 100755 --- a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/Allrun +++ b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/Allrun @@ -5,7 +5,6 @@ cd "${0%/*}" || exit # Run from this directory restore0Dir -m4 system/blockMeshDict.m4 > system/blockMeshDict runApplication blockMesh runApplication $(getApplication) diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/system/blockMeshDict b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/system/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..7b03b48105d6d9e7f3a73cffec9f0d4f64188740 --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/system/blockMeshDict @@ -0,0 +1,129 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ 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 + +scale 0.001; + +transform +{ + origin (0 0 0); + rotation + { + type axisAngle; + axis (0 0 1); + angle 45; + } +} + +// Geometric parameters +lenInlet 150; +lenPoro 100; +lenOutlet 100; +h2 25; // Channel half-height (in y) +w2 25; // Channel half-height (in z) +bendAngle 135; // Bend: inclusive angle [approx 120..240 deg] + +// Divisions +cellWidth 5; +nInlet #eval #{ round($lenInlet / $cellWidth) #}; +nPoro #eval #{ round($lenPoro / $cellWidth) #}; +nOutlet #eval #{ round($lenOutlet / $cellWidth) #}; +nHeight #eval #{ round(4 * $h2 / $cellWidth) #}; // finer in cross direction +nWidth #eval #{ round(4 * $w2 / $cellWidth) #}; // finer in cross direction + + +// Calculations: +cosBend #eval #{ cos(degToRad($bendAngle)) #}; +sinBend #eval #{ sin(degToRad($bendAngle)) #}; + +// Ensure inlet walls remain parallel +shrink #eval #{ sin(mag(degToRad($bendAngle - 90))) #}; + +x0 #eval #{ ($lenInlet)*$cosBend - ($h2 * $shrink) * $sinBend #}; +x1 #eval #{ ($lenInlet)*$cosBend - (-$h2 * $shrink) * $sinBend #}; +y0 #eval #{ ($lenInlet)*$sinBend + ($h2 * $shrink) * $cosBend #}; +y1 #eval #{ ($lenInlet)*$sinBend + (-$h2 * $shrink) * $cosBend #}; + +xOutlet #eval #{ $lenPoro + $lenOutlet #}; + +vertices +( + // inlet region + ( $x0 $y0 -$w2 ) + ( 0 -$h2 -$w2 ) + ( 0 $h2 -$w2 ) + ( $x1 $y1 -$w2 ) + + ( $x0 $y0 $w2 ) + ( 0 -$h2 $w2 ) + ( 0 $h2 $w2 ) + ( $x1 $y1 $w2 ) + + // End of porosity + ( $lenPoro -$h2 -$w2 ) + ( $lenPoro $h2 -$w2 ) + ( $lenPoro -$h2 $w2 ) + ( $lenPoro $h2 $w2 ) + + // End of outlet + ( $xOutlet -$h2 -$w2 ) + ( $xOutlet $h2 -$w2 ) + ( $xOutlet -$h2 $w2 ) + ( $xOutlet $h2 $w2 ) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) inlet + ($nInlet $nHeight $nWidth) grading (1 1 1) + + hex (1 8 9 2 5 10 11 6) porosity + ($nPoro $nHeight $nWidth) grading (1 1 1) + + hex (8 12 13 9 10 14 15 11) outlet + ($nPoro $nHeight $nWidth) grading (1 1 1) +); + +boundary +( + inlet + { + type patch; + faces ( (0 0) ); + } + + outlet + { + type patch; + faces ( (2 1) ); + } + + porosityWall + { + type wall; + faces ( (1 2) (1 3) (1 4) (1 5) ); + } +); + +// The defaultFaces == outside "walls" +defaultPatch +{ + type wall; + name walls; +} + +// ************************************************************************* // 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 70f832183b2a08fd34079851d88509b69d2a0cfc..0000000000000000000000000000000000000000 --- a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/system/blockMeshDict.m4 +++ /dev/null @@ -1,165 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v2106 | -| \\ / A nd | Website: www.openfoam.com | -| \\/ 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> <STANDARD DEFINTIONS> -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> </STANDARD DEFINTIONS> -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> - -scale 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) -); - -edges -( -); - -patches -( - // is there no way of defining all my 'defaultFaces' to be 'wall'? - wall front - ( - // inlet block - frontQuad(in1, join1, join2, in2) - // outlet block - frontQuad(poro1, out1, out2, poro2) - ) - - wall back - ( - // inlet block - backQuad(in1, join1, join2, in2) - // outlet block - backQuad(poro1, out1, out2, poro2) - ) - - wall walls - ( - // inlet block - quad2D(in1, join1) - quad2D(join2, in2) - // outlet block - quad2D(poro1, out1) - quad2D(out2, poro2) - ) - - 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) - ) -); - -mergePatchPairs -( -); - -// ************************************************************************* // diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/common/blockMeshDict b/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/common/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..7b03b48105d6d9e7f3a73cffec9f0d4f64188740 --- /dev/null +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/common/blockMeshDict @@ -0,0 +1,129 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ 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 + +scale 0.001; + +transform +{ + origin (0 0 0); + rotation + { + type axisAngle; + axis (0 0 1); + angle 45; + } +} + +// Geometric parameters +lenInlet 150; +lenPoro 100; +lenOutlet 100; +h2 25; // Channel half-height (in y) +w2 25; // Channel half-height (in z) +bendAngle 135; // Bend: inclusive angle [approx 120..240 deg] + +// Divisions +cellWidth 5; +nInlet #eval #{ round($lenInlet / $cellWidth) #}; +nPoro #eval #{ round($lenPoro / $cellWidth) #}; +nOutlet #eval #{ round($lenOutlet / $cellWidth) #}; +nHeight #eval #{ round(4 * $h2 / $cellWidth) #}; // finer in cross direction +nWidth #eval #{ round(4 * $w2 / $cellWidth) #}; // finer in cross direction + + +// Calculations: +cosBend #eval #{ cos(degToRad($bendAngle)) #}; +sinBend #eval #{ sin(degToRad($bendAngle)) #}; + +// Ensure inlet walls remain parallel +shrink #eval #{ sin(mag(degToRad($bendAngle - 90))) #}; + +x0 #eval #{ ($lenInlet)*$cosBend - ($h2 * $shrink) * $sinBend #}; +x1 #eval #{ ($lenInlet)*$cosBend - (-$h2 * $shrink) * $sinBend #}; +y0 #eval #{ ($lenInlet)*$sinBend + ($h2 * $shrink) * $cosBend #}; +y1 #eval #{ ($lenInlet)*$sinBend + (-$h2 * $shrink) * $cosBend #}; + +xOutlet #eval #{ $lenPoro + $lenOutlet #}; + +vertices +( + // inlet region + ( $x0 $y0 -$w2 ) + ( 0 -$h2 -$w2 ) + ( 0 $h2 -$w2 ) + ( $x1 $y1 -$w2 ) + + ( $x0 $y0 $w2 ) + ( 0 -$h2 $w2 ) + ( 0 $h2 $w2 ) + ( $x1 $y1 $w2 ) + + // End of porosity + ( $lenPoro -$h2 -$w2 ) + ( $lenPoro $h2 -$w2 ) + ( $lenPoro -$h2 $w2 ) + ( $lenPoro $h2 $w2 ) + + // End of outlet + ( $xOutlet -$h2 -$w2 ) + ( $xOutlet $h2 -$w2 ) + ( $xOutlet -$h2 $w2 ) + ( $xOutlet $h2 $w2 ) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) inlet + ($nInlet $nHeight $nWidth) grading (1 1 1) + + hex (1 8 9 2 5 10 11 6) porosity + ($nPoro $nHeight $nWidth) grading (1 1 1) + + hex (8 12 13 9 10 14 15 11) outlet + ($nPoro $nHeight $nWidth) grading (1 1 1) +); + +boundary +( + inlet + { + type patch; + faces ( (0 0) ); + } + + outlet + { + type patch; + faces ( (2 1) ); + } + + porosityWall + { + type wall; + faces ( (1 2) (1 3) (1 4) (1 5) ); + } +); + +// The defaultFaces == outside "walls" +defaultPatch +{ + type wall; + name walls; +} + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/common/blockMeshDict.m4 b/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/common/blockMeshDict.m4 deleted file mode 100644 index 70f832183b2a08fd34079851d88509b69d2a0cfc..0000000000000000000000000000000000000000 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/common/blockMeshDict.m4 +++ /dev/null @@ -1,165 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v2106 | -| \\ / A nd | Website: www.openfoam.com | -| \\/ 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> <STANDARD DEFINTIONS> -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> </STANDARD DEFINTIONS> -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> - -scale 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) -); - -edges -( -); - -patches -( - // is there no way of defining all my 'defaultFaces' to be 'wall'? - wall front - ( - // inlet block - frontQuad(in1, join1, join2, in2) - // outlet block - frontQuad(poro1, out1, out2, poro2) - ) - - wall back - ( - // inlet block - backQuad(in1, join1, join2, in2) - // outlet block - backQuad(poro1, out1, out2, poro2) - ) - - wall walls - ( - // inlet block - quad2D(in1, join1) - quad2D(join2, in2) - // outlet block - quad2D(poro1, out1) - quad2D(out2, poro2) - ) - - 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) - ) -); - -mergePatchPairs -( -); - -// ************************************************************************* // diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/explicit/Allrun b/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/explicit/Allrun index 47869113b33ed8aad6f7c3c6b9b8f00d6c84ddb2..58f34896aa7bbc4caea1433f2760b0ebbd35680f 100755 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/explicit/Allrun +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/explicit/Allrun @@ -11,8 +11,7 @@ cp -rf ../common/0.orig 0 cp -rf ../common/constant constant -m4 system/blockMeshDict.m4 > system/blockMeshDict -runApplication blockMesh +runApplication blockMesh -dict ../common/blockMeshDict runApplication $(getApplication) diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/explicit/system/blockMeshDict.m4 b/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/explicit/system/blockMeshDict.m4 deleted file mode 120000 index 55f23c148bb2123e27460000f3762b0ed5bb3ec0..0000000000000000000000000000000000000000 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/explicit/system/blockMeshDict.m4 +++ /dev/null @@ -1 +0,0 @@ -../../common/blockMeshDict.m4 \ No newline at end of file diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/implicit/Allrun b/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/implicit/Allrun index 83fc61d637d40c3636373937c69084f144bd35d7..e14c0c5c998a37b7c31125cbd2e447d265a2d263 100755 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/implicit/Allrun +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/implicit/Allrun @@ -13,8 +13,7 @@ cp -rf ../common/0.orig 0 cp -rf ../common/constant constant -m4 system/blockMeshDict.m4 > system/blockMeshDict -runApplication blockMesh +runApplication blockMesh -dict ../common/blockMeshDict runApplication $(getApplication) diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/implicit/system/blockMeshDict.m4 b/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/implicit/system/blockMeshDict.m4 deleted file mode 120000 index 55f23c148bb2123e27460000f3762b0ed5bb3ec0..0000000000000000000000000000000000000000 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/implicit/system/blockMeshDict.m4 +++ /dev/null @@ -1 +0,0 @@ -../../common/blockMeshDict.m4 \ No newline at end of file diff --git a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/Allrun b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/Allrun index 922b280b7c26e8aad75c1628f931bfe2d49c6ca2..5f30e6c3bbff0d738d32641422fb6e6d2253eb9d 100755 --- a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/Allrun +++ b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/Allrun @@ -5,7 +5,6 @@ cd "${0%/*}" || exit # Run from this directory restore0Dir -m4 system/blockMeshDict.m4 > system/blockMeshDict runApplication blockMesh runApplication $(getApplication) diff --git a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/blockMeshDict b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..7b03b48105d6d9e7f3a73cffec9f0d4f64188740 --- /dev/null +++ b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/blockMeshDict @@ -0,0 +1,129 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ 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 + +scale 0.001; + +transform +{ + origin (0 0 0); + rotation + { + type axisAngle; + axis (0 0 1); + angle 45; + } +} + +// Geometric parameters +lenInlet 150; +lenPoro 100; +lenOutlet 100; +h2 25; // Channel half-height (in y) +w2 25; // Channel half-height (in z) +bendAngle 135; // Bend: inclusive angle [approx 120..240 deg] + +// Divisions +cellWidth 5; +nInlet #eval #{ round($lenInlet / $cellWidth) #}; +nPoro #eval #{ round($lenPoro / $cellWidth) #}; +nOutlet #eval #{ round($lenOutlet / $cellWidth) #}; +nHeight #eval #{ round(4 * $h2 / $cellWidth) #}; // finer in cross direction +nWidth #eval #{ round(4 * $w2 / $cellWidth) #}; // finer in cross direction + + +// Calculations: +cosBend #eval #{ cos(degToRad($bendAngle)) #}; +sinBend #eval #{ sin(degToRad($bendAngle)) #}; + +// Ensure inlet walls remain parallel +shrink #eval #{ sin(mag(degToRad($bendAngle - 90))) #}; + +x0 #eval #{ ($lenInlet)*$cosBend - ($h2 * $shrink) * $sinBend #}; +x1 #eval #{ ($lenInlet)*$cosBend - (-$h2 * $shrink) * $sinBend #}; +y0 #eval #{ ($lenInlet)*$sinBend + ($h2 * $shrink) * $cosBend #}; +y1 #eval #{ ($lenInlet)*$sinBend + (-$h2 * $shrink) * $cosBend #}; + +xOutlet #eval #{ $lenPoro + $lenOutlet #}; + +vertices +( + // inlet region + ( $x0 $y0 -$w2 ) + ( 0 -$h2 -$w2 ) + ( 0 $h2 -$w2 ) + ( $x1 $y1 -$w2 ) + + ( $x0 $y0 $w2 ) + ( 0 -$h2 $w2 ) + ( 0 $h2 $w2 ) + ( $x1 $y1 $w2 ) + + // End of porosity + ( $lenPoro -$h2 -$w2 ) + ( $lenPoro $h2 -$w2 ) + ( $lenPoro -$h2 $w2 ) + ( $lenPoro $h2 $w2 ) + + // End of outlet + ( $xOutlet -$h2 -$w2 ) + ( $xOutlet $h2 -$w2 ) + ( $xOutlet -$h2 $w2 ) + ( $xOutlet $h2 $w2 ) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) inlet + ($nInlet $nHeight $nWidth) grading (1 1 1) + + hex (1 8 9 2 5 10 11 6) porosity + ($nPoro $nHeight $nWidth) grading (1 1 1) + + hex (8 12 13 9 10 14 15 11) outlet + ($nPoro $nHeight $nWidth) grading (1 1 1) +); + +boundary +( + inlet + { + type patch; + faces ( (0 0) ); + } + + outlet + { + type patch; + faces ( (2 1) ); + } + + porosityWall + { + type wall; + faces ( (1 2) (1 3) (1 4) (1 5) ); + } +); + +// The defaultFaces == outside "walls" +defaultPatch +{ + type wall; + name walls; +} + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/blockMeshDict.m4 b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/blockMeshDict.m4 deleted file mode 100644 index 70f832183b2a08fd34079851d88509b69d2a0cfc..0000000000000000000000000000000000000000 --- a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/blockMeshDict.m4 +++ /dev/null @@ -1,165 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v2106 | -| \\ / A nd | Website: www.openfoam.com | -| \\/ 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> <STANDARD DEFINTIONS> -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> </STANDARD DEFINTIONS> -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> - -scale 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) -); - -edges -( -); - -patches -( - // is there no way of defining all my 'defaultFaces' to be 'wall'? - wall front - ( - // inlet block - frontQuad(in1, join1, join2, in2) - // outlet block - frontQuad(poro1, out1, out2, poro2) - ) - - wall back - ( - // inlet block - backQuad(in1, join1, join2, in2) - // outlet block - backQuad(poro1, out1, out2, poro2) - ) - - wall walls - ( - // inlet block - quad2D(in1, join1) - quad2D(join2, in2) - // outlet block - quad2D(poro1, out1) - quad2D(out2, poro2) - ) - - 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) - ) -); - -mergePatchPairs -( -); - -// ************************************************************************* // diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuct/common/blockMeshDict b/tutorials/incompressible/porousSimpleFoam/angledDuct/common/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..56a97c9d3a5198f5f0241740af6fbf99e6619c6d --- /dev/null +++ b/tutorials/incompressible/porousSimpleFoam/angledDuct/common/blockMeshDict @@ -0,0 +1,129 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ 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 + +scale 0.001; + +transform +{ + origin (0 0 0); + rotation + { + type axisAngle; + axis (0 0 1); + angle 45; + } +} + +// Geometric parameters +lenInlet 150; +lenPoro 100; +lenOutlet 100; +h2 25; // Channel half-height (in y) +w2 25; // Channel half-height (in z) +bendAngle 135; // Bend: inclusive angle [approx 120..240 deg] + +// Divisions +cellWidth 5; +nInlet #eval #{ round($lenInlet / $cellWidth) #}; +nPoro #eval #{ round($lenPoro / $cellWidth) #}; +nOutlet #eval #{ round($lenOutlet / $cellWidth) #}; +nHeight #eval #{ round(4 * $h2 / $cellWidth) #}; // finer in cross direction +nWidth #eval #{ round(4 * $w2 / $cellWidth) #}; // finer in cross direction + + +// Calculations: +cosBend #eval #{ cos(degToRad($bendAngle)) #}; +sinBend #eval #{ sin(degToRad($bendAngle)) #}; + +// Ensure inlet walls remain parallel +shrink #eval #{ sin(mag(degToRad($bendAngle - 90))) #}; + +x0 #eval #{ ($lenInlet)*$cosBend - ($h2 * $shrink) * $sinBend #}; +x1 #eval #{ ($lenInlet)*$cosBend - (-$h2 * $shrink) * $sinBend #}; +y0 #eval #{ ($lenInlet)*$sinBend + ($h2 * $shrink) * $cosBend #}; +y1 #eval #{ ($lenInlet)*$sinBend + (-$h2 * $shrink) * $cosBend #}; + +xOutlet #eval #{ $lenPoro + $lenOutlet #}; + +vertices +( + // inlet region + ( $x0 $y0 -$w2 ) + ( 0 -$h2 -$w2 ) + ( 0 $h2 -$w2 ) + ( $x1 $y1 -$w2 ) + + ( $x0 $y0 $w2 ) + ( 0 -$h2 $w2 ) + ( 0 $h2 $w2 ) + ( $x1 $y1 $w2 ) + + // End of porosity + ( $lenPoro -$h2 -$w2 ) + ( $lenPoro $h2 -$w2 ) + ( $lenPoro -$h2 $w2 ) + ( $lenPoro $h2 $w2 ) + + // End of outlet + ( $xOutlet -$h2 -$w2 ) + ( $xOutlet $h2 -$w2 ) + ( $xOutlet -$h2 $w2 ) + ( $xOutlet $h2 $w2 ) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) inlet + ($nInlet $nHeight $nWidth) grading (1 1 1) + + hex (1 8 9 2 5 10 11 6) porosity + ($nPoro $nHeight $nWidth) grading (1 1 1) + + hex (8 12 13 9 10 14 15 11) outlet + ($nPoro $nHeight $nWidth) grading (1 1 1) +); + +boundary +( + inlet + { + type patch; + faces ( (0 0) ); + } + + outlet + { + type patch; + faces ( (2 1) ); + } + + porosityWall + { + type wall; + faces ( (1 2) (1 3) (1 4) (1 5) ); + } +); + +// The defaultFaces == outside "walls" +defaultPatch +{ + type wall; + name walls; +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuct/common/blockMeshDict.m4 b/tutorials/incompressible/porousSimpleFoam/angledDuct/common/blockMeshDict.m4 deleted file mode 100644 index 70f832183b2a08fd34079851d88509b69d2a0cfc..0000000000000000000000000000000000000000 --- a/tutorials/incompressible/porousSimpleFoam/angledDuct/common/blockMeshDict.m4 +++ /dev/null @@ -1,165 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v2106 | -| \\ / A nd | Website: www.openfoam.com | -| \\/ 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> <STANDARD DEFINTIONS> -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> </STANDARD DEFINTIONS> -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> - -scale 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) -); - -edges -( -); - -patches -( - // is there no way of defining all my 'defaultFaces' to be 'wall'? - wall front - ( - // inlet block - frontQuad(in1, join1, join2, in2) - // outlet block - frontQuad(poro1, out1, out2, poro2) - ) - - wall back - ( - // inlet block - backQuad(in1, join1, join2, in2) - // outlet block - backQuad(poro1, out1, out2, poro2) - ) - - wall walls - ( - // inlet block - quad2D(in1, join1) - quad2D(join2, in2) - // outlet block - quad2D(poro1, out1) - quad2D(out2, poro2) - ) - - 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) - ) -); - -mergePatchPairs -( -); - -// ************************************************************************* // diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuct/explicit/Allrun b/tutorials/incompressible/porousSimpleFoam/angledDuct/explicit/Allrun index 4babcb025d0b5bf37bfb4ceb369a114826f25dc1..2e3614e70d64ac338afbafc5b0a9e72a519f79e7 100755 --- a/tutorials/incompressible/porousSimpleFoam/angledDuct/explicit/Allrun +++ b/tutorials/incompressible/porousSimpleFoam/angledDuct/explicit/Allrun @@ -8,8 +8,7 @@ rm -rf 0 constant cp -rf ../common/0.orig 0 cp -rf ../common/constant constant -m4 system/blockMeshDict.m4 > system/blockMeshDict -runApplication blockMesh +runApplication blockMesh -dict ../common/blockMeshDict runApplication $(getApplication) diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuct/explicit/system/blockMeshDict.m4 b/tutorials/incompressible/porousSimpleFoam/angledDuct/explicit/system/blockMeshDict.m4 deleted file mode 120000 index 55f23c148bb2123e27460000f3762b0ed5bb3ec0..0000000000000000000000000000000000000000 --- a/tutorials/incompressible/porousSimpleFoam/angledDuct/explicit/system/blockMeshDict.m4 +++ /dev/null @@ -1 +0,0 @@ -../../common/blockMeshDict.m4 \ No newline at end of file diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuct/implicit/Allrun b/tutorials/incompressible/porousSimpleFoam/angledDuct/implicit/Allrun index 4babcb025d0b5bf37bfb4ceb369a114826f25dc1..2e3614e70d64ac338afbafc5b0a9e72a519f79e7 100755 --- a/tutorials/incompressible/porousSimpleFoam/angledDuct/implicit/Allrun +++ b/tutorials/incompressible/porousSimpleFoam/angledDuct/implicit/Allrun @@ -8,8 +8,7 @@ rm -rf 0 constant cp -rf ../common/0.orig 0 cp -rf ../common/constant constant -m4 system/blockMeshDict.m4 > system/blockMeshDict -runApplication blockMesh +runApplication blockMesh -dict ../common/blockMeshDict runApplication $(getApplication) diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuct/implicit/system/blockMeshDict.m4 b/tutorials/incompressible/porousSimpleFoam/angledDuct/implicit/system/blockMeshDict.m4 deleted file mode 120000 index 55f23c148bb2123e27460000f3762b0ed5bb3ec0..0000000000000000000000000000000000000000 --- a/tutorials/incompressible/porousSimpleFoam/angledDuct/implicit/system/blockMeshDict.m4 +++ /dev/null @@ -1 +0,0 @@ -../../common/blockMeshDict.m4 \ No newline at end of file diff --git a/tutorials/multiphase/interFoam/RAS/angledDuct/Allrun b/tutorials/multiphase/interFoam/RAS/angledDuct/Allrun index 922b280b7c26e8aad75c1628f931bfe2d49c6ca2..5f30e6c3bbff0d738d32641422fb6e6d2253eb9d 100755 --- a/tutorials/multiphase/interFoam/RAS/angledDuct/Allrun +++ b/tutorials/multiphase/interFoam/RAS/angledDuct/Allrun @@ -5,7 +5,6 @@ cd "${0%/*}" || exit # Run from this directory restore0Dir -m4 system/blockMeshDict.m4 > system/blockMeshDict runApplication blockMesh runApplication $(getApplication) diff --git a/tutorials/multiphase/interFoam/RAS/angledDuct/system/blockMeshDict b/tutorials/multiphase/interFoam/RAS/angledDuct/system/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..7b03b48105d6d9e7f3a73cffec9f0d4f64188740 --- /dev/null +++ b/tutorials/multiphase/interFoam/RAS/angledDuct/system/blockMeshDict @@ -0,0 +1,129 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ 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 + +scale 0.001; + +transform +{ + origin (0 0 0); + rotation + { + type axisAngle; + axis (0 0 1); + angle 45; + } +} + +// Geometric parameters +lenInlet 150; +lenPoro 100; +lenOutlet 100; +h2 25; // Channel half-height (in y) +w2 25; // Channel half-height (in z) +bendAngle 135; // Bend: inclusive angle [approx 120..240 deg] + +// Divisions +cellWidth 5; +nInlet #eval #{ round($lenInlet / $cellWidth) #}; +nPoro #eval #{ round($lenPoro / $cellWidth) #}; +nOutlet #eval #{ round($lenOutlet / $cellWidth) #}; +nHeight #eval #{ round(4 * $h2 / $cellWidth) #}; // finer in cross direction +nWidth #eval #{ round(4 * $w2 / $cellWidth) #}; // finer in cross direction + + +// Calculations: +cosBend #eval #{ cos(degToRad($bendAngle)) #}; +sinBend #eval #{ sin(degToRad($bendAngle)) #}; + +// Ensure inlet walls remain parallel +shrink #eval #{ sin(mag(degToRad($bendAngle - 90))) #}; + +x0 #eval #{ ($lenInlet)*$cosBend - ($h2 * $shrink) * $sinBend #}; +x1 #eval #{ ($lenInlet)*$cosBend - (-$h2 * $shrink) * $sinBend #}; +y0 #eval #{ ($lenInlet)*$sinBend + ($h2 * $shrink) * $cosBend #}; +y1 #eval #{ ($lenInlet)*$sinBend + (-$h2 * $shrink) * $cosBend #}; + +xOutlet #eval #{ $lenPoro + $lenOutlet #}; + +vertices +( + // inlet region + ( $x0 $y0 -$w2 ) + ( 0 -$h2 -$w2 ) + ( 0 $h2 -$w2 ) + ( $x1 $y1 -$w2 ) + + ( $x0 $y0 $w2 ) + ( 0 -$h2 $w2 ) + ( 0 $h2 $w2 ) + ( $x1 $y1 $w2 ) + + // End of porosity + ( $lenPoro -$h2 -$w2 ) + ( $lenPoro $h2 -$w2 ) + ( $lenPoro -$h2 $w2 ) + ( $lenPoro $h2 $w2 ) + + // End of outlet + ( $xOutlet -$h2 -$w2 ) + ( $xOutlet $h2 -$w2 ) + ( $xOutlet -$h2 $w2 ) + ( $xOutlet $h2 $w2 ) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) inlet + ($nInlet $nHeight $nWidth) grading (1 1 1) + + hex (1 8 9 2 5 10 11 6) porosity + ($nPoro $nHeight $nWidth) grading (1 1 1) + + hex (8 12 13 9 10 14 15 11) outlet + ($nPoro $nHeight $nWidth) grading (1 1 1) +); + +boundary +( + inlet + { + type patch; + faces ( (0 0) ); + } + + outlet + { + type patch; + faces ( (2 1) ); + } + + porosityWall + { + type wall; + faces ( (1 2) (1 3) (1 4) (1 5) ); + } +); + +// The defaultFaces == outside "walls" +defaultPatch +{ + type wall; + name walls; +} + +// ************************************************************************* // 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 5817e8a6837fdf0c7502bda5c068987fecb0ac90..0000000000000000000000000000000000000000 --- a/tutorials/multiphase/interFoam/RAS/angledDuct/system/blockMeshDict.m4 +++ /dev/null @@ -1,189 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v2106 | -| \\ / A nd | Website: www.openfoam.com | -| \\/ 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> <STANDARD DEFINTIONS> -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> </STANDARD DEFINTIONS> -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> - -scale 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) -); - -edges -( -); - -boundary -( - // is there no way of defining all my 'defaultFaces' to be 'wall'? - front - { - type wall; - faces - ( - // inlet block - frontQuad(in1, join1, join2, in2) - // outlet block - frontQuad(poro1, out1, out2, poro2) - ); - } - - back - { - type wall; - faces - ( - // inlet block - backQuad(in1, join1, join2, in2) - // outlet block - backQuad(poro1, out1, out2, poro2) - ); - } - - walls - { - type wall; - faces - ( - // inlet block - quad2D(in1, join1) - quad2D(join2, in2) - // outlet block - quad2D(poro1, out1) - quad2D(out2, poro2) - ); - } - - 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) - ); - } -); - -mergePatchPairs -( -); - -// ************************************************************************* //