diff --git a/applications/utilities/preProcessing/snappyHexMeshConfig/Make/files b/applications/utilities/preProcessing/snappyHexMeshConfig/Make/files index e364d57038..9a5dc44074 100644 --- a/applications/utilities/preProcessing/snappyHexMeshConfig/Make/files +++ b/applications/utilities/preProcessing/snappyHexMeshConfig/Make/files @@ -5,6 +5,7 @@ blockMeshConfigurationBase.C blockMeshCartesianConfiguration.C blockMeshCylindricalConfiguration.C snappyHexMeshConfiguration.C +meshQualityConfiguration.C surfaceFeaturesConfiguration.C snappyHexMeshConfig.C diff --git a/applications/utilities/preProcessing/snappyHexMeshConfig/meshQualityConfiguration.C b/applications/utilities/preProcessing/snappyHexMeshConfig/meshQualityConfiguration.C new file mode 100644 index 0000000000..b29bbad598 --- /dev/null +++ b/applications/utilities/preProcessing/snappyHexMeshConfig/meshQualityConfiguration.C @@ -0,0 +1,60 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2023 OpenFOAM Foundation + \\/ 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 . + +\*---------------------------------------------------------------------------*/ + +#include "meshQualityConfiguration.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::meshQualityConfiguration::meshQualityConfiguration +( + const fileName& name, + const fileName& dir, + const Time& time +) +: + caseFileConfiguration(name, dir, time) +{} + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::meshQualityConfiguration::~meshQualityConfiguration() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +void Foam::meshQualityConfiguration::write() +{ + dict_.writeHeader(os_, word("dictionary")); + os_ << "#includeEtc \"caseDicts/mesh/generation/meshQualityDict.cfg\"" + << nl << endl; + + os_ << "//- minFaceWeight (0 -> 0.5)" << nl + << "//minFaceWeight 0.02;"; + + dict_.writeEndDivider(os_); +} + +// ************************************************************************* // diff --git a/applications/utilities/preProcessing/snappyHexMeshConfig/meshQualityConfiguration.H b/applications/utilities/preProcessing/snappyHexMeshConfig/meshQualityConfiguration.H new file mode 100644 index 0000000000..5461d766d9 --- /dev/null +++ b/applications/utilities/preProcessing/snappyHexMeshConfig/meshQualityConfiguration.H @@ -0,0 +1,94 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2023 OpenFOAM Foundation + \\/ 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 . + +Class + Foam::meshQualityConfiguration + +Description + Writes a meshQualityDict file which is included from the snappyHexMeshDict + file. + +SourceFiles + meshQualityConfiguration.C + +\*---------------------------------------------------------------------------*/ + +#ifndef meshQualityConfiguration_H +#define meshQualityConfiguration_H + +#include "caseFileConfiguration.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class meshQualityConfiguration Declaration +\*---------------------------------------------------------------------------*/ + +class meshQualityConfiguration +: + public caseFileConfiguration +{ + +public: + + // Constructors + + meshQualityConfiguration + ( + const fileName& name, + const fileName& dir, + const Time& time + ); + + //- Disallow default bitwise copy construction + meshQualityConfiguration(const meshQualityConfiguration&) = delete; + + //- Destructor + ~meshQualityConfiguration(); + + + // Member Functions + + // Write the snappyHexMeshDict + void write(); + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const meshQualityConfiguration&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/utilities/preProcessing/snappyHexMeshConfig/snappyHexMeshConfig.C b/applications/utilities/preProcessing/snappyHexMeshConfig/snappyHexMeshConfig.C index ec7e4b5d91..d4b51c3928 100644 --- a/applications/utilities/preProcessing/snappyHexMeshConfig/snappyHexMeshConfig.C +++ b/applications/utilities/preProcessing/snappyHexMeshConfig/snappyHexMeshConfig.C @@ -75,20 +75,20 @@ Description oriented along the z-axis along x = y = 0. The snappyHexMesh configuration is generated automatically, applying a set - of defaults to the main configuration parameters. By default, explicit - feature capturing is configured, for which a surfaceFeaturesDict file is - written for the user to generate the features files with the - surfaceFeatures utility. Implicit feature capturing can alternatively be - selected with the '-implicitFeatures' option. Refinement levels can be + of defaults to the main configuration parameters. By default, implicit + feature capturing is configured. Explicit feature capturing can + alternatively be selected with the '-explicitFeatures' option, when an + additional surfaceFeaturesDict file is written for the user to generate the + features files with the surfaceFeatures utility. Refinement levels can be controlled with a range of options including: '-refinementLevel' for the baseline refinement level; '-refinementSurfaces' for levels on specific surfaces; '-refinementRegions' for levels inside specific surfaces; - '-refinementBoxes' for quick, box-shaped refinement regions specified by - min and max bounds; '-refinementDists' for distance-based refinement; and + '-refinementBoxes' for quick, box-shaped refinement regions specified by min + and max bounds; '-refinementDists' for distance-based refinement; and '-nCellsBetweenLevels' to control the transition between refinement levels. A '-layers' option specifies additional layers of cells at wall - boundaries. The insidePoint parameter is set to '(0 0 0)' by default but - can be overridden using the '-insidePoint' option. + boundaries. The insidePoint parameter is set to '(0 0 0)' by default but can + be overridden using the '-insidePoint' option. Usage \b snappyHexMeshConfig [OPTIONS] @@ -134,8 +134,8 @@ Usage - \par -clearBoundary, Do not set default patch entries, i.e. xMin, xMax, yMin, etc... - - \par -implicitFeatures, - Use implicit feature capturing + - \par -explicitFeatures, + Use explicit feature capturing, default is implicit - \par -layers \ Specify surface layers at wall boundaries, default 0 @@ -169,6 +169,7 @@ Usage #include "blockMeshCartesianConfiguration.H" #include "blockMeshCylindricalConfiguration.H" #include "snappyHexMeshConfiguration.H" +#include "meshQualityConfiguration.H" #include "surfaceFeaturesConfiguration.H" #include "boundBox.H" #include "searchableSurface.H" @@ -308,8 +309,8 @@ int main(int argc, char *argv[]) argList::addBoolOption ( - "implicitFeatures", - "use implicit feature capturing" + "explicitFeatures", + "use explicit feature capturing" ); argList::addOption @@ -569,7 +570,7 @@ int main(int argc, char *argv[]) ); } - const bool implicitFeatures(args.optionFound("implicitFeatures")); + const bool explicitFeatures(args.optionFound("explicitFeatures")); const label layers(args.optionLookupOrDefault