问题:

圆柱绕流问题,模拟仿真有两个圆柱、一个源的流体变化情况。

解决步骤:

1.使用Gmsh画出网格,并保存cylindertwo.msh

2.以Cavity为基础创建新的Case:Cylindertwo,先将0,constant,system三个文件夹复制进Cylindertwo,将constant文件夹中的transportProperties文件复制出来,删除constant文件夹。

3.由于采用源码安装,使用以下代码启动OpenFoam.

  1. source ~/OpenFOAM/OpenFOAM-v3.0+/etc/bashrc
  2. run

运行以下代码生成网格:

  1. gmshToFoam

4.改写P,U和boundary文件,具体如何改写参见代码.

5.生产网格,进行计算,命令如下:

  1. checkMesh
  2. renumberMesh -overwrite
  3. icoFoam

6.使用paraFoam命令查看效果.

  1. paraFoam

画网格:

画出的网格效果如下:

Fg.1 mesh前三维图

Fg.2 mesh后三维图

代码:

cylindertwo.geo

  1. // Gmsh project created on Wed Jun 29 11:30:24 2016
  2. Nx = 41;Rx = 1.00;
  3. Ny = 41;Ry = 1.00;
  4. Nb = 41;Rb = 1.00;
  5. Nc = 41;Rc = 1.00;
  6.  
  7. Point(1) = {-10,-10,0,1.0};
  8. Point(2) = {10,-10,0,1.0};
  9. Point(3) = {40,-10,0,1.0};
  10. Point(4) = {-10,10,0,1.0};
  11. Point(5) = {10,10,0,1.0};
  12. Point(6) = {40,10,0,1.0};
  13.  
  14. //cylinder1 points
  15. Point(7) = {-0.35355339,-0.35355339,0,1.0};
  16. Point(8) = {0.35355339,-0.35355339,0,1.0};
  17. Point(9) = {-0.35355339,0.35355339,0,1.0};
  18. Point(10) = {0.35355339,0.35355339,0,1.0};
  19. Point(11) = {0,0,0,1.0};
  20.  
  21. //cylinder2 points
  22. Point(12) = {-0.35355339+30,-0.35355339,0,1.0};
  23. Point(13) = {0.35355339+30,-0.35355339,0,1.0};
  24. Point(14) = {-0.35355339+30,0.35355339,0,1.0};
  25. Point(15) = {0.35355339+30,0.35355339,0,1.0};
  26. Point(16) = {0+30,0,0,1.0};
  27.  
  28. Point(17) = {20,10,0,1.0};
  29. Point(18) = {20,-10,0,1.0};
  30.  
  31. //x lines
  32. Line(1) = {4, 5};Transfinite Line {1} = Nx Using Progression Rx;
  33. Line(2) = {5, 17};Transfinite Line {2} = Nx Using Progression Rx;
  34. Line(3) = {17, 6};Transfinite Line {3} = Nx Using Progression Rx;
  35. Line(4) = {1, 2};Transfinite Line {4} = Nx Using Progression Rx;
  36. Line(5) = {2, 18};Transfinite Line {5} = Nx Using Progression Rx;
  37. Line(6) = {18, 3};Transfinite Line {6} = Nx Using Progression Rx;
  38. //y lines
  39. Line(7) = {4, 1};Transfinite Line {7} = Ny Using Bump Ry;
  40. Line(8) = {5, 2};Transfinite Line {8} = Ny Using Bump Ry;
  41. Line(9) = {17, 18};Transfinite Line {9} = Ny Using Bump Ry;
  42. Line(10) = {6, 3};Transfinite Line {10} = Ny Using Bump Ry;
  43. //cicle lines of one
  44. Circle(11) = {9, 11, 10};Transfinite Line {11} = Nc Using Progression Rc;
  45. Circle(12) = {10, 11, 8};Transfinite Line {12} = Nc Using Progression Rc;
  46. Circle(13) = {8, 11, 7};Transfinite Line {13} = Nc Using Progression Rc;
  47. Circle(14) = {7, 11, 9};Transfinite Line {14} = Nc Using Progression Rc;
  48. //cicle lines of two
  49. Circle(15) = {14, 16, 15};Transfinite Line {15} = Nc Using Progression Rc;
  50. Circle(16) = {15, 16, 13};Transfinite Line {16} = Nc Using Progression Rc;
  51. Circle(17) = {13, 16, 12};Transfinite Line {17} = Nc Using Progression Rc;
  52. Circle(18) = {12, 16, 14};Transfinite Line {18} = Nc Using Progression Rc;
  53. //block lines
  54. Line(19) = {4, 9};Transfinite Line {19} = Nb Using Progression Rb;
  55. Line(20) = {5, 10};Transfinite Line {20} = Nb Using Progression Rb;
  56. Line(21) = {2, 8};Transfinite Line {21} = Nb Using Progression Rb;
  57. Line(22) = {1, 7};Transfinite Line {22} = Nb Using Progression Rb;
  58. Line(23) = {17, 14};Transfinite Line {23} = Nb Using Progression Rb;
  59. Line(24) = {6, 15};Transfinite Line {24} = Nb Using Progression Rb;
  60. Line(25) = {3, 13};Transfinite Line {25} = Nb Using Progression Rb;
  61. Line(26) = {18, 12};Transfinite Line {26} = Nb Using Progression Rb;
  62.  
  63. //surfaces
  64. Line Loop(27) = {1, 20, -11, -19};
  65. Plane Surface(28) = {27};
  66. Line Loop(29) = {7, 22, 14, -19};
  67. Plane Surface(30) = {29};
  68. Line Loop(31) = {4, 21, 13, -22};
  69. Plane Surface(32) = {31};
  70. Line Loop(33) = {8, 21, -12, -20};
  71. Plane Surface(34) = {33};
  72. Line Loop(35) = {2, 9, -5, -8};
  73. Plane Surface(36) = {35};
  74. Line Loop(37) = {3, 24, -15, -23};
  75. Plane Surface(38) = {37};
  76. Line Loop(39) = {9, 26, 18, -23};
  77. Plane Surface(40) = {39};
  78. Line Loop(41) = {6, 25, 17, -26};
  79. Plane Surface(42) = {41};
  80. Line Loop(43) = {10, 25, -16, -24};
  81. Plane Surface(44) = {43};
  82. Transfinite Surface {28};
  83. Transfinite Surface {30};
  84. Transfinite Surface {32};
  85. Transfinite Surface {34};
  86. Transfinite Surface {36};
  87. Transfinite Surface {38};
  88. Transfinite Surface {40};
  89. Transfinite Surface {42};
  90. Transfinite Surface {44};
  91. Recombine Surface {28};
  92. Recombine Surface {30};
  93. Recombine Surface {32};
  94. Recombine Surface {34};
  95. Recombine Surface {36};
  96. Recombine Surface {38};
  97. Recombine Surface {40};
  98. Recombine Surface {42};
  99. Recombine Surface {44};
  100.  
  101. Extrude {0, 0, 2} {
  102. Surface{28, 30, 32, 34, 36, 40, 38, 44, 42};
  103. Layers{1};
  104. Recombine;
  105. }
  106.  
  107. Physical Surface("inlet") = {75};//inlet
  108. Physical Surface("outlet") = {207};//outlet
  109. Physical Surface("top") = {53, 141, 185};//top
  110. Physical Surface("bottom") = {97, 149, 229};//bottom
  111. Physical Surface("cylinderWalls_1") = {61, 83, 105, 127};//cylinderWalls_1
  112. Physical Surface("cylinderWalls_2") = {193, 171, 237, 215};//cylinderWalls_2
  113. Physical Surface("frontAndBack") = {66, 88, 110, 132, 154, 176, 198, 220, 242, 30, 32, 28, 34, 36, 40, 42, 44, 38};
  114. //frontAndBack
  115. Physical Volume("internal") = {1,2,3,4,5,6,7,8,9};//internal

P

  1. /*--------------------------------*- C++ -*----------------------------------*\
  2. | ========= | |
  3. | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
  4. | \\ / O peration | Version: v3.0+ |
  5. | \\ / A nd | Web: www.OpenFOAM.com |
  6. | \\/ M anipulation | |
  7. \*---------------------------------------------------------------------------*/
  8. FoamFile
  9. {
  10. version 2.0;
  11. format ascii;
  12. class volScalarField;
  13. location "0";
  14. object p;
  15. }
  16. // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
  17.  
  18. dimensions [0 2 -2 0 0 0 0];
  19.  
  20. internalField uniform 0;
  21.  
  22. boundaryField
  23. {
  24. frontAndBack
  25. {
  26. type empty;
  27. }
  28. top
  29. {
  30. type zeroGradient;
  31. }
  32. cylinderWalls_1
  33. {
  34. type zeroGradient;
  35. }
  36. inlet
  37. {
  38. type zeroGradient;
  39. }
  40. bottom
  41. {
  42. type zeroGradient;
  43. }
  44. cylinderWalls_2
  45. {
  46. type zeroGradient;
  47. }
  48. outlet
  49. {
  50. type fixedValue;
  51. value uniform 0;
  52. }
  53. }
  54.  
  55. // ************************************************************************* //

U

  1. /*--------------------------------*- C++ -*----------------------------------*\
  2. | ========= | |
  3. | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
  4. | \\ / O peration | Version: v3.0+ |
  5. | \\ / A nd | Web: www.OpenFOAM.com |
  6. | \\/ M anipulation | |
  7. \*---------------------------------------------------------------------------*/
  8. FoamFile
  9. {
  10. version 2.0;
  11. format ascii;
  12. class volVectorField;
  13. location "0";
  14. object U;
  15. }
  16. // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
  17.  
  18. dimensions [0 1 -1 0 0 0 0];
  19.  
  20. internalField uniform (0 0 0);
  21.  
  22. boundaryField
  23. {
  24. frontAndBack
  25. {
  26. type empty;
  27. }
  28. top
  29. {
  30. type slip;
  31. }
  32. cylinderWalls_1
  33. {
  34. type fixedValue;
  35. value uniform (0 0 0);
  36. }
  37. inlet
  38. {
  39. type fixedValue;
  40. value uniform (1 0 0);
  41. }
  42. bottom
  43. {
  44. type slip;
  45. }
  46. cylinderWalls_2
  47. {
  48. type fixedValue;
  49. value uniform (0 0 0);
  50. }
  51. outlet
  52. {
  53. type zeroGradient;
  54. }
  55. }
  56.  
  57. // ************************************************************************* //

Boundary

  1. /*--------------------------------*- C++ -*----------------------------------*\
  2. | ========= | |
  3. | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
  4. | \\ / O peration | Version: v3.0+ |
  5. | \\ / A nd | Web: www.OpenFOAM.com |
  6. | \\/ M anipulation | |
  7. \*---------------------------------------------------------------------------*/
  8. FoamFile
  9. {
  10. version 2.0;
  11. format ascii;
  12. class polyBoundaryMesh;
  13. location "constant/polyMesh";
  14. object boundary;
  15. }
  16. // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
  17.  
  18. 7
  19. (
  20. frontAndBack
  21. {
  22. type empty;
  23. inGroups 1(empty);
  24. nFaces 28800;
  25. startFace 28480;
  26. }
  27. top
  28. {
  29. type patch;
  30. physicalType patch;
  31. nFaces 120;
  32. startFace 57280;
  33. }
  34. cylinderWalls_1
  35. {
  36. type patch;
  37. physicalType patch;
  38. nFaces 160;
  39. startFace 57400;
  40. }
  41. inlet
  42. {
  43. type patch;
  44. physicalType patch;
  45. nFaces 40;
  46. startFace 57560;
  47. }
  48. bottom
  49. {
  50. type patch;
  51. physicalType patch;
  52. nFaces 120;
  53. startFace 57600;
  54. }
  55. cylinderWalls_2
  56. {
  57. type patch;
  58. physicalType patch;
  59. nFaces 160;
  60. startFace 57720;
  61. }
  62. outlet
  63. {
  64. type patch;
  65. physicalType patch;
  66. nFaces 40;
  67. startFace 57880;
  68. }
  69. )
  70.  
  71. // ************************************************************************* //

controlDict

  1. /*--------------------------------*- C++ -*----------------------------------*\
  2. | ========= | |
  3. | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
  4. | \\ / O peration | Version: v3.0+ |
  5. | \\ / A nd | Web: www.OpenFOAM.com |
  6. | \\/ M anipulation | |
  7. \*---------------------------------------------------------------------------*/
  8. FoamFile
  9. {
  10. version 2.0;
  11. format ascii;
  12. class dictionary;
  13. location "system";
  14. object controlDict;
  15. }
  16. // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
  17.  
  18. application icoFoam;
  19.  
  20. startFrom startTime;
  21.  
  22. startTime 0;
  23.  
  24. stopAt endTime;
  25.  
  26. endTime 100;
  27.  
  28. deltaT 0.005;
  29.  
  30. writeControl timeStep;
  31.  
  32. writeInterval 20;
  33.  
  34. purgeWrite 0;
  35.  
  36. writeFormat ascii;
  37.  
  38. writePrecision 6;
  39.  
  40. writeCompression off;
  41.  
  42. timeFormat general;
  43.  
  44. timePrecision 6;
  45.  
  46. runTimeModifiable true;
  47.  
  48. // ************************************************************************* //

结果展示:

Fg3 T = 0

Fg4 T = 40

Fg8 T = 200

Fg11 T = 600

Fg13 T = 725

OpenFOAM&Gmsh&CFD圆柱绕流(两个圆柱)的更多相关文章

  1. OpenFOAM——圆柱绕流对流换热

    本算例来自<ANSYS FLUENT技术基础与工程应用:流动传热与环境污染控制领域> TOP和DOWN为对称边界(symmetry),入口速度为0.01m/s,入口温度为300K,圆柱温度 ...

  2. ICEM-extrude功能画圆柱绕流网格【转载】

    转载自:http://blog.csdn.net/lgw19910426/article/details/26401517 首先画网格大体顺序为点-->线-->面-->单元体. 第一 ...

  3. ICEM—两孔圆柱

    ​原视频下载地址: https://pan.baidu.com/s/1eSJ7ciQ 密码: 1gj3

  4. 原生WebGL场景中绘制多个圆锥圆柱

    前几天解决了原生WebGL开发中的一个问题,就是在一个场景中绘制多个几何网格特征不同的模型,比如本文所做的绘制多个圆锥和圆柱在同一个场景中,今天抽空把解决的办法记录下来,同时也附上代码.首先声明,圆柱 ...

  5. 【CFD之道】2017年原创文章汇总

    1 Fluent案例(21篇) [Fluent案例]01 空气流经障碍物 [Fluent案例]02:Tesla阀 [Fluent案例]03:RAE2822翼型外流场计算 [Fluent案例]04:多孔 ...

  6. 【CFD之道】2018年原创文章汇总

    以下是公众号CFD之道2018年的全部原创文章,共计210篇. 1 Fluent验证案例[60篇] Fluent验证案例02:通过均匀热通量管道层流流动 Fluent验证案例03:管道中湍流流动压降计 ...

  7. OpenFOAM当中监测力和阻力系数

    首先准备好我们自己的平常算例文件,本次我们以圆柱绕流的算例来说明用法 我们找到constant文件夹 打开其中的transportProperties文件 我们将其中的: nu             ...

  8. 【小白的CFD之旅】24 稳态和瞬态

    小白最近在练习案例的时候,对稳态和瞬态的问题,产生了一些疑问.譬如说,为什么有的案例用稳态,而有的案例用瞬态?有时候相同的案例既可以用稳态也可以用瞬态,而有的案例却只能用瞬态计算?小白决定找小牛师兄问 ...

  9. OpenFOAM设置监测点(探针)

    首先准备好我们自己的平常算例文件,本次我们以圆柱绕流的算例来说明用法 然后我们在/opt/openfoam4/etc/caseDicts/postProcessing/probes文件夹下找到prob ...

随机推荐

  1. 设备模型(device-model)之平台总线(bus),驱动(driver),设备(device)

    关于关于驱动设备模型相关概念请参考<Linux Device Drivers>等相关书籍,和内核源码目录...\Documentation\driver-model 简单来说总线(bus) ...

  2. EZchip花1.3亿美元买Tilera然后以8亿美元把自己与Tilera一起卖掉

    2014年7月EZchip花1.3亿美元收购的Tilera2015年10 Mellanox 8亿美元收购EZchip,2016年1月完成.EZchip转手卖掉Tilera与自己? http://www ...

  3. 安装TFS(2015)工作组模式代理服务器(Agent)

    TFS的代理服务器(agent)用于持续集成编译和发布,为开发.测试团队和运维团队带来的非常便捷高效的发布和测试速度,许多企业和研发团队都在自己的研发测试平台中广泛使用这一技术. 在部署TFS代理服务 ...

  4. 使用jenkins配置.net mvc网站进行持续集成三

    前两篇讲解了Jenkins的配置和VS远程发布,现在还有一个问题,VS项目远程发布的时候,配置的是覆盖所有文件重生成的,而通常类似于配置文件这种东西,在本地开发环境和测试环境是不一样的.所以我们通常需 ...

  5. Struts2(Ognl)

    OGNL(Object-Graph Navigation Language)全称为对象图导航语言,是一种功能强大的表达式语言,它通过简单一致的语法,可以任意存取对象的属性或者调用对象的方法,能够遍历整 ...

  6. [python]设计模式

    需要说明:java跟python在思维模式上并不一样,java利用接口以及多态可以实现很多抽象上的东西,而python不行,其实以下很多设计模式写法并不适用也没有必要,更多是为了对比和帮助理解这些设计 ...

  7. rxjs5.X系列 —— transform系列 api 笔记

    欢迎指导与讨论:) 前言 本文是笔者翻译 RxJS 5.X 官网各类operation操作系列的的第一篇 -- transform转换.如有错漏,希望大家指出提醒O(∩_∩)O.更详细的资料尽在rxj ...

  8. [LeetCode] Minimum Number of Arrows to Burst Balloons 最少数量的箭引爆气球

    There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided ...

  9. 数组为什么可以使用linq查询

    问题引出 这视乎是个完全不必要进行讨论的话题,因为linq(这里具体是linq to objects)本来就是针对集合类型的,数组类型作为集合类型的一种当然可以使用了.不过我还是想写一下,这个问题源于 ...

  10. 语义网 (Semantic Web)和 web 3.0

    语义网=有意义的网络. "如果说 HTML 和 WEB 将整个在线文档变成了一本巨大的书,那么 RDF, schema, 和 inference languages 将会使世界上所有的数据变 ...