1

我正在尝试按照本教程 创建以下轴对称模型:

在此处输入图像描述

经过这里的讨论,我的blockMeshDict文件是:

FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}

convertToMeters 0.001;

wa 5.0;
cr 10.0;
pr 8.0;
cl 50.0;
px 20.0; 
pl 10.0; 
px2 #calc "$px+$pl"; 
ms 50; 

vertices
(
    (0                      0                         0)    //00
    (#calc "$pr*cos($wa/2)" #calc "$pr*sin($wa/2)"    0)    //01
    (#calc "$pr*cos($wa/2)" #calc "-$pr*sin($wa/2)"   0)    //02
    (#calc "$pr*cos($wa/2)" #calc "-$pr*sin($wa/2)"   $px)  //03
    (#calc "$pr*cos($wa/2)" #calc "$pr*sin($wa/2)"    $px)  //04
    (0                      0                         $px)  //05
    (#calc "$cr*cos($wa/2)" #calc "$cr*sin($wa/2)"    $px)  //06
    (#calc "$cr*cos($wa/2)" #calc "$cr*sin($wa/2)"    0)    //07
    (#calc "$cr*cos($wa/2)" #calc "-$cr*sin($wa/2)"   0)    //08
    (#calc "$cr*cos($wa/2)" #calc "-$cr*sin($wa/2)"   $px)  //09
    (#calc "$cr*cos($wa/2)" #calc "-$cr*sin($wa/2)"   $px2) //10
    (#calc "$cr*cos($wa/2)" #calc "$cr*sin($wa/2)"    $px2) //11
    (#calc "$pr*cos($wa/2)" #calc "$pr*sin($wa/2)"    $px2) //12
    (#calc "$pr*cos($wa/2)" #calc "-$pr*sin($wa/2)"   $px2) //13
    (#calc "$pr*cos($wa/2)" #calc "-$pr*sin($wa/2)"   $cl)  //14
    (#calc "$pr*cos($wa/2)" #calc "$pr*sin($wa/2)"    $cl)  //15
    (#calc "$cr*cos($wa/2)" #calc "$cr*sin($wa/2)"    $cl)  //16
    (#calc "$cr*cos($wa/2)" #calc "-$cr*sin($wa/2)"   $cl)  //17
    (0                      0                         $cl)  //18
    (0                      0                         $px2) //19
);

blocks
(
    hex (0  1  2  0  5  4  3  5)         ($ms 1 $ms) simpleGrading (1 1 1)
    hex (1  7  8  2  4  6  9  3)         ($ms 1 $ms) simpleGrading (1 1 1)
    hex (4  6  9  3  12 11 10 13)        ($ms 1 $ms) simpleGrading (1 1 1)
    hex (12 11 10 13 15 16 17 14)        ($ms 1 $ms) simpleGrading (1 1 1)
    hex (19 12 13 19 18 15 14 18)        ($ms 1 $ms) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
    inlet
    {
        type patch;
        faces
        (
            (0 1 2 0)
            (1 7 8 2)
        );
    }
    outlet
    {
        type patch;
        faces
        (
            (18 15 14 18)
            (15 16 17 14)
        );
    }
    walls
    {
        type wall;
        faces
        (
            (7  8  9  6)
            (6  9  10 11)
            (11 10 17 16)
        );
    }
    wedgeBack
    {
        type wedge;
        faces
        (
            (0  1  4  5)
            (1  7  6  4)
            (4  6  11 12)
            (12 11 16 15)
            (19 12 15 18)
        );
    }

    wedgeFront
    {
        type wedge;
        faces
        (
            (0  2  3  5)
            (2  8  9  3)
            (3  9  10 13)
            (13 10 17 14)
            (19 13 14 18)
        );
    }

    axis
     { 
           type empty;
           faces  
           (
               (0  5  5  0)
               (19 18 18 19)
           );
    }
);

mergePatchPairs
(
);

但是当我运行时,blockMesh我会收到如下警告:

创建块网格拓扑 --> FOAM 警告:来自函数 Foam::polyMesh::polyMesh(const Foam::IOobject&, const Foam::Xfer > >&, const cellShapeList&, const faceListList&, const wordList&, const Foam::PtrList&, const Foam::word&, const Foam::word&, bool) 在文件 meshes/polyMesh/polyMeshFromShapeMesh.C 中的第 871 行 在网格中找到 3 个未定义的面;添加到默认补丁。

其次是错误:

--> FOAM FATAL ERROR: 楔形楔形前中心平面未与坐标平面对齐 0.360319 来自文件 meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch 中的函数 virtual void Foam::wedgePolyPatch::calcGeometry(Foam::PstreamBuffers&) .C 在第 98 行。

不幸的是,谷歌搜索错误消息并没有返回多少。如果您能帮助我了解问题所在以及如何解决,我将不胜感激。

4

1 回答 1

2

你计算点坐标的方式对我来说似乎很奇怪,例如参数wa应该是什么意思?看来你打算把它变成一个角度。

我设法通过将楔形补丁的补丁类型更改为patch比类型更宽容的类型来获得有效的网格wegde。在对 blockMeshDicts 进行故障排除时,我经常这样做。

此外,我更改了入口补丁定义中顶点的顺序。补丁定义中的顶点列表必须遵守“右手规则”,请参阅用户指南

对于采用轴对称的情况,用户指南建议为轴对称域设置一个小的楔角,例如 1°。这很可能是您错误指出楔形中心平面未对齐的原因。

因此,我建议:

  • patch暂时保持楔形补丁的类型
  • 整理你的几何图形,这样你就可以生成一个 1° 的几何切片
  • wedge一旦几何形状为 1° 切片,将楔形块改回

块结构

FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}

convertToMeters 0.001;

wa 4.0;
cr 10.0;
pr 8.0;
cl 50.0;
px 20.0; 
pl 10.0; 
px2 #calc "$px+$pl"; 
ms 50; 

vertices
(
    (0                      0                         0)    //00
    (#calc "$pr*cos($wa/2)" #calc "$pr*sin($wa/2)"    0)    //01
    (#calc "$pr*cos($wa/2)" #calc "-$pr*sin($wa/2)"   0)    //02
    (#calc "$pr*cos($wa/2)" #calc "-$pr*sin($wa/2)"   $px)  //03
    (#calc "$pr*cos($wa/2)" #calc "$pr*sin($wa/2)"    $px)  //04
    (0                      0                         $px)  //05
    (#calc "$cr*cos($wa/2)" #calc "$cr*sin($wa/2)"    $px)  //06
    (#calc "$cr*cos($wa/2)" #calc "$cr*sin($wa/2)"    0)    //07
    (#calc "$cr*cos($wa/2)" #calc "-$cr*sin($wa/2)"   0)    //08
    (#calc "$cr*cos($wa/2)" #calc "-$cr*sin($wa/2)"   $px)  //09
    (#calc "$cr*cos($wa/2)" #calc "-$cr*sin($wa/2)"   $px2) //10
    (#calc "$cr*cos($wa/2)" #calc "$cr*sin($wa/2)"    $px2) //11
    (#calc "$pr*cos($wa/2)" #calc "$pr*sin($wa/2)"    $px2) //12
    (#calc "$pr*cos($wa/2)" #calc "-$pr*sin($wa/2)"   $px2) //13
    (#calc "$pr*cos($wa/2)" #calc "-$pr*sin($wa/2)"   $cl)  //14
    (#calc "$pr*cos($wa/2)" #calc "$pr*sin($wa/2)"    $cl)  //15
    (#calc "$cr*cos($wa/2)" #calc "$cr*sin($wa/2)"    $cl)  //16
    (#calc "$cr*cos($wa/2)" #calc "-$cr*sin($wa/2)"   $cl)  //17
    (0                      0                         $cl)  //18
    (0                      0                         $px2) //19
);

blocks
(
    hex (0  1  2  0  5  4  3  5)         ($ms 1 $ms) simpleGrading (1 1 1)
    hex (1  7  8  2  4  6  9  3)         ($ms 1 $ms) simpleGrading (1 1 1)
    hex (4  6  9  3  12 11 10 13)        ($ms 1 $ms) simpleGrading (1 1 1)
    hex (12 11 10 13 15 16 17 14)        ($ms 1 $ms) simpleGrading (1 1 1)
    hex (19 12 13 19 18 15 14 18)        ($ms 1 $ms) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
    inlet
    {
        type patch;
        faces
        (
            (0 2 1 0)
            (1 2 8 7)
        );
    }
    outlet
    {
        type patch;
        faces
        (
            (18 15 14 18)
            (15 16 17 14)
        );
    }
    walls
    {
        type wall;
        faces
        (
            (7  8  9  6)
            (6  9  10 11)
            (11 10 17 16)
        );
    }
    wedgeBack
    {
        type patch;
        faces
        (
            (0  1  4  5)
            (1  7  6  4)
            (4  6  11 12)
            (12 11 16 15)
            (19 12 15 18)
        );
    }

    wedgeFront
    {
        type patch;
        faces
        (
            (0  2  3  5)
            (2  8  9  3)
            (3  9  10 13)
            (13 10 17 14)
            (19 13 14 18)
        );
    }

    axis
     { 
           type empty;
           faces  
           (
               (0  5  5  0)
               (19 18 18 19)
           );
    }
);

mergePatchPairs
(
);
于 2018-08-23T08:43:47.187 回答