Integrated Foundation code to commit 104aac5

This commit is contained in:
Andrew Heather
2017-05-17 16:35:18 +01:00
590 changed files with 5963 additions and 3699 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: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ 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

@ -83,11 +83,13 @@ castellatedMeshControls
locationInMesh (1e-5 1e-5 1e-5); // Offset from (0 0 0) to avoid
// coinciding with face or edge
nCellsBetweenLevels 3;
}
snapControls
{
explicitFeatureSnap true;
implicitFeatureSnap false;
}
addLayersControls