OpenFOAM中refineMesh的用法

本文移植自博主以前的新浪博客,原文发表于 (2014-12-25 09:58:12)。

想要实现 refineMesh, system 文件夹下需要两个文件,topoSetDict 和 refineMeshDict。
如下:

/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 7
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object topoSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

actions
(
{
name c0;
type cellSet;
action new;
source boxToCell;
sourceInfo
{
box (-1 -1 -1) (1 1 1); // Edit box bounds as required
}
}
);

// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 7
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object refineMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

set c0;

coordinateSystem global;

globalCoeffs
{
tan1 (1 0 0);
tan2 (0 1 0);
}

directions // comment out as required
(
tan1
tan2
normal
);

useHexTopology no;

geometricCut yes;

writeMesh no;

// ************************************************************************* //

按如下指令操作:

blockMesh
topoSet
refineMesh -dict ./system/refineMeshDict -overwrite
checkMesh

如果需要再次细化:

topoSet
refineMesh -dict ./system/refineMeshDict -overwrite
checkMesh

当年对 OF 了解不够,现在才发现 OF 早已提供了相关配置文件:
https://github.com/OpenFOAM/OpenFOAM-dev/tree/master/etc/caseDicts/mesh/manipulation/refineRegion

文章作者: Yan Zhang
文章链接: https://openfoam.top/refineMesh/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 OpenFOAM 成长之路
您的肯定会给我更大动力~