diff --git a/etc/caseDicts/mesh/generation/collapseDict b/etc/caseDicts/mesh/generation/collapseDict new file mode 100644 index 000000000..51010db6d --- /dev/null +++ b/etc/caseDicts/mesh/generation/collapseDict @@ -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; +} + + +// ************************************************************************* // diff --git a/etc/caseDicts/mesh/generation/extrudeMeshDict b/etc/caseDicts/mesh/generation/extrudeMeshDict new file mode 100644 index 000000000..13fda4ead --- /dev/null +++ b/etc/caseDicts/mesh/generation/extrudeMeshDict @@ -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)); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/etc/caseDicts/mesh/generation/snappyHexMeshDict b/etc/caseDicts/mesh/generation/snappyHexMeshDict new file mode 100644 index 000000000..16e378303 --- /dev/null +++ b/etc/caseDicts/mesh/generation/snappyHexMeshDict @@ -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 + { + { name inlet; } + { name outlet; } + } + } +}; + +castellatedMeshControls +{ + features + ( +// { file "CAD.eMesh"; level 1; } + ); + + refinementSurfaces + { + CAD + { + level (2 2); + patchInfo { type wall; } + + regions + { + + { + level (2 2); + patchInfo + { + type patch; + inGroups (inlet); + } + } + + + { + 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; + +// ************************************************************************* // diff --git a/etc/caseDicts/mesh/manipulation/AMI/createBafflesDict b/etc/caseDicts/mesh/manipulation/AMI/createBafflesDict new file mode 100644 index 000000000..a7b38ff6b --- /dev/null +++ b/etc/caseDicts/mesh/manipulation/AMI/createBafflesDict @@ -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; + } + } + } +} + +// ************************************************************************* // diff --git a/etc/caseDicts/mesh/manipulation/AMI/createPatchDict b/etc/caseDicts/mesh/manipulation/AMI/createPatchDict new file mode 100644 index 000000000..a0c8ab293 --- /dev/null +++ b/etc/caseDicts/mesh/manipulation/AMI/createPatchDict @@ -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); + } +); + + +// ************************************************************************* // diff --git a/etc/caseDicts/mesh/manipulation/baffles/createBafflesDict b/etc/caseDicts/mesh/manipulation/baffles/createBafflesDict new file mode 100644 index 000000000..2afc0bde9 --- /dev/null +++ b/etc/caseDicts/mesh/manipulation/baffles/createBafflesDict @@ -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; + } + } + } +} + + +// ************************************************************************* // diff --git a/etc/caseDicts/mesh/manipulation/patches/createPatchDict b/etc/caseDicts/mesh/manipulation/patches/createPatchDict new file mode 100644 index 000000000..4d6da16cb --- /dev/null +++ b/etc/caseDicts/mesh/manipulation/patches/createPatchDict @@ -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.*"); + } +); + +// ************************************************************************* // diff --git a/etc/caseDicts/preProcessing/decomposeParDict b/etc/caseDicts/preProcessing/decomposeParDict new file mode 100644 index 000000000..8e3b86b4f --- /dev/null +++ b/etc/caseDicts/preProcessing/decomposeParDict @@ -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; +} + + +// ************************************************************************* // diff --git a/etc/caseDicts/preProcessing/mapFieldsDict b/etc/caseDicts/preProcessing/mapFieldsDict new file mode 100644 index 000000000..451c2848d --- /dev/null +++ b/etc/caseDicts/preProcessing/mapFieldsDict @@ -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 +( + + +); + +// Target patches whose field values are mapped from the internal source mesh +cuttingPatches +( + + +); + +// ************************************************************************* // diff --git a/etc/caseDicts/preProcessing/setFieldsDict b/etc/caseDicts/preProcessing/setFieldsDict new file mode 100644 index 000000000..9e4915998 --- /dev/null +++ b/etc/caseDicts/preProcessing/setFieldsDict @@ -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) + ); + } +); + + +// ************************************************************************* // diff --git a/etc/caseDicts/surface/surfaceFeaturesDict b/etc/caseDicts/surface/surfaceFeaturesDict new file mode 100644 index 000000000..9040aab9f --- /dev/null +++ b/etc/caseDicts/surface/surfaceFeaturesDict @@ -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; + + +// ************************************************************************* //