mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
etc/caseDicts: added useful examples of common dictionary files
including decomposeParDict, mapFieldsDict, setFieldsDict, surfaceFeaturesDict, createBafflesDict, createPatchDict, snappyHexMeshDict, extrudeMeshDict and collapseDict
This commit is contained in:
62
etc/caseDicts/mesh/generation/collapseDict
Normal file
62
etc/caseDicts/mesh/generation/collapseDict
Normal file
@ -0,0 +1,62 @@
|
||||
/*--------------------------------*- 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 collapseDict;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// If on, adhere to quality criteria in controlMeshQualityCoeffs
|
||||
controlMeshQuality on;
|
||||
|
||||
controlMeshQualityCoeffs
|
||||
{
|
||||
#includeEtc "caseDicts/mesh/generation/meshQualityDict"
|
||||
|
||||
edgeReductionFactor 0.5;
|
||||
faceReductionFactor 0.5;
|
||||
maximumSmoothingIterations 2;
|
||||
maximumIterations 10;
|
||||
maxPointErrorCount 5;
|
||||
}
|
||||
|
||||
collapseEdgesCoeffs
|
||||
{
|
||||
// Absolute length of edges that are merged
|
||||
minimumEdgeLength 1e-6;
|
||||
|
||||
// The maximum angle between edges that permits merging
|
||||
maximumMergeAngle 30;
|
||||
}
|
||||
|
||||
|
||||
collapseFacesCoeffs
|
||||
{
|
||||
// The initial face length factor
|
||||
initialFaceLengthFactor 0.5;
|
||||
|
||||
// Relative length of face for collapsing to a point
|
||||
maxCollapseFaceToPointSideLengthCoeff 0.3;
|
||||
|
||||
// Allow early collapse of edges to a point
|
||||
allowEarlyCollapseToPoint on;
|
||||
|
||||
// Factor to premultiply maxCollapseFaceTo... for early collapse
|
||||
allowEarlyCollapseCoeff 0.2;
|
||||
|
||||
// Limiting relative distance between a vertex and face centre
|
||||
guardFraction 0.1;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
83
etc/caseDicts/mesh/generation/extrudeMeshDict
Normal file
83
etc/caseDicts/mesh/generation/extrudeMeshDict
Normal file
@ -0,0 +1,83 @@
|
||||
/*--------------------------------*- 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 extrudeMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
constructFrom patch;
|
||||
/*
|
||||
patch: patch of sourceCase
|
||||
mesh: patch of sourceCase, retaining original mesh
|
||||
surface: surface geometry file
|
||||
*/
|
||||
|
||||
sourceCase "$FOAM_CASE"; // uses current case; can be a separate case
|
||||
sourcePatches (front);
|
||||
// surface "geometry.obj"; // constructFrom surface
|
||||
|
||||
// constructFrom patch: name of exposed "original" patch
|
||||
exposedPatchName back;
|
||||
|
||||
flipNormals false;
|
||||
|
||||
extrudeModel plane;
|
||||
/*
|
||||
linearNormal: linear extrusion in point-normal direction
|
||||
plane: single-layer, point-normal extrusion with empty type (2D)
|
||||
linearDirection: linear extrusion in specified direction
|
||||
wedge: single-layer, wedge extrusion with wedge type (axisymmetric)
|
||||
sector: sector extrusion about specified axis
|
||||
linearRadial: linear extrusion in radial direction
|
||||
radial: linear extrusion in radial direction with multiple radii
|
||||
*/
|
||||
|
||||
thickness 0.5; // used by plane extrusion
|
||||
|
||||
nLayers 10;
|
||||
expansionRatio 1.0;
|
||||
|
||||
// Merge front and back patches, typically for 360 deg wedge extrusion
|
||||
mergeFaces false;
|
||||
mergeTol 0;
|
||||
|
||||
linearNormalCoeffs
|
||||
{
|
||||
thickness 0.5;
|
||||
}
|
||||
|
||||
linearDirectionCoeffs
|
||||
{
|
||||
direction (0 1 0);
|
||||
thickness 0.5;
|
||||
}
|
||||
|
||||
sectorCoeffs // used by sector and wedge extrusion
|
||||
{
|
||||
axisPt (0 0 0);
|
||||
axis (1 0 0);
|
||||
angle 360;
|
||||
}
|
||||
|
||||
linearRadialCoeffs
|
||||
{
|
||||
R 0.5;
|
||||
Rsurface 0.1;
|
||||
}
|
||||
|
||||
radialCoeffs
|
||||
{
|
||||
R table ((0 0.01) (3 0.03) (10 0.1));
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
124
etc/caseDicts/mesh/generation/snappyHexMeshDict
Normal file
124
etc/caseDicts/mesh/generation/snappyHexMeshDict
Normal file
@ -0,0 +1,124 @@
|
||||
/*--------------------------------*- 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 snappyHexMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#includeEtc "caseDicts/mesh/generation/snappyHexMeshDict.cfg"
|
||||
|
||||
castellatedMesh on;
|
||||
snap off;
|
||||
addLayers off;
|
||||
|
||||
geometry
|
||||
{
|
||||
CAD
|
||||
{
|
||||
type triSurfaceMesh;
|
||||
file "CAD.obj";
|
||||
regions
|
||||
{
|
||||
<inletPatch> { name inlet; }
|
||||
<outletPatch> { name outlet; }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
castellatedMeshControls
|
||||
{
|
||||
features
|
||||
(
|
||||
// { file "CAD.eMesh"; level 1; }
|
||||
);
|
||||
|
||||
refinementSurfaces
|
||||
{
|
||||
CAD
|
||||
{
|
||||
level (2 2);
|
||||
patchInfo { type wall; }
|
||||
|
||||
regions
|
||||
{
|
||||
<inletPatch>
|
||||
{
|
||||
level (2 2);
|
||||
patchInfo
|
||||
{
|
||||
type patch;
|
||||
inGroups (inlet);
|
||||
}
|
||||
}
|
||||
|
||||
<outletPatch>
|
||||
{
|
||||
level (2 2);
|
||||
patchInfo
|
||||
{
|
||||
type patch;
|
||||
inGroups (outlet);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
refinementRegions
|
||||
{
|
||||
CAD
|
||||
{
|
||||
mode inside;
|
||||
levels ((1E15 2));
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
layers
|
||||
{
|
||||
"CAD.*"
|
||||
{
|
||||
nSurfaceLayers 2;
|
||||
}
|
||||
}
|
||||
|
||||
relativeSizes true; // false, usually with firstLayerThickness
|
||||
expansionRatio 1.2;
|
||||
finalLayerThickness 0.5;
|
||||
minThickness 1e-3;
|
||||
// firstLayerThickness 0.01;
|
||||
|
||||
// maxThicknessToMedialRatio 0.6;
|
||||
}
|
||||
|
||||
writeFlags
|
||||
(
|
||||
// scalarLevels
|
||||
layerSets
|
||||
layerFields
|
||||
);
|
||||
|
||||
mergeTolerance 1e-6;
|
||||
|
||||
// ************************************************************************* //
|
||||
46
etc/caseDicts/mesh/manipulation/AMI/createBafflesDict
Normal file
46
etc/caseDicts/mesh/manipulation/AMI/createBafflesDict
Normal file
@ -0,0 +1,46 @@
|
||||
/*--------------------------------*- 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 createBafflesDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
internalFacesOnly true;
|
||||
|
||||
baffles
|
||||
{
|
||||
baffleFaces
|
||||
{
|
||||
type faceZone;
|
||||
zoneName rotatingZone;
|
||||
|
||||
patches
|
||||
{
|
||||
master
|
||||
{
|
||||
name AMI1;
|
||||
type cyclicAMI;
|
||||
matchTolerance 0.0001;
|
||||
neighbourPatch AMI2;
|
||||
transform noOrdering;
|
||||
}
|
||||
slave
|
||||
{
|
||||
$master;
|
||||
name AMI2;
|
||||
neighbourPatch AMI1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
56
etc/caseDicts/mesh/manipulation/AMI/createPatchDict
Normal file
56
etc/caseDicts/mesh/manipulation/AMI/createPatchDict
Normal file
@ -0,0 +1,56 @@
|
||||
/*--------------------------------*- 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 createPatchDict;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
pointSync false;
|
||||
|
||||
// AMI created from internal boundary with cylinder and cylinder_slave patches
|
||||
|
||||
masterAMI
|
||||
{
|
||||
name AMI1;
|
||||
patchInfo
|
||||
{
|
||||
type cyclicAMI;
|
||||
matchTolerance 0.0001;
|
||||
neighbourPatch AMI2;
|
||||
transform noOrdering;
|
||||
}
|
||||
constructFrom patches;
|
||||
patches (cylinder);
|
||||
}
|
||||
|
||||
patches
|
||||
(
|
||||
// master AMI patch
|
||||
{
|
||||
$masterAMI;
|
||||
}
|
||||
|
||||
// slave AMI patch
|
||||
{
|
||||
$masterAMI;
|
||||
name AMI2;
|
||||
patchInfo
|
||||
{
|
||||
neighbourPatch AMI1;
|
||||
}
|
||||
patches (cylinder_slave);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
47
etc/caseDicts/mesh/manipulation/baffles/createBafflesDict
Normal file
47
etc/caseDicts/mesh/manipulation/baffles/createBafflesDict
Normal file
@ -0,0 +1,47 @@
|
||||
/*--------------------------------*- 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 createBafflesDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// Whether to convert internal faces only (so leave boundary faces intact).
|
||||
// This is only relevant if your face selection type can pick up boundary
|
||||
// faces.
|
||||
internalFacesOnly true;
|
||||
|
||||
// Example using "blades" as name of baffle patch
|
||||
baffles
|
||||
{
|
||||
baffles // group name
|
||||
{
|
||||
//- Use predefined faceZone to select faces and orientation.
|
||||
type faceZone;
|
||||
zoneName blades;
|
||||
|
||||
patches
|
||||
{
|
||||
master
|
||||
{
|
||||
name blades; // patch name
|
||||
type wall;
|
||||
}
|
||||
slave
|
||||
{
|
||||
$master;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
42
etc/caseDicts/mesh/manipulation/patches/createPatchDict
Normal file
42
etc/caseDicts/mesh/manipulation/patches/createPatchDict
Normal file
@ -0,0 +1,42 @@
|
||||
/*--------------------------------*- 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 createPatchDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
pointSync false;
|
||||
|
||||
patches
|
||||
(
|
||||
{
|
||||
name inlet;
|
||||
patchInfo
|
||||
{
|
||||
type patch;
|
||||
}
|
||||
constructFrom set;
|
||||
set inletFaces;
|
||||
}
|
||||
|
||||
{
|
||||
name walls;
|
||||
patchInfo
|
||||
{
|
||||
type wall;
|
||||
}
|
||||
constructFrom patches;
|
||||
patches ("CAD.*");
|
||||
}
|
||||
);
|
||||
|
||||
// ************************************************************************* //
|
||||
41
etc/caseDicts/preProcessing/decomposeParDict
Normal file
41
etc/caseDicts/preProcessing/decomposeParDict
Normal file
@ -0,0 +1,41 @@
|
||||
/*--------------------------------*- 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 decomposeParDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
numberOfSubdomains 8;
|
||||
|
||||
/*
|
||||
Main methods are:
|
||||
1) Geometric: "simple"; "hierarchical", with ordered sorting, e.g. xyz, yxz
|
||||
2) Scotch: "scotch", when running in serial; "ptscotch", running in parallel
|
||||
*/
|
||||
|
||||
method hierarchical;
|
||||
|
||||
simpleCoeffs
|
||||
{
|
||||
n (4 2 1); // total must match numberOfSubdomains
|
||||
delta 0.001;
|
||||
}
|
||||
|
||||
hierarchicalCoeffs
|
||||
{
|
||||
n (4 2 1); // total must match numberOfSubdomains
|
||||
delta 0.001;
|
||||
order xyz;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
31
etc/caseDicts/preProcessing/mapFieldsDict
Normal file
31
etc/caseDicts/preProcessing/mapFieldsDict
Normal file
@ -0,0 +1,31 @@
|
||||
/*--------------------------------*- 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 mapFieldsDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// Map data from source patch to target coincident patch
|
||||
patchMap
|
||||
(
|
||||
<sourcePatch1> <targetPatch1>
|
||||
<sourcePatch2> <targetPatch2>
|
||||
);
|
||||
|
||||
// Target patches whose field values are mapped from the internal source mesh
|
||||
cuttingPatches
|
||||
(
|
||||
<targetPatch1>
|
||||
<targetPatch2>
|
||||
);
|
||||
|
||||
// ************************************************************************* //
|
||||
67
etc/caseDicts/preProcessing/setFieldsDict
Normal file
67
etc/caseDicts/preProcessing/setFieldsDict
Normal file
@ -0,0 +1,67 @@
|
||||
/*--------------------------------*- 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 setFieldsDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
defaultFieldValues
|
||||
(
|
||||
volScalarFieldValue alpha.water 0
|
||||
volVectorFieldValue U (0 0 0)
|
||||
);
|
||||
|
||||
regions
|
||||
(
|
||||
// Setting values inside a box
|
||||
boxToCell
|
||||
{
|
||||
box (0 0 0) (30 30 30);
|
||||
fieldValues
|
||||
(
|
||||
volScalarFieldValue alpha.water 1
|
||||
volVectorFieldValue U (1 0 0)
|
||||
);
|
||||
}
|
||||
|
||||
// Setting values inside a sphere
|
||||
sphereToCell
|
||||
{
|
||||
centre (40 40 40);
|
||||
radius 10;
|
||||
fieldValues
|
||||
(
|
||||
volScalarFieldValue alpha.water 1
|
||||
volVectorFieldValue U (1 0 0)
|
||||
);
|
||||
}
|
||||
|
||||
// Setting values inside a surface geometry file
|
||||
surfaceToCell
|
||||
{
|
||||
file "geometry.obj";
|
||||
outsidePoints ( (0 0 0) );
|
||||
includeCut no;
|
||||
includeInside yes;
|
||||
includeOutside no;
|
||||
nearDistance 0;
|
||||
curvature 0;
|
||||
fieldValues
|
||||
(
|
||||
volScalarFieldValue alpha.water 1
|
||||
volVectorFieldValue U (1 0 0)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
61
etc/caseDicts/surface/surfaceFeaturesDict
Normal file
61
etc/caseDicts/surface/surfaceFeaturesDict
Normal file
@ -0,0 +1,61 @@
|
||||
/*--------------------------------*- 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 surfaceFeatureExtractDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
surfaces
|
||||
(
|
||||
"surface1.stl"
|
||||
"surface2.obj"
|
||||
);
|
||||
|
||||
// Identify edges when angle between faces < includedAngle
|
||||
includedAngle 120;
|
||||
|
||||
// Include region boundaries as features
|
||||
geometricTestOnly no;
|
||||
|
||||
subsetFeatures
|
||||
{
|
||||
// Include only edges that intersect the plane with (normal)(basePoint)
|
||||
// plane (1 0 0)(0 0 0);
|
||||
|
||||
// Include only edges inside the box
|
||||
// insideBox (0 0 0)(1 1 1);
|
||||
|
||||
// Include only edges outside the box
|
||||
// outsideBox (0 0 0)(1 1 1);
|
||||
|
||||
// Include nonManifold edges (edges with >2 connected faces)
|
||||
nonManifoldEdges yes;
|
||||
|
||||
// Include open edges (edges with 1 connected face)
|
||||
openEdges yes;
|
||||
}
|
||||
|
||||
trimFeatures
|
||||
{
|
||||
// Remove features with fewer than the specified number of edges
|
||||
minElem 0;
|
||||
|
||||
// Remove features shorter than the specified cumulative length
|
||||
minLen 0.0;
|
||||
}
|
||||
|
||||
// Write features to obj format for visualisation
|
||||
writeObj yes;
|
||||
verboseObj no;
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
Reference in New Issue
Block a user