CFD中文网

    CFD中文网

    • 登录
    • 搜索
    • 最新

    blockMesh划分网格,在v2112和v6均测试可以,v8报错

    OpenFOAM
    3
    6
    401
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • 尚
      尚善若水 最后由 编辑

      请教一下大家,我用 of 的 blockMesh 划分一个带圆形喷孔几何体的六面体网格。blockMesh 在 v2112 和 v6 均测试可以运行,但是 v8 报错。我刚学习 of,自己没排查出错误,请教下大家。
      错误提示如下:

      // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
      Create time
      
      Creating block mesh from
          "system/blockMeshDict"
      Using #calcEntry at line 46 in file "/home/users/nus/e0944146/OpenFOAM/e0944146-8/run/JISCF/system/blockMeshDict"
      Using #codeStream with "/home/users/nus/e0944146/OpenFOAM/e0944146-8/run/JISCF/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libcodeStream_b7af15ef665f94aa93a235a5e34750b6bd3e16a1.so"
      Invoking "wmake -s libso /home/users/nus/e0944146/OpenFOAM/e0944146-8/run/JISCF/dynamicCode/_b7af15ef665f94aa93a235a5e34750b6bd3e16a1"
      wmake libso /home/users/nus/e0944146/OpenFOAM/e0944146-8/run/JISCF/dynamicCode/_b7af15ef665f94aa93a235a5e34750b6bd3e16a1
          Ctoo: codeStreamTemplate.C
      /home/users/nus/e0944146/OpenFOAM/e0944146-8/run/JISCF/system/blockMeshDict: In function 'void Foam::codeStream_b7af15ef665f94aa93a235a5e34750b6bd3e16a1(Foam::Ostream&, const Foam::dictionary&)':
      /home/users/nus/e0944146/OpenFOAM/e0944146-8/run/JISCF/system/blockMeshDict:1:8: error: '$D' was not declared in this scope
       /*--------------------------------*- C++ -*----------------------------------*\
              ^
      make: *** [Make/linux64GccDPInt32Opt/codeStreamTemplate.o] Error 1
      
      
      --> FOAM FATAL IO ERROR: 
      Failed wmake "dynamicCode/_b7af15ef665f94aa93a235a5e34750b6bd3e16a1/platforms/linux64GccDPInt32Opt/lib/libcodeStream_b7af15ef665f94aa93a235a5e34750b6bd3e16a1.so"
      
      
      file: /home/users/nus/e0944146/OpenFOAM/e0944146-8/run/JISCF/system/blockMeshDict from line 17 to line 45.
      
          From function static void (* Foam::functionEntries::codeStream::getFunction(const Foam::dictionary&, const Foam::dictionary&))(Foam::Ostream&, const Foam::dictionary&)
          in file db/dictionary/functionEntries/codeStream/codeStream.C at line 214.
      
      FOAM exiting
      

      网格如下:


      测试文件 blockMesh.zip

      C 2 条回复 最后回复 回复 引用
      • C
        coolhhh 最后由 编辑

        @尚善若水
        我用OpenFOAM-8试了下,提示‘$D’ was not declared,尝试找到$D,在后面加个空格,如下所示。

        alpha 45.0;                   // o-block degree
        // s     #calc "$D/4.0";         // Inner square side half
        // sc    #calc "$D/4.0 + 0.1";   // Inner square side curvature
        // R     #calc "$D/2.0";         // Radius of the jet nozzle
        
        s     #calc "$D /4.0";         // Inner square side half
        sc    #calc "$D /4.0 + 0.1";   // Inner square side curvature
        R     #calc "$D /2.0";         // Radius of the jet nozzle
        

        接着能运行一会,又出现error: ‘$lx’ was not declared,也是类似在后面加个空格,就可继续运行。

        // round 函数表示四舍五入取整数
        
        // xCells #calc "round($lx/$deltax)"; // 310  
        // yCells #calc "round($ly/$deltay)"; // 110
        // zCells #calc "round($lz/$deltaz)"; // 200
        
        xCells #calc "round($lx /$deltax)"; // 310  
        yCells #calc "round($ly /$deltay)"; // 110
        zCells #calc "round($lz /$deltaz)"; // 200
        

        以此方式后续还有好几个类似的参数都这个问题,当基本改完后,运行还是有如下错误。这块也不清楚什么问题了

            ln: ./lnInclude
            wmkdep: codeStreamTemplate.C
            Ctoo: codeStreamTemplate.C
            ld: /home/user1/OpenFOAM/user1-8/run/blockmesh/dynamicCode/_d585a44b91ff1f499e2e3d99401445beaf8aa06c/../platforms/linux64GccDPInt32Opt/lib/libcodeStream_d585a44b91ff1f499e2e3d99401445beaf8aa06c.so
        Creating block edges
        No non-planar block faces defined
        Creating topology blocks
        
        
        --> FOAM FATAL IO ERROR: 
        wrong token type - expected int32_t, found on line 184 the doubleScalar 10
        
        file: /home/user1/OpenFOAM/user1-8/run/blockmesh/system/blockMeshDict/blocks at line 184.
        
            From function Foam::Istream& Foam::operator>>(Foam::Istream&, int32_t&)
            in file primitives/ints/int32/int32IO.C at line 62.
        
        FOAM exiting
        
        
        1 条回复 最后回复 回复 引用
        • C
          coolhhh @尚善若水 最后由 编辑

          @尚善若水 刚再试了OpenFOAM-2012,可以运行没有任何报错。如果你需要用OpenFOAM-8计算,看是否可以用其他版本的先生成网格,然后再用OpenFOAM-8计算?

          1 条回复 最后回复 回复 引用
          • C
            coolhhh @尚善若水 最后由 编辑

            @尚善若水 除了加空格,再把rsCells改为10,就可以在OpenFOAM-8 运行了。上面提示的错误是指划分网格数量应该是int类型数值

            //rsCells 10.0; // Number of cells between inner square and circle 
            
            rsCells 10; // Number of cells between inner square and circle 
            

            4.png

            尚 1 条回复 最后回复 回复 引用
            • 李东岳
              李东岳 管理员 最后由 编辑

              :146: :146:

              CFD高性能服务器 http://dyfluid.com/servers.html

              1 条回复 最后回复 回复 引用
              • 尚
                尚善若水 @coolhhh 最后由 编辑

                @coolhhh 厉害厉害,我就觉着是变量定义格式问题,但是自己不太懂。感谢~

                1 条回复 最后回复 回复 引用
                • First post
                  Last post