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 7becbba9a3..d4b51c3928 100644 --- a/applications/utilities/preProcessing/snappyHexMeshConfig/snappyHexMeshConfig.C +++ b/applications/utilities/preProcessing/snappyHexMeshConfig/snappyHexMeshConfig.C @@ -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" @@ -615,6 +616,15 @@ int main(int argc, char *argv[]) snappyConfig.write(); + meshQualityConfiguration meshQualityConfig + ( + "meshQualityDict", + runTime.system(), + runTime + ); + + meshQualityConfig.write(); + Info<< "\nEnd\n" << endl; return 0;