template cases: added cylindrical background mesh in rotating geometry cases

snappyHexMesh produces a far better quality AMI interface using a cylindrical background mesh,
leading to much more robust performance, even on a relatively coarse mesh.  The min/max AMI
weights remain close to 1 as the mesh moves, giving better conservation.

The rotating geometry template cases are configured with a blockMeshDict file for a cylindrical
background mesh aligned along the z-axis.  The details of use are found in the README and
blockMeshDict files.
This commit is contained in:
Chris Greenshields
2017-04-04 12:24:01 +01:00
parent 28df1a2d1d
commit d9b9118ee4
9 changed files with 526 additions and 58 deletions

View File

@ -2,6 +2,61 @@ Overview
========
+ Template case for rotating geometry flow for a closed geometry
+ Can be used for MRF or AMI simulations
+ Setup to run the simpleFoam solver
+ Set up is like inflowOutflowRotating but without inlet and outlet
+ See $FOAM_ETC/templates/closedVolume/README for details of use
+ Setup to run the simpleFoam solver for MRF, pimpleDyMFoam for AMI
+ The case is designed to be meshed with snappyHexMesh
+ snappyHexMesh is setup to use 3 trisurface files
+ fixed.obj: CAD of the stationary geometry
+ rotating.obj: CAD of the rotating geometry
+ rotatingZone.obj: CAD of surface bounding the rotating region
+ Copy the *.obj files to the constant/triSurface directory
+ The fixed.obj should contain an inlet and outlet region to create the relevant
patches in the mesh
Background Mesh
===============
+ The blockMeshDict file contains a configuration for a cylindrical background
mesh aligned along the z-axis
+ The mesh includes a core box-shaped block and inner and outer cylinders
+ The backgroundMesh subdictionary includes key geometric parameters of the mesh
+ The inner cylinder relates to the rotatingZone.obj
+ The outer cyliner relates to the external boundary, e.g. fixed.obj
+ Set the radii of inner and outer cylinders to ~2% larger than respective OBJ
files
+ Set background mesh density with boxCells, inCells, outCells and zCells
+ Run blockMesh
+ NOTE: An alternative blockMeshDict-box file exists if the user wants a regular
box-shaped background mesh, similar to set up in the inflowOutflow template
Features
========
+ Run surfaceFeatureExtract to extract features for explicit feature capturing
Castellated Mesh
================
+ run snappyHexMesh to obtain a castellatedMesh
+ Review the mesh; modify refinement levels and regenerate the mesh as required
(levels are set in refinementSurfaces and refinementRegions)
Snapped Mesh
============
+ In snappyHexMeshDict, set castellatedMesh off; snap on;
+ Run the snapping phase of snappyHexMesh
+ Review the mesh
Layers
======
+ To add layers to the mesh along wall boundary patches...
+ Switch on addLayers; switch snap off;
+ Run snappyHexMesh
+ The number of layers can be changed by modifying nSurfaceLayers
Initialisation
==============
+ Initialise the field files in the 0 directory
+ Set the viscosity in constant/transportProperties
+ Rotating properties are set in constant/rotatingZoneProperties
+ For MRF, this file is included from system/fvOptions
+ For AMI, this file is included from constant/dynamicMeshDict
+ Ensure settings are appropriate in controlDict, fvSchemes, fvSolution, for
relevant simulation; for AMI, in particular, ensure that deltaT, ddtSchemes
and relaxationFactors are set for transient simulation

View File

@ -14,47 +14,175 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Example configuration:
// - Cylindrical mesh along z-axis (0 < z < 10)
// - External boundary (fixed.obj) radius = 3
// - Rotating zone (rotatingZone.obj) radius = 1
backgroundMesh
{
xMin -1;
xMax 1;
yMin -1;
yMax 1;
zMin -1;
zMax 1;
xCells 20;
yCells 20;
zCells 20;
radOut 3.06; // larger than fixed.obj by ~ 1/cos(45/boxCells)
radOutN -3.06;
radIn 1.02; // larger than rotatingZone.obj (see above)
radInN -1.02;
radBox 0.30; // ~30% of rotatingZone.obj
radBoxN -0.30;
zMin 0;
zMax 10; // External boundary axial length
boxCells 5; // Cells across inner box-shaped block
inCells 5; // Cells in radial direction, inner cylinder
outCells 8; // Cells in radial direction, outer cylinder
zCells 50; // Cells in axial direction
outGrading 2.0; // Expansion ratio in outer region, radial direction
}
geometry
{
rotatingZone
{
type searchableCylinder;
point1 (0 0 -100);
point2 (0 0 100);
radius $:backgroundMesh.radIn;
}
fixed
{
type searchableCylinder;
point1 (0 0 -100);
point2 (0 0 100);
radius $:backgroundMesh.radOut;
}
}
convertToMeters 1;
vertices
(
($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMin)
($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMin)
($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMin)
($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMin)
($:backgroundMesh.radBoxN $:backgroundMesh.radBoxN $:backgroundMesh.zMin)
($:backgroundMesh.radBox $:backgroundMesh.radBoxN $:backgroundMesh.zMin)
($:backgroundMesh.radBox $:backgroundMesh.radBox $:backgroundMesh.zMin)
($:backgroundMesh.radBoxN $:backgroundMesh.radBox $:backgroundMesh.zMin)
($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMax)
($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMax)
($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMax)
($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMax)
project
($:backgroundMesh.radInN $:backgroundMesh.radInN $:backgroundMesh.zMin)
(rotatingZone)
project
($:backgroundMesh.radIn $:backgroundMesh.radInN $:backgroundMesh.zMin)
(rotatingZone)
project
($:backgroundMesh.radIn $:backgroundMesh.radIn $:backgroundMesh.zMin)
(rotatingZone)
project
($:backgroundMesh.radInN $:backgroundMesh.radIn $:backgroundMesh.zMin)
(rotatingZone)
project
($:backgroundMesh.radOutN $:backgroundMesh.radOutN $:backgroundMesh.zMin)
(fixed)
project
($:backgroundMesh.radOut $:backgroundMesh.radOutN $:backgroundMesh.zMin)
(fixed)
project
($:backgroundMesh.radOut $:backgroundMesh.radOut $:backgroundMesh.zMin)
(fixed)
project
($:backgroundMesh.radOutN $:backgroundMesh.radOut $:backgroundMesh.zMin)
(fixed)
($:backgroundMesh.radBoxN $:backgroundMesh.radBoxN $:backgroundMesh.zMax)
($:backgroundMesh.radBox $:backgroundMesh.radBoxN $:backgroundMesh.zMax)
($:backgroundMesh.radBox $:backgroundMesh.radBox $:backgroundMesh.zMax)
($:backgroundMesh.radBoxN $:backgroundMesh.radBox $:backgroundMesh.zMax)
project
($:backgroundMesh.radInN $:backgroundMesh.radInN $:backgroundMesh.zMax)
(rotatingZone)
project
($:backgroundMesh.radIn $:backgroundMesh.radInN $:backgroundMesh.zMax)
(rotatingZone)
project
($:backgroundMesh.radIn $:backgroundMesh.radIn $:backgroundMesh.zMax)
(rotatingZone)
project
($:backgroundMesh.radInN $:backgroundMesh.radIn $:backgroundMesh.zMax)
(rotatingZone)
project
($:backgroundMesh.radOutN $:backgroundMesh.radOutN $:backgroundMesh.zMax)
(fixed)
project
($:backgroundMesh.radOut $:backgroundMesh.radOutN $:backgroundMesh.zMax)
(fixed)
project
($:backgroundMesh.radOut $:backgroundMesh.radOut $:backgroundMesh.zMax)
(fixed)
project
($:backgroundMesh.radOutN $:backgroundMesh.radOut $:backgroundMesh.zMax)
(fixed)
);
boxMesh
($:backgroundMesh.boxCells $:backgroundMesh.boxCells $:backgroundMesh.zCells)
simpleGrading (1 1 1);
inMesh
($:backgroundMesh.boxCells $:backgroundMesh.inCells $:backgroundMesh.zCells)
simpleGrading (1 1 1);
outMesh
($:backgroundMesh.boxCells $:backgroundMesh.outCells $:backgroundMesh.zCells)
simpleGrading (1 $:backgroundMesh.outGrading 1);
blocks
(
hex (0 1 2 3 4 5 6 7)
(
$:backgroundMesh.xCells
$:backgroundMesh.yCells
$:backgroundMesh.zCells
)
simpleGrading (1 1 1)
hex (0 1 2 3 12 13 14 15) $boxMesh
hex (1 0 4 5 13 12 16 17) $inMesh
hex (0 3 7 4 12 15 19 16) $inMesh
hex (2 1 5 6 14 13 17 18) $inMesh
hex (3 2 6 7 15 14 18 19) $inMesh
hex (5 4 8 9 17 16 20 21) $outMesh
hex (4 7 11 8 16 19 23 20) $outMesh
hex (6 5 9 10 18 17 21 22) $outMesh
hex (7 6 10 11 19 18 22 23) $outMesh
);
edges
(
project 4 5 (rotatingZone)
project 5 6 (rotatingZone)
project 6 7 (rotatingZone)
project 7 4 (rotatingZone)
project 16 17 (rotatingZone)
project 17 18 (rotatingZone)
project 18 19 (rotatingZone)
project 19 16 (rotatingZone)
project 8 9 (fixed)
project 9 10 (fixed)
project 10 11 (fixed)
project 11 8 (fixed)
project 20 21 (fixed)
project 21 22 (fixed)
project 22 23 (fixed)
project 23 20 (fixed)
);
boundary

View File

@ -0,0 +1,68 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
backgroundMesh
{
xMin -1;
xMax 1;
yMin -1;
yMax 1;
zMin -1;
zMax 1;
xCells 20;
yCells 20;
zCells 20;
}
convertToMeters 1;
vertices
(
($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMin)
($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMin)
($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMin)
($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMin)
($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMax)
($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMax)
($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMax)
($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMax)
);
blocks
(
hex (0 1 2 3 4 5 6 7)
(
$:backgroundMesh.xCells
$:backgroundMesh.yCells
$:backgroundMesh.zCells
)
simpleGrading (1 1 1)
);
edges
(
);
boundary
(
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -88,6 +88,7 @@ castellatedMeshControls
snapControls
{
explicitFeatureSnap true;
implicitFeatureSnap false;
}
addLayersControls

View File

@ -14,7 +14,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Uinlet (10 0 0);
Uinlet (0 0 10);
dimensions [0 1 -1 0 0 0 0];

View File

@ -12,12 +12,48 @@ Overview
+ The fixed.obj should contain an inlet and outlet region to create the relevant
patches in the mesh
Meshing
=======
+ Meshing is setup as in the inflowOutflow template
+ See $FOAM_ETC/templates/inflowOutflow/README for details
+ For AMI, the AMI interface can be set up by running createBaffles which uses
the createBafflesDict file
Background Mesh
===============
+ The blockMeshDict file contains a configuration for a cylindrical background
mesh aligned along the z-axis
+ The mesh includes a core box-shaped block and inner and outer cylinders
+ The backgroundMesh subdictionary includes key geometric parameters of the mesh
+ The inner cylinder relates to the rotatingZone.obj
+ The outer cyliner relates to the external boundary, e.g. fixed.obj
+ Set the radii of inner and outer cylinders to ~2% larger than respective OBJ
files
+ The background mesh can define the external boundary by uncommenting
entries, e.g. inlet, in the boundary section of blockMeshDict
+ Set background mesh density with boxCells, inCells, outCells and zCells
+ Run blockMesh
+ NOTE: An alternative blockMeshDict-box file exists if the user wants a regular
box-shaped background mesh, similar to set up in the inflowOutflow template
Features
========
+ Run surfaceFeatureExtract to extract features for explicit feature capturing
Castellated Mesh
================
+ In the snappyHexMeshDict file, replace <inletPatch> with the name of the inlet
region in the fixed.obj file, if it defines the external boundary
+ Replace <outletPatch> with the name of the outlet region
+ run snappyHexMesh to obtain a castellatedMesh
+ Review the mesh; modify refinement levels and regenerate the mesh as required
(levels are set in refinementSurfaces and refinementRegions)
Snapped Mesh
============
+ In snappyHexMeshDict, set castellatedMesh off; snap on;
+ Run the snapping phase of snappyHexMesh
+ Review the mesh
Layers
======
+ To add layers to the mesh along wall boundary patches...
+ Switch on addLayers; switch snap off;
+ Run snappyHexMesh
+ The number of layers can be changed by modifying nSurfaceLayers
Initialisation
==============

View File

@ -14,51 +14,227 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Example configuration:
// - Cylindrical mesh along z-axis (0 < z < 10)
// - External boundary (fixed.obj) radius = 3
// - Rotating zone (rotatingZone.obj) radius = 1
backgroundMesh
{
xMin -1;
xMax 1;
yMin -1;
yMax 1;
zMin -1;
zMax 1;
xCells 20;
yCells 20;
zCells 20;
radOut 3.06; // larger than fixed.obj by ~ 1/cos(45/boxCells)
radOutN -3.06;
radIn 1.02; // larger than rotatingZone.obj (see above)
radInN -1.02;
radBox 0.30; // ~30% of rotatingZone.obj
radBoxN -0.30;
zMin 0;
zMax 10; // External boundary axial length
boxCells 5; // Cells across inner box-shaped block
inCells 5; // Cells in radial direction, inner cylinder
outCells 8; // Cells in radial direction, outer cylinder
zCells 50; // Cells in axial direction
outGrading 2.0; // Expansion ratio in outer region, radial direction
}
geometry
{
rotatingZone
{
type searchableCylinder;
point1 (0 0 -100);
point2 (0 0 100);
radius $:backgroundMesh.radIn;
}
fixed
{
type searchableCylinder;
point1 (0 0 -100);
point2 (0 0 100);
radius $:backgroundMesh.radOut;
}
}
convertToMeters 1;
vertices
(
($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMin)
($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMin)
($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMin)
($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMin)
($:backgroundMesh.radBoxN $:backgroundMesh.radBoxN $:backgroundMesh.zMin)
($:backgroundMesh.radBox $:backgroundMesh.radBoxN $:backgroundMesh.zMin)
($:backgroundMesh.radBox $:backgroundMesh.radBox $:backgroundMesh.zMin)
($:backgroundMesh.radBoxN $:backgroundMesh.radBox $:backgroundMesh.zMin)
($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMax)
($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMax)
($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMax)
($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMax)
project
($:backgroundMesh.radInN $:backgroundMesh.radInN $:backgroundMesh.zMin)
(rotatingZone)
project
($:backgroundMesh.radIn $:backgroundMesh.radInN $:backgroundMesh.zMin)
(rotatingZone)
project
($:backgroundMesh.radIn $:backgroundMesh.radIn $:backgroundMesh.zMin)
(rotatingZone)
project
($:backgroundMesh.radInN $:backgroundMesh.radIn $:backgroundMesh.zMin)
(rotatingZone)
project
($:backgroundMesh.radOutN $:backgroundMesh.radOutN $:backgroundMesh.zMin)
(fixed)
project
($:backgroundMesh.radOut $:backgroundMesh.radOutN $:backgroundMesh.zMin)
(fixed)
project
($:backgroundMesh.radOut $:backgroundMesh.radOut $:backgroundMesh.zMin)
(fixed)
project
($:backgroundMesh.radOutN $:backgroundMesh.radOut $:backgroundMesh.zMin)
(fixed)
($:backgroundMesh.radBoxN $:backgroundMesh.radBoxN $:backgroundMesh.zMax)
($:backgroundMesh.radBox $:backgroundMesh.radBoxN $:backgroundMesh.zMax)
($:backgroundMesh.radBox $:backgroundMesh.radBox $:backgroundMesh.zMax)
($:backgroundMesh.radBoxN $:backgroundMesh.radBox $:backgroundMesh.zMax)
project
($:backgroundMesh.radInN $:backgroundMesh.radInN $:backgroundMesh.zMax)
(rotatingZone)
project
($:backgroundMesh.radIn $:backgroundMesh.radInN $:backgroundMesh.zMax)
(rotatingZone)
project
($:backgroundMesh.radIn $:backgroundMesh.radIn $:backgroundMesh.zMax)
(rotatingZone)
project
($:backgroundMesh.radInN $:backgroundMesh.radIn $:backgroundMesh.zMax)
(rotatingZone)
project
($:backgroundMesh.radOutN $:backgroundMesh.radOutN $:backgroundMesh.zMax)
(fixed)
project
($:backgroundMesh.radOut $:backgroundMesh.radOutN $:backgroundMesh.zMax)
(fixed)
project
($:backgroundMesh.radOut $:backgroundMesh.radOut $:backgroundMesh.zMax)
(fixed)
project
($:backgroundMesh.radOutN $:backgroundMesh.radOut $:backgroundMesh.zMax)
(fixed)
);
boxMesh
($:backgroundMesh.boxCells $:backgroundMesh.boxCells $:backgroundMesh.zCells)
simpleGrading (1 1 1);
inMesh
($:backgroundMesh.boxCells $:backgroundMesh.inCells $:backgroundMesh.zCells)
simpleGrading (1 1 1);
outMesh
($:backgroundMesh.boxCells $:backgroundMesh.outCells $:backgroundMesh.zCells)
simpleGrading (1 $:backgroundMesh.outGrading 1);
blocks
(
hex (0 1 2 3 4 5 6 7)
(
$:backgroundMesh.xCells
$:backgroundMesh.yCells
$:backgroundMesh.zCells
)
simpleGrading (1 1 1)
hex (0 1 2 3 12 13 14 15) $boxMesh
hex (1 0 4 5 13 12 16 17) $inMesh
hex (0 3 7 4 12 15 19 16) $inMesh
hex (2 1 5 6 14 13 17 18) $inMesh
hex (3 2 6 7 15 14 18 19) $inMesh
hex (5 4 8 9 17 16 20 21) $outMesh
hex (4 7 11 8 16 19 23 20) $outMesh
hex (6 5 9 10 18 17 21 22) $outMesh
hex (7 6 10 11 19 18 22 23) $outMesh
);
edges
(
project 4 5 (rotatingZone)
project 5 6 (rotatingZone)
project 6 7 (rotatingZone)
project 7 4 (rotatingZone)
project 16 17 (rotatingZone)
project 17 18 (rotatingZone)
project 18 19 (rotatingZone)
project 19 16 (rotatingZone)
project 8 9 (fixed)
project 9 10 (fixed)
project 10 11 (fixed)
project 11 8 (fixed)
project 20 21 (fixed)
project 21 22 (fixed)
project 22 23 (fixed)
project 23 20 (fixed)
);
boundary
(
// Uncomment below to define patches in background mesh
/*
inlet
{
type patch;
faces
(
(0 1 2 3)
(0 4 5 1)
(1 5 6 2)
(2 6 7 3)
(3 7 4 0)
(4 8 9 5)
(5 9 10 6)
(6 10 11 7)
(7 11 8 4)
);
}
outlet
{
type patch;
faces
(
(12 13 14 15)
(12 16 17 13)
(13 17 18 14)
(14 18 19 15)
(15 19 16 12)
(16 20 21 17)
(17 21 22 18)
(18 22 23 19)
(19 23 20 16)
);
}
walls
{
type wall;
faces
(
(8 9 21 20)
(9 10 22 21)
(10 11 23 22)
(11 8 20 23)
);
}
*/
);
mergePatchPairs

View File

@ -59,6 +59,8 @@ edges
boundary
(
// Uncomment below to define patches in background mesh
/*
left
{
type patch;
@ -112,6 +114,7 @@ boundary
(3 2 6 7)
);
}
*/
);
mergePatchPairs

View File

@ -117,6 +117,7 @@ castellatedMeshControls
snapControls
{
explicitFeatureSnap true;
implicitFeatureSnap false;
}
addLayersControls