Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
39 views1 page

'R' On 'G' Off 'Uniform Flow With Source at Origin' 'Psi' 'Phi'

This document contains code that generates contour plots of the stream function (psi) and velocity potential (phi) for a uniform flow with a source located at the origin. The code defines a grid, sets the mass and velocity constants, calculates phi and psi based on these constants and the grid coordinates, then plots the contour lines of phi and psi on the same graph with labels.

Uploaded by

Atul Rai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views1 page

'R' On 'G' Off 'Uniform Flow With Source at Origin' 'Psi' 'Phi'

This document contains code that generates contour plots of the stream function (psi) and velocity potential (phi) for a uniform flow with a source located at the origin. The code defines a grid, sets the mass and velocity constants, calculates phi and psi based on these constants and the grid coordinates, then plots the contour lines of phi and psi on the same graph with labels.

Uploaded by

Atul Rai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

% (f) uniform flow with source at origin

clc;
clear;
[x,y]=meshgrid(-15:.01:15,-3:.01:3);
m=1;
u=1;
phi=-u*x-m*.5*log(x.^2+y.^2);
psi=-u*y-m*atan(y./x);
contour(x,y,psi,'r');
hold on
contour(x,y,phi,'g');
hold off
title('Uniform flow with source at origin');
legend('psi','phi');

You might also like