フィルターのクリア

Plotting Contours of velocity potential and stream function of top of velocity vectors.

19 ビュー (過去 30 日間)
Stephen Mixon
Stephen Mixon 2019 年 10 月 24 日
編集済み: Isaiah Garcia-Romaine 2023 年 10 月 27 日
This is my question I have
Use MATLAB to plot contours of velocity potential and stream function on top of velocity vectors for each a combined with a uniform flow of V = 10 m/s
a. A source strength 20 m2/s
b. A doublet strength 20 m2/s
c. A vortex strength 20 m3/s
d. A source and a sink each of strength 15 m2 separated by 1 m
Here is my code so far. I am terrible with MATLAB and do not know where to go from here
clc, clear
[x,y] = meshgrid(0:0.1:4,0:0.1:4);
u = 10*y;
v = (-6*x)-10;
z=5*(y.^2)-(3*x.^2)-(10*x)-5;
figure
quiver(x,y,v,u)
hold on
contour(x,y,z,20)

回答 (2 件)

Ali Alaraini
Ali Alaraini 2020 年 1 月 22 日
How do you plot the veolcity isolines of a veolcity potential flow of a source or a sink ??

Isaiah Garcia-Romaine
Isaiah Garcia-Romaine 2023 年 10 月 27 日
編集済み: Isaiah Garcia-Romaine 2023 年 10 月 27 日
clc, clear
[x,y] = meshgrid(-2:0.1:2,-2:0.1:2);
V = 10; % uniform flow speed
% a. A source strength 20 m2/s
strength_source = 20;
u_source = strength_source/(2*pi)*x./(x.^2+y.^2);
v_source = strength_source/(2*pi)*y./(x.^2+y.^2);
figure
quiver(x,y,u_source+V,v_source)
hold on
contour(x,y,u_source+V,20)
title('A source strength 20 m^2/s')
% b. A doublet strength 20 m2/s
strength_doublet = 20;
u_doublet = -strength_doublet/(2*pi)*x./(x.^2+y.^2).^2;
v_doublet = -strength_doublet/(2*pi)*y./(x.^2+y.^2).^2;
figure
quiver(x,y,u_doublet+V,v_doublet)
hold on
contour(x,y,u_doublet+V,20)
title('A doublet strength 20 m^2/s')
% c. A vortex strength 20 m3/s
strength_vortex = 20;
u_vortex = strength_vortex/(2*pi)*y./(x.^2+y.^2);
v_vortex = -strength_vortex/(2*pi)*x./(x.^2+y.^2);
figure
quiver(x,y,u_vortex+V,v_vortex)
hold on
contour(x,y,u_vortex+V,20)
title('A vortex strength 20 m^3/s')
% d. A source and a sink each of strength 15 m^2 separated by 1 m
strength_source_sink = 15;
separation_distance = 1;
u_source_sink = strength_source_sink/(2*pi)*(x+separation_distance/2)./( (x+separation_distance/2).^2 + y.^2 ) - strength_source_sink/(2*pi)*(x-separation_distance/2)./( (x-separation_distance/2).^2 + y.^2 );
v_source_sink = strength_source_sink/(2*pi)*y./( (x+separation_distance/2).^2 + y.^2 ) - strength_source_sink/(2*pi)*y./( (x-separation_distance/2).^2 + y.^2 );
figure
quiver(x,y,u_source_sink+V,v_source_sink)
hold on
contour(x,y,u_source_sink+V,20)
title('A source and a sink each of strength 15 m^2 separated by 1 m')

カテゴリ

Help Center および File ExchangeObject Containers についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by