summaryrefslogtreecommitdiff
path: root/689/CH2/EX2.7/7.sce
blob: 6f2bbe803013be65be450207b7a908adba919a93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//Example 2.7  Uniform Flow Plus a Source

// Initialisation of variables
U = 100;
m = 600;
P0 = 2116.2;
rho = 0.002378;
function[z] = shi(x,y)
    z = -U*y + (m/(2*%pi)*atan(y/x));
endfunction

// Calculations
h = 0.000001;
u = (shi(h,1.5+h)-shi(h,1.5))/h  ;      // Partial derivative is ts taken in just the neighbourhood of 0 as if we take absolute zero then there will be a divide by zero error.
v = -(shi(2*h,1.5)-shi(h,1.5))/h ;       
Velo = sqrt(u^2+v^2);
P = P0 - (rho/2)*(Velo^2-U^2);

//Results 
disp(P,"Pressure at P(0, 1.5) (lb/sq-ft)");