# Chapter 1. Compressible Flow-Some History and Introductory Thoughts¶

## Example 1.1¶

In [1]:
# Example 1.1.py
# Consider the low-speed flow of air over an airplane wing at standard
# sea level conditions; the free-stream velocity far ahead of the wing
# is 100 mi/h. The flow accelerates over the wing, reaching a maximum
# velocity of 150 mi/h at some point on the wing. What is the percentage
# pressure change between this point and the free stream?

# Variable declaration
rho = 0.002377     # density at sea level (slug/ft^3)
p_1 = 2116.0       # pressure at sea level (lb/ft^2)
v_1 = 100.0        # velocity far ahead of the wing (mi/h)
v_2 = 150.0        # velocity at some point on the wing (mi/h)

# Calculations

u_1 = v_1 * 88.0/60.0 # converting v_1 in ft/s
u_2 = v_2 * 88.0/60.0 # converting v_2 in ft/s

delP = 0.5*rho*(u_2*u_2 - u_1*u_1) # p_1 - p_2 from Bernoulli's equation
fracP = delP/p_1 # fractional change in pressure with respect to freestream

# Result
print "Fractional change in pressure is %.3f or %.1f percent" %(fracP, fracP*100)

Fractional change in pressure is 0.015 or 1.5 percent


## Example 1.2¶

In [2]:
# Example 1.2.py
# A pressure vessel that has a volume of 10 m^3 is used to store high
# pressure air for operating a supersonic wind tunnel. If the air pressure
# and temperature inside the vessel are 20 atm and 300 K, respectively,
# what is the mass of air stored in the vessel?

# Variable declaration
V = 10             # volume of vessel (m^3)
p = 20.0           # pressure (atm)
T = 300            # temperature (K)

R = 287.0          # gas constant (J/Kg/K)

# Calculations
p = p * 101000.0   # units conversion to N/m^2
rho = p/R/T        # from ideal gas equation of state
m = V * rho        # total mass volume * density

# Result
print "Total mass stored is %.1f Kg" %(m)

Total mass stored is 234.6 Kg


## Example 1.3¶

In [3]:
# Example 1.3.py
# Calculate the isothermal compressibility for air at a pressure of 0.5 atm.

# Variable declaration
p = 0.5           # pressure (atm)
p_si = 0.5*101325 # pressure (N/m^2)
p_eng = 0.5*2116  # pressure (lb/ft^2)

# Calculations
tau_atm = 1/p       # isothermal compressibility in atm^-1
tau_si = 1/p_si     # isothermal compressibility in m^2/N
tau_eng = 1/p_eng   # isothermal compressibility in ft^2/lb

# Result
print "Isothermal compressibility for air at %.1f atm is %.2f atm^-1 or %.2e m^2/N or %.2e ft^2/lb" %(p, tau_atm, tau_si, tau_eng)

Isothermal compressibility for air at 0.5 atm is 2.00 atm^-1 or 1.97e-05 m^2/N or 9.45e-04 ft^2/lb


## Example 1.4¶

In [4]:
# Example 1.4.py
# For thre pressure vessel in Example 1.2, calculate the total internal
# energy of the gas stored in the vessel.

# Variable declaration from example 1.2
V = 10             # volume of vessel (m^3)
p = 20.0           # pressure (atm)
T = 300            # temperature (Kelvin)

R = 287.0          # gas constant (J/Kg/K)
gamma = 1.4        # ratio of specific heats for air

# Calculations
cv = R / (gamma-1) # specific heat capacity at constant volume(J/Kg K)
e = cv * T         # internal energy per Kg (J/Kg)
p = p * 101000.0   # units conversion to N/m^2
rho = p/R/T        # from ideal gas equation of state (Kg/m^3)
m = V * rho        # total mass = volume * density (Kg)
E = m*e            # total energy in J

# Result
print "Total internal energy is %.2e J" %(E)

Total internal energy is 5.05e+07 J


## Example 1.5¶

In [5]:
# Example 1.5.py
# Consider the air in the pressure vessel in Example 1.2. Let us now heat
# the gas in the vessel. Enough heat is added to increase the temperature
# to 600 K. Calculate the change in entropy of the air inside the vessel.

# Variable declaration from example 1.2
V = 10             # volume of vessel (m^3)
p = 20.0           # pressure (atm)
T = 300.0          # initial temperature (K)
T2 = 600.0         # final temperature (Kelvin)
R = 287.0          # gas constant (J/Kg/K)
gamma = 1.4        # ratio of specific heats for air

# Calculations
p2_by_p = T2/T     # p2/p, at constant volume p/T = constant

cv = R / (gamma-1) # specific heat capacity at constant volume (J/Kg K)
cp = cv + R        # specific heat capacity at constant pressure (J/Kg K)

p = p * 101000.0   # units conversion to N/m^2
rho = p/R/T        # from ideal gas equation of state (Kg/m^3)
m = V * rho        # total mass = volume * density (Kg)

from numpy import log                 # importing log
del_s = cp*log(T2/T) - R*log(p2_by_p) # change in entropy per unit mass (J/ Kg K)
total_del_s = m*del_s                 # total change in entropy (J/K)

# Result
print "Total change in entropy is %.3e J/K" %(total_del_s)

Total change in entropy is 1.167e+05 J/K


## Example 1.6¶

In [6]:
# Example 1.6.py
# Consider the flow through a rocket engine nozzle. Assume that the gas flow
# through the nozzle in an isentropic expansion of a calorically perfect gas.
# In the combustion chamber, the gas which results from the combustion of the
# rocket fuel and oxidizer is at a pressure and temperature of 15 atm and
# 2500 K, respectively, the molecular weight and specific heat at constant
# pressure of the combustion gas are 12 and 4157 J/kg K, respectively. The gas
# expands to supersonic speed through the nozzle, with temperature of 1350 K at
# the nozzle exit. Calculate the pressure at the exit.

# Variable declaration
pc = 15.0          # pressure combustion chamber (atm)
Tc = 2500.0        # temperature combustion chamber (K)
mol_wt = 12.0      # molecular weight (gm)
cp = 4157.0        # specific heat at constant pressure (J/Kg/K)

Tn  = 1350.0       # temperature at nozzle exit (K)

# Calculations
R = 8314.0/mol_wt  # gas constant = R_prime/mo_wt, R_prime = 8314 J/K
cv = cp - R        # specific heat at constant volume (J/Kg/K)
gamma = cp/cv      # ratio of specific heat

pn_by_pc = pow(Tn/Tc, gamma/(gamma-1)) # ratio of pressure for isentropic process, pn/pc

pn = pc * pn_by_pc # pn = pc * pn/pc

# Result
print "Pressure at the exit is %.3f atm" %(pn)

Pressure at the exit is 0.372 atm


## Example 1.7¶

In [7]:
# Example 1.7.py
# A flat plate with a chord length of 3 ft and an infinite span(perpendicular to
# the page in fig 1.5) is immersed in a Mach 2 flow at standard sea level
# conditions at an angle of attack of 10 degrees. The pressure distribution
# over the plate is as follows: upper surface, p2=constant=1132 lb/ft^2; lower
# surface, p3=constant=3568 lb/ft^2. The local shear stress is given by tau_w =
# 13/xeta^0.2, where tau_w is in pounds per square feet and xeta is the distance
# in feet along the plate from the leading edge. Assume the distribution of
# tau_w over the top and bottom surfaces is the same. Both the pressure and
# shear disributions are sketched qualitatively in fig. 1.5. Calculate the lift
# and drag per unit span on the plate.

from numpy import sin, cos, pi # importing sin, cos and pi

# Variable declaration
M1 = 2.0        # mach number freestream
p1 = 2116.0     # pressure at sea level (in lb/ft^2)
l = 3.0         # chord of plate (in ft)
alpha = 10.0    # angle of attack in degrees

p2 = 1132.0     # pressure on the upper surface (in lb/ft^2)
p3 = 3568.0     # pressure on the lower surface (in lb/ft^2)

# Calculations

# assuming unit span

pds = -p2*l + p3*l   # integral p.ds from leading edge to trailing edge (in lb/ft)

L = pds*cos(alpha*pi/180.0) # lift per unit span (in lb/ft), alpha is converted to radians

Dw = pds*sin(alpha*pi/180.0) # pressure drag per unit span (in lb/ft), alpha is converted to radians

Df = 16.25 * pow(l, 4.0/5.0) # skin friction drag per unit span (in lb/ft)
# from integral tau.d(xeta)

Df = 2 * Df * cos(alpha*pi/180.0) # since skin friction acts on both the side

D = Df + Dw                  # total drag per unit span (in lb/ft)
# Result
print "Total Lift per unit span = %.0f lb" %(L)
print "Total Drag per unit span = %.0f lb" %(D)

Total Lift per unit span = 7197 lb
Total Drag per unit span = 1346 lb