diff --git a/applications/solvers/basic/potentialFoam/readControls.H b/applications/solvers/basic/potentialFoam/readControls.H index 8bda4d5017..915028c4e7 100644 --- a/applications/solvers/basic/potentialFoam/readControls.H +++ b/applications/solvers/basic/potentialFoam/readControls.H @@ -3,4 +3,3 @@ const int nNonOrthCorr = potentialFlow.lookupOrDefault("nNonOrthogonalCorrectors", 0); - diff --git a/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/Make/options b/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/Make/options index 14f2ed2f93..91cab4609b 100644 --- a/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/Make/options +++ b/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/Make/options @@ -13,4 +13,3 @@ EXE_LIBS = \ -lmolecule \ -lpotential \ -lmolecularMeasurements - diff --git a/applications/solvers/discreteMethods/molecularDynamics/mdFoam/Make/options b/applications/solvers/discreteMethods/molecularDynamics/mdFoam/Make/options index 14f2ed2f93..91cab4609b 100644 --- a/applications/solvers/discreteMethods/molecularDynamics/mdFoam/Make/options +++ b/applications/solvers/discreteMethods/molecularDynamics/mdFoam/Make/options @@ -13,4 +13,3 @@ EXE_LIBS = \ -lmolecule \ -lpotential \ -lmolecularMeasurements - diff --git a/applications/solvers/discreteMethods/molecularDynamics/mdFoam/createFields.H b/applications/solvers/discreteMethods/molecularDynamics/mdFoam/createFields.H new file mode 100644 index 0000000000..d5ea5ef8b6 --- /dev/null +++ b/applications/solvers/discreteMethods/molecularDynamics/mdFoam/createFields.H @@ -0,0 +1,55 @@ + Info<< "\nReading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + word polyatomicCloudName("polyatomicCloud"); + + potential polyPot + ( + mesh, + IOdictionary + ( + IOobject + ( + polyatomicCloudName + "Properties", + mesh.time().constant(), + mesh, + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false + ) + ) + ); + + polyatomicCloud polyatomics(polyatomicCloudName, mesh, polyPot); + + word monoatomicCloudName("monoatomicCloud"); + + potential monoPot + ( + mesh, + IOdictionary + ( + IOobject + ( + monoatomicCloudName + "Properties", + mesh.time().constant(), + mesh, + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false + ) + ) + ); + + monoatomicCloud monoatomics(monoatomicCloudName, mesh, monoPot); diff --git a/applications/solvers/discreteMethods/molecularDynamics/old/mdEquilibrationFoam/Make/files b/applications/solvers/discreteMethods/molecularDynamics/old/mdEquilibrationFoam/Make/files new file mode 100644 index 0000000000..c3a050bb68 --- /dev/null +++ b/applications/solvers/discreteMethods/molecularDynamics/old/mdEquilibrationFoam/Make/files @@ -0,0 +1,3 @@ +mdEquilibrationFoam.C + +EXE = $(FOAM_APPBIN)/mdEquilibrationFoam diff --git a/applications/solvers/discreteMethods/molecularDynamics/old/mdEquilibrationFoam/Make/options b/applications/solvers/discreteMethods/molecularDynamics/old/mdEquilibrationFoam/Make/options new file mode 100644 index 0000000000..14f2ed2f93 --- /dev/null +++ b/applications/solvers/discreteMethods/molecularDynamics/old/mdEquilibrationFoam/Make/options @@ -0,0 +1,16 @@ +EXE_INC = \ + -I$(LIB_SRC)/lagrangian/molecularDynamics/molecule/lnInclude \ + -I$(LIB_SRC)/lagrangian/molecularDynamics/potential/lnInclude \ + -I$(LIB_SRC)/lagrangian/molecularDynamics/molecularMeasurements/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/lagrangian/basic/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude + +EXE_LIBS = \ + -lmeshTools \ + -lfiniteVolume \ + -llagrangian \ + -lmolecule \ + -lpotential \ + -lmolecularMeasurements + diff --git a/applications/solvers/discreteMethods/molecularDynamics/old/mdEquilibrationFoam/mdEquilibrationFoam.C b/applications/solvers/discreteMethods/molecularDynamics/old/mdEquilibrationFoam/mdEquilibrationFoam.C new file mode 100644 index 0000000000..96c07a1756 --- /dev/null +++ b/applications/solvers/discreteMethods/molecularDynamics/old/mdEquilibrationFoam/mdEquilibrationFoam.C @@ -0,0 +1,101 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Application + mdEquilibrationFoam + +Description + Equilibrates and/or preconditions molecular dynamics systems + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "md.H" + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nReading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + potential pot(mesh); + + moleculeCloud molecules(mesh, pot); + + #include "temperatureAndPressureVariables.H" + + #include "readmdEquilibrationDict.H" + + label nAveragingSteps = 0; + + Info<< "\nStarting time loop\n" << endl; + + while (runTime.loop()) + { + nAveragingSteps++; + + Info<< "Time = " << runTime.timeName() << endl; + + molecules.evolve(); + + #include "meanMomentumEnergyAndNMols.H" + + #include "temperatureAndPressure.H" + + #include "temperatureEquilibration.H" + + runTime.write(); + + if (runTime.outputTime()) + { + nAveragingSteps = 0; + } + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/solvers/discreteMethods/molecularDynamics/old/mdEquilibrationFoam/readmdEquilibrationDict.H b/applications/solvers/discreteMethods/molecularDynamics/old/mdEquilibrationFoam/readmdEquilibrationDict.H new file mode 100644 index 0000000000..3f43981907 --- /dev/null +++ b/applications/solvers/discreteMethods/molecularDynamics/old/mdEquilibrationFoam/readmdEquilibrationDict.H @@ -0,0 +1,18 @@ +Info<< nl << "Reading MD Equilibration Dictionary" << nl << endl; + +IOdictionary mdEquilibrationDict +( + IOobject + ( + "mdEquilibrationDict", + runTime.system(), + mesh, + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE + ) +); + +scalar targetTemperature = readScalar +( + mdEquilibrationDict.lookup("targetTemperature") +); diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/UEqn.H b/applications/solvers/lagrangian/LTSReactingParcelFoam/UEqn.H index e52431f1e8..9664c2a50d 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/UEqn.H +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/UEqn.H @@ -16,4 +16,3 @@ { solve(UEqn == -fvc::grad(p)); } - diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/rhoEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/rhoEqn.H index 33b7943cad..2c307794c4 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/rhoEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/rhoEqn.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/applications/test/momentOfInertia/Test-momentOfInertia.C b/applications/test/momentOfInertia/Test-momentOfInertia.C index 08ffc37cc5..9000df4c50 100644 --- a/applications/test/momentOfInertia/Test-momentOfInertia.C +++ b/applications/test/momentOfInertia/Test-momentOfInertia.C @@ -26,7 +26,7 @@ Application Description Calculates the inertia tensor and principal axes and moments of a - test face, tetrahedron and mesh. + test face, tetrahedron and cell. \*---------------------------------------------------------------------------*/ diff --git a/applications/utilities/mesh/generation/cvMesh/Make/files b/applications/utilities/mesh/generation/cvMesh/Make/files new file mode 100644 index 0000000000..425e0f5b83 --- /dev/null +++ b/applications/utilities/mesh/generation/cvMesh/Make/files @@ -0,0 +1,3 @@ +cvMesh.C + +EXE = $(FOAM_APPBIN)/cvMesh diff --git a/applications/utilities/mesh/generation/cvMesh/Make/options b/applications/utilities/mesh/generation/cvMesh/Make/options new file mode 100644 index 0000000000..65996f338e --- /dev/null +++ b/applications/utilities/mesh/generation/cvMesh/Make/options @@ -0,0 +1,26 @@ +EXE_DEBUG = -DFULLDEBUG -g -O0 +EXE_FROUNDING_MATH = -frounding-math +EXE_NDEBUG = -DNDEBUG + +include $(GENERAL_RULES)/CGAL + +EXE_INC = \ + ${EXE_FROUNDING_MATH} \ + ${EXE_NDEBUG} \ + ${CGAL_INC} \ + -I$(LIB_SRC)/mesh/conformalVoronoiMesh/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \ + -I$(LIB_SRC)/edgeMesh/lnInclude \ + -I$(LIB_SRC)/dynamicMesh/lnInclude \ + -I$(LIB_SRC)/triSurface/lnInclude + +EXE_LIBS = \ + $(CGAL_LIBS) \ + -lconformalVoronoiMesh \ + -lmeshTools \ + -ldecompositionMethods -L$(FOAM_LIBBIN)/dummy -lscotchDecomp \ + -ledgeMesh \ + -ltriSurface \ + -ldynamicMesh diff --git a/applications/utilities/mesh/generation/cvMesh/cvMesh.C b/applications/utilities/mesh/generation/cvMesh/cvMesh.C new file mode 100644 index 0000000000..884d10b905 --- /dev/null +++ b/applications/utilities/mesh/generation/cvMesh/cvMesh.C @@ -0,0 +1,82 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Application + cvMesh + +Description + Conformal Voronoi automatic mesh generator + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "conformalVoronoiMesh.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ +# include "setRootCase.H" +# include "createTime.H" + runTime.functionObjects().off(); + + IOdictionary cvMeshDict + ( + IOobject + ( + "cvMeshDict", + runTime.system(), + runTime, + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE + ) + ); + + conformalVoronoiMesh mesh(runTime, cvMeshDict); + + while (runTime.loop()) + { + Info<< nl << "Time = " << runTime.timeName() << endl; + + mesh.move(); + + Info<< nl << "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } + + mesh.writeMesh(runTime.constant()); + + Info<< nl << "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + + Info<< nl << "End" << nl << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/utilities/mesh/generation/cvMesh/cvMeshDict b/applications/utilities/mesh/generation/cvMesh/cvMeshDict new file mode 100644 index 0000000000..8c65ed5140 --- /dev/null +++ b/applications/utilities/mesh/generation/cvMesh/cvMeshDict @@ -0,0 +1,496 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object cvMeshDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +/* + +Control dictionary for cvMesh - polyhedral mesh generator. + +cvMesh phases: +1. fill volume with initial points (initialPoints subdictionary). An option + is to reread from previous set of points. + +2. internal point motion (motionControl subdictionary) + +3. every once in a while add point duplets/triplets to conform to + surfaces and features (surfaceConformation subdictionary) + +4. back to 2 + +5. construct polyMesh. + - filter (polyMeshFiltering subdictionary) + - check (meshQualityControls subdictionary) and undo filtering + + +See also cvControls.H in the conformalVoronoiMesh library + +*/ + + +// Important: +// ---------- +// Any scalar with a name Coeff specifies a value that will be implemented +// as a faction of the local target cell size +// Any scalar with a name Size specifies an absolute size. + + +// Geometry. Definition of all surfaces. All surfaces are of class +// searchableSurface. +// Surfaces need to be (almost) closed - use closedTriSurfaceMesh +// if they are not topologically closed. Surfaces need to be oriented so +// the space to be meshed is always on the inside of all surfaces. Use e.g. +// surfaceOrient. +geometry +{ + // Surface to conform to + flange.obj + { + type triSurfaceMesh; + } + + // Surface used for cell size control + ref7.stl + { + name ref7; + type triSurfaceMesh; + } + + // Surface used for cell size control + tunnel_APPROACH_INLET.obj + { + type triSurfaceMesh; + } +} + + +// Controls for conforming to the surfaces. +surfaceConformation +{ + // A point inside surfaces that is inside mesh. + locationInMesh (0 0 0); + + // How far apart are point-duplets generated. Balance this between + // - very low distance: little chance of interference from other + // surfaces + // - largish distance: less non-orthogonality in final cell + // (circumcentre far away from centroid) + pointPairDistanceCoeff 0.1; + + // Mixed feature points - connected to both inside and outside edges. + // Recreated by inserting triplets of points to recreate a single edge. + // Done for all edges emanating from point. triplets of points get inserted + // mixedFeaturePointPPDistanceCoeff distance away from feature point. + // Set to a negative number to disable. + mixedFeaturePointPPDistanceCoeff 5.0; //-1; + + // Distance to a feature point within which surface and edge + // conformation points are excluded - fraction of the local target + // cell size + featurePointExclusionDistanceCoeff 0.4; + + // Distance to an existing feature edge conformation location + // within which other edge conformation location are excluded - + // fraction of the local target cell size + featureEdgeExclusionDistanceCoeff 0.2; + + // Optimisation: do not check for surface intersection (of dual edges) + // for points near to surface. + surfaceSearchDistanceCoeff 2.5; + + // Maximum allowable protrusion through the surface before + // conformation points are added - fraction of the local target + // cell size. These small protusions are (hopefully) done by mesh filtering + // instead. + maxSurfaceProtrusionCoeff 0.1; + + // If feature edge with large angle (so more than 125 degrees) introduce + // additional points to create two half angled cells (= mitering). + maxQuadAngle 125; + + // Frequency to redo surface conformation (expensive). + surfaceConformationRebuildFrequency 10; + + // Initial and intermediate controls + coarseConformationControls + { + // Initial conformation + initial + { + // We've got a point poking through the surface. Don't do any + // surface conformation if near feature edge (since feature edge + // conformation should have priority) + + // distance to search for near feature edges + edgeSearchDistCoeff 1.1; + + // Proximity to a feature edge where a surface hit is + // not created, only the edge conformation is created + // - fraction of the local target cell size. Coarse + // conformation, initial protrusion tests. + surfacePtReplaceDistCoeff 0.5; + } + + // Same for iterations + iteration + { + edgeSearchDistCoeff 1.25; + surfacePtReplaceDistCoeff 0.7; + } + + // Stop either at maxIterations or if the number of surface pokes + // is very small (iterationToInitialHitRatioLimit * initial number) + // Note: perhaps iterationToInitialHitRatioLimit should be absolute + // count? + maxIterations 15; + + iterationToInitialHitRatioLimit 0.001; + } + + // Final (at endTime) controls + fineConformationControls + { + initial + { + edgeSearchDistCoeff 1.1; + surfacePtReplaceDistCoeff 0.5; + } + + iteration + { + edgeSearchDistCoeff 1.25; + surfacePtReplaceDistCoeff 0.7; + } + + maxIterations 15; + + iterationToInitialHitRatioLimit 0.001; + } + + // Geometry to mesh to + geometryToConformTo + { + flange.obj + { + featureMethod extendedFeatureEdgeMesh; // or none; + extendedFeatureEdgeMesh "flange.extendedFeatureEdgeMesh"; + } + } + + // Additional features. + additionalFeatures + { + //line + //{ + // featureMethod extendedFeatureEdgeMesh; // or none; + // extendedFeatureEdgeMesh "line.extendedFeatureEdgeMesh"; + //} + } +} + + +// Controls for seeding initial points and general control of the target +// cell size (used everywhere) +initialPoints +{ + // Do not place point closer than minimumSurfaceDistanceCoeff + // to the surface. Is fraction of local target cell size (see below) + minimumSurfaceDistanceCoeff 0.55; + + initialPointsMethod autoDensity; + // initialPointsMethod uniformGrid; + // initialPointsMethod bodyCentredCubic; + // initialPointsMethod pointFile; + + + // Take boundbox of all geometry. Sample with this box. If too much + // samples in box (due to target cell size) split box. + autoDensityDetails + { + // Initial number of refinement levels. Needs to be enough to pick + // up features due to size ratio. If not enough it will take longer + // to determine point seeding. + minLevels 4; + // Split box if ratio of min to max cell size larger than maxSizeRatio + maxSizeRatio 5.0; + // Per box sample 5x5x5 internally + sampleResolution 5; + // Additionally per face of the box sample 5x5 + surfaceSampleResolution 5; + } + + uniformGridDetails + { + // Absolute cell size. + initialCellSize 0.0015; + randomiseInitialGrid yes; + randomPerturbationCoeff 0.02; + } + + bodyCentredCubicDetails + { + initialCellSize 0.0015; + randomiseInitialGrid no; + randomPerturbationCoeff 0.1; + } + + pointFileDetails + { + // Reads points from file. Still rejects points that are too + // close to the surface (minimumSurfaceDistanceCoeff) or on the + // wrong side of the surfaces. + pointFile "constant/internalDelaunayVertices"; + } +} + + +// Control size of voronoi cells i.e. distance between points. This +// determines the target cell size which is used everywhere. +// It determines the cell size given a location. It then uses all +// the rules +// - defaultCellSize +// - cellSizeControlGeometry +// to determine target cell size. Rule with highest priority wins. If same +// priority smallest cell size wins. +motionControl +{ + // Absolute cell size of back ground mesh. This is the maximum cell size. + defaultCellSize 0.00075; + + // Assign a priority to all requests for cell sizes, the highest overrules. + defaultPriority 0; + + cellSizeControlGeometry + { + ref7_outside + { + // optional name of geometry + surface ref7; + priority 1; + mode outside;//inside/bothSides + cellSizeFunction linearDistance; + + // cellSizeFunctions: + // uniform : uniform size + // uniformDistance : fixed size for all within distance + // linearSpatial : grading in specified direction only + // linearDistance : vary linearly as distance to surface + // surfaceOffsetLinearDistance : constant close to surface then + // fade like linearDistance + + // Vary from surfaceCellSize (close to the surface) to + // distanceCellSize (further than 'distance') + linearDistanceCoeffs + { + surfaceCellSize 1e-5; // absolute size + distanceCellSize $defaultCellSize; + distance 1.0; + } + } + + tunnel_APPROACH_INLET.obj + { + priority 1; + mode bothSides; + cellSizeFunction surfaceOffsetLinearDistance; + // Constant within a certain distance then linear fade away. + // Good for layers. + surfaceOffsetLinearDistanceCoeffs + { + surfaceCellSize 1e-5; + distanceCellSize $defaultCellSize; + surfaceOffset 0.1; + totalDistance 1.0; + } + } + } + + // Underrelaxation for point motion. Simulated annealing: starts off at 1 + // and lowers to 0 (at simulation endTime) to converge points. + // adaptiveLinear is preferred choice. + // Points move by e.g. 10% of tet size. + relaxationModel adaptiveLinear; //rampHoldFall + + adaptiveLinearCoeffs + { + relaxationStart 1.0; + relaxationEnd 0.0; + } + + // Output lots and lots of .obj files + objOutput no; + + // Timing and memory usage. + timeChecks yes; + + // Number of rays in plane parallel to nearest surface. Used to detect + // next closest surfaces. Used to work out alignment (three vectors) + // to surface. + // Note that only the initial points (from the seeding) calculate this + // information so if these are not fine enough the alignment will + // not be correct. (any points added during the running will lookup + // this information from the nearest initial point since it is + // expensive) + alignmentSearchSpokes 36; + + // For each delaunay edge (between two vertices, becomes + // the Voronoi face normal) snap to the alignment direction if within + // alignmentAcceptanceAngle. Slightly > 45 is a good choice - prevents + // flipping. + alignmentAcceptanceAngle 48; + + // How often to rebuild the alignment info (expensive) + sizeAndAlignmentRebuildFrequency 20; + + // When to insert points. Not advisable change to + // these settings. + pointInsertionCriteria + { + // If edge larger than 1.75 target cell size + // (so tets too large/stretched) insert point + cellCentreDistCoeff 1.75; + // Do not insert point if voronoi face (on edge) very small. + faceAreaRatioCoeff 0.0025; + // Insert point only if edge closely aligned to local alignment + // direction. + acceptanceAngle 21.5; + } + + // Opposite: remove point if mesh too compressed. Do not change these + // settings. + pointRemovalCriteria + { + cellCentreDistCoeff 0.65; + } + + // How to determine the point motion. All edges got some direction. + // Sum all edge contributions to determine point motion. Weigh by + // face area so motion is preferentially determined by large faces + // (or more importantly ignore contribution from small faces). + // Do not change these settings. + faceAreaWeightModel piecewiseLinearRamp; + + piecewiseLinearRampCoeffs + { + lowerAreaFraction 0.5; + upperAreaFraction 1.0; + } +} + + +// After simulation, when converting to polyMesh, filter out small faces/edges. +// Do not change. See cvControls.H +polyMeshFiltering +{ + // Write the underlying Delaunay tet mesh at output time + writeTetDualMesh false; //true; + + // Upper limit on the size of faces to be filtered. + // fraction of the local target cell size + filterSizeCoeff 0.2; + + // Upper limit on how close two dual vertices can be before + // being merged, fraction of the local target cell size + mergeClosenessCoeff 1e-9; + + // To not filter: set maxNonOrtho to 1 (so check fails) and then + // set continueFilteringOnBadInitialPolyMesh to false. + continueFilteringOnBadInitialPolyMesh true; + + // When a face is "bad", what fraction should the filterSizeCoeff be + // reduced by. Recursive, so for a filterCount value of fC, the + // filterSizeCoeff is reduced by pow(filterErrorReductionCoeff, fC) + filterErrorReductionCoeff 0.5; + + // Maximum number of filterCount applications before a face + // is not attempted to be filtered + filterCountSkipThreshold 4; + + // Maximum number of permissible iterations of the face collapse + // algorithm. The value to choose will be related the maximum number + // of points on a face that is to be collapsed and how many faces + // around it need to be collapsed. + maxCollapseIterations 25; + + // Maximum number of times an to allow an equal faceSet to be + // returned from the face quality assessment before stopping iterations + // to break an infinitie loop. + maxConsecutiveEqualFaceSets 5; + // Remove little steps (almost perp to surface) by collapsing face. + surfaceStepFaceAngle 80; + // Do not collapse face to edge if should become edges + edgeCollapseGuardFraction 0.3; + // Only collapse face to point if high aspect ratio + maxCollapseFaceToPointSideLengthCoeff 0.35; +} + + +// Generic mesh quality settings. At any undoable phase these determine +// where to undo. Same as in snappyHexMeshDict +meshQualityControls +{ + //- Maximum non-orthogonality allowed. Set to 180 to disable. + maxNonOrtho 65; + + //- Max skewness allowed. Set to <0 to disable. + maxBoundarySkewness 50; + maxInternalSkewness 10; + + //- Max concaveness allowed. Is angle (in degrees) below which concavity + // is allowed. 0 is straight face, <0 would be convex face. + // Set to 180 to disable. + maxConcave 80; + + //- Minimum pyramid volume. Is absolute volume of cell pyramid. + // Set to a sensible fraction of the smallest cell volume expected. + // Set to very negative number (e.g. -1E30) to disable. + minVol -1E30; + + //- Minimum quality of the tet formed by the + // variable base point minimum decomposition triangles and + // the cell centre (so not face-centre decomposition). + // This has to be a positive number for tracking + // to work. Set to very negative number (e.g. -1E30) to + // disable. + // <0 = inside out tet, + // 0 = flat tet + // 1 = regular tet + minTetQuality 1e-30; + + //- Minimum absolute face area. Set to <0 to disable. + minArea -1; + + //- Minimum face twist. Set to <-1 to disable. dot product of face normal + //- and face centre triangles normal + minTwist 0.02; + + //- minimum normalised cell determinant + //- 1 = hex, <= 0 = folded or flattened illegal cell + minDeterminant 0.001; + + //- minFaceWeight (0 -> 0.5) + minFaceWeight 0.02; + + //- minVolRatio (0 -> 1) + minVolRatio 0.01; + + //must be >0 for Fluent compatibility + minTriangleTwist -1; +} + + +// ************************************************************************* // diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C b/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C index 1f40bc50a7..31e9b74a0f 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C @@ -91,6 +91,26 @@ int main(int argc, char *argv[]) // Clear mesh before checking mesh.clearOut(); + pointIOField overrideCCs + ( + IOobject + ( + "cellCentres", + mesh.pointsInstance(), + polyMesh::meshSubDir, + runTime, + IOobject::READ_IF_PRESENT, + IOobject::NO_WRITE + ) + ); + + if (overrideCCs.headerOk()) + { + Info<< "Read " << overrideCCs.size() << " cell centres" << endl; + + mesh.overrideCellCentres(overrideCCs); + } + // Reconstruct globalMeshData mesh.globalData(); diff --git a/applications/utilities/mesh/manipulation/topoSet/topoSet.C b/applications/utilities/mesh/manipulation/topoSet/topoSet.C index 2f15bdce1d..8e4e33e8af 100644 --- a/applications/utilities/mesh/manipulation/topoSet/topoSet.C +++ b/applications/utilities/mesh/manipulation/topoSet/topoSet.C @@ -208,7 +208,8 @@ int main(int argc, char *argv[]) IOobject::MUST_READ ); Info<< "Read set " << setName << " with size " - << currentSet().size() << endl; + << returnReduce(currentSet().size(), sumOp