问题:

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

解决步骤:

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

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

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

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

运行以下代码生成网格:

gmshToFoam

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

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

checkMesh
renumberMesh -overwrite
icoFoam

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

paraFoam

画网格:

画出的网格效果如下:

Fg.1 mesh前三维图

Fg.2 mesh后三维图

代码:

cylindertwo.geo

// Gmsh project created on Wed Jun 29 11:30:24 2016
Nx = 41;Rx = 1.00;
Ny = 41;Ry = 1.00;
Nb = 41;Rb = 1.00;
Nc = 41;Rc = 1.00; Point(1) = {-10,-10,0,1.0};
Point(2) = {10,-10,0,1.0};
Point(3) = {40,-10,0,1.0};
Point(4) = {-10,10,0,1.0};
Point(5) = {10,10,0,1.0};
Point(6) = {40,10,0,1.0}; //cylinder1 points
Point(7) = {-0.35355339,-0.35355339,0,1.0};
Point(8) = {0.35355339,-0.35355339,0,1.0};
Point(9) = {-0.35355339,0.35355339,0,1.0};
Point(10) = {0.35355339,0.35355339,0,1.0};
Point(11) = {0,0,0,1.0}; //cylinder2 points
Point(12) = {-0.35355339+30,-0.35355339,0,1.0};
Point(13) = {0.35355339+30,-0.35355339,0,1.0};
Point(14) = {-0.35355339+30,0.35355339,0,1.0};
Point(15) = {0.35355339+30,0.35355339,0,1.0};
Point(16) = {0+30,0,0,1.0}; Point(17) = {20,10,0,1.0};
Point(18) = {20,-10,0,1.0}; //x lines
Line(1) = {4, 5};Transfinite Line {1} = Nx Using Progression Rx;
Line(2) = {5, 17};Transfinite Line {2} = Nx Using Progression Rx;
Line(3) = {17, 6};Transfinite Line {3} = Nx Using Progression Rx;
Line(4) = {1, 2};Transfinite Line {4} = Nx Using Progression Rx;
Line(5) = {2, 18};Transfinite Line {5} = Nx Using Progression Rx;
Line(6) = {18, 3};Transfinite Line {6} = Nx Using Progression Rx;
//y lines
Line(7) = {4, 1};Transfinite Line {7} = Ny Using Bump Ry;
Line(8) = {5, 2};Transfinite Line {8} = Ny Using Bump Ry;
Line(9) = {17, 18};Transfinite Line {9} = Ny Using Bump Ry;
Line(10) = {6, 3};Transfinite Line {10} = Ny Using Bump Ry;
//cicle lines of one
Circle(11) = {9, 11, 10};Transfinite Line {11} = Nc Using Progression Rc;
Circle(12) = {10, 11, 8};Transfinite Line {12} = Nc Using Progression Rc;
Circle(13) = {8, 11, 7};Transfinite Line {13} = Nc Using Progression Rc;
Circle(14) = {7, 11, 9};Transfinite Line {14} = Nc Using Progression Rc;
//cicle lines of two
Circle(15) = {14, 16, 15};Transfinite Line {15} = Nc Using Progression Rc;
Circle(16) = {15, 16, 13};Transfinite Line {16} = Nc Using Progression Rc;
Circle(17) = {13, 16, 12};Transfinite Line {17} = Nc Using Progression Rc;
Circle(18) = {12, 16, 14};Transfinite Line {18} = Nc Using Progression Rc;
//block lines
Line(19) = {4, 9};Transfinite Line {19} = Nb Using Progression Rb;
Line(20) = {5, 10};Transfinite Line {20} = Nb Using Progression Rb;
Line(21) = {2, 8};Transfinite Line {21} = Nb Using Progression Rb;
Line(22) = {1, 7};Transfinite Line {22} = Nb Using Progression Rb;
Line(23) = {17, 14};Transfinite Line {23} = Nb Using Progression Rb;
Line(24) = {6, 15};Transfinite Line {24} = Nb Using Progression Rb;
Line(25) = {3, 13};Transfinite Line {25} = Nb Using Progression Rb;
Line(26) = {18, 12};Transfinite Line {26} = Nb Using Progression Rb; //surfaces
Line Loop(27) = {1, 20, -11, -19};
Plane Surface(28) = {27};
Line Loop(29) = {7, 22, 14, -19};
Plane Surface(30) = {29};
Line Loop(31) = {4, 21, 13, -22};
Plane Surface(32) = {31};
Line Loop(33) = {8, 21, -12, -20};
Plane Surface(34) = {33};
Line Loop(35) = {2, 9, -5, -8};
Plane Surface(36) = {35};
Line Loop(37) = {3, 24, -15, -23};
Plane Surface(38) = {37};
Line Loop(39) = {9, 26, 18, -23};
Plane Surface(40) = {39};
Line Loop(41) = {6, 25, 17, -26};
Plane Surface(42) = {41};
Line Loop(43) = {10, 25, -16, -24};
Plane Surface(44) = {43};
Transfinite Surface {28};
Transfinite Surface {30};
Transfinite Surface {32};
Transfinite Surface {34};
Transfinite Surface {36};
Transfinite Surface {38};
Transfinite Surface {40};
Transfinite Surface {42};
Transfinite Surface {44};
Recombine Surface {28};
Recombine Surface {30};
Recombine Surface {32};
Recombine Surface {34};
Recombine Surface {36};
Recombine Surface {38};
Recombine Surface {40};
Recombine Surface {42};
Recombine Surface {44}; Extrude {0, 0, 2} {
Surface{28, 30, 32, 34, 36, 40, 38, 44, 42};
Layers{1};
Recombine;
} Physical Surface("inlet") = {75};//inlet
Physical Surface("outlet") = {207};//outlet
Physical Surface("top") = {53, 141, 185};//top
Physical Surface("bottom") = {97, 149, 229};//bottom
Physical Surface("cylinderWalls_1") = {61, 83, 105, 127};//cylinderWalls_1
Physical Surface("cylinderWalls_2") = {193, 171, 237, 215};//cylinderWalls_2
Physical Surface("frontAndBack") = {66, 88, 110, 132, 154, 176, 198, 220, 242, 30, 32, 28, 34, 36, 40, 42, 44, 38};
//frontAndBack
Physical Volume("internal") = {1,2,3,4,5,6,7,8,9};//internal

P

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v3.0+ |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField
{
frontAndBack
{
type empty;
}
top
{
type zeroGradient;
}
cylinderWalls_1
{
type zeroGradient;
}
inlet
{
type zeroGradient;
}
bottom
{
type zeroGradient;
}
cylinderWalls_2
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 0;
}
} // ************************************************************************* //

U

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v3.0+ |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField
{
frontAndBack
{
type empty;
}
top
{
type slip;
}
cylinderWalls_1
{
type fixedValue;
value uniform (0 0 0);
}
inlet
{
type fixedValue;
value uniform (1 0 0);
}
bottom
{
type slip;
}
cylinderWalls_2
{
type fixedValue;
value uniform (0 0 0);
}
outlet
{
type zeroGradient;
}
} // ************************************************************************* //

Boundary

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v3.0+ |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 7
(
frontAndBack
{
type empty;
inGroups 1(empty);
nFaces 28800;
startFace 28480;
}
top
{
type patch;
physicalType patch;
nFaces 120;
startFace 57280;
}
cylinderWalls_1
{
type patch;
physicalType patch;
nFaces 160;
startFace 57400;
}
inlet
{
type patch;
physicalType patch;
nFaces 40;
startFace 57560;
}
bottom
{
type patch;
physicalType patch;
nFaces 120;
startFace 57600;
}
cylinderWalls_2
{
type patch;
physicalType patch;
nFaces 160;
startFace 57720;
}
outlet
{
type patch;
physicalType patch;
nFaces 40;
startFace 57880;
}
) // ************************************************************************* //

controlDict

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v3.0+ |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application icoFoam; startFrom startTime; startTime 0; stopAt endTime; endTime 100; deltaT 0.005; writeControl timeStep; writeInterval 20; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable true; // ************************************************************************* //

结果展示:

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. 教程三:Wechat库的使用

    上一篇教程中我们提供了wechat的php的库,这里我们简要介绍一个这个库的源码和使用.这个库的主文件为`Wechat.php`,其余的几个文件都是为这个文件服务的,提供加解密,消息拼接等功能.`We ...

  2. BZOJ 3555: [Ctsc2014]企鹅QQ [字符串哈希]【学习笔记】

    3555: [Ctsc2014]企鹅QQ Time Limit: 20 Sec  Memory Limit: 256 MBSubmit: 2046  Solved: 749[Submit][Statu ...

  3. Handler(二)

    1.Handler 实现Handler第二种和第三种 1.1 继承AbstractController 优点:能定制请求方式 package cn.happyl.controller; import ...

  4. Python学习Day2笔记(字符编码和函数)

    1.字符编码 #ASCII码里只能存英文和特殊字符 不能存中文 存英文占1个字节 8位#中文编码为GBK 操作系统编码也为GBK#为了统一存储中文和英文和其他语言文字出现了万国码Unicode 所有一 ...

  5. HTML <meta> 标签,搜索引擎

    关于Mate标签的详尽解释,请查看w3school 网址为:http://www.w3school.com.cn/tags/tag_meta.asp meta标签作用 META标签是HTML标记HEA ...

  6. 移动端重要的几个CSS3属性设置

    去掉点击链接和文本框对象的半透明覆盖(iOS)或者虚框(Android) -webkit-tap-hightlight-color:rgba(0,0,0,0); 禁用长按页面时弹出菜单(iOS下有效) ...

  7. Web Deploy自动配置

    自动发布配置,需要在发布的配置文件里面添加以下一句,避免在发布时,无权限! <Project ToolsVersion="4.0" xmlns="http://sc ...

  8. 源码之Queue

    看源码可以把python看得更透,更懂,想必也是开发人员的必经之路. 现在有个任务,写个线程池.使用Queue就能写一个最简单的,下面就来学学Queue源码. 源码之Queue: class Queu ...

  9. wpf ListBox删除

    绑定一个GUID对象 重绑定的数组中移除改对象,重新绑定.

  10. TypeScript 素描-基础类型

    博文读自 TypeScript 官方文档而来,不具有学习性,仅是本人学习时记录以供日后翻阅 ,有学习TypeScript的朋友还请去看更为详细的官方文档 TypeScript官网文档中的基础类型, T ...