《计算流体力学一维稳态导热编程作业.docx》由会员分享,可在线阅读,更多相关《计算流体力学一维稳态导热编程作业.docx(5页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、The Finite Volume Method for One-DimensionalDiffusion ProblemsL Problem of 1-dimensional Steady-State Source-free HeatConductionConsider the problem of source-free heat conduction in an insulated rod whose ends are maintained at constant temperatures of 100 and 500*C respectively.The one-dimensional
2、 problem sketched in the Figure 1 is governed byCalculate the steady state temperature distribution in the rod. Thermal conductivity k equals lOOOW/m/K, cross-sectional area A is 10*2m2.Fig. 1 Physical Model1网格划分Tq条件L = 0.5/, Ax = L/5 = O.bn,攵= 1OOOW/ z/K,Ta =1()(), Tb =500A = 0-2m22方程离散求解域内共有5个节点,节
3、点2、3、4的离散方程:上=0% +f_k &PE 7 OXWP JJI OXpE )(小由于 = kw = k , 5Kpe = 3xwp = (Sr, Ae = Aw = A 均为常数, 方程:aPTP = awTw +aETEtV 由 -A a -A . n - /i 4- zzcwp )因此对节点2、3、4有离散上、1c,-C 5P - Jw 丁 ”,OXox节点1的离散方程:keAc 懵1 -kwAw 懵岂XPE胡八P(k ( k( kAe + -A“ -7;=0-7;v+ - OXPE y l 及八 p )xPt可写为:aPTp = awTw + aETE + S“k其中. = A
4、e, aw = 0, ap = aw + aE - SP, 羯E(2k、S -工 a S“ = 2f. TAPOXAP7同理,节点5的离散方程(A,组二”一院4.Mb+Tp =0-7;-+f-Uhp )e)讯/可写为:cipTp = awTw + aETE + Stlk其口 e 0, aw Aw, aP aw + aE SP的yp=0、(k 、-4 小T-4工;)l况?)4Tp - Tw = Q瓯,夕AvA, tbJ3依)Sp =,S“ =所以得到各节点的初,在Sc, Sp的值各节点离散方程系数节点、awSpsuap= aw+ciE-Sp10-2A (5r2AT; 蜃八r k人 3A(X2%
5、蜃匕002A (X3-A口002A 及4乙乙 凉002A (5v5院0-2Ac k-2丁 A今ox, k A3A 6x即:awCIESpSuap= aw+aE-Sp10100-200200 T. /I30021001000020031001000020041001000020051000-200200300从而得下述代数方程组 3007; =1007;+200T4 2007; =1007; +1007; 2007; =1005 + 1007;2007; =1007;+1007;3007; = 1007;+200Tw写成矩阵形式有:300-100000-20074-100200-10000t20
6、0-100200-1000=000-100200-1000000-100300工一2007g将7; = 1007尸5(X)代入,解得此方程组为:140220=3003804603程序C程序内容如下: #include stdafx.h #include #define N 5 int main() ( int i; double GL,TA,TB,dx,k,Area,Lenth; double AWN+1,AEN+1LAPN+1,SPN+1,SUN+1; doubleaN+lJbN+l,cN+l,fN+1,MN+1,LN+1,UN+1jYN+1,TN+1;Lenth=0.5;TA=100;TB
7、=500; dx=Lenth/N; k=1000;Area=0.01;Lenth=0.5;TA=100;TB=500; dx=Lenth/N; k=1000;Area=0.01;长度西边界温度/东边界温度网格宽度导热系数截面积第一点计算AW1=0.0;AEl=k*Area/dx;SPl=-2*k*Area/dx;SUl=2*k*Area/dx*TA;/最后一点计算AWN=k*Area/dx;AEN=0.0;SPN=-2*k*Area/dx;SUN=2*k*Area/dx*TB;/中间点计算for(i=2;i=N-l;i+) AWi=k*Area/dx;AEi=k*Area/dx;SPi=0.0;SUi=0.0;)计算Apfor(i=l;i=N;i+) APi=AWi+AEi-SPi;/三对角方程组追赶法求解for(i=l;i=N;i+) ai+l=-AEi;bi=APi;ci=-AWi+l;fi=SUi;)for(i=l;i=N-l;i+)Ui=ci;Ll=bl;for(i=2;i=N;i+)Mi=ai/Li-1;Li=bi-Mi*Ui-l;for(i=2;i=l;i-)Ti=(Yi-Ui*Ti+l)/Li;printf (方程组ax=b的解为:n”); for(i=l;i=N;i+)printf( T%d=%.3fnJiJTi);return 0;