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

加入VIP,免费下载
 

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

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

下载须知

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

版权提示 | 免责声明

本文(相变传热与流体流动数值分析作业3.docx)为本站会员(b****4)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

相变传热与流体流动数值分析作业3.docx

1、相变传热与流体流动数值分析作业3相变传热与流体流动数值分析作业3学 院(系): 能源与动力学院 专 业: 能源与动力工程 * * * * * * * 学 号: * 指 导 教 师: 宋永臣 教授 完 成 日 期: 2012.3.6 大连理工大学Dalian University of TechnologyThe Finite Volume Method for Convection-Diffusion ProblemsSubject:A propertyis transported by means of convection and diffusion through the one-dim

2、ensional domain sketched in Figure1.The governing equation is; boundary conditions are 0=1 at x=0 and L=0 at x=L. Using five equally spaced cells for convection and diffusion calculate the distribution of a function of x for case:(i)Case1:u=0.1m/s;(ii)Case2:u=2.5m/s;(iii)Case3:u=2.5m/s with 20 grid

3、nodes;The following data apply: Length L=1.0m, =1.0kg/m3, =0.1kg/m/s. Solution:(I)The central differencing scheme:/ 王佳琪-作业-中心差分.cpp : 定义控制台应用程序的入口点。/#include #include #include #include #include #include #include #include #include #define N 5using namespace std;int i;double awN,bN,aeN,fN,xN;/*-追赶法求解数

4、组-*/void tdma( ) double lN,uN,yN; for(i=1;iN;i+) u0=b0;l0=0; li=awi/ui-1; ui=bi-li*aei-1; y0=f0; for(i=1;i=0;i-) xi=(yi-aei*xi+1)/ui; void main() void Output( );/*-定义变量及边界条件-*/ double F,D,u,x,L,A,B,SpN; u=0.1;=1;=0.1;L=1;A=1;B=0; x=L/N; F=*u;D=/x;/*-网格离散-*/for(i=0;iN;i+) if(i=0) awi=0;aei=-(D-F/2);S

5、pi=-(2*D+F);fi=(2*D+F)*A; else if(i=N-1) aei=0;awi=-(D+F/2);Spi=-(2*D-F);fi=(2*D-F)*B; else awi=-(D+F/2);aei=-(D-F/2);Spi=0;fi=0; bi=-awi-aei-Spi; tdma(); Output( );void Output( )/*-后处理文件生成-*/ ostringstream name; name.str(); name central_.plt; ofstream out(name.str().c_str();out Title = centralendl

6、VARIABLES = X , Y1 , Y2 nZONE I=N,J=1,F=POINTendl; for(i = 0;i N ;i+) out double(0.2*i+0.1) xi (2.7183-exp(0.2*i+0.1)/1.7183 2).(II)The upwind differencing scheme:/ 王佳琪-作业3-迎风.cpp : 定义控制台应用程序的入口点。/#include stdafx.h#include #include #include #include #include #include #include #include #define N 5usi

7、ng namespace std;int i;double awN,bN,aeN,fN,xN;/*-追赶法求解数组-*/void tdma( ) double lN,uN,yN; for(i=1;iN;i+) u0=b0;l0=0; li=awi/ui-1; ui=bi-li*aei-1; y0=f0; for(i=1;i=0;i-) xi=(yi-aei*xi+1)/ui;void main() void Output( ); double Fw1,Fw,Fe1,Fe,Dw,De,u,x,L,A,B,SpN; u=0.1;=1;=0.1;L=1;A=1;B=0; x=L/N;Fw=Fe=*u

8、;Dw=De=/x; Fw1=0Fw?0:Fw; Fe1=0(-Fe)?0:(-Fe);/*-网格离散-*/ for(i=0;iN;i+) if(i=0) awi=0;aei=-(De-Fe1);Spi=-(2*Dw+Fw1);fi=(2*Dw+Fw1)*A; else if(i=N-1) awi=-(Dw+Fw1);aei=0;Spi=-(2*De+Fe1);fi=(2*De-Fe1)*B; else awi=-(Dw+Fw1);aei=-(De+Fe1);Spi=0;fi=0; bi=-awi-aei-Spi; tdma();Output( );void Output( )ostrings

9、tream name; name.str(); name upwind.plt; ofstream out(name.str().c_str(); out Title = upwind endl VARIABLES = X, Y1, Y2endlZONE I=N,J=1,F=POINTendl; for(i = 0;i N ;i+) out double(0.2*i+0.1) xi (2.7183-exp(0.2*i+0.1)/1.7183 endl; Results:(i)case1: u=0.1m/s; N=5;(ii) Case2: u=2.5m/s; N=5;Discussion:Th

10、e upwind differencing scheme produces a much more realistic solution than the central differencing scheme, however, not very close to the exact solution near boundary B. That is because that its accuracy is only first order, while the central differencing is second order. (III) The hybrid differenci

11、ng scheme:/ 王佳琪-作业-混合.cpp : 定义控制台应用程序的入口点。/#include stdafx.h#include #include #include #include #include #include #include #include #define N 5using namespace std;int i;double awN,bN,aeN,fN,xN;/*-追赶法求解数组-*/void tdma( ) double lN,uN,yN; for(i=1;iN;i+) u0=b0;l0=0; li=awi/ui-1; ui=bi-li*aei-1; y0=f0; f

12、or(i=1;i=0;i-) xi=(yi-aei*xi+1)/ui;void main() void Output( ); double Fw1,Fw,Fe1,Fe,Dw,De,u,x,L,A,B,SpN; u=2.5;=1;=0.1;L=1;A=1;B=0; x=L/N;Fw=Fe=*u;Dw=De=/x; if(Fw0&(Dw+Fw/2)0) Fw1=0; else if(Fw0) Fw1=(Dw+Fw/2); else if(Fw0&(Dw+Fw/2)0) Fw1=Fw; else if(0Fw&Fw(Dw+Fw/2) Fw1=(Dw+Fw/2); else if(0(Dw+Fw/2)

13、&(Dw+Fw/2)Fw) Fw1=Fw; if(-Fe)0&(De-Fe/2)0) Fe1=0; else if(-Fe)0) Fe1=(De-Fe/2); else if(-Fe)0&(De-Fe/2)0) Fe1=(-Fe); else if(0(-Fe)&(-Fe)(De-Fe/2) Fe1=(De-Fe/2); else if(0(De-Fe/2)&(De-Fe/2)(-Fe) Fe1=(-Fe); /*-网格离散-*/ for(i=0;iN;i+) if(i=0) awi=0;aei=-Fe1;Spi=-(2*Dw+Fw1);fi=(2*Dw+Fw1)*A; else if(i=N

14、-1) awi=-Fw1;aei=0;Spi=-(2*De+Fe1);fi=(2*De-Fe1)*B; else awi=-Fw1;aei=-Fe1;Spi=0;fi=0; bi=-awi-aei-Spi; tdma();Output( );void Output( )double m=25; ostringstream name; name.str(); name hybrid.plt; ofstream out(name.str().c_str(); out Title =hybrid endl VARIABLES = X, Y1, Y2endlZONE I=N,J=1,F=POINTen

15、dl; for(i = 0;i N ;i+) out double(0.2*i+0.1) xi (1+(1-exp(25*(0.2*i+0.1)/(exp(m)-1) endl; Results:(i)Case1:u=2.5m/s; N=5;(ii)Case 2:u=2.5m/s; N=25;Discussion:On a combination of central and upwind differencing schemes, the hybrid scheme provides a much more realistic solution and agrees the exact so

16、lution very well. The more nodes, the more accurate the result is. (IV)The power-law scheme:/ 王佳琪-作业-指数.cpp : 定义控制台应用程序的入口点。/#include stdafx.h#include #include#include#include #include #include #include #include #define N 5using namespace std;int i;double awN,bN,aeN,fN,xN;/*-追赶法求解数组-*/void tdma( ) d

17、ouble lN,uN,yN; for(i=1;iN;i+) u0=b0;l0=0; li=awi/ui-1; ui=bi-li*aei-1; y0=f0; for(i=1;i=0;i-) xi=(yi-aei*xi+1)/ui;void main()void Output( );ofstream note;double Fw,Fw1,Fe,Fe1,Dw,De,u,x,L,A,B,SpN,p,p1,Pew,Pee,q,q1;u=2.5;=1;=0.1;L=1;A=1;B=0;x=L/N;Fw=Fe=*u;Dw=De=/x;Pew=Fw/Dw;Pee=Fe/De;Fw1=0Fw?0:Fw;Fe1

18、=0(-Fe)?0:(-Fe);p=pow(1-0.1*fabs(Pew),5);p1=0p?0:p;q=pow(1-0.1*fabs(Pee),5);q1=0q?0:q;/*-网格离散-*/for(i=0;iN;i+) if(i=0) awi=0;aei=-(Fe1+De*q1);Spi=-(2*Dw+Fw1);fi=(2*Dw+Fw1)*A; else if(i=N-1) awi=-(Fw1+Dw*p1);aei=0;Spi=-(2*De+Fe1);fi=(2*De-Fe1)*B; else awi=-(Fw1+Dw*p1);aei=-(Fe1+De*q1);Spi=0;fi=0; bi=

19、-awi-aei-Spi; tdma(); Output( );void Output( )double m=25; ostringstream name; name.str(); name power-law.plt; ofstream out(name.str().c_str();out power-lowendl VARIABLES = X , Y1 , Y2 nZONE I= N,J= 1,F=POINTendl; for(i = 0;i N ;i+) out double(0.2*i+0.1) xi (1+(1-exp(25*(0.2*i+0.1)/(exp(m)-1) endl; Result:(i)Case1:u=2.5m/s; N=5;(ii)Case 2:u=2.5m/s; N=25;Discussion:This result is more accurate than the three former schemes .

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1