ImageVerifierCode 换一换
格式:DOCX , 页数:17 ,大小:186.54KB ,
资源ID:5717773      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bingdoc.com/d-5717773.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(哈工大传热学虚拟仿真实验报告.docx)为本站会员(b****4)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

哈工大传热学虚拟仿真实验报告.docx

1、哈工大传热学虚拟仿真实验报告Harbin Institute of Technology传热学虚拟仿真实验报告 院 系:能源科学与工程学院 班 级: 设 计 者: 学 号: 指导教师: 董士奎 设计时间: 2016.11.7 传热学虚拟仿真实验报告1 应用背景 数值热分析在核工业、铁道、石油化工、航空航天、机械制造、能源、汽车交通、国防军工、电子、土木工程、造船、生物医学、轻工、地矿、水利、以及日用家电等各个领域都有广泛的应用。2 二维导热温度场的数值模拟2.1 二维稳态导热实例 假设一用砖砌成的长方形截面的冷空气通道,其截面如图2.1所示,假设在垂直于纸面方向上冷空气及砖墙的温度变化很小,可

2、以近似地予以忽略。图2.1 一用砖砌成的长方形截面的冷空气通道截面2.2 二维数值模拟 基于模型的对称性,简化为如图所示的四分之一模型。图2.2 二维数值模拟2.3 建立离散方程 此时对于内部节点,如图2.3: 对于平直边界上的节点,如图2.4: 对于外部和内部角点,如图2.5: 图2.3 内部节点 图2.4 平直边界上的节点 图2.5 内部角点和外部角点 对于对称边界(绝热边界),如图2.6: 图2.6 对称边界(绝热边界) 图2.7 建立离散方程此时显示格式、隐式格式依次为,如图2.7:2.4 C+程序2.4.1 程序流程图如下图2.8所示图2.8 程序流程图2.4.2 程序各变量含义如下

3、图2.9所示 n_L1, n_L2, n_L3, n_L4, n_thick1, n_thick2分别为对应边的网格数。2.4.3 程序#include#includeint main() float L1,L2,L3,L4,thick1,thick2; /* L1 外矩形宽,L2外矩形长,L3内矩形宽,L4内矩形长,thick1宽度方向厚度,thick1长度方向厚度*/ int n_L1,n_L2,n_L3,n_L4,n_thick1,n_thick2; /*各边网格数*/ int i,j,n,number; /*n迭代次数*/ double eps=5.0e-6; float delt_y

4、1,delt_y2,delt_x1,delt_x2; float cond,conv_out,conv_in,tout,tin; /* cond 导热系数 conv_out 外部对流换热系数 conv_in 内部对流换热系数 tout 外部环境温度 tin 内部环境温度*/ /*输入几何信息*/ printf(请输入 L1:); scanf(%f, &L1); printf(请输入 L2:); scanf(%f, &L2); printf(请输入 L3:); scanf(%f, &L3); printf(请输入 L4:); scanf(%f, &L4); /*输入网格信息*/ printf(请

5、输入边L1网格数(100):); scanf(%d, &n_L1); printf(请输入边L2网格数(100):); scanf(%d, &n_L2); printf(请输入边L3网格数(100):); scanf(%d, &n_L3); printf(请输入边L4网格数(100):); scanf(%d, &n_L4);/*输入边界条件*/ printf(请输入材料导热系数(W/(mK):); scanf(%f, &cond); printf(请输入外部环境温度(K):); scanf(%f, &tout); printf(请输入内部环境温度(K):); scanf(%f, &tin);

6、printf(请输入外部对流换热系数(W/(m2K):); scanf(%f, &conv_out); printf(请输入内部对流换热系数(W/(m2K):); scanf(%f, &conv_in); thick1=(L2-L4); thick2=(L1-L3); n_thick1=(n_L2-n_L4); n_thick2=(n_L1-n_L3);/*网格大小*/ delt_x1=thick1/n_thick1; delt_x2=L4/n_L4; delt_y1=thick2/n_thick2; delt_y2=L3/n_L3;/*/ /*节点赋初值*/ double tem010010

7、0; /*节点温度 tem0()上次迭代结果,tem()本次迭代结果*/ double tem100100; double x100100; double y100100; n=0; do /*区域1内部节点温度*/ /*/ for(i=1;in_thick1;i+) for(j=n_L3+1;jn_L1;j+) tem0ij=(temi+1j+temi-1j)*delt_y1*delt_y1+(temij+1+temij-1)*delt_x1*delt_x1)/2.0/(delt_y1*delt_y1+delt_x1*delt_x1); /*/ /*区域2内部节点温度*/ /*/ for(i

8、=1;in_thick1;i+) for(j=1;jn_L3;j+) tem0ij=(temi+1j+temi-1j)*delt_y2*delt_y2+(temij+1+temij-1)*delt_x1*delt_x1)/2.0/(delt_x1*delt_x1+delt_y2*delt_y2); /*/ /*区域3内部节点温度*/ /*/ for(i=n_thick1+1;in_L2;i+) for(j=n_L3+1;jn_L1;j+) tem0ij=(temi+1j+temi-1j)*delt_y1*delt_y1+(temij+1+temij-1)*delt_x2*delt_x2)/2.

9、0/(delt_x2*delt_x2+delt_y1*delt_y1); /*/ /*区域1与区域2边界线*/ /*/ for(i=1;in_thick1;i+) j=n_L3; tem0ij=(temi+1j+temi-1j)/2.0*(delt_y1+delt_y2)*delt_y1*delt_y2+temij+1*delt_y2*delt_x1*delt_x1+temij-1*delt_y1*delt_x1*delt_x1)/(delt_y1+delt_y2)*delt_y1*delt_y2+delt_y2*delt_x1*delt_x1+delt_x1*delt_x1*delt_y1)

10、; /*/ /*区域1与区域3边界线*/ /*/ for(j=n_L3+1;jn_L1;j+) i=n_thick1; tem0ij=(temij+1+temij-1)/2.0*(delt_x1+delt_x2)*delt_x1*delt_x2+temi-1j*delt_x2*delt_y1*delt_y1+temi+1j*delt_x1*delt_y1*delt_y1)/(delt_x1+delt_x2)*delt_x1*delt_x2+delt_x2*delt_y1*delt_y1+delt_y1*delt_y1*delt_x1); /*/ /*边界条件*/ /*绝热边界条件(对称面)*/

11、 /*右边界*/ for(j=n_L3+1;jn_L1;j+) i=n_L2; tem0ij=(2.0*temi-1j*delt_y1*delt_y1+(temij+1+temij-1)*delt_x2*delt_x2)/2.0/(delt_x2*delt_x2+delt_y1*delt_y1); /*下边界*/ for(i=1;in_thick1;i+) j=0; tem0ij=(delt_y2*temi-1j/2/delt_x1)+(delt_x1*temij+1/delt_y2)+(delt_y2*temi+1j/2/delt_x1)/(delt_y2/2/delt_x1)+(delt_

12、x1/delt_y2)+(delt_y2/2/delt_x1); for(i=n_thick1+1;in_L2;i+) j=n_L3; tem0ij=(delt_y1*temi-1j/2/delt_x2)+(delt_x2*temij+1/delt_y2)+(delt_y2*temi+1j/2/delt_x2)+(delt_x2*conv_in*tin)/(delt_y2/2/delt_x2)+(delt_x2/delt_y2)+(delt_y2/2/delt_x2)+(delt_x2*conv_in); /*外部对流边界条件*/ /*上边界*/ for(i=1;in_thick1;i+) j

13、=n_L1; tem0ij=(cond*delt_y1*delt_y1*(temi-1j+temi+1j)+2.0*cond*delt_x1*delt_x1*temij-1+2.0*delt_y1*delt_x1*delt_x1*conv_out*tout)/(2.0*cond*delt_y1*delt_y1+2.0*cond*delt_x1*delt_x1+2.0*delt_y1*conv_out*delt_x1*delt_x1); for(i=n_thick1+1;in_L2;i+) j=n_L1; tem0ij=(cond*delt_y1*delt_y1*(temi-1j+temi+1j

14、)+2.0*cond*delt_x2*delt_x2*temij-1+2.0*delt_y1*delt_x2*delt_x2*conv_out*tout)/(2.0*cond*delt_y1*delt_y1+2.0*cond*delt_x2*delt_x2+2.0*delt_y1*conv_out*delt_x2*delt_x2); i=n_thick1; j=n_L1; tem0ij=(cond*delt_y1*delt_y1*delt_x2*temi-1j+cond*delt_y1*delt_y1*delt_x1*temi+1j+cond*delt_x1*delt_x2*(delt_x1+

15、delt_x2)*temij-1+delt_y1*delt_x1*delt_x2*(delt_x1+delt_x2)*conv_out*tout)/(cond*delt_y1*delt_y1*delt_x2+cond*delt_y1*delt_y1*delt_x1+cond*delt_x1*delt_x2*(delt_x1+delt_x2)+delt_y1*conv_out*delt_x1*delt_x2*(delt_x1+delt_x2); /*左边界*/ for(j=n_L3+1;jn_L1;j+) i=0; tem0ij=(cond*delt_x1*temij+1/2/delt_y1)+

16、(cond*delt_y1*temi+1j/delt_x1)+(cond*delt_x1*temij-1/2/delt_y1)+(delt_y1*conv_out*tout)/(cond*delt_x1/2/delt_y1)+(cond*delt_y1/delt_x1)+(cond*delt_x1/2/delt_y1)+(delt_y1*conv_out); for(j=1;jn_L3;j+) i=0; tem0ij=(cond*delt_x1*temij+1/2/delt_y2)+(cond*delt_y2*temi+1j/delt_x1)+(cond*delt_x1*temij-1/2/d

17、elt_y2)+(delt_y2*conv_out*tout)/(cond*delt_x1/2/delt_y2)+(cond*delt_y2/delt_x1)+(cond*delt_x1/2/delt_y2)+(delt_y2*conv_out); i=0; j=n_L3; tem0ij=(cond*delt_x1*temij+1/2/delt_y1)+(cond*(delt_y1+delt_y2)/2)*temi+1j/delt_x1)+(cond*delt_x1*temij-1/2/delt_y2)+(delt_y1+delt_y2)/2)*conv_out*tout)/(cond*del

18、t_x1/2/delt_y1)+(cond*(delt_y1+delt_y2)/2)/delt_x1)+(cond*delt_x1/2/delt_y2)+(delt_y1+delt_y2)/2)*conv_out); /*内部对流边界条件*/ /*上边界*/ for(i=n_thick1+1;in_L2;i+) j=n_L3; tem0ij=(cond*delt_y1*delt_y1*(temi-1j+temi+1j)+2.0*cond*delt_x2*delt_x2*temij+1+2.0*delt_y1*delt_x2*delt_x2*conv_in*tin)/(2.0*cond*delt

19、_y1*delt_y1+2.0*cond*delt_x2*delt_x2+2.0*delt_y1*conv_in*delt_x2*delt_x2); /*左边界*/ for(j=1;jn_L3;j+) i=n_thick1; tem0ij=(cond*delt_x1*temij+1/2/delt_y2)+(cond*delt_y2*temi-1j/delt_x1)+(cond*delt_x1*temij-1/2/delt_y2)+(delt_y2*conv_in*tin)/(cond*delt_x1/2/delt_y2)+(cond*delt_y2/delt_x1)+(cond*delt_x1

20、/2/delt_y2)+(delt_y2*conv_in); /*特殊点*/ /*左下角*/ tem000=(cond*delt_x1*delt_x1*tem01+cond*delt_y2*delt_y2*tem10+delt_y2*delt_y2*delt_x1*conv_out*tout)/(cond*delt_x1*delt_x1+cond*delt_y2*delt_y2+delt_y2*delt_y2*delt_x1*conv_out); /*右下角*/ tem0n_thick10=(cond*delt_x1*delt_x1*temn_thick11+cond*delt_y2*delt

21、_y2*temn_thick1-10+delt_y2*delt_y2*delt_x1*conv_in*tin)/(cond*delt_x1*delt_x1+cond*delt_y2*delt_y2+delt_y2*delt_y2*delt_x1*conv_in); /*左上角*/ tem00n_L1=(cond*delt_y1*delt_y1*tem1n_L1+cond*delt_x1*delt_x1*tem0n_L1-1+delt_x1*delt_y1*(delt_y1+delt_x1)*conv_out*tout)/(cond*delt_y1*delt_y1+cond*delt_x1*de

22、lt_x1+delt_x1*delt_y1*(delt_y1+delt_x1)*conv_out); /*右上角1*/ tem0n_L2n_L1=(cond*delt_y1*delt_y1*temn_L2-1n_L1+cond*delt_x2*delt_x2*temn_L2n_L1-1+delt_x2*delt_y1*delt_x2*conv_out*tout)/(cond*delt_y1*delt_y1+cond*delt_x2*delt_x2+delt_y1*delt_x2*delt_x2*conv_out); /*右上角2*/ tem0n_L2n_L3=(cond*delt_y1*del

23、t_y1*temn_L2-1n_L3+cond*delt_x2*delt_x2*temn_L2n_L3+1+delt_x2*delt_y1*delt_x2*conv_in*tin)/(cond*delt_y1*delt_y1+cond*delt_x2*delt_x2+delt_y1*delt_x2*delt_x2*conv_in); /*内角点*/ tem0n_thick1n_L3=(cond*(delt_y1+delt_y2)/delt_x1*temn_thick1-1n_L3+cond*(delt_x1+delt_x2)/delt_y1*temn_thick1n_L3+1+cond*del

24、t_y1/delt_x2*temn_thick1+1n_L3+cond*delt_x1/delt_y2*temn_thick1n_L3-1+(delt_x2+delt_y2)*conv_in*tin)/(cond*(delt_y1+delt_y2)/delt_x1+cond*(delt_x1+delt_x2)/delt_y1+cond*delt_y1/delt_x2+cond*delt_x1/delt_y2+(delt_x2+delt_y2)*conv_in);/*判断是否收敛*/ number=0; for(i=0;i=n_L2;i+) for(j=0;jeps) number+; for(

25、i=0;i=n_L2;i+) for(j=0;j0 & n1000000); /*计算各节点坐标*/ for (i=0;i=n_L2;i+) for(j=0;j=n_L1;j+) if(i=n_thick1 & j=n_L3) xij=delt_x1*i; yij=delt_y2*j; if(in_L3) xij=delt_x1*i; yij=delt_y2*n_L3+delt_y1*(j-n_L3); if(in_thick1 & jn_thick1 & jn_L3) xij=n_thick1*delt_x1+delt_x2*(i-n_thick1); yij=delt_y2*n_L3+delt_y1*(j-n_L3); /*计算各节点坐标结束*/ ofstream SaveFile(temperature.dat); /*输出计算结果*/ SaveFile title=Temper

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2