# Homework Help: Modelling a flow past a symmetric body

1. Oct 18, 2008

### mybrainhurts

1. The problem statement, all variables and given/known data
I need to model the streamlines for an incompressible, irrotational flow about various symmetric bodies, starting with an ellipse

2. Relevant equations
for a uniform flow in the positive x direction, psi =y
for a source/sink of strength K at (xn,yn)
psi = Karctan((y-yn)/(x-xn))
at any point along the body, there must be no flow across it, and hence psi = 0

3. The attempt at a solution

the stream function for the whole flow = Uy+ SUM Knarctan(y/(x-xn)) (no ydisplacement as all sources are on axis)
this = 0 at each of the control points y(m) (and everywhere else along the surface of the sphere, but a number of control points = to the number of sources should be appropriate)

hence
Knpsin(m) - Uy(m) = 0

and so I should be able to get the strengths from the following matlab code (taking U =1)

Code (Text):

n = 10;
L = 1;
D = 0.5;
dx = 2*L/(n+1);
xs = -L+dx:dx:L-dx;   % uniformly distributed
xb = -L+dx:dx:L-dx   % uniformly distributed
%
% definition of body geometry
%
yb = D*sqrt(1-xb.^2./L^2); % ellipse
%
% plot control points
%
figure
plot([-L xb L],[0 yb 0],[-L xb L],[0 -yb 0])
axis equal
%
% compute source strengths
%
% K = strength
%
for i=1:n
for j=1:n
a(i,j) = atan(yb(i)./(xb(i)-xs(j)));
end
b(i,1) = -yb(i);
end
K = a\b

However this, results in all negative values for K, meaning a huge total removal of volume from the system instead of the expected no (or approximately no) change, and hence a set of funky streamlines that look nothing at all like a flow around an ellipse.

EDIT: realised I made a mistake, should be b(i,1) = yb(i) (not -yb(i)) however this just results in all strengths being positive, so I get what looks like a funky superposition of flows around multiple semi-infinite bodies.

Last edited: Oct 18, 2008