Chapter 4

[1]:
import sympy as sp
from sympy import symbols, sqrt, init_printing
from sympy_equation import Eqn, solve, table_of_expressions
from ambiance import Atmosphere
import numpy as np
import pint
import pygasflow
from pygasflow import *
from pygasflow.atd import *
init_printing()
pygasflow.defaults.solver_to_dict = True

ureg = pint.UnitRegistry()
# use "~P" to format units with unicode
ureg.formatter.default_format = "~"
pygasflow.defaults.pint_ureg = ureg
K = ureg.K
m = ureg.m
km = ureg.km
s = ureg.s
J = ureg.J
W = ureg.W
kg = ureg.kg
deg = ureg.deg
atm = ureg.atm

P 4.1

[2]:
from scipy.optimize import bisect
[3]:
L = 0.1 * m
v = 3000 * m / s
Sr = 0.2
[4]:
t_res = L / v
t_res
[4]:
3.3333333333333335×10-5 s
[5]:
def func(t_ref):
    return Sr - Strouhal(t_res, t_ref * s)

t_ref_lim = bisect(func, a=1e-12, b=1e06)
t_ref_lim *= s
t_ref_lim
[5]:
0.0001666666658442172 s

It must be \(t_{ref} \ge 1.67 \cdot 10^{-04} s\)

P 4.2

[6]:
T = 500 * K
[7]:
mu_s = viscosity_air_southerland(T)
mu_s
[7]:
2.6705333479641985×10-5 kg/(m s)
[8]:
mu_1 = 0.702e-07 * T.magnitude * (kg / (m * s))
mu_1
[8]:
3.5100000000000006×10-5 kg/(m s)
[9]:
mu_2 = viscosity_air_power_law(T)
mu_2
[9]:
2.6376836898609894×10-5 kg/(m s)

P 4.3

[10]:
T = 500 * K
[11]:
k_han = thermal_conductivity_hansen(T)
k_han
[11]:
0.03640917875128334 W/(K m)
[12]:
k_1 = 9.572e-05 * T.magnitude * (W / (m * K))
k_1
[12]:
0.04786 W/(K m)
[13]:
k_2 = thermal_conductivity_power_law(T)
k_2
[13]:
0.036962527256091796 W/(K m)

P 4.4

Using real gas model:

[14]:
from CoolProp.CoolProp import PropsSI
T = 500 * K
p = 1 * atm
[15]:
T = T.magnitude
p = p.to("Pa").magnitude

# specific heat at constant pressure (J/kg/K)
Cp = PropsSI('Cpmass', 'T', T, 'P', p, 'Air')
# specific heat at constant volume (J/kg/K)
Cv = PropsSI('Cvmass', 'T', T, 'P', p, 'Air')
# Viscosity (Pa·s)
mu = PropsSI('V', 'T', T, 'P', p, 'Air')
# Thermal conductivity (W/m·K)
k = PropsSI('L', 'T', T, 'P', p, 'Air')
[16]:
Cp * (J/(kg*K))
[16]:
1029.8687929493178 J/(K kg)
[17]:
gamma = Cp / Cv
gamma
[17]:
$\displaystyle 1.38717948687843$
[18]:
Pr1 = Prandtl(mu, Cp, k)
Pr1
[18]:
$\displaystyle 0.698449105961065$
[19]:
Pr2 = Prandtl(gamma)
Pr2
[19]:
$\displaystyle 0.741349777428482$

If I were to use the calorically perfect gas assumption, then \(C_{p}, \, C_{v}\) are constants and would not depend on temperature. Then, the values of the Prandtl number computed with the two different methods would be essentially the same:

[20]:
res = gas_solver("r", 287.05*J/kg/K, "gamma", 1.4)
res.show()
key     quantity
-------------------------
gamma   gamma                 1.40000000
R       R [J / K / kg]      287.05000000
Cp      Cp [J / K / kg]    1004.67500000
Cv      Cv [J / K / kg]     717.62500000
[21]:
k = thermal_conductivity_hansen(T*K)
k
[21]:
0.03640917875128334 W/(K m)
[22]:
mu = viscosity_air_southerland(T*K)
mu
[22]:
2.6705333479641985×10-5 kg/(m s)
[23]:
Pr1 = Prandtl(mu, res["Cp"], k)
Pr1
[23]:
0.7369070611820272 J/(s W)
[24]:
Pr2 = Prandtl(res["gamma"])
Pr2
[24]:
$\displaystyle 0.736842105263158$
[ ]: