Files
openfoam/tutorials/mesh/blockMesh/sphere/system/blockMeshDict
2022-12-21 16:16:18 +00:00

104 lines
2.2 KiB
C++

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
scale 1;
// Geometric parameters
outerRadius 1;
// Divisions in x/y/z directions. Can be unequal.
nx 10;
ny $nx;
nz $nx;
geometry
{
sphere
{
type sphere;
origin (0 0 0);
radius $outerRadius;
}
}
// Box size
vo #eval{ sqrt($outerRadius/3) };
vertices
(
(-$vo -$vo -$vo)
( $vo -$vo -$vo)
( $vo $vo -$vo)
(-$vo $vo -$vo)
(-$vo -$vo $vo)
( $vo -$vo $vo)
( $vo $vo $vo)
(-$vo $vo $vo)
);
blocks
(
hex (0 1 2 3 4 5 6 7) ($nx $ny $nz) grading (1 1 1)
);
edges
(
arc 0 1 origin (0 0 0)
arc 2 3 origin (0 0 0)
arc 6 7 origin (0 0 0)
arc 4 5 origin (0 0 0)
arc 0 3 origin (0 0 0)
arc 1 2 origin (0 0 0)
arc 5 6 origin (0 0 0)
arc 4 7 origin (0 0 0)
arc 0 4 origin (0 0 0)
arc 1 5 origin (0 0 0)
arc 2 6 origin (0 0 0)
arc 3 7 origin (0 0 0)
);
faces
(
project (0 0) sphere // x-min
project (0 1) sphere // x-max
project (0 2) sphere // y-min
project (0 3) sphere // y-max
project (0 4) sphere // z-min
project (0 5) sphere // z-max
);
boundary
(
walls
{
type wall;
faces
(
(0 0) // x-min
(0 1) // x-max
(0 2) // y-min
(0 3) // y-max
(0 4) // z-min
(0 5) // z-max
);
}
);
// ************************************************************************* //