-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathringvortex.m
29 lines (23 loc) · 864 Bytes
/
ringvortex.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
function [ u, v ] = ringvortex( xn, rn, xm, rm )
% Velocity induced by unit-strength ring vortex around the x-axis.
%
% Vortex Element Methods for Fluid Dynamic Analysis of Engineering Systems
% R. I. Lewis, 1991, Cambridge University Press, p. 150
%
% n Subscript for the ring vortex
% m Subscript for the point of interest
% Non-dimensional coordinates
x = (xm - xn)./rn;
r = rm./rn;
reqzero = ( r == 0 );
A = x.^2 + ( r + 1.0 ).^2;
B = x.^2 + ( r - 1.0 ).^2;
% Matlab's elliptic integral routine is done in terms of M, where M=k^2
ksq = 4.0 * r ./ A;
[K,E] = ellipke( ksq );
% External routine, slightly slower than built-in.
% [K,E] = lellipke( ksq );
u = - 1.0 ./ ( 2.0 * pi * rn .* sqrt( A ) ) .* ( K - ( 1.0 + 2.0 * ( r - 1.0 ) ./ B ) .* E );
v = (x./r) ./ ( 2.0 * pi * rn .* sqrt( A ) ) .* ( K - ( 1.0 + 2.0 * r ./ B ) .* E );
v( reqzero ) = 0;
end