Vortcity Study
clc
clear
N=100;
Lx=1;
Ly=1;
dx=Lx/N;
dy=Ly/N;
Area=dx*dy;
for i=1:N;
du(i)=0.01*randn(1,1);
dv(i)=0.01*randn(1,1);
dudy(i)=du(i)/dx;
dvdx(i)=dv(i)/dy;
x0=0.5;
y0=0.5;
if (i==1)
x(i)=x0;
y(i)=y0;
end
if (i==N)
x(i)=x0;
y(i)=y0;
end
x(i+1)=x(i)+du(i);
y(i+1)=y(i)+dv(i);
v1(i,1:2)=[x(i+1),x(i)];
v2(i,1:2)=[y(i+1),y(i)];
ff=line(v1,v2);
W(i)=0.5*(dudy(i)-dvdx(i));
pause(0.1)
end
circulation=sum(W)*Area
%plot(W)
xc=sum(x(:))/N
yc=sum(y(:))/N
hold on
axis equal
plot(xc,yc,'*r')
grid on
xx1=max(x(:));
xx2=min(x(:));
yy1=max(y(:));
yy2=min(y(:));
r1=xx1-xx2;
r2=yy1-yy2;
R_AVG=0.5*(r1+r2)+r2-r1;
r=R_AVG/2;
theta(1)=0;
for i=1:360;
co=pi/180;
theta(i+1)=theta(i)+1;
xxx(i)=xc+r*cos(co*theta(i+1));
yyy(i)=yc+r*sin(co*theta(i+1));
end
plot(xxx(:),yyy(:),'r')
clear
N=100;
Lx=1;
Ly=1;
dx=Lx/N;
dy=Ly/N;
Area=dx*dy;
for i=1:N;
du(i)=0.01*randn(1,1);
dv(i)=0.01*randn(1,1);
dudy(i)=du(i)/dx;
dvdx(i)=dv(i)/dy;
x0=0.5;
y0=0.5;
if (i==1)
x(i)=x0;
y(i)=y0;
end
if (i==N)
x(i)=x0;
y(i)=y0;
end
x(i+1)=x(i)+du(i);
y(i+1)=y(i)+dv(i);
v1(i,1:2)=[x(i+1),x(i)];
v2(i,1:2)=[y(i+1),y(i)];
ff=line(v1,v2);
W(i)=0.5*(dudy(i)-dvdx(i));
pause(0.1)
end
circulation=sum(W)*Area
%plot(W)
xc=sum(x(:))/N
yc=sum(y(:))/N
hold on
axis equal
plot(xc,yc,'*r')
grid on
xx1=max(x(:));
xx2=min(x(:));
yy1=max(y(:));
yy2=min(y(:));
r1=xx1-xx2;
r2=yy1-yy2;
R_AVG=0.5*(r1+r2)+r2-r1;
r=R_AVG/2;
theta(1)=0;
for i=1:360;
co=pi/180;
theta(i+1)=theta(i)+1;
xxx(i)=xc+r*cos(co*theta(i+1));
yyy(i)=yc+r*sin(co*theta(i+1));
end
plot(xxx(:),yyy(:),'r')
Unless otherwise noted, all content on this site is @Copyright by Ahmed Al Makky 2012-2013 - http://cfd2012.com