# CHAPTER03 : FUNDAMENTALS OF INVISCID INCOMPRESSIBLE FLOW¶

## Example E01 : Pg 63¶

In :
# All the quantities are expressed in SI units
from math import sqrt
rho_inf = 1.23;    # freestream density of air at sea level
p_inf = 101000.;    # freestream static pressure
v_inf = 50.;        # freestream velocity
p = 90000.;         # pressure at given point

# The velocity at the given point can be expressed as
v = sqrt((2.*(p_inf-p)/rho_inf) + (v_inf**2.));

print"The velocity at the given point is V =",v,"m/s"

The velocity at the given point is V = 142.780176712 m/s


## Example E02 : Pg 64¶

In :
# All the quantities are expressed in SI units
rho = 1.225;       # freestream density of air along the streamline
p_1 = 101314.1;    # pressure at point 1
v_1 = 3.05;        # velocity at point 1
v_2 = 57.91;       # velocity at point 2
# The pressure at point 2 on the given streamline can be given as
p_2 = p_1 + 1/2*rho*((v_1**2) - (v_2**2));
print"The pressure at point 2 is p2 =",p_2,"Pa\n"

The pressure at point 2 is p2 = 101314.1 Pa



## Example E03 : Pg 69¶

In :
# All the quantities are expressed in SI units
import math
rho = 1.225;       # freestream density of air along the streamline
delta_p = 335.16;   # pressure difference between inlet and throat
ratio = 0.8;       # throat-to-inlet area ratio
# The velocity at the inlet can be given as
v_1 = math.sqrt(2*delta_p/rho/(((1/ratio)**2)-1));
print"The value of velocity at the inlet is V1 =",v_1,"m/s\n"

The value of velocity at the inlet is V1 = 31.1897419034 m/s



## Example E04 : Pg 72¶

In :
# All the quantities are expressed in SI units
import math
rho=1.23;           # freestream density of air along the streamline
v=50.;               # operating velocity inside wind tunnel
rho_hg = 13600.;       # density of mercury
ratio = 12.;           # contraction ratio of the nozzle
g = 9.8;              # acceleration due to gravity
w = rho_hg*g;         # weight per unit volume of mercury
# The pressure difference delta_p between the inlet and the test section is given as
delta_p = 1./2.*rho*v*v*(1.-(1./ratio**2.));
# Thus the height difference in a U-tube mercury manometer would be
delta_h = delta_p/w;
print"The height difference in a U-tube mercury manometer is delta_h =",delta_h,"m\n"

The height difference in a U-tube mercury manometer is delta_h = 0.0114557541767 m



## Example E05 : Pg 73¶

In :
# all the quantities are expressed in SI units
from math import sqrt
ratio = 12.;        # contraction ratio of wind tunnel nozzle
Cl_max = 1.3;      # maximum lift coefficient of the model
S = 0.56;          # wing planform area of the model
L_max = 4448.22;   # maximum lift force that can be measured by the mechanical balance
rho_inf = 1.225;   # free-stream density of air
# the maximum allowable freestream velocity can be given as
V_inf = sqrt(2.*L_max/rho_inf/S/Cl_max);
# thus the maximum allowable pressure difference is given by
delta_p = 1./2.*rho_inf*(V_inf**2.)*(1.-(ratio**-2.));
print"The maximum allowable pressure difference between the wind tunnel setling chamber and the test section is delta_p =",delta_p,"Pa"

The maximum allowable pressure difference between the wind tunnel setling chamber and the test section is delta_p = 6067.76041667 Pa


## Example E06 : Pg 75¶

In :
# all the quantities are expressed in SI units

V2 = 100.*1609./3600.;        # test section flow velocity converted from miles per hour to meters per second
p_atm = 101000.;            # atmospheric pressure
p2 = p_atm;                # pressure of the test section which is vented to atmosphere
rho = 1.23;                # air density at sea level
ratio = 10.;                # contraction ratio of the nozzle

# the pressure difference in the wind tunnel can be calculated as
delta_p = rho/2.*(V2**2.)*(1.-(1./ratio**2.));

# thus the reservoir pressure can be given as
p1 = p2 + delta_p;

p1_atm = p1/p_atm;         # reservoir pressure expressed in units of atm

print"The reservoir pressure is p1 =",p1_atm,"atm"

#Ex3_6b
# all the quantities are expressed in SI units

V2 = 89.4;        # test section flow velocity converted from miles per hour to meters per second
p_atm = 101000;            # atmospheric pressure
p2 = p_atm;                # pressure of the test section which is vented to atmosphere
rho = 1.23;                # air density at sea level
ratio = 10;                # contraction ratio of the nozzle

# the pressure difference in the wind tunnel can be calculated as
delta_p = rho/2*(V2**2)*(1-(1/ratio**2));

# thus the reservoir pressure can be given as
p1 = p2 + delta_p;

p1_atm = p1/p_atm;         # reservoir pressure expressed in units of atm

print"The new reservoir pressure is p1 =",p1_atm,"atm"

The reservoir pressure is p1 = 1.01204192792 atm
The new reservoir pressure is p1 = 1.0486663505 atm


## Example E07 : Pg 80¶

In :
# all the quantities are expressed in SI units
import math
p0 = 104857.2;             # total pressure as measured by the pitot tube
p1 = 101314.1;             # standard sea level pressure
rho = 1.225;               # density of air at sea level

# thus the velocity of the airplane can be given as
V1 = math.sqrt(2*(p0-p1)/rho);

print"The velocity of the airplane is V1 =",V1,"atm"

The velocity of the airplane is V1 = 76.0569067293 atm


## Example E08 : Pg 82¶

In :
# all the quantities are expressed in SI units

V_inf = 100.1;                # freestream velocity
p_inf = 101314.1;             # standard sea level pressure
rho_inf = 1.225;              # density of air at sea level

# the dynamic pressure can be calculated as
q_inf = 1/2*rho_inf*(V_inf**2);

# thus the total pressure is given as
p0 = p_inf + q_inf;

print"The total pressure measured by pitot tube is p0 =",p0,"Pa"

The total pressure measured by pitot tube is p0 = 101314.1 Pa


## Example E09 : Pg 85¶

In :
# all the quantities are expressed in SI units
import math
p0 = 6.7e4;                # total pressure as measured by the pitot tube
p1 = 6.166e4;              # ambient pressure at 4km altitude
rho = 0.81935;             # density of air at 4km altitude

# thus the velocity of the airplane can be given as
V1 = math.sqrt(2*(p0-p1)/rho);

print"The velocity of the airplane is V1 =",V1,"m/s =",V1/0.447,"mph"

The velocity of the airplane is V1 = 114.169709845 m/s = 255.413221129 mph


## Example E10 : Pg 88¶

In :
# all the quantities are expressed in SI units
from math import sqrt
V1 =114.2;                 # velocity of airplane at 4km altitude
rho = 0.81935;             # density of air at 4km altitude
q1 = 1./2.*rho*(V1**2.)        # dynamic pressure experienced by the aircraft at 4km altitude
rho_sl = 1.23;             # density of air at sea level
# according to the question
q_sl = q1;                 # sealevel dynamic pressure
# thus the equivallent air speed at sea level is given by
Ve = sqrt(2*q_sl/rho_sl);
print"The equivallent airspeed of the airplane is Ve =",Ve,"m/s"

The equivallent airspeed of the airplane is Ve = 93.2069457878 m/s


## Example E11 : Pg 89¶

In :
# all the quantities are expressed in SI units
V_inf = 45.72;        # freestream velocity
V = 68.58;            # velocity at the given point
# the coeeficient of pressure at the given point is given as
Cp = 1. - (V/V_inf)**2.;
print"The coefficient of pressure at the given point is Cp =",Cp

The coefficient of pressure at the given point is Cp = -1.25


## Example E12 : Pg 91¶

In :
# all the quantities are expressed in SI units
from math import sqrt,pi
Cp = -5.3;            # peak negative pressure coefficient
V_inf = 24.38;        # freestream velocity
# the velocity at the given point can be calculated as
V = sqrt(V_inf**2*(1-Cp));
print"The velocity at the given point is V =",V,"m/s"
#Ex3_12b
# all the quantities are expressed in SI units
Cp = -5.3;            # peak negative pressure coefficient
V_inf = 91.44;        # freestream velocity
# the velocity at the given point can be calculated as
V = math.sqrt(V_inf**2*(1-Cp));

print"The velocity at the given point is V =",V,"m/s"

The velocity at the given point is V = 61.1933143407 m/s
The velocity at the given point is V = 229.512578479 m/s


## Example E13 : Pg 100¶

In :
# all the quantities are expressed in SI units
# When p = p_inf, Cp = 0, thus
# 1-4*(sin(theta)**2) = 0
# thus theta can be given as
#theta = (asind(1/2), 180-asind(1/2), 180-asind(-1/2), 360+asind(-1/2));
# sine inverse of 1/2 and -1/2 where theta varies from 0 to 360 degrees
theta1=30.;#
theta2=150.;#
theta3=210.;#
theta4=330.;#
print"The angular locations where surface pressure equals freestream pressure are theta=",theta1,theta2,theta3,theta4,"degrees"

The angular locations where surface pressure equals freestream pressure are theta= 30.0 150.0 210.0 330.0 degrees


## Example E14 : Pg 103¶

In :
# All the quantities are expressed in SI units
import math
Cl = 5;                              # lift coefficient of the cylinder
V_by_Vinf = -2 - Cl/2/math.pi;            # ratio of maximum to freestream velocity

# thus the pressure coefficient can be calculated as
Cp = 1 - (V_by_Vinf**2);

print"The peak negative pressure coefficient is Cp =",Cp

The peak negative pressure coefficient is Cp = -5.95176382404


## Example E15 : Pg 106¶

In :
# All the quantities are expressed in SI units
#theta = (180-asind(-5/4/math.pi) 360+asind(-5/4/math.pi));        # location of the stagnation points
theta1=203.4;#
theta2=336.6;#
print"The angular location of the stagnation points are theta =",theta1, theta2,"degrees"
#function temp = Cp(thet)
#   temp = 0.367 -3.183*sind(thet) - 4*(sind(thet)**2);    # Cp written as a function of theta
#endfunction
Cp90=-6.82;#
print "\nCp =",Cp90
#[k] = roots([-4 -3.183 0.367]);
#theta_2 = 180/math.pi*(math.pi-asin(k(1)), 2*math.pi+asin(k(1)), asin(k(2)), math.pi-asin(k(2)));
theta_2_1=243.9;#
theta_2_2=296.11;#
theta_2_3=5.86;#
theta_2_4=174.1;#
Cp270=-0.45;#
print"\nThe angular location of points on the cylinder where p = p_inf is theta =",theta_2_1,theta_2_2,theta_2_3,theta_2_4
print"\nThe value of Cp at the bottom of the cylinder is Cp = ",Cp270

The angular location of the stagnation points are theta = 203.4 336.6 degrees

Cp = -6.82

The angular location of points on the cylinder where p = p_inf is theta = 243.9 296.11 5.86 174.1

The value of Cp at the bottom of the cylinder is Cp =  -0.45


## Example E16 : Pg 110¶

In :
# All the quantities are expressed in SI units
import math
rho_inf = 0.90926;        # density of air at 3km altitude
V_theta = -75;            # maximum velocity on the surface of the cylinder
V_inf = 25;               # freestream velocity
R = 0.25;                 # radius of the cylinder

# thus the circulation can be calculated as
tow = -2*math.pi*R*(V_theta+2*V_inf);

# and the lift per unit span is given as
L = rho_inf*V_inf*tow;

print"The Lift per unit span for the given cylinder is L=",L,"N"

The Lift per unit span for the given cylinder is L= 892.663917563 N