tutorials: coolingCylinder2D: Move zone creation into blockMeshDict
This prevents the need for a topoSet configuration. It also avoids a potential error associated with duplicate specification of the geometry of the solid region. Also, the unnecessary ./Allclean has been removed, and some minor re-naming has been done for clarity.
This commit is contained in:
@ -1,9 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
cd "${0%/*}" || exit 1 # run from this directory
|
|
||||||
|
|
||||||
# Source tutorial clean functions
|
|
||||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
|
||||||
|
|
||||||
cleanCase
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
@ -6,9 +6,7 @@ cd ${0%/*} || exit 1 # Run from this directory
|
|||||||
|
|
||||||
runApplication blockMesh
|
runApplication blockMesh
|
||||||
|
|
||||||
runApplication topoSet
|
runApplication splitMeshRegions -cellZones -overwrite
|
||||||
|
|
||||||
runApplication splitMeshRegions -cellZones -defaultRegionName fluid -overwrite
|
|
||||||
|
|
||||||
paraFoam -region fluid -touch
|
paraFoam -region fluid -touch
|
||||||
paraFoam -region solid -touch
|
paraFoam -region solid -touch
|
||||||
|
|||||||
@ -16,23 +16,17 @@ FoamFile
|
|||||||
convertToMeters 1;
|
convertToMeters 1;
|
||||||
|
|
||||||
cylinderRadius 0.005; // Radius of the cylinder
|
cylinderRadius 0.005; // Radius of the cylinder
|
||||||
halfWidth 0.04; // Half the width of the domain
|
cylinderCore 0.002; // Radius of the core block inside the cylinder
|
||||||
halfThickness 0.0025; // Half of domain thickness
|
halfWidth 0.04; // Half the channel width
|
||||||
xMax 0.1; // Maximum size of outer box in streamwise direction
|
halfThickness 0.0025; // Half the domain thickness
|
||||||
cylinderBox 0.002; // Half width of box projected outwards onto the
|
xDownstream 0.1; // X-coordinate of the downstream outlet
|
||||||
// cylinder
|
|
||||||
|
|
||||||
cylinderBoxCells 15; // Cells across cylinder
|
cylinderRadialCells 12; // Cells across the radius of the non-core part of the cylinder
|
||||||
cylinderRadialCells 12; // Cells cylinder radially
|
cylinderCoreCells 15; // Cells across the core block inside the cylinder
|
||||||
upstreamCells 30; // Cells across width of outer box
|
widthCells 30; // Cells across the domain width
|
||||||
downstreamCells 20; // Cells downstream of the cylinder
|
downstreamCells 20; // Cells across the downstream region
|
||||||
|
|
||||||
radialGrading 20; // Expansion ratio in outer region, radial direction
|
|
||||||
|
|
||||||
negHalfWidth #neg $halfWidth;
|
|
||||||
negHalfThickness #neg $halfThickness;
|
|
||||||
negSphereBox #neg $cylinderBox;
|
|
||||||
|
|
||||||
|
radialGrading 20; // Expansion ratio outside the cylinder in a radial direction
|
||||||
|
|
||||||
geometry
|
geometry
|
||||||
{
|
{
|
||||||
@ -47,61 +41,58 @@ geometry
|
|||||||
|
|
||||||
vertices
|
vertices
|
||||||
(
|
(
|
||||||
project ($negSphereBox $negSphereBox $negHalfThickness) (cylinder) // 0
|
project (#neg $cylinderCore #neg $cylinderCore #neg $halfThickness) (cylinder)
|
||||||
project ($cylinderBox $negSphereBox $negHalfThickness) (cylinder) // 1
|
project ( $cylinderCore #neg $cylinderCore #neg $halfThickness) (cylinder)
|
||||||
project ($negSphereBox $negSphereBox $halfThickness ) (cylinder) // 2
|
project (#neg $cylinderCore #neg $cylinderCore $halfThickness) (cylinder)
|
||||||
project ($cylinderBox $negSphereBox $halfThickness ) (cylinder) // 3
|
project ( $cylinderCore #neg $cylinderCore $halfThickness) (cylinder)
|
||||||
|
|
||||||
project ($negSphereBox $cylinderBox $negHalfThickness) (cylinder) // 4
|
project (#neg $cylinderCore $cylinderCore #neg $halfThickness) (cylinder)
|
||||||
project ($cylinderBox $cylinderBox $negHalfThickness) (cylinder) // 5
|
project ( $cylinderCore $cylinderCore #neg $halfThickness) (cylinder)
|
||||||
project ($negSphereBox $cylinderBox $halfThickness ) (cylinder) // 6
|
project (#neg $cylinderCore $cylinderCore $halfThickness) (cylinder)
|
||||||
project ($cylinderBox $cylinderBox $halfThickness ) (cylinder) // 7
|
project ( $cylinderCore $cylinderCore $halfThickness) (cylinder)
|
||||||
|
|
||||||
($negHalfWidth $negHalfWidth $negHalfThickness) // 8
|
(#neg $halfWidth #neg $halfWidth #neg $halfThickness)
|
||||||
($halfWidth $negHalfWidth $negHalfThickness) // 9
|
( $halfWidth #neg $halfWidth #neg $halfThickness)
|
||||||
($negHalfWidth $negHalfWidth $halfThickness ) // 10
|
(#neg $halfWidth #neg $halfWidth $halfThickness)
|
||||||
($halfWidth $negHalfWidth $halfThickness ) // 11
|
( $halfWidth #neg $halfWidth $halfThickness)
|
||||||
|
|
||||||
($negHalfWidth $halfWidth $negHalfThickness) // 12
|
(#neg $halfWidth $halfWidth #neg $halfThickness)
|
||||||
($halfWidth $halfWidth $negHalfThickness) // 13
|
( $halfWidth $halfWidth #neg $halfThickness)
|
||||||
($negHalfWidth $halfWidth $halfThickness ) // 14
|
(#neg $halfWidth $halfWidth $halfThickness)
|
||||||
($halfWidth $halfWidth $halfThickness ) // 15
|
( $halfWidth $halfWidth $halfThickness)
|
||||||
|
|
||||||
($xMax $negHalfWidth $negHalfThickness) // 16
|
($xDownstream #neg $halfWidth #neg $halfThickness)
|
||||||
($xMax $negHalfWidth $halfThickness ) // 17
|
($xDownstream #neg $halfWidth $halfThickness)
|
||||||
($xMax $halfWidth $negHalfThickness) // 18
|
($xDownstream $halfWidth #neg $halfThickness)
|
||||||
($xMax $halfWidth $halfThickness ) // 19
|
($xDownstream $halfWidth $halfThickness)
|
||||||
|
|
||||||
($negSphereBox $negSphereBox $negHalfThickness) // 20
|
(#neg $cylinderCore #neg $cylinderCore #neg $halfThickness)
|
||||||
($cylinderBox $negSphereBox $negHalfThickness) // 21
|
( $cylinderCore #neg $cylinderCore #neg $halfThickness)
|
||||||
($cylinderBox $negSphereBox $halfThickness ) // 22
|
( $cylinderCore #neg $cylinderCore $halfThickness)
|
||||||
($negSphereBox $negSphereBox $halfThickness ) // 23
|
(#neg $cylinderCore #neg $cylinderCore $halfThickness)
|
||||||
|
|
||||||
($negSphereBox $cylinderBox $negHalfThickness) // 24
|
(#neg $cylinderCore $cylinderCore #neg $halfThickness)
|
||||||
($cylinderBox $cylinderBox $negHalfThickness) // 25
|
( $cylinderCore $cylinderCore #neg $halfThickness)
|
||||||
($cylinderBox $cylinderBox $halfThickness ) // 26
|
( $cylinderCore $cylinderCore $halfThickness)
|
||||||
($negSphereBox $cylinderBox $halfThickness ) // 27
|
(#neg $cylinderCore $cylinderCore $halfThickness)
|
||||||
);
|
);
|
||||||
|
|
||||||
expandBlock simpleGrading (1 $radialGrading 1);
|
graded simpleGrading (1 $radialGrading 1);
|
||||||
reg simpleGrading (1 1 1);
|
uniform simpleGrading (1 1 1);
|
||||||
|
|
||||||
blocks
|
blocks
|
||||||
(
|
(
|
||||||
// Fluid region
|
hex (4 6 14 12 0 2 10 8) fluid (1 $widthCells $cylinderCoreCells) $graded
|
||||||
hex (4 6 14 12 0 2 10 8) (1 $upstreamCells $cylinderBoxCells) $expandBlock
|
hex (7 5 13 15 3 1 9 11) fluid (1 $widthCells $cylinderCoreCells) $graded
|
||||||
hex (7 5 13 15 3 1 9 11) (1 $upstreamCells $cylinderBoxCells) $expandBlock
|
hex (2 3 11 10 0 1 9 8) fluid ($cylinderCoreCells $widthCells 1) $graded
|
||||||
hex (2 3 11 10 0 1 9 8) ($cylinderBoxCells $upstreamCells 1) $expandBlock
|
hex (7 6 14 15 5 4 12 13) fluid ($cylinderCoreCells $widthCells 1) $graded
|
||||||
hex (7 6 14 15 5 4 12 13) ($cylinderBoxCells $upstreamCells 1) $expandBlock
|
hex (13 18 19 15 9 16 17 11) fluid ($downstreamCells 1 $cylinderCoreCells) $uniform
|
||||||
hex (13 18 19 15 9 16 17 11) ($downstreamCells 1 $cylinderBoxCells) $reg
|
|
||||||
|
|
||||||
// Solid region
|
|
||||||
hex (24 25 26 27 20 21 22 23) ($cylinderBoxCells 1 $cylinderBoxCells) $reg
|
|
||||||
hex (0 2 23 20 4 6 27 24) (1 $cylinderRadialCells $cylinderBoxCells) $reg
|
|
||||||
hex (21 22 3 1 25 26 7 5) (1 $cylinderRadialCells $cylinderBoxCells) $reg
|
|
||||||
hex (0 2 3 1 20 23 22 21) (1 $cylinderBoxCells $cylinderRadialCells) $reg
|
|
||||||
hex (4 5 7 6 24 25 26 27) ($cylinderBoxCells 1 $cylinderRadialCells) $reg
|
|
||||||
|
|
||||||
|
hex (24 25 26 27 20 21 22 23) solid ($cylinderCoreCells 1 $cylinderCoreCells) $uniform
|
||||||
|
hex (0 2 23 20 4 6 27 24) solid (1 $cylinderRadialCells $cylinderCoreCells) $uniform
|
||||||
|
hex (21 22 3 1 25 26 7 5) solid (1 $cylinderRadialCells $cylinderCoreCells) $uniform
|
||||||
|
hex (0 2 3 1 20 23 22 21) solid (1 $cylinderCoreCells $cylinderRadialCells) $uniform
|
||||||
|
hex (4 5 7 6 24 25 26 27) solid ($cylinderCoreCells 1 $cylinderRadialCells) $uniform
|
||||||
);
|
);
|
||||||
|
|
||||||
edges
|
edges
|
||||||
@ -164,5 +155,4 @@ boundary
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -1,40 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Version: dev
|
|
||||||
\\/ M anipulation |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
format ascii;
|
|
||||||
class dictionary;
|
|
||||||
object topoSetDict;
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#include "$FOAM_CASE/system/blockMeshDict"
|
|
||||||
|
|
||||||
actions
|
|
||||||
(
|
|
||||||
{
|
|
||||||
name cs;
|
|
||||||
type cellSet;
|
|
||||||
action new;
|
|
||||||
source cylinderToCell;
|
|
||||||
point1 (0 0 -100);
|
|
||||||
point2 (0 0 100);
|
|
||||||
centre (0 0 0);
|
|
||||||
radius $cylinderRadius;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name solid;
|
|
||||||
type cellZoneSet;
|
|
||||||
action new;
|
|
||||||
source setToCellZone;
|
|
||||||
set cs;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
Reference in New Issue
Block a user