Hi i want simulation of flow in the pipe.
but my script shows something wrong. T_T
I want to show second images like this Image.
how can i do more?
dbstop if error
Ps=10;
Pf=50;
mu=8.94e-4;
R=0.10;
l=1.00;
if Ps==Pf
disp(' Same pressure dont show Velocity in pipe.');
end
N=100;
r=linspace(-R,R,N);
S=pi*R^2;
Vmax=(abs(Ps-Pf))*(R^2)/(4*mu*l);
Vmean=Vmax/2;
V=Vmax*(1-(r.^2)/R^2);
Q=Vmean*S;
subplot(2, 1, 1)
plot(V,r,'b.');
grid on, xlabel(' Velocity (m/s)'), ylabel(' Radius (m)');
T=100*ones(100,R*2)
for iter = 1:100
for t=1:100
va=V*t
end
subplot(2, 1, 2)
imagesc(va')
drawnow
end

2 件のコメント

Amit
Amit 2014 年 12 月 9 日
Which line you get error? Also can you use the '{} code' to post your complete code?
Image Analyst
Image Analyst 2014 年 12 月 12 日
a's "Flag" of this comment moved here, and the flag removed:
well... my english is poor. I want to show flow's displacement using V in second plot. like animation second plot means pipe. starting point velocity in pipe is 0. but t=0,1...,100 , flow is moving. velocity is side velocity slower than the center. velocity slows the farther away from the center. Do you understand?

サインインしてコメントする。

 採用された回答

per isakson
per isakson 2014 年 12 月 9 日
編集済み: per isakson 2014 年 12 月 10 日

1 投票

The inner for-loop overwrites va one hundred times. The outer for-loop draws the "same" image one hundred times in the same place.
In plain English, what do you want to show in the second plot?
&nbsp
&nbsp
Replace
T=100*ones(100,R*2);
...
% end of script
by
% T=100*ones(100,R*2);
subplot(2, 1, 2)
plot( 0, r, 'r.' );
axh = gca;
set( axh, 'XLim', [0,1e3] )
hold all
for t = 1:6
displacement = V*t;
plot( axh, displacement, r, 'r.' );
pause( 1 )
end
and run the script. That will take you a bit closer to the goal.

5 件のコメント

a
a 2014 年 12 月 10 日
編集済み: a 2014 年 12 月 10 日
well... my english is poor. I want to show flow's displacement using V in second plot. like animation
second plot means pipe.
starting point velocity in pipe is 0. but t=0,1...,100 , flow is moving. velocity is side velocity slower than the center. velocity slows the farther away from the center.
Do you understand?
per isakson
per isakson 2014 年 12 月 10 日
Do you assume an ideal model of fully developed laminar flow?
per isakson
per isakson 2014 年 12 月 10 日
編集済み: per isakson 2014 年 12 月 10 日
Your English is adequate. However, I didn't understand that you wanted to plot the displacement.
See my answer
a
a 2014 年 12 月 10 日
Wow amazing work!! thank you very very very very very much!!!! I love you!!
Arik Chattopadhyay
Arik Chattopadhyay 2021 年 3 月 31 日
can I get the entire code?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeFluid Dynamics についてさらに検索

質問済み:

a
a
2014 年 12 月 9 日

コメント済み:

2021 年 3 月 31 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by