Solve MATLAB Source Potential Flow Issues

  • Context: MATLAB 
  • Thread starter Thread starter physicsCU
  • Start date Start date
  • Tags Tags
    Flow Potential Source
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 7K views
physicsCU
Messages
198
Reaction score
1
Hey all:

I am trying to plot the streamlines of a source flow in MATLAB. I just have a couple issues. First, when I change the strength, it doesn't appear that the streamlines change at all. Second, the three lines commented out below, I used them from an example, but now they don't work.

If someone could give me a hand checking this code, that would be great.

Code:

clear all
close all
clc

nx = 100; xmin = -2; xmax = 2;
ny = 100; ymin = -2; ymax = 2;
[x y] = meshgrid(linspace(xmin,xmax,nx),linspace(ymin,ymax,ny));
M = 8; xM = 0; yM = 0;
PsiM = (M/(2*pi))*atan2(y - yM,x - xM);
% levmin = PsiM(1,nx);
% levmax = PsiM(ny,nx/2);
% levels = linspace(levmin,levmax,50);
contour(x,y,PsiM,100)
axis([xmin xmax ymin ymax])
xlabel('x'), ylabel('y')
title('Source of Strength M = 4')
 
Physics news on Phys.org
Can anyone help me?