您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 能源与动力工程 > 数值传热学----陶文铨-----第7章全
7-1解:对下列方程求解:5223122321321321xxxxxxxxx1.运用Jacobi点迭代法Matlab编程如下:clear;clc;a=[12-2;111;221];b=[1;3;5];i=100;x=zeros(3,1);forn=2:i+1form=1:size(a,1)x(m,n)=(-1*sum(a(m,:)*x(:,n-1))+a(m,m)*x(m,n-1)+b(m,1))/a(m,m);ende=0;form=1:size(a,1)ifabs(x(m,n)-x(m,n-1))ee=abs(x(m,n)-x(m,n-1));endendife10^(-3)break;endend计算结果:迭代次数初始值1234X101511X203-311X305-3112.G-S点迭代法求解Matlab程序如下:clear;clc;a=[12-2;111;221];b=[1;3;5];i=100;t=zeros(3,1);forn=2:i+1form=1:size(a,1)ifm==1t(m,n)=(-1*sum(a(m,2:end).*t(2:end,n-1)')+b(m,1))/a(m,m);elseifm==size(a,1)t(m,n)=(-1*sum(a(m,1:m-1).*t(1:m-1,n)')+b(m,1))/a(m,m);elset(m,n)=(-1*sum(a(m,1:m-1).*t(1:m-1,n)')-sum(a(m,m+1:end).*t(m+1:end,n-1)')+b(m,1))/a(m,m);endende=0;form=1:size(a,1)ifabs(t(m,n)-t(m,n-1))ee=abs(t(m,n)-t(m,n-1));endend结果如下:迭代次数初始值12345678910X101-5-23-71-191-479-1151-2687-6143-13823X2029298120951312172817640114337X30-1-3-7-15-31-63-127-255-511-1023故由上表可知:采用Jacobi点迭代法时是收敛的;而采用G-S点迭代法时是发散的。7-4解:常物性无内热源的稳态导热方程如下:02222yTxT对上式在控制容积内积分,界面采用线性插值可得:NSEWPTTTTT41下边界采用补充节点法,可得到二阶精度的边界条件离散格式:xqSxxTTBjiji1,,由0,0SqB可得:1,,jijiTT由上述分析可得待求四个节点的离散方程:4704141321TTT--4504141421TTT-415414341331TTT-410434141432TTT-采用7-1题中的程序,得结果如下:1.Jacobi点迭代法:迭代次数初始123416171819T1017.521.87524.913226.4019…28.733228.734828.735628.7362T2012.517.708320.260422.0327…24.259724.26124.26224.2624T30511.944415.347217.7103…20.679620.681420.682620.6833T403.33339.166713.217615.2025…18.31118.313118.314118.31492.G-S点迭代法:迭代次数初始1234891011T1017.524.427127.270328.2378…28.730228.734628.736128.7366T2016.87521.749123.407723.9721…24.259324.261824.262724.263T3010.833317.332219.543620.2961…20.67920.682420.683620.684T4012.569416.360417.650418.0894…18.312818.314818.315418.3157由上述计算结果可知,Jacobi迭代的速度比G-S迭代的速度要慢;7-6解:由上题可知:可列出方程式:1.G-S点迭代法时:方程简化为:4504141321TTT--4904141421TTT-4704141331TTT-41104141432TTT-采用matlab程序:结果如下:迭代次数初始123478910T1012.524.062530.390631.9727…32.491832.497932.499532.4999T2025.62538.281341.445342.2363…42.495942.49942.499742.4999T3020.62533.281336.445337.2363…37.495937.49937.499737.4999T4039.062545.390646.972747.3682…47.497947.499547.499947.52.采用线迭代法:选择自上而下的迭代:方程式化简为:)3515(41)1(3)(2)(1nnnTTT)4050(41)1(4)(1)(2nnnTTT)4525(41)(4)(1)(3nnnTTT)6050(41)(2)(3)(4nnnTTT用matlab编程如下:clear;clc;a=[1,-1/4,-1/4,0;-1/4,1,0,-1/4;-1/4,0,1,-1/4;0,-1/4,-1/4,1];b=[50/4;90/4;70/4;110/4];i=100;t=zeros(size(a,1),1);forn=2:i+1k1=-a(1,2)/a(2,2);t(1,n)=(-1*sum(a(1,2:end)*t(2:end,n-1))+b(1,1)-1*k1*sum(a(2,2:end)*t(2:end,n-1))+k1*b(2,1))/(a(1,1)+k1*a(2,1));t(2,n)=(-1*sum(a(1,3:end)*t(3:end,n-1))+b(1,1)-a(1,1)*t(1,n))/a(1,2);k2=-a(3,4)/a(4,4);t(3,n)=(-1*sum(a(3,1:2)*t(1:2,n))+b(3,1)-1*k2*sum(a(4,1:2)*t(1:2,n))+k2*b(4,1))/(a(3,3)+k2*a(4,3));t(4,n)=(-1*sum(a(3,1:3)*t(1:3,n))+b(3,1))/a(3,4);e=0;form=1:size(a,1)ifabs(t(m,n)-t(m,n-1))ee=abs(t(m,n)-t(m,n-1));endendife10^(-3)break;endend结果如下:迭代次数初始1234567T1019.333330.965932.326732.480632.497832.499832.5T2027.333340.885942.323542.480542.497842.499842.5T3032.977836.983337.44237.493537.499337.499937.5T4042.577846.967347.441447.493547.499347.499947.5由上述计算比较可知,相同的初始条件和边界条件,线迭代的收敛迭代次数少于点迭代算法。与例1相比,两者相差体现在边界条件的给定,但两者的四角温度之和相等,最终两者计算结果相同,可以解释如下:边界条件的传入是通过相关的内节点实现的,所以当某一内节点相关的边界条件温度值之和相等时可以视作同一条件,因为对该内节点而言,I类边界条件的影响效果可以线性叠加;7-8解:由方程式推导:44321xxx构造方程如右:)4(41)(3)(2)1(1kkkxxx924321xxx)29(41)(3)1(1)1(2kkkxxx252321xxx)22(51)1(2)1(1)1(3kkkxxx则误差传递方程为:)(41)(3)(2)1(1kkkεεε故有)(41)(3)(2)1(1kkkεεε)2(41)(3)1(1)1(2kkkεεε)2(41)(3)1(1)1(2kkkεεε)2(51)1(2)1(1)1(3kkkεεε)2(51)1(2)1(1)1(3kkkεεε由于上述误差式中(1)右端无常数项;(2)系数的绝对值之和小于1,故误差项误差之值必随迭代进行而逐渐衰减结果如下:迭代次数初值1234…192021X1111.37501.49841.49681.49351.49351.4935X211.50001.90631.91911.90981.90911.90911.9091X310-0.0875-0.0680-0.0646-0.0649-0.0649-0.0649E100.37500.1234-0.001704.4409e-160E20.50000.40630.0129-0.00941.5543e-1500E3-1-0.08750.01950.0034-6.2450e-168.3267e-170
本文标题:数值传热学----陶文铨-----第7章全
链接地址:https://www.777doc.com/doc-7190912 .html