blob: 706c615750a246b6a4c9114e070cd38ea0fe0522 (
plain)
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
|
//Example 2.8 Source Plus Sink Plus Uniform Flow
// Initialisation of variables
U = -100;
m = 314.2;
P0 = 2116.2;
rho = 0.002378;
c = 1;
x = 1.05;
y = 0.6;
P0 = 2116.2;
function[z] = shi(x,y)
z = -U*y + (m/(2*%pi)*atan(2*c*y/(x^2-y^2-c^2)));
endfunction
// Calculations
h = 0.00001;
u = (shi(x,y+h)-shi(x,y))/h ;
v = -(shi(x+h,y)-shi(x,y))/h ;
Velo = sqrt(u^2+v^2);
P = P0 - (rho/2)*(Velo^2-U^2);
//Results
disp(P,"Pressure at P(1.05, 0.6) (lb/sq-ft)");
|