




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Harbin Institute of Technology传热学虚拟仿真实验报告 院 系:能源科学与工程学院 班 级: 设 计 者: 学 号: 指引教师: 董士奎 设计时间: .11.7 传热学虚拟仿真实验报告1 应用背景 数值热分析在核工业、铁道、石油化工、航空航天、机械制造、能源、汽车交通、国防军工、电子、土木工程、造船、生物医学、轻工、地矿、水利、以及日用家电等各个领域均有广泛旳应用。2 二维导热温度场旳数值模拟2.1 二维稳态导热实例 假设一用砖砌成旳长方形截面旳冷空气通道,其截面如图2.1所示,假设在垂直于纸面方向上冷空气及砖墙旳温度变化很小,可以近似地予以忽视。图2.1 一用砖砌
2、成旳长方形截面旳冷空气通道截面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 程序各变量含义如下图2.9所示 n_L1, n_L2,
3、 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_y1,delt_y2,delt_x1,
4、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(请输入边L1网格数(100):); s
5、canf(%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); printf(请输入外部对流换热系数
6、(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 tem0100100; /*节点温度 tem0()上次
7、迭代成果,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=1;in_thick1;i+) f
8、or(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.0/(delt_x2*delt_x2
9、+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); /*/ /*区域1与区域3边界线
10、*/ /*/ 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); /*/ /*边界条件*/ /*绝热边界条件(对称面)*/ /*右边界*/ for(j=n_L
11、3+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_x1/delt_y2)+(delt_
12、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=n_L1; tem0ij=(con
13、d*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)+2.0*cond*delt_x2
14、*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+delt_x2)*temij-1+d
15、elt_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)+(cond*delt_y1*temi
16、+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/delt_y2)+(delt_y2*c
17、onv_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*delt_x1/2/delt_y1)+(c
18、ond*(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_y1*delt_y1+2.0*co
19、nd*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/2/delt_y2)+(delt_
20、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_y2*temn_thick1-10
21、+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*delt_x1+delt_x1*delt
22、_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*delt_y1*temn_L2-1n_L3
23、+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*delt_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_
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 3-3编码器1电子课件教学版
- 粮食仓储企业绿色税收政策考核试卷
- 玻璃管道生产考核试卷
- 油气仓储与能源安全风险管理体系构建策略研究考核试卷
- 残疾人座车内饰设计与材料选择考核试卷
- 游乐设施施工电气安全知识考核试卷
- 电气设备数字化设计与制造考核试卷
- 电机专利技术考核试卷
- 竹浆在纸品印刷适应性改进的技术研究考核试卷
- 纱线国际贸易的风险防范考核试卷
- 《花生膜下滴灌技术》课件
- 名片设计教程
- 森林消防员劳务派遣服务投标方案技术标
- 妇科学妇科感染病
- 《内科常见病的诊治》课件
- 离心泵有效汽蚀余量计算公式
- 第十一章计划调控法律制度
- 《我的家乡日喀则》课件
- 语文版一年级下册语文阅读理解(15篇)
- 华文版书法五年级下册 第12课 同字框 教案
- 国网装表接电(初级)理论考试复习题库(含答案)
评论
0/150
提交评论