Plotting Contours of velocity potential and stream function of top of velocity vectors.
75 次查看(过去 30 天)
显示 更早的评论
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)
0 个评论
回答(2 个)
Ali Alaraini
2020-1-22
How do you plot the veolcity isolines of a veolcity potential flow of a source or a sink ??
0 个评论
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')
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!