snappyHexMeshConfig: write out a meshQualityDict file

This commit is contained in:
Chris Greenshields
2023-07-19 11:43:26 +01:00
parent afdaf49b4f
commit a71bbe5c6f
4 changed files with 165 additions and 0 deletions

View File

@ -5,6 +5,7 @@ blockMeshConfigurationBase.C
blockMeshCartesianConfiguration.C blockMeshCartesianConfiguration.C
blockMeshCylindricalConfiguration.C blockMeshCylindricalConfiguration.C
snappyHexMeshConfiguration.C snappyHexMeshConfiguration.C
meshQualityConfiguration.C
surfaceFeaturesConfiguration.C surfaceFeaturesConfiguration.C
snappyHexMeshConfig.C snappyHexMeshConfig.C

View File

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#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_);
}
// ************************************************************************* //

View File

@ -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 <http://www.gnu.org/licenses/>.
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
// ************************************************************************* //

View File

@ -169,6 +169,7 @@ Usage
#include "blockMeshCartesianConfiguration.H" #include "blockMeshCartesianConfiguration.H"
#include "blockMeshCylindricalConfiguration.H" #include "blockMeshCylindricalConfiguration.H"
#include "snappyHexMeshConfiguration.H" #include "snappyHexMeshConfiguration.H"
#include "meshQualityConfiguration.H"
#include "surfaceFeaturesConfiguration.H" #include "surfaceFeaturesConfiguration.H"
#include "boundBox.H" #include "boundBox.H"
#include "searchableSurface.H" #include "searchableSurface.H"
@ -615,6 +616,15 @@ int main(int argc, char *argv[])
snappyConfig.write(); snappyConfig.write();
meshQualityConfiguration meshQualityConfig
(
"meshQualityDict",
runTime.system(),
runTime
);
meshQualityConfig.write();
Info<< "\nEnd\n" << endl; Info<< "\nEnd\n" << endl;
return 0; return 0;