请问.msh的2维旋转轴对称网格如何转换到OpenFOAM



  • 大家好,我通过fluentMeshToFoam xxx.msh转换二维旋转轴对称网格,但是不能转换成OpenFOAM的用于二维旋转轴对称的楔形网格,而是转换成了一个轴对称的平面网格,原来定义的axis变成了symmetry,前后的面变成了empty,并不是我所想象的前后的面变成了wedge。期待各位的回复,谢谢



  • @D-Benjamin请问.msh的2维旋转轴对称网格如何转换到OpenFOAM 中说:

    而是转换成了一个轴对称的平面网格,

    这是什么网格,发图瞅瞅
    Axis不需要定义


  • OpenFOAM教授

    fluent的二维轴对称网格,其实只是二维网格,所以转换为openfoam网格的时候,只能转换为二维平面网格。如果需要楔形网格,需要一些其他工具,你可以在网上搜一下makeAxialMesh代码。



  • @dzw05 谢谢你的回复与帮助



  • @东岳 李老师,就如楼上dzwo5所说,转换后变成了平面网格,,而我想要的是能用于OpenFOAM二维轴对称的楔形网格



  • @dzw05 你好,我在http://openfoamwiki.net/index.php/Contrib/MakeAxialMesh#Download网站上下载的makeAxialMesh代码编译出现如下错误。download的版本最新是2.x的(如下图红圈所示),但是OpenFOAM现在已经更新到OpenFOAM-6了。希望能获得你的帮助,再谢!

    error.png
    捕获.PNG



  • 为何不用blockMesh自己写呢?



  • @东岳 老师,blockMeshDict真的太复杂了,效率低,简单一点的模型还好,稍微复杂一点的模型,靠一行一行的代码围成一个一个的block,会把人搞得晕头转向。



  • @东岳 @dzw05 两位老师好,上面的问题我已经解决了,确实是版本问题,我最后找到了新版的makeAxialMesh,就能够编译成功了,但是我遇到一个新的问题。就是在使用了makeAxialMesh之后,我在命令行键入collapseEdges,会出现大量的warning,如下所示:

    --> FOAM Warning : 
        From function virtual void Foam::wedgePolyPatch::calcGeometry(Foam::PstreamBuffers&)
        in file meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C at line 70
        Wedge patch 'frontAndBack_neg' is not planar.
    At local face at (0.0975 0.1975 0.00489095) the normal (0 0.0435786 -0.99905) differs from the average normal (-4.60529e-27 0.043578 -0.99905) by 3.70688e-13
    Either correct the patch or split it into planar parts
    Reading createPatchDict
    

    然后我checkMesh,同样会出现上述的大量warning,但是最后check的结果是Mesh OK。请两位老师帮我解答一下,谢谢


  • OpenFOAM教授

    @D-Benjamin 这个其实不是什么大问题,把平面网格转换为楔形网格的过程,其实是网格点坐标转换的过程。只要把controlDict文件中的writePrecision(精度)增大到10或者12,将坐标转换得更精确,应该就不会有问题了。



  • @D-Benjamin 您好,我想问下您最新版的makeaxialMesh模块是在哪里找的呢?可以告诉我一下吗,我找到的都是2.0版本的。万分感谢





  • 谢谢您



  • @浪迹天大 谢谢您



  • @浪迹天大 您好,我按照您提供的方法进行网格转化的时候出现了这种情况

    frontAndBack
        {
            type            empty;
            inGroups        1(empty);
            nFaces          0;
            startFace       949841;
        }
        frontAndBack_pos
        {
            type            wedge;
            inGroups        1(wedge);
            nFaces          474627;
            startFace       949841;
        }
        frontAndBack_neg
        {
            type            wedge;
            inGroups        1(wedge);
            nFaces          474627;
            startFace       1424468;
        };
    

    frontAndBack没被融合掉;我没有写blockdictionary,直接用fluent.msh转化的。、



  • @LYD 我最近也在搞轴对称网格,我这里遇到这种情况是ok的,可以计算。感觉留着frontAndBack也没啥大问题。反正在设温度、压力的边界条件的时候都带上,给成empty的type就行



  • 对,frontAndBack的面数是0,无所谓



  • @shampoo @LYD @D-Benjamin 我在OF5上下载了Benjamin的OF7版本的makeAxialMesh,编译通过也没报错,网格生成时有warnning,但是不是链接中指出的Either correct the patch or split it into planar parts,该warnning会在计算的时候出现,请指出的错误
    makeAxialMesh -overwrite时

    Create time
    
    --> FOAM Warning : 
        From function void *Foam::dlOpen(const Foam::fileName &, bool)
        in file POSIX.C at line 1210
        dlopen error : /home2/snst/gzh1/OpenFOAM/gzh1-5.0/platforms/linux64IccDPInt32Opt/lib/libtabularThermophysicalModels.so: undefined symbol: _ZTIN4Foam29mixedEnergyFvPatchScalarFieldE
    --> FOAM Warning : 
        From function bool Foam::dlLibraryTable::open(const Foam::fileName &, bool)
        in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 105
        could not load "libtabularThermophysicalModels.so"
    Create mesh for time = 0
    
    Plane of the grid: (0 0 1) (0.5 0.000169685 5.95636e-21)
    
    The rotation-axis: ((0 0 0) (1 0 0))
    
    Creating wedge with an opening angle of 5 degrees
    
    Projecting nodes
    Radius to axis: min = 0 max = 0.00035
     Calculated Distance of center to axis is 0.000350333
    Distance of axis to patch is 0.000350333 -> not changing the patch type
    Splitting patch frontAndBack
    
     Copying patches 
     Creating Patches
     Creating Pos-patch 
     Creating Neg-patch 
     Changing patches
    
    Changing patch types 
     Changing frontAndBack_pos to wedge
     Changing frontAndBack_neg to wedge
    Writing mesh to time 0
    End
    Now use collapseEdges to clean grid
    
    --> FOAM Warning : 
        From function void *Foam::dlOpen(const Foam::fileName &, bool)
        in file POSIX.C at line 1210
        dlopen error : /home2/snst/gzh1/OpenFOAM/gzh1-5.0/platforms/linux64IccDPInt32Opt/lib/libtabularThermophysicalModels.so: undefined symbol: _ZTIN4Foam29mixedEnergyFvPatchScalarFieldE
    --> FOAM Warning : 
        From function bool Foam::dlLibraryTable::open(const Foam::fileName &, bool)
        in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 105
        could not load "libtabularThermophysicalModels.so"
    Create mesh for time = 0
    
    Reading collapseDict
    
    Time = 0
    Read faceSet indirectPatchFaces with 0 faces
    Merging:
        edges with length less than 1e-06 metres
        edges split by a point with edges in line to within 179 degrees
        Minimum edge length reduction factor = -1
    
    Face collapsing is on
        Initial face length factor = -1
    Control mesh quality = false
    Selectively disabling wanted collapses until resulting quality satisfies constraints in system/meshQualityDict
    
    
    Outer Iteration = 0
    
        "Edge Filter Factor": min = 1e-06 av = 1e-06 max = 1e-06
            484693 / 484693 elements used
    
        Inner iteration = 0
    
            Collapsing 4503 small edges
            Collapsing 0 in line edges
                Uncollapsed edges = 4502 / 484693
                Uncollapsed edges = 0 / 484693
    
            Collapsing 1 edges after synchronisation and PointEdgeWave
                Number of points : 195130
                Not visited      : 0
                Not collapsed    : 195128
                Collapsed        : 2
    
            Collapsing 0 cells
            Apply changes to the current mesh
    
        Inner iteration = 1
    
            Collapsing 4502 small edges
            Collapsing 0 in line edges
                Uncollapsed edges = 4502 / 484692
                Uncollapsed edges = 0 / 484692
            Collapsing 0 edges after synchronisation and PointEdgeWave
    Writing collapsed mesh to time 0
    ExecutionTime = 1.68 s  ClockTime = 1 s
    

    运行时

    --> FOAM Warning :
     From function void Foam::wedgePolyPatch::calcGeometry(Foam::PstreamBuffers &)
    in file meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C at line 70
    Wedge patch 'frontAndBack_pos' is not planar.
    At local face at (0.999667 0.000347009 1.51363e-05) the normal (-7.75524e-19 -0.043578 0.99905) differs from the average normal (1.35466e-08 -0.0435779 0.99905) b       y 6.36941e-15
     Either correct the patch or split it into planar parts
    
     SIMPLE: convergence criteria
         field p_rgh  tolerance 1e-05
         field U      tolerance 1e-06
         field h      tolerance 1e-09
         field "(k|epsilon|omega)"    tolerance 1e-07
    Reading thermophysical properties
    Selecting thermodynamics package
    {
       type            hTabularThermo; 
    


  • @dzw05 @浪迹天大 两位老师好,上一个问题已经解决,我觉得应该是网格质量问题导致,目前已经checkMesh通过了,但还有个问题,想请老师们指导。我首先用blockMesh画了一个前后面empty的2D网格,下底面刚好在x轴上,然后绕x轴旋转成一个圆柱,所以将旋转轴设置为了(1 0 0),将上边界设置为了center,最后生成的几何原先empty的frontAndBack变成了frontAndBack_pos和frontAndBack_neg, bottom面由于变成了对称轴所以face就为0(即一条线),top面就变成了圆柱体的外表面,但是因为将其边界类型设为了symmetryPlane,所以如果想实现等热流或者等温,边界条件该如何给定?在哪改?



  • @Exthan top面是圆柱的顶面吗还是圆柱的圆柱面?为啥会用的symmetry呢?一般设等温就在boundary里把类型改成patch,然后温度的边界条件里设成fixed value,应该就可以了



  • @shampoo 你好,我想算个半径为0.35的圆管,壁面等温,top面其实就是圆柱面,下壁面也就是对称轴所以应该设为symmetry,之所以用symmetry是因为在makeAxisMesh中定义的,如果用blockMeshDict则是empty,两者对对称轴生成的网格数都是0,这样对于top面,类型为Wall,确实可以用fixedValue边界,但是插值发现壁面处的温度不是固定的温度,而且用foamMeshToFluent发现,网格是个楔形网格,不是圆弧,也就是说径向上的尺寸最大不是0.35,如果整个楔形为5°,一般是2.5°,那最大的y应该只是0.35*cos2.5°,边界条件y=0.35的圆柱面的边界如何跟它对应呢?



  • @Exthan 不吧,如果2D网格画的时候半径画到了0.35,转换完成的楔形网格最大的y应该有0.35啊。



  • @shampoo QQ图片20200331151114.png 不是圆弧



  • @Exthan 啊我懂你的意思,但我一般就把那个平面近似当成圆弧面设边界条件。网格的单元也画不出圆弧的边啊,我觉得不用特纠结。如果一定要在那个圆弧面上设条件的话,不如单开个帖问问吧,这个我的确没考虑过,不好意思



  • @shampoo 是因为我用postProcess取值发现边界的速度本应为0,但是非0,其次边界温度本应等于fixedValue,但也不等,所以就很疑惑



  • @Exthan 你取的是半径为0.35位置的速度和温度吧?其实那个并不是边界?



  • @shampoo 我用网格Cell取过,也有用Cloud取边界实际值,均不对


Log in to reply
 

CFD中文网 2016 - 2020 | 京ICP备15017992号-2