加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

openfaom Adaptive mesh refinement 自适应网格

(2013-04-26 20:15:11)
分类: 科研技术

forwardStep算例进行说明:

/opt/openfoam201/tutorials/compressible/sonicFoam/laminar/forwardStep

 

一:网格

                          1加密前计算网格(5025





 

                            2加密后计算网格(6369

1、图2分别为加密前后的网格分布。

 

: 加密方法

 

加密的要求: 压力梯度比较大的区域进行网格加密

openfoam中,可以使用topoSetrefineMeshmapField一系列命令对网格进行加密。这里为了更好的捕捉激波,选择归一化压力梯度进行加密。normalisedGradP=openfaom <wbr>Adaptive <wbr>mesh <wbr>refinement <wbr>自适应网格

命令:

1     topoSet           //得到要加密区域的网格节点位置,这里选择normalisedGradP 

2     refineMesh –dict   //利用得到的节点位置进行网格加密过程

3     mapField ../orig –sourceTime  latestTime –consistent   //将粗网格上的结果作为细网格的初始值进行计算


第一步topoSet命令需要在system中加入topoSetDict文件,格式为:

 

FoamFile

{

    version     2.0;

    format      ascii;

    class       dictionary;

    object      topoSetDict;

}

 

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

 

actions

(

    // Example:pick up internal faces on outside of cellSet

    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

    // Load initial cellSet

    {

        name    c0;

        type    cellSet;

        action  new;

        source fieldToCell;

        sourceInfo

       {

           fieldName  normalisedGradP;

           min         0.1;

           max         1.00;

       }

    }

);

第二步refineMesh –dict命令需要在system中加入refineMeshDict文件,格式为:

 

FoamFile

{

    version     2.0;

    format      ascii;

    class       dictionary;

    object      refineMeshDict;

}

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

// Cells to refine; name of cell set

set c0;

// Type of coordinate system:

// - global : coordinate system same for every cell. Usually aligned with

//   x,y,z axis. Specify in globalCoeffs section below.

// - patchLocal : coordinate system different for every cell. Specify in

//   patchLocalCoeffs section below.

coordinateSystem global;

//coordinateSystem patchLocal;

// .. and its coefficients. x,y in this case. (normal direction is calculated

// as tan1^tan2)

globalCoeffs

{

    tan1 (1 0 0);

    tan2 (0 1 0);

}

 

//patchLocalCoeffs

//{

//    patch outside;  // Normal direction is facenormal of zero'th face of patch

//    tan1 (1 0 0);

//}

// List of directions to refine

directions

(

    tan1

    tan2

);

 

// Whether to use hex topology. This will

// - if patchLocal: all cells on selected patch should be hex

// - split all hexes in 2x2x2 through the middle of edges.

useHexTopology  false;

 

// Cut purely geometric (will cut hexes through vertices) or take topology

// into account. Incompatible with useHexTopology

geometricCut    true;

 

// Write meshes from intermediate steps

writeMesh       false;

 

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

 

 

 

 

第三:mapField ../orig –sourceTime  latestTime –consistent命令中的orig即粗网格上的结果,可以将粗网格上的结果作为细网格的初始值进行计算。

 

 

 

 

三:结果对比

 



                          a)加密前压力分布

 

 

 

 

                             b)加密后压力

 


 

                      

 



 

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有