nobre55
nobre55

Reputation: 21

creating a simulation of potential vortex in matlab

I'm trying to simulate different potential vortexes in MATLAB. I got the flow function and the velocities and it is working for one single vortex. But I don't know how to vary the vortex from being in the origin. Can anybody help me?

[x,y] = meshgrid(-10:10);
Gamma = 5;%circulation
yc = 1; %aberration from the origin 
xc = 1; 
rc = sqrt((x-xc).^2+(y-yc).^2);
r = sqrt(x.^2 + y.^2);
u = - Gamma*(y-yc) / 2*pi*rc +2* Gamma* y / 2*pi*r -Gamma*(y-yc)/2*pi*rc;
v = Gamma * (x-xc) / 2*pi*rc-2* Gamma*x / 2*pi*r + Gamma*(x-xc)/2*pi*rc;

quiver(x,y,u,v);

I tried to transform the potential flow function for a potential vortex to cartesian coordinates to simulate four vortexes in a quadrat:

[x,y] = meshgrid(-8:0.1:8);
Gamma = 5;
spacing = 0.1;
yc = 1;
xc = 1; 
rc = sqrt((x+xc).^2+(y+yc).^2);
rc2 = sqrt((x+xc).^2+y.^2);
rc3 = sqrt(x.^2 +(y+yc).^2);
r = sqrt(x.^2 + y.^2);
u = Gamma/2*pi * (-(y+yc)./rc +(y+yc)./rc3 + y./rc2 - y./r);
v = Gamma/2*pi *(-(x+xc)./rc +(x+xc)./rc2 + x./rc3 - x./r); 
quiver(x,y,u,v);

Therewith I was able to simulate different vortexes but it seems that there is a source in the middle of the vortexes now. Vortexes with a unwanted source in the middle:

image

Upvotes: 0

Views: 231

Answers (0)

Related Questions