| 查看: 1020 | 回复: 4 | ||
[求助]
有一段matlab不太理解,求大神解释 已有2人参与
|
|
边界层方程流体计算的 viscosity = 18.1e-6; % viscosity density = 1.19 ; kvisc = viscosity/density; % kinematic viscosity Pr = 0.72; % Prandtl number Umax = 5; % free stream velocity maxres = 1e-5; % max residual maxit = 3; nx = input('Number of increment in x-dir= ') ny = input('Number of increment in y-dir= ') ni = nx +1; nj = ny +1; % Increment length in y-dir 0.05 - 0.2 mm % Increment length in x-dir 0.1 - 1.0 mm dx = input('Increment length in x-dir (mm)= ') dy = input('Increment length in y-dir (mm)= ') dx = dx/1000; dy = dy/1000; x=0:dx (ni-1)*dx)y=0:dy nj-1)*dy% Boundary and initial values for i=1:ni for j=1:nj U(i,j)=Umax; if j==1; U(i,j)=0; end; V(i,j) = 0; T(i,j) = 0; if j==1; T(i,j)=1.0; end; end; end; counter = 0; for i = 2:ni counter = 0; sumres = 1; while ((sumres > maxres)&(counter < maxit) ) P(1)=0;Q(1)=0; sumres=0; %% momentuum eqn for j = 2:nj-1 a = U(i,j)/dx+2*kvisc/dy^2; b = kvisc/dy^2-V(i,j)/(2*dy); c = kvisc/dy^2+V(i,j)/(2*dy); d = U(i,j)*U(i-1,j)/dx; P(j)=b/(a-c*P(j-1)); Q(j)=(c*Q(j-1)+d)/(a-c*P(j-1)); sumres=sumres+abs(a*U(i,j)-(b*U(i,j+1)+c*U(i,j-1)+d)); end; for j=nj-1:-1:2 U(i,j) = P(j)*U(i,j+1)+Q(j); end; P(1)=0;Q(1)=0; %%continuity eqn. for j = 2:nj-1 a = 1/dy; b = 0; c = 1/dy; d = -((U(i,j)-U(i-1,j))+(U(i,j-1)-U(i-1,j-1)))/(2*dx); P(j)=b/(a-c*P(j-1)); Q(j)=(c*Q(j-1)+d)/(a-c*P(j-1)); sumres=sumres+abs(a*V(i,j)-(b*V(i,j+1)+c*V(i,j-1)+d)); end; for j=nj-1:-1:2 V(i,j) = P(j)*V(i,j+1)+Q(j); end; counter = counter +1; % counts number of iterations end; TotalResidual = sumres end; for i = 2:ni % Temperature field P(1)=0;Q(1)=T(i,1); % TDMA % for j = 2:nj-1 % a =??? % b =??? % c =??? % d =??? % P(j)=b/(a-c*P(j-1)); % Q(j)=(c*Q(j-1)+d)/(a-c*P(j-1)); % end; % for j=nj-1:-1:2 % T(i,j) = P(j)*T(i,j+1)+Q(j); % end; end; for i=2:ni % calc. Nusselt number and friction factor end; 中间的 a = U(i,j)/dx+2*kvisc/dy^2; b = kvisc/dy^2-V(i,j)/(2*dy); c = kvisc/dy^2+V(i,j)/(2*dy); d = U(i,j)*U(i-1,j)/dx; P(j)=b/(a-c*P(j-1)); Q(j)=(c*Q(j-1)+d)/(a-c*P(j-1)); sumres=sumres+abs(a*U(i,j)-(b*U(i,j+1)+c*U(i,j-1)+d)) 这一段是什么意思,a,b,c,d是什么?是动量方程模型吗? |
» 猜你喜欢
今天系统多次维护,明天很可能放榜!
已经有5人回复
欢迎发来filecode的Mz6后的代码验证其规律
已经有74人回复
岩土工程学报什么时候才能终审完呐
已经有4人回复
时间戳又变了8-15
已经有25人回复
2027广东省杰青
已经有6人回复
快农历七夕节了,轻松一下,男人悄悄话,女施主请不要进来。
已经有3人回复
哪位老哥知道今年的国自然具体哪一天放榜?
已经有9人回复
咱们一起用铁证分析2026国家社科基金中标与否
已经有26人回复
我的国基提前知道中了,可是同事的操作让我实在接受不了,怎么会有这样的人
已经有16人回复
有时候,自然基金真的不能太认真 (我的申报经验)
已经有12人回复
» 本主题相关价值贴推荐,对您同样有帮助:
想写matlab程序之前不妨看看matlab的fileexchange
已经有4人回复
求各位大神帮忙解释一下审稿人的评论,小硕不太理解,非常感谢~~~
已经有7人回复
请问一下matlab这个是什么问题
已经有10人回复
求大神帮忙解释截断能测试中的问题!
已经有7人回复
求大神翻译,解释,不胜感激
已经有21人回复
关于ANSYS荷载组合问题,求大神指点迷津!!
已经有4人回复
求大神帮忙拟合一个非线性方程,求出模型参数
已经有15人回复
MATLAB/Simulink大神请进
已经有4人回复
求数学大神用matlab帮我解决一个问题。不胜感激
已经有6人回复
跪求大神帮看matlab小程序
已经有3人回复
求大神用matlab给我处理一组数据,有人没有啊?
已经有15人回复
求大神帮忙用MATLAB解一道积分题
已经有5人回复
关于matlab进行傅里叶变换和逆变换的程序,求大神指导!
已经有9人回复
matlab解决重心法选址问题,运行不了啊,求助各位大神
已经有10人回复
求大神解释下Current Microbiology杂志的作者指南?
已经有14人回复
编程达人CP3
银虫 (正式写手)
- 应助: 2 (幼儿园)
- 金币: 1238.8
- 红花: 1
- 沙发: 1
- 帖子: 316
- 在线: 136.6小时
- 虫号: 2437507
- 注册: 2013-04-26
- 性别: GG
- 专业: 计算机软件

2楼2015-01-04 07:40:57
3楼2015-01-04 09:11:45
4楼2015-01-04 09:47:05
5楼2015-01-04 10:42:26










(ni-1)*dx)
回复此楼

25