Skip to content
Thermofluids

thermofluids-ai999x

Fluid statics and dynamics, pipe flow, boundary layers, aerodynamics, heat conduction, convection and radiation, heat exchangers, thermodynamic cycles, psychrometrics and combustion.

99capabilities
20topics
99formulas typeset
8worked examples below
1.0.0version
About this model

What Thermofluids does

Thermofluids (thermofluids-ai999x) is an offline Python package for thermofluids. It covers fluid statics and dynamics, pipe flow, boundary layers, aerodynamics, heat conduction, convection and radiation, heat exchangers, thermodynamic cycles, psychrometrics and combustion.

It has 99 capabilities — 13 computational procedures and 86 formulas — in 20 topics, the largest being Pipe flow, Convection, Conduction, Gas processes, Heat exchangers and Psychrometrics. Ask a question in words with ask(), or call a capability by name with typed inputs with solve(). Every answer carries its value and unit, the steps that produced it and the formula in LaTeX.

When a question is not determined — a value is missing, an input is out of range, or the request is outside the package — it says so and names what it needs, instead of guessing. It runs on an ordinary CPU without a network connection (Python >=3.10), and the same question always gets the same answer.

Install

pip install thermofluids-ai999x
hf download AI999X/thermofluids-ai999x --local-dir thermofluids-ai999x

What it covers

Aerodynamics1Lift coefficient of a thin symmetric airfoilBoundary layers4Average skin-friction coefficient of a laminar flat plate · Displacement thickness of a laminar flat-plate boundary layer · Local skin-friction coefficient of a laminar flat plate …Combustion3Adiabatic flame temperature with constant product specific heat · Equivalence ratio of a fuel-air mixture · Stoichiometric air-fuel ratio of a gaseous fuelCompressible flow6Isentropic stagnation pressure of air from the Mach number · Mach number · Mach number behind a normal shock in air …Conduction8Critical radius of insulation on a cylinder · Fourier's law: heat conduction through a plane wall · Heat transfer rate from the overall heat transfer coefficient …Convection10Average Nusselt number for laminar flow over a flat plate · Churchill-Bernstein correlation for a cylinder in cross flow · Churchill-Chu correlation for natural convection on a vertical plate …External flow4Drag force from the drag coefficient · Lift force from the lift coefficient · Stokes drag on a small sphere …Fins2Efficiency of a pin fin with an insulated tip · Heat transfer rate of a very long finFluid dynamics4Bernoulli's equation along a horizontal streamline · Continuity: speed after a change of pipe diameter · Dynamic pressure of a moving fluid …Fluid statics4Absolute pressure at a depth in a liquid · Buoyant force (Archimedes' principle) · Gauge pressure at a depth in a liquid …Gas processes7Actual outlet temperature of an adiabatic air compressor · Entropy change of an incompressible substance · Ideal gas law …Heat exchangers7Effectiveness of a heat exchanger with one stream changing phase · Effectiveness of a parallel-flow heat exchanger · Heat added to a flowing stream (steady-flow energy balance) …Natural convection2Grashof number · Rayleigh numberOpen channel1Froude number of an open-channel flowPipe flow12Blasius friction factor for turbulent flow in a smooth pipe · Darcy friction factor from the Colebrook equation · Darcy friction factor in laminar pipe flow …Psychrometrics7Dew-point temperature from dry-bulb temperature and relative humidity · Humidity ratio from temperature, relative humidity and pressure · Humidity ratio from the partial pressure of water vapour …Pumps2Hydraulic power delivered to a fluid · Shaft power required by a pumpRadiation5Emissive power of a blackbody (Stefan-Boltzmann law) · Linearised radiation heat transfer coefficient · Net radiation between two large parallel grey plates …Thermodynamic cycles6Carnot efficiency of a reversible heat engine · Coefficient of performance of a Carnot heat pump · Coefficient of performance of a Carnot refrigerator …Transient conduction4Biot number · Fourier number · Temperature of a lumped body cooling or heating in a fluid …
Try it

Worked examples

Each question below was put to thermofluids-ai999x and the answer shown is the one it returned, with the steps it took.

Pipe flowm.ask(…)

Water with density 998 kg/m^3 and dynamic viscosity 0.001 Pa*s flows at an average velocity of 1.5 m/s in a pipe of diameter 0.05 m. What is the Reynolds number?

Re = 74850 1
Show the steps
  1. Reynolds number from density, velocity, diameter and viscosity
    \mathrm{Re} = \frac{\rho v D}{\mu}
    with rho = 998 kg/m^3, v = 1.5 m/s, D = 0.05 m, mu = 0.001 Pa*s
    → Re = 74850 1
Pipe flowm.ask(…)

Oil of density 900 kg/m^3 and viscosity 0.1 Pa*s flows in laminar flow at a mean velocity of 0.5 m/s in a pipe of diameter 0.02 m. What is the friction factor?

f = 0.7111111111 1
Show the steps
  1. Reynolds number from density, velocity, diameter and viscosity
    \mathrm{Re} = \frac{\rho v D}{\mu}
    with rho = 900 kg/m^3, v = 0.5 m/s, D = 0.02 m, mu = 0.1 Pa*s
    → Re = 90 1
  2. Darcy friction factor in laminar pipe flow
    f = \frac{64}{\mathrm{Re}}
    with Re = 90 1
    → f = 0.7111111111 1
Thermodynamic cyclesm.ask(…)

An air-standard Otto cycle has a compression ratio of 8. What is its thermal efficiency?

eta = 0.5647247184 1
Show the steps
  1. Thermal efficiency of the air-standard Otto cycle
    \eta = 1 - r^{\frac{-2}{5}}
    with r = 8 1
    → eta = 0.5647247184 1
Psychrometricsm.ask(…)

Dew point temperature: T = 25 °C, RH = 60%

T_dew = 289.8511319 K
p_v = 1901.529882 Pa
Show the steps
  1. Dew-point temperature from dry-bulb temperature and relative humidity
    p_{ws}(T_{dp}) = \phi\,p_{ws}(T)
    with T = 25 °C, RH = 0.6
    → T_dew = 289.8511319 K, p_v = 1901.529882 Pa
Heat exchangersm.solve(…)
m.solve("lmtd", Th_in="150 °C", Th_out="90 °C", Tc_in="30 °C", Tc_out="70 °C", arrangement="counterflow")
lmtd = 69.52118994 K
dT1 = 80 K
dT2 = 60 K
Show the steps
  1. Log-mean temperature difference of a heat exchanger
    \Delta T_{lm} = \frac{\Delta T_1 - \Delta T_2}{\ln(\Delta T_1/\Delta T_2)}
    with Th_in = 150 °C, Th_out = 90 °C, Tc_in = 30 °C, Tc_out = 70 °C, arrangement = counterflow
    → lmtd = 69.52118994 K, dT1 = 80 K, dT2 = 60 K
Aerodynamicsm.ask(…)

Using thin airfoil theory, what is the lift coefficient of a symmetric airfoil at an angle of attack of 5 deg?

CL = 0.5483113556 1
Show the steps
  1. Lift coefficient of a thin symmetric airfoil
    C_{L} = 2 \pi \alpha
    with alpha = 0.0872664626 rad
    → CL = 0.5483113556 1
Boundary layersm.ask(…)

Air flows over a flat plate with a laminar boundary layer and a Reynolds number of 250000 at the trailing edge. What is the average skin friction coefficient?

cfm = 0.00265645869 1
Show the steps
  1. Average skin-friction coefficient of a laminar flat plate
    \text{cfm} = \frac{1.3282293448607851}{\sqrt{\text{ReL}}}
    with ReL = 250000 1
    → cfm = 0.00265645869 1
Combustionm.ask(…)

Methane with a lower heating value of 50000000 J/kg burns at an air-fuel ratio of 17.2 with a reactant temperature of 298 K. Taking the specific heat of the products as 1200 J/(kg*K), what is the adiabatic flame temperature?

Tad = 2587.377289 K
Show the steps
  1. Adiabatic flame temperature with constant product specific heat
    \text{Tad} = T_{0} + \frac{\text{LHV}}{\left(1 + \text{AFR}\right) c_{p}}
    with T0 = 298 K, LHV = 50000000 J/kg, AFR = 17.2 1, cp = 1200 J/(kg*K)
    → Tad = 2587.377289 K
Use it

From Python or the command line

Every snippet was run as shown; the output under it is what it printed.

import thermofluids_ai999x as m

a = m.ask("Water with density 998 kg/m^3 and dynamic viscosity 0.001 Pa*s flows at an average velocity of 1.5 m/s in a pipe of diameter 0.05 m. What is the Reynolds number?")
print(a.outcome)
print(a.value, a.unit)
for step in a.steps:
    print(step["name"])
Output
SOLVED
74850.0 1
Reynolds number from density, velocity, diameter and viscosity
Figures

Computed, not drawn by hand

Every value in these figures was computed by the package, each point a run of solve(); in a notebook, plot() and plot_relation() draw a capability's curves the same way.

Friction factor chart (Colebrook, turbulent flow)

\frac{1}{\sqrt{f}} = -2\log_{10}\left(\frac{\varepsilon/D}{3.7} + \frac{2.51}{Re\sqrt{f}}\right)
Friction factor chart (Colebrook, turbulent flow)Darcy friction factor of turbulent pipe flow against Reynolds number (logarithmic axis) for five relative roughnesses from smooth to ε/D = 0.05, each from the Colebrook equation solved by the package at up to 89 Reynolds numbers between 4000 and 10⁸. Marked: Re = 100000, ε/D = 0.0002, f = 0.0190054.100001.00e51.00e61.00e71.00e80.020.040.060.08f = 0.0190054ε/D = 0ε/D = 0.0001ε/D = 0.001ε/D = 0.01ε/D = 0.05Re — Reynolds numberf — Darcy friction factor
Darcy friction factor of turbulent pipe flow against Reynolds number (logarithmic axis) for five relative roughnesses from smooth to ε/D = 0.05, each from the Colebrook equation solved by the package at up to 89 Reynolds numbers between 4000 and 10⁸. Marked: Re = 100000, ε/D = 0.0002, f = 0.0190054.

Psychrometric chart: humidity ratio against temperature

W = 0.621945\,\frac{\phi p_{ws}}{P - \phi p_{ws}}
Psychrometric chart: humidity ratio against temperaturePsychrometric chart at 101325 Pa: humidity ratio against dry-bulb temperature at 20, 40, 60, 80 and 100 % relative humidity, computed by the package every 1 °C. Air at 30 °C and 40 % has a wet-bulb temperature of 20.0643 °C; marked: T = 30 °C, W = 10.6028 g/kg.02040020406020 %40 %60 %80 %100 %W = 10.6028 g/kg20–80 % relative humiditysaturation (100 %)toward the wet-bulb pointT — dry-bulb temperature [°C]W — humidity ratio [g/kg dry air]
Psychrometric chart at 101325 Pa: humidity ratio against dry-bulb temperature at 20, 40, 60, 80 and 100 % relative humidity, computed by the package every 1 °C. Air at 30 °C and 40 % has a wet-bulb temperature of 20.0643 °C; marked: T = 30 °C, W = 10.6028 g/kg.

Heat-exchanger effectiveness against NTU

Q = \varepsilon(NTU, C_r)\,C_{min}(T_{h,i} - T_{c,i})
Heat-exchanger effectiveness against NTUHeat-exchanger effectiveness against the number of transfer units for counterflow and parallel flow with heat-capacity rates 2000 and 4000 W/K (ratio 0.5), computed by the package at 60 values of UA. Marked: counterflow, UA = 3000 W/K, NTU = 1.5, ε = 0.690785, Q = 165788 W.02400.250.50.751ε = 0.690785counterflowparallelNTU = UA / C_minε — effectiveness
Heat-exchanger effectiveness against the number of transfer units for counterflow and parallel flow with heat-capacity rates 2000 and 4000 W/K (ratio 0.5), computed by the package at 60 values of UA. Marked: counterflow, UA = 3000 W/K, NTU = 1.5, ε = 0.690785, Q = 165788 W.

Otto cycle on a pressure–volume diagram

\eta = 1 - r^{\frac{-2}{5}}
Otto cycle on a pressure–volume diagramAn air-standard Otto cycle drawn on pressure–volume axes: compression ratio 8, intake 1 bar and 300 K in 0.5 L, peak temperature 1800 K (stated). Each point is a solve of the package's isentropic and ideal-gas relations (amount of air 0.0200454 mol): T2 = 689.219 K, T4 = 783.496 K; the enclosed area is the net work. The package's Otto efficiency for r = 8 is 0.564725; marked: state 3, P = 48 bar.0.10.20.30.40.502040123448 barnet work per cycle (η = 0.564725)1→2 isentropic compression3→4 isentropic expansionheat in / out at constant volumeV — cylinder volume [L]P — pressure [bar]
An air-standard Otto cycle drawn on pressure–volume axes: compression ratio 8, intake 1 bar and 300 K in 0.5 L, peak temperature 1800 K (stated). Each point is a solve of the package's isentropic and ideal-gas relations (amount of air 0.0200454 mol): T2 = 689.219 K, T4 = 783.496 K; the enclosed area is the net work. The package's Otto efficiency for r = 8 is 0.564725; marked: state 3, P = 48 bar.

Wet-bulb temperature table

W = \frac{(2501 - 2.326\,t^*)W_s^* - 1.006(t - t^*)}{2501 + 1.86\,t - 4.186\,t^*}
Wet-bulb temperatureWet-bulb temperature at 101325 Pa for dry-bulb temperatures 10, 15, 20, 25, 30, 35, 40 °C (rows) and relative humidities 20, 40, 60, 80 and 100 % (columns), each cell computed by the package (°C, one decimal). At 100 % the wet bulb equals the dry bulb; at 40 °C and 20 % it is 22 °C.2.54.66.58.31068.510.813159.312.415.117.72012.516.219.522.42515.720.123.827.13018.923.928.231.8352227.832.636.640wet bulb °C · rows dry bulb 10 → 40 °C · columns RH 20 → 100 %
Wet-bulb temperature at 101325 Pa for dry-bulb temperatures 10, 15, 20, 25, 30, 35, 40 °C (rows) and relative humidities 20, 40, 60, 80 and 100 % (columns), each cell computed by the package (°C, one decimal). At 100 % the wet bulb equals the dry bulb; at 40 °C and 20 % it is 22 °C.
Formulas

The mathematics inside

12 of its 99 formulas; every one is in the capability browser below.

Log-mean temperature difference of a heat exchanger
\Delta T_{lm} = \frac{\Delta T_1 - \Delta T_2}{\ln(\Delta T_1/\Delta T_2)}
Average skin-friction coefficient of a laminar flat plate
\text{cfm} = \frac{1.3282293448607851}{\sqrt{\text{ReL}}}
Adiabatic flame temperature with constant product specific heat
\text{Tad} = T_{0} + \frac{\text{LHV}}{\left(1 + \text{AFR}\right) c_{p}}
Displacement thickness of a laminar flat-plate boundary layer
d_{s} = \frac{1.7207876575205 x}{\sqrt{\text{Rex}}}
Isentropic stagnation pressure of air from the Mach number
P_{0} = P \left(1 + \frac{M^{2}}{5}\right)^{\frac{7}{2}}
Average Nusselt number for laminar flow over a flat plate
\mathrm{Nu} = 0.664 \text{ReL}^{\frac{1}{2}} \mathrm{Pr}^{\frac{1}{3}}
Capabilities

Every capability, with an example

Search by name, formula, input or topic. Each capability opens to show what it takes, what it returns, when it applies, and a question it answered.

99 capabilities

Aerodynamics 1

Lift coefficient of a thin symmetric airfoilthin_airfoil_lift_coefficient
C_{L} = 2 \pi \alpha

Inputs

  • alpha angle of attack [rad]

Returns

  • CL section lift coefficient

Applies when

  • thin symmetric airfoil
  • small angle of attack
  • inviscid incompressible flow
  • small angles of attack below stall

Example

m.ask("Using thin airfoil theory, what is the lift coefficient of a symmetric airfoil at an angle of attack of 5 deg?")
→ lift coefficient = 0.548311 1

Boundary layers 4

Average skin-friction coefficient of a laminar flat plateblasius_average_skin_friction
\text{cfm} = \frac{1.3282293448607851}{\sqrt{\text{ReL}}}

Inputs

  • ReL Reynolds number based on the plate length

Returns

  • cfm average skin-friction coefficient over the plate

Applies when

  • laminar boundary layer over the whole plate
  • zero pressure gradient
  • Re_L below about 500000

Example

m.ask("Air flows over a flat plate with a laminar boundary layer and a Reynolds number of 250000 at the trailing edge. What is the average skin friction coefficient?")
→ average skin friction coefficient = 0.00265646 1
Displacement thickness of a laminar flat-plate boundary layerblasius_displacement_thickness
d_{s} = \frac{1.7207876575205 x}{\sqrt{\text{Rex}}}

Inputs

  • x distance from the leading edge [m]
  • Rex local Reynolds number U x / nu

Returns

  • ds displacement thickness [m]

Applies when

  • steady laminar flow over a flat plate
  • zero pressure gradient
  • Re_x below about 500000

Example

m.ask("Air flows over a flat plate with a laminar boundary layer. At a distance from the leading edge of 0.5 m the local Reynolds number is 200000. What is the displacement thickness?")
→ displacement thickness = 0.0019239 m
Local skin-friction coefficient of a laminar flat plateblasius_local_skin_friction
c_{f} = \frac{0.6641146724303926}{\sqrt{\text{Rex}}}

Inputs

  • Rex local Reynolds number U x / nu

Returns

  • cf local skin-friction coefficient

Applies when

  • steady laminar flow over a flat plate
  • zero pressure gradient
  • Re_x below about 500000

Example

m.ask("For laminar flow over a flat plate, what is the local skin friction coefficient where the local Reynolds number is 100000?")
→ local skin friction coefficient = 0.00210011 1
Momentum thickness of a laminar flat-plate boundary layerblasius_momentum_thickness
t_{h} = \frac{0.6641146724303926 x}{\sqrt{\text{Rex}}}

Inputs

  • x distance from the leading edge [m]
  • Rex local Reynolds number U x / nu

Returns

  • th momentum thickness [m]

Applies when

  • steady laminar flow over a flat plate
  • zero pressure gradient
  • Re_x below about 500000

Example

m.ask("A laminar boundary layer grows on a flat plate. At a distance from the leading edge of 0.5 m the local Reynolds number is 200000. What is the momentum thickness?")
→ momentum thickness = 0.000742503 m

Combustion 3

Adiabatic flame temperature with constant product specific heatadiabatic_flame_temperature_simple
\text{Tad} = T_{0} + \frac{\text{LHV}}{\left(1 + \text{AFR}\right) c_{p}}

Inputs

  • T0 temperature of the reactants [K]
  • LHV lower heating value of the fuel [J/kg]
  • AFR air-fuel ratio by mass
  • cp mean specific heat of the products [J/(kg*K)]

Returns

  • Tad adiabatic flame temperature [K]

Applies when

  • complete combustion
  • no dissociation
  • adiabatic, constant-pressure burning
  • constant mean cp of the products
  • first estimates of flame temperature for lean or stoichiometric mixtures

Example

m.ask("Methane with a lower heating value of 50000000 J/kg burns at an air-fuel ratio of 17.2 with a reactant temperature of 298 K. Taking the specific heat of the products as 1200 J/(kg*K), what is the adiabatic flame temperature?")
→ adiabatic flame temperature = 2587.38 K
Equivalence ratio of a fuel-air mixtureequivalence_ratio

Equivalence ratio and excess air of a gaseous fuel burned at a given air-fuel ratio by mass.

\phi = \frac{AFR_s}{AFR}

Inputs

  • fuel the fuel choice
  • afr actual air-fuel ratio by mass

Returns

  • phi equivalence ratio (fuel-air ratio over stoichiometric)
  • afr_stoich stoichiometric air-fuel ratio
  • excess_air excess air as a fraction

Applies when

  • afr > 0

Example

m.ask("Equivalence ratio of methane: afr = 20")
→ phi = 0.856016, afr_stoich = 17.1203 1, excess_air = 0.168203
Stoichiometric air-fuel ratio of a gaseous fuelstoichiometric_air_fuel_ratio

Mass of air per mass of fuel for complete combustion, with the moles of O2 and air per mole of fuel.

AFR_s = \frac{(x + y/4)(M_{O_2} + 3.76 M_{N_2})}{x M_C + y M_H}

Inputs

  • fuel the fuel choice

Returns

  • afr_stoich stoichiometric air-fuel ratio (mass)
  • o2_moles moles of O2 per mole of fuel
  • air_moles moles of air per mole of fuel

Applies when

  • complete combustion to CO2 and H2O
  • air = O2 + 3.76 N2

Example

m.ask("What is the stoichiometric air-fuel ratio of methane?")
→ afr_stoich = 17.1203 1, o2_moles = 2, air_moles = 9.52

Compressible flow 6

Isentropic stagnation pressure of air from the Mach numberstagnation_pressure_air
P_{0} = P \left(1 + \frac{M^{2}}{5}\right)^{\frac{7}{2}}

Inputs

  • P static pressure [Pa]
  • M Mach number

Returns

  • P0 stagnation pressure [Pa]

Applies when

  • air as an ideal gas with gamma = 1.4
  • isentropic deceleration
  • isentropic flow of air

Example

m.ask("Air flows isentropically at a Mach number of 1.5 with a static pressure of 50 kPa. What is the stagnation pressure?")
→ stagnation pressure = 183552 Pa
Mach numbermach_number
M = \frac{v}{a}

Inputs

  • v mean flow velocity [m/s]
  • a local speed of sound [m/s]

Returns

  • M Mach number

Applies when

  • v and a measured in the same frame and state
  • any flow or flight speed compared with the local speed of sound

Example

m.ask("An aircraft flies at 250 m/s where the speed of sound is 300 m/s. What is its Mach number?")
→ Mach number = 0.833333 1
Mach number behind a normal shock in airnormal_shock_mach_air
M_{2} = \sqrt{\frac{M_{1}^{2} + 5}{7 M_{1}^{2} - 1}}

Inputs

  • M1 Mach number ahead of the shock

Returns

  • M2 Mach number behind the shock

Applies when

  • air as an ideal gas with gamma = 1.4
  • steady normal shock
  • adiabatic
  • a stationary normal shock with supersonic upstream flow

Example

m.ask("Air with an upstream Mach number of 2 passes through a normal shock. What is the downstream Mach number?")
→ downstream Mach number = 0.57735 1
Speed of sound in an ideal gasspeed_of_sound_ideal_gas
a = \sqrt{\gamma R T}

Inputs

  • gamma ratio of specific heats
  • R specific gas constant [J/(kg*K)]
  • T absolute temperature of the gas [K]

Returns

  • a speed of sound [m/s]

Applies when

  • ideal gas
  • small-amplitude (acoustic) waves
  • gases at moderate pressure

Example

m.ask("What is the speed of sound in air at a temperature of 300 K, with a specific heat ratio of 1.4 and a specific gas constant of 287 J/(kg*K)?")
→ speed of sound = 347.189 m/s
Stagnation temperature from the Mach numberstagnation_temperature_mach
T_{0} = T \left(1 + \frac{\left(\gamma - 1\right) M^{2}}{2}\right)

Inputs

  • T static temperature [K]
  • gamma ratio of specific heats
  • M Mach number

Returns

  • T0 stagnation (total) temperature [K]

Applies when

  • ideal gas with constant specific heats
  • adiabatic deceleration
  • any adiabatic flow of an ideal gas

Example

m.ask("A gas with a specific heat ratio of 1.4 flows at a Mach number of 2 with a static temperature of 220 K. What is the stagnation temperature?")
→ stagnation temperature = 396 K
Static pressure behind a normal shock in airnormal_shock_pressure_air
P_{2} = \frac{P_{1} \left(7 M_{1}^{2} - 1\right)}{6}

Inputs

  • P1 static pressure ahead of the shock [Pa]
  • M1 Mach number ahead of the shock

Returns

  • P2 static pressure behind the shock [Pa]

Applies when

  • air as an ideal gas with gamma = 1.4
  • steady normal shock
  • adiabatic
  • a stationary normal shock with supersonic upstream flow

Example

m.ask("Air with an upstream pressure of 100 kPa and an upstream Mach number of 2 passes through a normal shock. What is the downstream pressure?")
→ downstream pressure = 450000 Pa

Conduction 8

Critical radius of insulation on a cylindercritical_insulation_radius
r = \frac{k}{h}

Inputs

  • k thermal conductivity [W/(m*K)]
  • h outside heat transfer coefficient [W/(m^2*K)]

Returns

  • r critical outer radius of the insulation [m]

Applies when

  • cylindrical insulation
  • constant outside heat transfer coefficient
  • no radiation
  • deciding whether insulating a small pipe or wire increases heat loss

Example

m.ask("Insulation with a thermal conductivity of 0.05 W/(m*K) covers a pipe, and the outside heat transfer coefficient is 10 W/(m^2*K). What is the critical radius of insulation?")
→ critical radius of insulation = 0.005 m
Fourier's law: heat conduction through a plane wallplane_wall_conduction
q = \frac{k A \left(T_{1} - T_{2}\right)}{L}

Inputs

  • k thermal conductivity [W/(m*K)]
  • A wall area [m^2]
  • T1 inner surface temperature [K]
  • T2 outer surface temperature [K]
  • L wall thickness [m]

Returns

  • q rate of heat transfer [W]

Applies when

  • steady one-dimensional conduction
  • constant thermal conductivity
  • no heat generation
  • a flat wall, slab or window with known surface temperatures

Example

m.ask("A brick wall 0.2 m thick has an area of 10 m^2 and a thermal conductivity of 0.7 W/(m*K). The inner surface temperature is 20 °C and the outer surface temperature is 5 °C. What is the rate of heat transfer through the wall?")
→ rate of heat transfer = 525 W
Heat transfer rate from the overall heat transfer coefficientoverall_heat_rate
q = U A \left(T_{i} - T_{o}\right)

Inputs

  • U overall heat transfer coefficient [W/(m^2*K)]
  • A wall area [m^2]
  • Ti inside fluid temperature [K]
  • To outside fluid temperature [K]

Returns

  • q rate of heat transfer [W]

Applies when

  • steady heat flow
  • U based on the stated area
  • building envelopes and walls between two fluids

Example

m.ask("A wall of area 20 m^2 has an overall heat transfer coefficient of 0.5 W/(m^2*K). The inside air temperature is 21 °C and the outside air temperature is -5 °C. What is the heat loss through the wall?")
→ heat loss = 260 W
Maximum temperature of a plane wall with uniform heat generationwall_generation_max_temperature
T_{\text{max}} = T_{s} + \frac{q L^{2}}{2 k}

Inputs

  • Ts surface temperature [K]
  • q heat generated per unit volume [W/m^3]
  • L half-thickness of the wall [m]
  • k thermal conductivity [W/(m*K)]

Returns

  • Tmax temperature at the mid-plane [K]

Applies when

  • steady one-dimensional conduction
  • both faces at the same temperature
  • uniform generation
  • electrically heated slabs and fuel plates

Example

m.ask("A plane wall with a half-thickness of 0.01 m and a thermal conductivity of 20 W/(m*K) has a uniform heat generation of 1000000 W/m^3. Both surfaces are held at a surface temperature of 350 K. What is the maximum temperature in the wall?")
→ maximum temperature = 352.5 K
Overall heat transfer coefficient of a plane wall with convection on both sidesoverall_u_plane_wall
U = \frac{1}{\frac{1}{h_{1}} + \frac{L}{k} + \frac{1}{h_{2}}}

Inputs

  • h1 inside heat transfer coefficient [W/(m^2*K)]
  • L wall thickness [m]
  • k thermal conductivity [W/(m*K)]
  • h2 outside heat transfer coefficient [W/(m^2*K)]

Returns

  • U overall heat transfer coefficient [W/(m^2*K)]

Applies when

  • steady one-dimensional heat flow
  • a single plane layer
  • no radiation
  • walls and windows between two fluids

Example

m.ask("A brick wall 0.2 m thick has a thermal conductivity of 0.7 W/(m*K). The inside heat transfer coefficient is 10 W/(m^2*K) and the outside heat transfer coefficient is 25 W/(m^2*K). What is the overall heat transfer coefficient?")
→ overall heat transfer coefficient = 2.34899 W/(m^2*K)
Radial heat conduction through a cylindrical wallcylinder_conduction
q = \frac{2 \pi k L \left(T_{1} - T_{2}\right)}{\ln\left(\frac{r_{2}}{r_{1}}\right)}

Inputs

  • k thermal conductivity [W/(m*K)]
  • L length of the cylinder [m]
  • T1 inner surface temperature [K]
  • T2 outer surface temperature [K]
  • r1 inner radius [m]
  • r2 outer radius [m]

Returns

  • q rate of heat transfer [W]

Applies when

  • steady radial conduction
  • constant thermal conductivity
  • no heat generation
  • pipe walls and pipe insulation

Example

m.ask("A 5 m long pipe made of steel has an inner radius of 0.05 m and an outer radius of 0.06 m, with thermal conductivity 45 W/(m*K). The inner surface temperature is 120 °C and the outer surface temperature is 119 °C. What is the rate of heat conduction through the pipe wall?")
→ rate of heat conduction = 7753.97 W
Radial heat conduction through a spherical shellsphere_conduction
q = \frac{4 \pi k \left(T_{1} - T_{2}\right)}{\frac{1}{r_{1}} - \frac{1}{r_{2}}}

Inputs

  • k thermal conductivity [W/(m*K)]
  • T1 inner surface temperature [K]
  • T2 outer surface temperature [K]
  • r1 inner radius [m]
  • r2 outer radius [m]

Returns

  • q rate of heat transfer [W]

Applies when

  • steady radial conduction
  • constant thermal conductivity
  • spherical tanks and their insulation

Example

m.ask("A spherical shell of insulation with thermal conductivity 0.04 W/(m*K) has an inner radius of 0.1 m and an outer radius of 0.15 m. The inner surface temperature is 400 K and the outer surface temperature is 300 K. What is the rate of heat conduction through the shell?")
→ rate of heat conduction = 15.0796 W
Thermal diffusivitythermal_diffusivity
\alpha = \frac{k}{\rho c_{p}}

Inputs

  • k thermal conductivity [W/(m*K)]
  • rho density of the material [kg/m^3]
  • cp specific heat capacity [J/(kg*K)]

Returns

  • alpha thermal diffusivity [m^2/s]

Applies when

  • constant properties
  • transient conduction in solids and fluids

Example

m.ask("Copper has a thermal conductivity of 400 W/(m*K), a density of 8900 kg/m^3 and a specific heat of 385 J/(kg*K). What is its thermal diffusivity?")
→ thermal diffusivity = 0.000116737 m^2/s

Convection 10

Average Nusselt number for laminar flow over a flat plateflat_plate_laminar_average_nusselt
\mathrm{Nu} = 0.664 \text{ReL}^{\frac{1}{2}} \mathrm{Pr}^{\frac{1}{3}}

Inputs

  • ReL Reynolds number based on the plate length
  • Pr Prandtl number of the fluid

Returns

  • Nu average Nusselt number over the plate

Applies when

  • laminar boundary layer over the whole plate
  • isothermal plate
  • Re_L < 500000 and 0.6 < Pr < 10

Example

m.ask("Air flows over a flat plate with a laminar boundary layer. At the end of the plate the Reynolds number is 100000 and the Prandtl number is 0.7. What is the average Nusselt number?")
→ average Nusselt number = 186.438 1
Churchill-Bernstein correlation for a cylinder in cross flowchurchill_bernstein_cylinder

Average Nusselt number of a circular cylinder in cross flow over the whole Reynolds range.

Nu = 0.3 + \frac{0.62\,Re^{1/2}Pr^{1/3}}{[1 + (0.4/Pr)^{2/3}]^{1/4}}\left[1 + \left(\frac{Re}{282000}\right)^{5/8}\right]^{4/5}

Inputs

  • Re Reynolds number based on the diameter
  • Pr Prandtl number

Returns

  • Nu average Nusselt number based on the diameter

Applies when

  • Re * Pr >= 0.2

Example

m.ask("Churchill-Bernstein correlation: Re = 10000, Pr = 0.7")
→ Nu = 53.3278 1
Churchill-Chu correlation for natural convection on a vertical platechurchill_chu_vertical_plate

Average Nusselt number of free convection from an isothermal vertical plate, laminar and turbulent.

Nu = \left(0.825 + \frac{0.387\,Ra^{1/6}}{[1 + (0.492/Pr)^{9/16}]^{8/27}}\right)^2

Inputs

  • Ra Rayleigh number based on the plate height
  • Pr Prandtl number

Returns

  • Nu average Nusselt number

Applies when

  • 0 < Ra <= 1e13

Example

m.ask("Churchill-Chu correlation: Ra = 1000000000, Pr = 0.71")
→ Nu = 122.857 1
Dittus-Boelter correlation, fluid being cooleddittus_boelter_cooling
\mathrm{Nu} = 0.023 \mathrm{Re}^{\frac{4}{5}} \mathrm{Pr}^{\frac{3}{10}}

Inputs

  • Re Reynolds number
  • Pr Prandtl number of the fluid

Returns

  • Nu Nusselt number

Applies when

  • fully developed turbulent flow in a smooth circular tube
  • properties at the bulk temperature
  • Re > 10000 and 0.6 < Pr < 160

Example

m.ask("Water is cooled in a pipe at a Reynolds number of 50000 and a Prandtl number of 5. Using the Dittus-Boelter correlation, what is the Nusselt number?")
→ Nusselt number = 214.089 1
Dittus-Boelter correlation, fluid being heateddittus_boelter_heating
\mathrm{Nu} = 0.023 \mathrm{Re}^{\frac{4}{5}} \mathrm{Pr}^{\frac{2}{5}}

Inputs

  • Re Reynolds number
  • Pr Prandtl number of the fluid

Returns

  • Nu Nusselt number

Applies when

  • fully developed turbulent flow in a smooth circular tube
  • properties at the bulk temperature
  • Re > 10000 and 0.6 < Pr < 160

Example

m.ask("Water is heated in a pipe at a Reynolds number of 50000 and a Prandtl number of 5. Using the Dittus-Boelter correlation, what is the Nusselt number?")
→ Nusselt number = 251.473 1
Gnielinski correlation for turbulent pipe flowgnielinski_nusselt

Nusselt number of fully developed turbulent or transitional flow in a tube.

Nu = \frac{(f/8)(Re - 1000)Pr}{1 + 12.7\sqrt{f/8}\,(Pr^{2/3} - 1)}

Inputs

  • Re Reynolds number (3000 to 5e6)
  • Pr Prandtl number (0.5 to 2000)
  • f Darcy friction factor

Returns

  • Nu Nusselt number based on the diameter

Applies when

  • 3000 <= Re <= 5e6
  • 0.5 <= Pr <= 2000

Example

m.ask("Gnielinski correlation: Re = 50000, Pr = 5, f = 0.021")
→ Nu = 285.589 1
Heat transfer coefficient from the Nusselt numbernusselt_heat_transfer_coefficient
h = \frac{\mathrm{Nu} k}{L_{c}}

Inputs

  • Nu average Nusselt number
  • k thermal conductivity [W/(m*K)]
  • Lc characteristic length (diameter or plate length) [m]

Returns

  • h convection heat transfer coefficient [W/(m^2*K)]

Applies when

  • Nu based on the same characteristic length
  • k of the fluid
  • turning a convection correlation's Nusselt number into h

Example

m.ask("Water with thermal conductivity 0.6 W/(m*K) flows in a tube of diameter 0.05 m, and the Nusselt number is 120. What is the heat transfer coefficient?")
→ heat transfer coefficient = 1440 W/(m^2*K)
Local Nusselt number for laminar flow over a flat plateflat_plate_laminar_local_nusselt
\text{Nux} = 0.332 \text{Rex}^{\frac{1}{2}} \mathrm{Pr}^{\frac{1}{3}}

Inputs

  • Rex local Reynolds number U x / nu
  • Pr Prandtl number of the fluid

Returns

  • Nux local Nusselt number

Applies when

  • laminar boundary layer
  • isothermal plate
  • Re_x < 500000 and 0.6 < Pr < 10

Example

m.ask("For laminar flow over a flat plate, what is the local Nusselt number where the local Reynolds number is 100000 and the Prandtl number is 0.7?")
→ local Nusselt number = 93.2189 1
Newton's law of cooling (convection heat transfer)newton_cooling
q = h A \left(T_{s} - \text{Tinf}\right)

Inputs

  • h convection heat transfer coefficient [W/(m^2*K)]
  • A surface area in contact with the fluid [m^2]
  • Ts surface temperature [K]
  • Tinf temperature of the fluid far from the surface [K]

Returns

  • q rate of heat transfer [W]

Applies when

  • uniform surface temperature
  • h averaged over the surface
  • heat exchange between a surface and a moving or still fluid

Example

m.ask("A hot plate with a surface area of 0.5 m^2 is cooled by convection with a heat transfer coefficient of 25 W/(m^2*K). The surface temperature is 80 °C and the air temperature is 20 °C. What is the rate of heat transfer?")
→ rate of heat transfer = 750 W
Prandtl numberprandtl_number
\mathrm{Pr} = \frac{c_{p} \mu}{k}

Inputs

  • cp specific heat of the fluid [J/(kg*K)]
  • mu dynamic viscosity of the fluid [Pa*s]
  • k thermal conductivity [W/(m*K)]

Returns

  • Pr Prandtl number of the fluid

Applies when

  • properties at the film temperature
  • any Newtonian fluid

Example

m.ask("Water has a specific heat of 4180 J/(kg*K), a dynamic viscosity of 0.001 Pa*s and a thermal conductivity of 0.6 W/(m*K). What is its Prandtl number?")
→ Prandtl number = 6.96667 1

External flow 4

Drag force from the drag coefficientdrag_force
F = \frac{C_{d} \rho v^{2} A}{2}

Inputs

  • Cd drag coefficient
  • rho density of the fluid [kg/m^3]
  • v mean flow velocity [m/s]
  • A frontal (reference) area [m^2]

Returns

  • F drag force [N]

Applies when

  • drag coefficient based on the stated reference area
  • incompressible flow
  • a body moving through a fluid with a known drag coefficient

Example

m.ask("A car with a drag coefficient of 0.3 and a frontal area of 2.2 m^2 travels at 30 m/s through air of density 1.2 kg/m^3. What is the drag force?")
→ drag force = 356.4 N
Lift force from the lift coefficientlift_force
F = \frac{C_{L} \rho v^{2} A}{2}

Inputs

  • CL lift coefficient
  • rho density of the fluid [kg/m^3]
  • v mean flow velocity [m/s]
  • A wing planform area [m^2]

Returns

  • F lift force [N]

Applies when

  • lift coefficient based on the planform area
  • incompressible flow
  • a wing or airfoil with a known lift coefficient

Example

m.ask("An aircraft wing with a wing area of 20 m^2 has a lift coefficient of 1.2 and moves at 70 m/s through air of density 1.1 kg/m^3. What is the lift force?")
→ lift force = 64680 N
Stokes drag on a small spherestokes_drag
F = 3 \pi \mu D v

Inputs

  • mu dynamic viscosity of the fluid [Pa*s]
  • D sphere diameter [m]
  • v mean flow velocity [m/s]

Returns

  • F drag force on the sphere [N]

Applies when

  • creeping flow (Re < 1)
  • rigid sphere far from walls
  • a small particle or droplet moving slowly through a viscous fluid

Example

m.ask("Using Stokes' law, what is the drag force on a sphere of diameter 0.0001 m moving at 0.002 m/s through water with viscosity 0.001 Pa*s?")
→ drag force = 1.88496e-09 N
Terminal settling velocity of a small sphere (Stokes)stokes_terminal_velocity
v = \frac{g D^{2} \left(\rho_{p} - \rho\right)}{18 \mu}

Inputs

  • g Acceleration [m/s^2] optional
  • D sphere diameter [m]
  • rho_p density of the particle [kg/m^3]
  • rho density of the fluid [kg/m^3]
  • mu dynamic viscosity of the fluid [Pa*s]

Returns

  • v terminal settling velocity [m/s]

Applies when

  • creeping flow (Re < 1)
  • particle denser than the fluid
  • rigid sphere
  • fine particles or droplets settling in a viscous fluid

Example

m.ask("A sand grain of diameter 0.0001 m and particle density 2650 kg/m^3 settles in water of density 1000 kg/m^3 and viscosity 0.001 Pa*s. Assuming Stokes flow, what is its terminal velocity?")
→ terminal velocity = 0.00898943 m/s

Fins 2

Efficiency of a pin fin with an insulated tippin_fin_efficiency

Fin efficiency tanh(mL)/(mL) of a cylindrical pin fin with m = sqrt(4h/(kD)).

\eta_f = \frac{\tanh(mL)}{mL},\quad m = \sqrt{\frac{4h}{kD}}

Inputs

  • h heat transfer coefficient [W/(m^2*K)]
  • k fin thermal conductivity [W/(m*K)]
  • D pin diameter [m]
  • L fin length [m]

Returns

  • efficiency fin efficiency
  • mL fin parameter m L

Applies when

  • h, k, D, L > 0
  • one-dimensional conduction, uniform h, insulated tip

Example

m.ask("Pin fin efficiency: h = 50 W/(m^2*K), k = 200 W/(m*K), D = 5 mm, L = 50 mm")
→ efficiency = 0.861057, mL = 0.707107
Heat transfer rate of a very long fininfinite_fin_heat_rate
q = \sqrt{h P k A_{c}} \left(T_{b} - \text{Tinf}\right)

Inputs

  • h convection heat transfer coefficient [W/(m^2*K)]
  • P perimeter of the fin's cross section [m]
  • k thermal conductivity [W/(m*K)]
  • Ac cross-sectional area of the fin [m^2]
  • Tb temperature at the fin base [K]
  • Tinf temperature of the fluid far from the surface [K]

Returns

  • q rate of heat transfer [W]

Applies when

  • one-dimensional conduction along the fin
  • uniform h
  • constant cross section
  • very long fin
  • m L above about 2.65

Example

m.ask("A very long aluminium pin fin has a perimeter of 0.0314 m, a cross-sectional area of 0.0000785 m^2 and a thermal conductivity of 200 W/(m*K). Its base temperature is 100 °C, the air temperature is 25 °C and the heat transfer coefficient is 25 W/(m^2*K). What is the rate of heat transfer from the fin?")
→ rate of heat transfer = 8.32618 W

Fluid dynamics 4

Bernoulli's equation along a horizontal streamlinebernoulli_horizontal
P_{2} = P_{1} + \frac{\rho \left(v_{1}^{2} - v_{2}^{2}\right)}{2}

Inputs

  • P1 pressure at the inlet [Pa]
  • rho density of the fluid [kg/m^3]
  • v1 speed at the inlet [m/s]
  • v2 speed at the outlet [m/s]

Returns

  • P2 pressure at the outlet [Pa]

Applies when

  • steady, incompressible, inviscid flow along a streamline
  • no height change
  • frictionless flow between two points at the same height

Example

m.ask("Water of density 1000 kg/m^3 flows without losses through a horizontal pipe. The inlet pressure is 200 kPa and the inlet velocity is 2 m/s. The outlet velocity is 6 m/s. What is the outlet pressure?")
→ outlet pressure = 184000 Pa
Continuity: speed after a change of pipe diametercontinuity_speed
v_{2} = v_{1} \left(\frac{D_{1}}{D_{2}}\right)^{2}

Inputs

  • v1 mean velocity at the inlet [m/s]
  • D1 diameter at the inlet [m]
  • D2 diameter at the outlet [m]

Returns

  • v2 mean velocity at the outlet [m/s]

Applies when

  • incompressible steady flow
  • circular cross sections
  • uniform velocity over each section
  • liquid flowing through a reducer, nozzle or expansion

Example

m.ask("Water enters a reducer with an inlet diameter of 0.1 m at an inlet velocity of 2 m/s. The outlet diameter is 0.05 m. What is the outlet velocity?")
→ outlet velocity = 8 m/s
Dynamic pressure of a moving fluiddynamic_pressure
q = \frac{\rho v^{2}}{2}

Inputs

  • rho density of the fluid [kg/m^3]
  • v mean flow velocity [m/s]

Returns

  • q dynamic pressure [Pa]

Applies when

  • incompressible flow (low Mach number)
  • a pitot-static measurement or the kinetic pressure of a stream

Example

m.ask("What is the dynamic pressure of air with density 1.225 kg/m^3 moving at 40 m/s?")
→ dynamic pressure = 980 Pa
Speed of efflux from a hole (Torricelli's law)torricelli_efflux
v = \sqrt{2 g h}

Inputs

  • g Acceleration [m/s^2] optional
  • h depth of the hole below the free surface [m]

Returns

  • v speed of the jet leaving the hole [m/s]

Applies when

  • large tank (surface speed negligible)
  • no losses at the hole
  • open to the atmosphere
  • liquid draining from a small hole in a large open tank

Example

m.ask("Water leaves a small hole in the side of a tank 2 m below the surface of the water. What is the speed of efflux?")
→ speed of efflux = 6.26311 m/s

Fluid statics 4

Absolute pressure at a depth in a liquidabsolute_pressure_depth
P = P_{0} + \rho g h

Inputs

  • P0 pressure at the free surface [Pa]
  • rho density of the fluid [kg/m^3]
  • g Acceleration [m/s^2] optional
  • h depth below the free surface [m]

Returns

  • P absolute pressure at the depth [Pa]

Applies when

  • incompressible liquid at rest
  • uniform gravity
  • a point at a depth below a free surface with a known surface pressure

Example

m.ask("A diver is at a depth of 20 m in seawater of density 1025 kg/m^3. The atmospheric pressure is 101325 Pa. What is the absolute pressure on the diver?")
→ absolute pressure = 302361 Pa
Buoyant force (Archimedes' principle)buoyant_force
F = \rho g V

Inputs

  • rho density of the fluid [kg/m^3]
  • g Acceleration [m/s^2] optional
  • V volume of fluid displaced [m^3]

Returns

  • F buoyant force [N]

Applies when

  • fluid at rest
  • uniform gravity
  • uniform fluid density
  • a body wholly or partly immersed in a fluid at rest

Example

m.ask("A solid block with a submerged volume of 0.02 m^3 is fully immersed in water of density 1000 kg/m^3. What is the buoyant force on it?")
→ buoyant force = 196.133 N
Gauge pressure at a depth in a liquidhydrostatic_gauge_pressure
P = \rho g h

Inputs

  • rho density of the fluid [kg/m^3]
  • g Acceleration [m/s^2] optional
  • h depth below the free surface [m]

Returns

  • P gauge pressure at the depth [Pa]

Applies when

  • incompressible liquid at rest
  • uniform gravity
  • a point at a depth below the free surface of a liquid at rest

Example

m.ask("What is the gauge pressure at a depth of 12 m in a lake of water with density 1000 kg/m^3?")
→ gauge pressure = 117680 Pa
Hydrostatic force on a submerged plane surfacehydrostatic_force_plane
F = \rho g h_{c} A

Inputs

  • rho density of the fluid [kg/m^3]
  • g Acceleration [m/s^2] optional
  • hc depth of the surface's centroid [m]
  • A area of the surface [m^2]

Returns

  • F resultant hydrostatic force on the surface [N]

Applies when

  • liquid at rest
  • gauge pressure (atmosphere acts on both sides)
  • a plane gate, wall or plate wholly submerged in a liquid

Example

m.ask("A vertical rectangular gate of area 2 m^2 is submerged in water of density 1000 kg/m^3 with the depth of the centroid at 3 m. What is the hydrostatic force on the gate?")
→ hydrostatic force = 58839.9 N

Gas processes 7

Actual outlet temperature of an adiabatic air compressorcompressor_outlet_temperature_air
T_{2} = T_{1} \left(1 + \frac{\left(\frac{P_{2}}{P_{1}}\right)^{\frac{2}{7}} - 1}{\eta}\right)

Inputs

  • T1 initial temperature [K]
  • P2 final pressure [Pa]
  • P1 initial pressure [Pa]
  • eta isentropic efficiency of the compressor

Returns

  • T2 final temperature [K]

Applies when

  • air as an ideal gas with gamma = 1.4
  • adiabatic compressor
  • real compressors with a known isentropic efficiency

Example

m.ask("An adiabatic compressor takes in air at an initial temperature of 300 K and an initial pressure of 100 kPa and delivers it at a final pressure of 600 kPa. Its isentropic efficiency is 0.85. What is the final temperature?")
→ final temperature = 535.945 K
Entropy change of an incompressible substanceentropy_change_incompressible
d_{S} = m c \ln\left(\frac{T_{2}}{T_{1}}\right)

Inputs

  • m mass [kg]
  • c specific heat [J/(kg*K)]
  • T2 final temperature [K]
  • T1 initial temperature [K]

Returns

  • dS total entropy change [J/K]

Applies when

  • incompressible substance with constant specific heat
  • liquids and solids heated or cooled

Example

m.ask("A mass of 2 kg of liquid water with specific heat 4180 J/(kg*K) is heated from an initial temperature of 20 °C to a final temperature of 80 °C. What is its entropy change?")
→ entropy change = 1556.7 J/K
Ideal gas lawideal_gas_law
P V = n R T

Inputs

  • P absolute pressure of the gas [Pa]
  • V volume of the gas [m^3]
  • n amount of gas [mol]
  • R Gas constant [J/(mol*K)] optional
  • T absolute temperature [K]

Applies when

  • ideal gas
  • absolute pressure and temperature
  • gases at moderate pressure

Example

m.ask("An ideal gas of 2 mol is held in a volume of 0.05 m^3 at a temperature of 300 K. What is its pressure?")
→ pressure = 99773.6 Pa
Specific entropy change of an ideal gasentropy_change_ideal_gas
d_{s} = c_{p} \ln\left(\frac{T_{2}}{T_{1}}\right) - R \ln\left(\frac{P_{2}}{P_{1}}\right)

Inputs

  • cp specific heat at constant pressure [J/(kg*K)]
  • R specific gas constant [J/(kg*K)]
  • T1 initial temperature [K]
  • T2 final temperature [K]
  • P1 initial pressure [Pa]
  • P2 final pressure [Pa]

Returns

  • ds change in specific entropy [J/(kg*K)]

Applies when

  • ideal gas with constant specific heats
  • any process between two equilibrium states

Example

m.ask("An ideal gas with a specific heat at constant pressure of 1005 J/(kg*K) and a gas constant of 287 J/(kg*K) goes from an initial temperature of 300 K and an initial pressure of 100 kPa to a final temperature of 600 K and a final pressure of 500 kPa. What is the specific entropy change?")
→ specific entropy change = 234.704 J/(kg*K)
Temperature after an isentropic pressure change of airisentropic_temperature_pressure_air
T_{2} = T_{1} \left(\frac{P_{2}}{P_{1}}\right)^{\frac{2}{7}}

Inputs

  • T1 initial temperature [K]
  • P2 final pressure [Pa]
  • P1 initial pressure [Pa]

Returns

  • T2 final temperature [K]

Applies when

  • air as an ideal gas with gamma = 1.4
  • reversible adiabatic process
  • ideal compressors, turbines and nozzles with air

Example

m.ask("Air at an initial temperature of 300 K and an initial pressure of 100 kPa is compressed isentropically to a final pressure of 800 kPa. What is the final temperature?")
→ final temperature = 543.434 K
Temperature after an isentropic volume change of airisentropic_temperature_volume_air
T_{2} = T_{1} \left(\frac{V_{1}}{V_{2}}\right)^{\frac{2}{5}}

Inputs

  • T1 initial temperature [K]
  • V1 initial volume [m^3]
  • V2 final volume [m^3]

Returns

  • T2 final temperature [K]

Applies when

  • air as an ideal gas with gamma = 1.4
  • reversible adiabatic process
  • ideal piston-cylinder compression or expansion of air

Example

m.ask("Air at an initial temperature of 300 K is compressed isentropically from an initial volume of 0.001 m^3 to a final volume of 0.000125 m^3. What is the final temperature?")
→ final temperature = 689.219 K
Work done by an ideal gas in a reversible isothermal processisothermal_work_ideal_gas
W = n R T \ln\left(\frac{V_{2}}{V_{1}}\right)

Inputs

  • n amount of gas [mol]
  • R Gas constant [J/(mol*K)] optional
  • T constant absolute temperature [K]
  • V2 final volume [m^3]
  • V1 initial volume [m^3]

Returns

  • W work done by the gas [J]

Applies when

  • ideal gas
  • reversible (quasi-static) process
  • slow expansion or compression at constant temperature

Example

m.ask("An ideal gas of 1 mol expands isothermally at a temperature of 300 K from an initial volume of 0.01 m^3 to a final volume of 0.02 m^3. How much work is done by the gas?")
→ work = 1728.94 J

Heat exchangers 7

Effectiveness of a heat exchanger with one stream changing phaseeffectiveness_phase_change
\varepsilon = 1 - e^{-N}

Inputs

  • N number of transfer units UA/Cmin

Returns

  • eps heat exchanger effectiveness

Applies when

  • one stream at constant temperature (Cr = 0)
  • condensers and evaporators, any flow arrangement

Example

m.ask("Steam condenses in a condenser whose heat exchanger has a number of transfer units of 2. What is the effectiveness?")
→ effectiveness = 0.864665 1
Effectiveness of a parallel-flow heat exchangereffectiveness_parallel_flow
\varepsilon = \frac{1 - e^{-N \left(1 + C_{r}\right)}}{1 + C_{r}}

Inputs

  • N number of transfer units UA/Cmin
  • Cr capacity rate ratio Cmin/Cmax

Returns

  • eps heat exchanger effectiveness

Applies when

  • steady flow, constant properties
  • pure parallel-flow (co-current) exchangers

Example

m.ask("A parallel flow heat exchanger has a number of transfer units of 1 and a capacity rate ratio of 0.5. What is its effectiveness?")
→ effectiveness = 0.517913 1
Heat added to a flowing stream (steady-flow energy balance)sensible_heat_rate
Q = \text{mdot} c_{p} \left(T_{\text{out}} - T_{\text{in}}\right)

Inputs

  • mdot mass flow rate of the stream [kg/s]
  • cp specific heat of the fluid [J/(kg*K)]
  • Tout outlet temperature [K]
  • Tin inlet temperature [K]

Returns

  • Q rate of heat transfer [W]

Applies when

  • steady flow
  • constant cp
  • no phase change
  • kinetic and potential energy changes negligible
  • heaters, coolers and each side of a heat exchanger

Example

m.ask("Water with a mass flow rate of 0.5 kg/s and a specific heat of 4180 J/(kg*K) is heated from an inlet temperature of 20 °C to an outlet temperature of 60 °C. What is the rate of heat transfer?")
→ rate of heat transfer = 83600 W
Heat exchanger rating by the effectiveness-NTU methodhx_effectiveness_ntu

Heat duty, outlet temperatures, effectiveness and NTU of a counterflow or parallel-flow exchanger.

Q = \varepsilon(NTU, C_r)\,C_{min}(T_{h,i} - T_{c,i})

Inputs

  • C_hot heat capacity rate of the hot stream (m cp) [W/K]
  • C_cold heat capacity rate of the cold stream (m cp) [W/K]
  • UA overall conductance U A [W/K]
  • Th_in hot inlet temperature [K]
  • Tc_in cold inlet temperature [K]
  • arrangement flow arrangement choice

Returns

  • Q heat transfer rate [W]
  • Th_out hot outlet temperature [K]
  • Tc_out cold outlet temperature [K]
  • effectiveness effectiveness
  • NTU number of transfer units

Applies when

  • positive capacity rates and UA
  • hot inlet hotter than cold inlet

Example

m.ask("Effectiveness-NTU rating, counterflow: C_hot = 2000 W/K, C_cold = 4000 W/K, UA = 3000 W/K, Th_in = 150 °C, Tc_in = 30 °C")
→ Q = 165788 W, Th_out = 340.256 K, Tc_out = 344.597 K, effectiveness = 0.690785 1, NTU = 1.5 1
Heat transfer rate from the effectivenessheat_rate_effectiveness
Q = \varepsilon C_{\text{min}} \left(\text{Thi} - \text{Tci}\right)

Inputs

  • eps heat exchanger effectiveness
  • Cmin smaller of the two heat capacity rates (m cp) [W/K]
  • Thi inlet temperature of the hot fluid [K]
  • Tci inlet temperature of the cold fluid [K]

Returns

  • Q rate of heat transfer [W]

Applies when

  • steady flow
  • no heat loss to the surroundings
  • rating an exchanger whose effectiveness is known

Example

m.ask("A heat exchanger has an effectiveness of 0.6 and a minimum heat capacity rate of 2000 W/K. The hot fluid inlet temperature is 150 °C and the cold fluid inlet temperature is 30 °C. What is the rate of heat transfer?")
→ rate of heat transfer = 144000 W
Log-mean temperature difference of a heat exchangerlmtd

The LMTD of a counterflow or parallel-flow exchanger from the four terminal temperatures.

\Delta T_{lm} = \frac{\Delta T_1 - \Delta T_2}{\ln(\Delta T_1/\Delta T_2)}

Inputs

  • Th_in hot stream inlet temperature [K]
  • Th_out hot stream outlet temperature [K]
  • Tc_in cold stream inlet temperature [K]
  • Tc_out cold stream outlet temperature [K]
  • arrangement flow arrangement choice

Returns

  • lmtd log-mean temperature difference [K]
  • dT1 temperature difference at the hot-inlet end [K]
  • dT2 temperature difference at the other end [K]

Applies when

  • both terminal temperature differences positive
  • the hot stream cools and the cold stream warms

Example

m.ask("Counterflow LMTD: Th_in = 150 °C, Th_out = 90 °C, Tc_in = 30 °C, Tc_out = 70 °C")
→ lmtd = 69.5212 K, dT1 = 80 K, dT2 = 60 K
Number of transfer units of a heat exchangerntu_definition
N = \frac{U A}{C_{\text{min}}}

Inputs

  • U overall heat transfer coefficient [W/(m^2*K)]
  • A heat transfer area [m^2]
  • Cmin smaller of the two heat capacity rates (m cp) [W/K]

Returns

  • N number of transfer units UA/Cmin

Applies when

  • U uniform over the area
  • the effectiveness-NTU method

Example

m.ask("A heat exchanger has an overall heat transfer coefficient of 500 W/(m^2*K), an area of 10 m^2 and a minimum heat capacity rate of 2000 W/K. What is the number of transfer units?")
→ number of transfer units = 2.5 1

Natural convection 2

Grashof numbergrashof_number
\mathrm{Gr} = \frac{g \beta \left(T_{s} - \text{Tinf}\right) L^{3}}{\nu^{2}}

Inputs

  • g Acceleration [m/s^2] optional
  • beta volumetric thermal expansion coefficient of the fluid [1/K]
  • Ts surface temperature [K]
  • Tinf temperature of the fluid far from the surface [K]
  • L height of the plate (characteristic length) [m]
  • nu kinematic viscosity of the fluid [m^2/s]

Returns

  • Gr Grashof number

Applies when

  • Boussinesq approximation
  • surface hotter than the fluid
  • buoyancy-driven flow next to a heated or cooled surface

Example

m.ask("A vertical plate of height 0.5 m has a surface temperature of 330 K in still air at an air temperature of 300 K. The air has a coefficient of volume expansion of 0.0033 1/K and a kinematic viscosity of 0.000016 m^2/s. What is the Grashof number for natural convection?")
→ Grashof number = 4.74052e+08 1
Rayleigh numberrayleigh_number
\mathrm{Ra} = \mathrm{Gr} \mathrm{Pr}

Inputs

  • Gr Grashof number
  • Pr Prandtl number of the fluid

Returns

  • Ra Rayleigh number

Applies when

  • properties at the film temperature
  • natural convection correlations

Example

m.ask("Natural convection from a heated wall has a Grashof number of 100000000 and a Prandtl number of 0.71. What is the Rayleigh number?")
→ Rayleigh number = 7.1e+07 1

Open channel 1

Froude number of an open-channel flowfroude_number
\mathrm{Fr} = \frac{v}{\sqrt{g h}}

Inputs

  • v mean flow velocity [m/s]
  • g Acceleration [m/s^2] optional
  • h flow depth [m]

Returns

  • Fr Froude number

Applies when

  • rectangular channel (hydraulic depth = flow depth)
  • free-surface flow in a channel or river

Example

m.ask("Water flows in an open channel at 3 m/s with a depth of 0.5 m. What is the Froude number?")
→ Froude number = 1.3548 1

Pipe flow 12

Blasius friction factor for turbulent flow in a smooth pipeblasius_friction_factor
f = 0.3164 \mathrm{Re}^{\frac{-1}{4}}

Inputs

  • Re Reynolds number

Returns

  • f Darcy friction factor

Applies when

  • fully developed turbulent flow in a hydraulically smooth circular pipe
  • Darcy friction factor
  • 4000 < Re < 100000 in a smooth pipe

Example

m.ask("Water flows turbulently through a smooth pipe at a Reynolds number of 50000. Using the Blasius correlation, what is the Darcy friction factor?")
→ Darcy friction factor = 0.0211589 1
Darcy friction factor from the Colebrook equationcolebrook_friction_factor

Solve the implicit Colebrook-White equation for the Darcy friction factor of turbulent pipe flow.

\frac{1}{\sqrt{f}} = -2\log_{10}\left(\frac{\varepsilon/D}{3.7} + \frac{2.51}{Re\sqrt{f}}\right)

Inputs

  • Re Reynolds number (turbulent, at least 4000)
  • eD relative roughness (roughness / diameter)

Returns

  • f Darcy friction factor

Applies when

  • Re >= 4000
  • 0 <= eD <= 0.05

Example

m.ask("Colebrook friction factor: Re = 100000, eD = 0.0002")
→ f = 0.0190054 1
Darcy friction factor in laminar pipe flowlaminar_friction_factor
f = \frac{64}{\mathrm{Re}}

Inputs

  • Re Reynolds number

Returns

  • f Darcy friction factor

Applies when

  • fully developed laminar flow in a circular pipe
  • Darcy (not Fanning) friction factor
  • Re below about 2300 in a circular pipe

Example

m.ask("Oil flows in a pipe with a Reynolds number of 1200. The flow is laminar. What is the Darcy friction factor?")
→ Darcy friction factor = 0.0533333 1
Darcy-Weisbach head loss in a pipedarcy_weisbach_head_loss
h_{L} = \frac{f L v^{2}}{2 g D}

Inputs

  • f Darcy friction factor
  • L length of the pipe [m]
  • v mean flow velocity [m/s]
  • g Acceleration [m/s^2] optional
  • D inner diameter of the pipe [m]

Returns

  • hL head loss to friction [m]

Applies when

  • fully developed flow
  • Darcy friction factor
  • constant diameter
  • frictional loss along a straight pipe of constant diameter

Example

m.ask("Water flows at an average velocity of 2 m/s through a 100 m long pipe of diameter 0.1 m. The Darcy friction factor is 0.02. What is the head loss?")
→ head loss = 4.07886 m
Darcy-Weisbach pressure drop in a pipedarcy_weisbach_pressure_drop
d_{P} = \frac{f L \rho v^{2}}{2 D}

Inputs

  • f Darcy friction factor
  • L length of the pipe [m]
  • rho density of the fluid [kg/m^3]
  • v mean flow velocity [m/s]
  • D inner diameter of the pipe [m]

Returns

  • dP frictional pressure drop [Pa]

Applies when

  • fully developed flow
  • Darcy friction factor
  • constant diameter
  • frictional pressure loss along a straight pipe of constant diameter

Example

m.ask("Oil of density 870 kg/m^3 flows at a mean velocity of 1.5 m/s through a 30 m long pipe of diameter 0.05 m with a friction factor of 0.03. What is the pressure drop?")
→ pressure drop = 17617.5 Pa
Haaland explicit friction factor for turbulent pipe flowhaaland_friction_factor
f = \frac{1}{\left(\frac{1.8 \ln\left(\left(\frac{\varepsilon}{3.7 D}\right)^{\frac{111}{100}} + \frac{6.9}{\mathrm{Re}}\right)}{\ln\left(10\right)}\right)^{2}}

Inputs

  • eps absolute roughness of the pipe wall [m]
  • D inner diameter of the pipe [m]
  • Re Reynolds number

Returns

  • f Darcy friction factor

Applies when

  • fully developed turbulent flow in a circular pipe
  • Darcy friction factor
  • 4000 < Re < 1e8 and eps/D < 0.05

Example

m.ask("Use the Haaland equation to find the Darcy friction factor for turbulent flow in a pipe of diameter 0.05 m with an absolute roughness of 0.00015 m at a Reynolds number of 80000.")
→ Darcy friction factor = 0.0276632 1
Hagen-Poiseuille flow rate in laminar pipe flowhagen_poiseuille
Q = \frac{\pi D^{4} d_{P}}{128 \mu L}

Inputs

  • D inner diameter of the pipe [m]
  • dP pressure drop along the pipe [Pa]
  • mu dynamic viscosity of the fluid [Pa*s]
  • L length of the pipe [m]

Returns

  • Q volume flow rate [m^3/s]

Applies when

  • fully developed laminar flow
  • Newtonian fluid
  • circular pipe
  • Re below about 2300

Example

m.ask("Oil with a viscosity of 0.05 Pa*s flows in laminar flow through a 10 m long tube of diameter 0.01 m under a pressure drop of 20000 Pa. What is the volume flow rate?")
→ volume flow rate = 9.81748e-06 m^3/s
Kinematic viscosity from dynamic viscosity and densitykinematic_viscosity
\nu = \frac{\mu}{\rho}

Inputs

  • mu dynamic viscosity of the fluid [Pa*s]
  • rho density of the fluid [kg/m^3]

Returns

  • nu kinematic viscosity [m^2/s]

Applies when

  • Newtonian fluid
  • converting between dynamic and kinematic viscosity

Example

m.ask("A liquid has a dynamic viscosity of 0.002 Pa*s and a density of 800 kg/m^3. What is its kinematic viscosity?")
→ kinematic viscosity = 2.5e-06 m^2/s
Minor head loss in a fittingminor_loss_head
h_{L} = \frac{K v^{2}}{2 g}

Inputs

  • K loss coefficient of the fitting
  • v mean flow velocity [m/s]
  • g Acceleration [m/s^2] optional

Returns

  • hL head loss across the fitting [m]

Applies when

  • fully turbulent flow (K independent of Re)
  • K based on the mean velocity in the pipe
  • valves, elbows, entrances, exits and expansions

Example

m.ask("Water flows at 3 m/s through a fully open globe valve with a loss coefficient of 10. What is the head loss across the valve?")
→ head loss = 4.58872 m
Reynolds number from density, velocity, diameter and viscosityreynolds_number
\mathrm{Re} = \frac{\rho v D}{\mu}

Inputs

  • rho density of the fluid [kg/m^3]
  • v mean flow velocity [m/s]
  • D pipe or body diameter [m]
  • mu dynamic viscosity of the fluid [Pa*s]

Returns

  • Re Reynolds number

Applies when

  • Newtonian fluid
  • the diameter as the characteristic length
  • flow in a circular pipe or past a sphere or cylinder of that diameter

Example

m.ask("Water with density 998 kg/m^3 and dynamic viscosity 0.001 Pa*s flows at an average velocity of 1.5 m/s in a pipe of diameter 0.05 m. What is the Reynolds number?")
→ Reynolds number = 74850 1
Reynolds number from velocity, diameter and kinematic viscosityreynolds_number_kinematic
\mathrm{Re} = \frac{v D}{\nu}

Inputs

  • v mean flow velocity [m/s]
  • D pipe or body diameter [m]
  • nu kinematic viscosity of the fluid [m^2/s]

Returns

  • Re Reynolds number

Applies when

  • Newtonian fluid
  • the diameter as the characteristic length
  • flow in a circular pipe or past a sphere or cylinder of that diameter

Example

m.ask("Air with a kinematic viscosity of 0.000015 m^2/s flows at 10 m/s past a cylinder of diameter 0.03 m. What is the Reynolds number?")
→ Reynolds number = 20000 1
Swamee-Jain explicit friction factor for turbulent pipe flowswamee_jain_friction_factor
f = \frac{0.25}{\left(\frac{\ln\left(\frac{\varepsilon}{3.7 D} + \left(\frac{6.97}{\mathrm{Re}}\right)^{\frac{9}{10}}\right)}{\ln\left(10\right)}\right)^{2}}

Inputs

  • eps absolute roughness of the pipe wall [m]
  • D inner diameter of the pipe [m]
  • Re Reynolds number

Returns

  • f Darcy friction factor

Applies when

  • fully developed turbulent flow in a circular pipe
  • Darcy friction factor
  • 5000 < Re < 1e8 and 1e-6 < eps/D < 0.01

Example

m.ask("Water flows in a commercial steel pipe of diameter 0.1 m with an absolute roughness of 0.000045 m at a Reynolds number of 100000. Use the Swamee-Jain equation to find the Darcy friction factor.")
→ Darcy friction factor = 0.0201957 1

Psychrometrics 7

Dew-point temperature from dry-bulb temperature and relative humiditydew_point_temperature

The temperature at which moist air of a given relative humidity becomes saturated on cooling.

p_{ws}(T_{dp}) = \phi\,p_{ws}(T)

Inputs

  • T dry-bulb temperature [K]
  • RH relative humidity (fraction, or % written)

Returns

  • T_dew dew-point temperature [K]
  • p_v partial pressure of the water vapour [Pa]

Applies when

  • 0 < RH <= 1
  • -100 °C <= T <= 200 °C

Example

m.ask("Dew point temperature: T = 25 °C, RH = 60%")
→ T_dew = 289.851 K, p_v = 1901.53 Pa
Humidity ratio from temperature, relative humidity and pressurehumidity_ratio_from_relative_humidity

Mass of water vapour per kilogram of dry air in moist air of a given relative humidity.

W = 0.621945\,\frac{\phi p_{ws}}{P - \phi p_{ws}}

Inputs

  • T dry-bulb temperature [K]
  • RH relative humidity (fraction, or % written)
  • P total (barometric) pressure [Pa]

Returns

  • W humidity ratio (kg/kg dry air)
  • p_v partial pressure of the water vapour [Pa]

Applies when

  • 0 < RH <= 1
  • P greater than the vapour pressure

Example

m.ask("Humidity ratio: T = 30 °C, RH = 50%, P = 101325 Pa")
→ W = 0.0133102 1, p_v = 2123.02 Pa
Humidity ratio from the partial pressure of water vapourhumidity_ratio_vapour_pressure
W = \frac{0.621945 p_{v}}{P - p_{v}}

Inputs

  • pv partial pressure of water vapour [Pa]
  • P total (barometric) pressure of the moist air [Pa]

Returns

  • W humidity ratio (kg water vapour per kg dry air)

Applies when

  • moist air as an ideal-gas mixture
  • ratio of molar masses 0.621945
  • atmospheric air-conditioning and drying calculations

Example

m.ask("Moist air at a barometric pressure of 101325 Pa has a partial pressure of water vapour of 2000 Pa. What is the humidity ratio?")
→ humidity ratio = 0.0125234 1
Saturation pressure of water vapoursaturation_vapour_pressure

The saturation pressure of water vapour over liquid water (above 0.01 °C) or ice, -100 °C to 200 °C.

\ln p_{ws} = C_8/T + C_9 + C_{10}T + C_{11}T^2 + C_{12}T^3 + C_{13}\ln T

Inputs

  • T temperature [K]

Returns

  • p_sat saturation pressure of water vapour [Pa]

Applies when

  • -100 °C <= T <= 200 °C

Example

m.ask("Saturation vapour pressure of water: T = 25 °C")
→ p_sat = 3169.22 Pa
Specific enthalpy of moist airmoist_air_enthalpy
h = \text{cpa} \left(T - T_{0}\right) + W \left(h_{g} + \text{cpv} \left(T - T_{0}\right)\right)

Inputs

  • T dry-bulb temperature [K]
  • W humidity ratio (kg water vapour per kg dry air)
  • cpa Specific heat [J/(kg*K)] optional
  • cpv Specific heat [J/(kg*K)] optional
  • hg Latent heat [J/kg] optional
  • T0 Temperature [K] optional

Returns

  • h enthalpy per kilogram of dry air [J/kg]

Applies when

  • reference state: dry air and liquid water at 0 °C
  • constant specific heats
  • air-conditioning processes between about -40 and 60 °C

Example

m.ask("Moist air has a dry-bulb temperature of 25 °C and a humidity ratio of 0.01. What is its specific enthalpy?")
→ specific enthalpy = 50625 J/kg
Specific volume of moist air per kilogram of dry airmoist_air_specific_volume
v = \frac{\mathrm{Ra} T \left(1 + 1.607858 W\right)}{P}

Inputs

  • T dry-bulb temperature [K]
  • W humidity ratio (kg water vapour per kg dry air)
  • P total (barometric) pressure of the moist air [Pa]
  • Ra Specific gas constant [J/(kg*K)] optional

Returns

  • v specific volume per kilogram of dry air [m^3/kg]

Applies when

  • moist air as an ideal-gas mixture
  • fan and duct sizing in air conditioning

Example

m.ask("Moist air at a dry-bulb temperature of 25 °C, a humidity ratio of 0.01 and a barometric pressure of 101325 Pa. What is its specific volume?")
→ specific volume = 0.858205 m^3/kg
Thermodynamic wet-bulb temperaturewet_bulb_temperature

The wet-bulb temperature of moist air from its dry-bulb temperature, relative humidity and pressure.

W = \frac{(2501 - 2.326\,t^*)W_s^* - 1.006(t - t^*)}{2501 + 1.86\,t - 4.186\,t^*}

Inputs

  • T dry-bulb temperature [K]
  • RH relative humidity (fraction, or % written)
  • P total (barometric) pressure [Pa]

Returns

  • T_wb thermodynamic wet-bulb temperature [K]
  • W humidity ratio

Applies when

  • 0 < RH <= 1
  • 0 °C <= T <= 50 °C for the liquid-water branch

Example

m.ask("Wet bulb temperature: T = 30 °C, RH = 40%, P = 101325 Pa")
→ T_wb = 293.214 K, W = 0.0106028 1

Pumps 2

Hydraulic power delivered to a fluidhydraulic_power
P = \rho g Q H

Inputs

  • rho density of the fluid [kg/m^3]
  • g Acceleration [m/s^2] optional
  • Q volume flow rate [m^3/s]
  • H head added by the pump [m]

Returns

  • P power delivered to the fluid [W]

Applies when

  • incompressible liquid
  • steady flow
  • a pump adding head H to a liquid stream

Example

m.ask("A pump delivers water of density 1000 kg/m^3 at a flow rate of 0.05 m^3/s against a total head of 20 m. What is the hydraulic power?")
→ hydraulic power = 9806.65 W
Shaft power required by a pumppump_shaft_power
P = \frac{\rho g Q H}{\eta}

Inputs

  • rho density of the fluid [kg/m^3]
  • g Acceleration [m/s^2] optional
  • Q volume flow rate [m^3/s]
  • H head added by the pump [m]
  • eta pump efficiency (a fraction)

Returns

  • P shaft power required [W]

Applies when

  • incompressible liquid
  • steady flow
  • efficiency given as a fraction
  • sizing the drive of a pump

Example

m.ask("A pump with an efficiency of 0.8 lifts water of density 1000 kg/m^3 at a flow rate of 0.03 m^3/s through a total head of 25 m. What shaft power is required?")
→ shaft power = 9193.73 W

Radiation 5

Emissive power of a blackbody (Stefan-Boltzmann law)blackbody_emissive_power
E = \sigma T^{4}

Inputs

  • sigma Stefan boltzmann constant [W/(m^2*K^4)] optional
  • T absolute temperature of the surface [K]

Returns

  • E emissive power per unit area [W/m^2]

Applies when

  • an ideal blackbody
  • absolute temperature
  • total hemispherical emission of a black surface

Example

m.ask("What is the emissive power of a blackbody at 1000 K?")
→ emissive power = 56703.7 W/m^2
Linearised radiation heat transfer coefficientradiation_heat_transfer_coefficient
h_{r} = \varepsilon \sigma \left(T_{s} + \text{Tsur}\right) \left(T_{s}^{2} + \text{Tsur}^{2}\right)

Inputs

  • eps surface emissivity
  • sigma Stefan boltzmann constant [W/(m^2*K^4)] optional
  • Ts surface temperature [K]
  • Tsur temperature of the surroundings [K]

Returns

  • hr radiation heat transfer coefficient [W/(m^2*K)]

Applies when

  • small grey surface in large surroundings
  • combining radiation with convection

Example

m.ask("A surface with an emissivity of 0.9 is at a surface temperature of 400 K and its surroundings are at 300 K. What is the radiation heat transfer coefficient?")
→ radiation heat transfer coefficient = 8.93084 W/(m^2*K)
Net radiation between two large parallel grey platesradiation_parallel_plates
q_{f} = \frac{\sigma \left(T_{1}^{4} - T_{2}^{4}\right)}{\frac{1}{e_{1}} + \frac{1}{e_{2}} - 1}

Inputs

  • sigma Stefan boltzmann constant [W/(m^2*K^4)] optional
  • T1 temperature of the first plate [K]
  • T2 temperature of the second plate [K]
  • e1 emissivity of the first plate
  • e2 emissivity of the second plate

Returns

  • qf net radiative heat flux from plate 1 to plate 2 [W/m^2]

Applies when

  • infinite parallel grey diffuse plates
  • no participating medium
  • closely spaced large plates

Example

m.ask("Two large parallel plates exchange radiation. The first plate is at 800 K and the second plate is at 400 K. The emissivity of the first plate is 0.8 and the emissivity of the second plate is 0.6. What is the net radiation heat flux between them?")
→ net radiation heat flux = 11360.5 W/m^2
Net radiation exchange of a small grey surface with large surroundingsradiation_net_exchange
q = \varepsilon \sigma A \left(T_{s}^{4} - \text{Tsur}^{4}\right)

Inputs

  • eps emissivity of the surface
  • sigma Stefan boltzmann constant [W/(m^2*K^4)] optional
  • A surface area [m^2]
  • Ts surface temperature [K]
  • Tsur temperature of the surroundings [K]

Returns

  • q rate of heat transfer [W]

Applies when

  • grey diffuse surface
  • surroundings large compared with the surface
  • a small body inside a large enclosure

Example

m.ask("A surface of area 0.5 m^2 with an emissivity of 0.8 is at a surface temperature of 500 K in a large room whose surroundings are at 300 K. What is the net radiation heat transfer from the surface?")
→ net radiation heat transfer = 1233.87 W
Wien's displacement lawwien_displacement
\lambda = \frac{b}{T}

Inputs

  • T absolute temperature of the surface [K]
  • b Wien constant [m*K] optional

Returns

  • lam wavelength of maximum spectral emission [m]

Applies when

  • blackbody (or grey body) emission
  • the peak of the Planck spectrum

Example

m.ask("A star has a surface temperature of 5800 K. At what peak wavelength does it emit most strongly?")
→ peak wavelength = 4.99616e-07 m

Thermodynamic cycles 6

Carnot efficiency of a reversible heat enginecarnot_efficiency
\eta = 1 - \frac{T_{c}}{T_{h}}

Inputs

  • Tc temperature of the cold reservoir [K]
  • Th temperature of the hot reservoir [K]

Returns

  • eta Carnot (maximum) efficiency

Applies when

  • reversible cycle between two reservoirs
  • absolute temperatures
  • the upper limit of any heat engine between two temperatures

Example

m.ask("A Carnot engine operates between a hot reservoir temperature of 600 K and a cold reservoir temperature of 300 K. What is its efficiency?")
→ efficiency = 0.5 1
Coefficient of performance of a Carnot heat pumpcarnot_cop_heat_pump
\text{cop} = \frac{T_{h}}{T_{h} - T_{c}}

Inputs

  • Tc temperature of the cold reservoir [K]
  • Th temperature of the hot reservoir [K]

Returns

  • cop coefficient of performance (heating)

Applies when

  • reversible heat-pump cycle
  • absolute temperatures
  • the upper limit of a heat pump's COP

Example

m.ask("A Carnot heat pump delivers heat at a hot reservoir temperature of 295 K while extracting heat from a cold reservoir temperature of 275 K. What is its coefficient of performance?")
→ coefficient of performance = 14.75 1
Coefficient of performance of a Carnot refrigeratorcarnot_cop_refrigerator
\text{cop} = \frac{T_{c}}{T_{h} - T_{c}}

Inputs

  • Tc temperature of the cold reservoir [K]
  • Th temperature of the hot reservoir [K]

Returns

  • cop coefficient of performance (cooling)

Applies when

  • reversible refrigeration cycle
  • absolute temperatures
  • the upper limit of a refrigerator's COP

Example

m.ask("A Carnot refrigerator keeps a cold reservoir temperature of 270 K and rejects heat at a hot reservoir temperature of 300 K. What is its coefficient of performance?")
→ coefficient of performance = 9 1
Thermal efficiency of the air-standard Brayton cyclebrayton_efficiency_air
\eta = 1 - r_{p}^{\frac{-2}{7}}

Inputs

  • rp compressor pressure ratio

Returns

  • eta thermal efficiency of the cycle

Applies when

  • cold-air-standard: air as an ideal gas with gamma = 1.4
  • isentropic compressor and turbine
  • idealised gas-turbine cycles

Example

m.ask("An air-standard Brayton cycle operates with a pressure ratio of 10. What is its thermal efficiency?")
→ thermal efficiency = 0.482053 1
Thermal efficiency of the air-standard Diesel cyclediesel_efficiency_air
\eta = 1 - \frac{r^{\frac{-2}{5}} \left(r_{c}^{\frac{7}{5}} - 1\right)}{\frac{7 \left(r_{c} - 1\right)}{5}}

Inputs

  • r compression ratio V1/V2
  • rc cutoff ratio V3/V2

Returns

  • eta thermal efficiency of the cycle

Applies when

  • cold-air-standard: air as an ideal gas with gamma = 1.4
  • heat added at constant pressure
  • idealised compression-ignition engines

Example

m.ask("An air-standard Diesel cycle has a compression ratio of 18 and a cutoff ratio of 2. What is its thermal efficiency?")
→ thermal efficiency = 0.631578 1
Thermal efficiency of the air-standard Otto cycleotto_efficiency_air
\eta = 1 - r^{\frac{-2}{5}}

Inputs

  • r compression ratio V1/V2

Returns

  • eta thermal efficiency of the cycle

Applies when

  • cold-air-standard: air as an ideal gas with gamma = 1.4
  • reversible adiabatic compression and expansion
  • idealised spark-ignition engines

Example

m.ask("An air-standard Otto cycle has a compression ratio of 8. What is its thermal efficiency?")
→ thermal efficiency = 0.564725 1

Transient conduction 4

Biot numberbiot_number
\mathrm{Bi} = \frac{h L_{c}}{k}

Inputs

  • h convection heat transfer coefficient [W/(m^2*K)]
  • Lc characteristic length [m]
  • k thermal conductivity [W/(m*K)]

Returns

  • Bi Biot number

Applies when

  • Lc = volume / surface area for the lumped-capacitance test
  • judging whether a body's internal temperature is uniform (Bi < 0.1)

Example

m.ask("An aluminium part with a characteristic length of 0.01 m and thermal conductivity 200 W/(m*K) is cooled with a heat transfer coefficient of 50 W/(m^2*K). What is the Biot number?")
→ Biot number = 0.0025 1
Fourier numberfourier_number
F_{o} = \frac{\alpha t}{L_{c}^{2}}

Inputs

  • alpha thermal diffusivity [m^2/s]
  • t elapsed time [s]
  • Lc characteristic length [m]

Returns

  • Fo Fourier number

Applies when

  • constant properties
  • transient conduction charts and series solutions

Example

m.ask("A steel plate with thermal diffusivity 0.00001 m^2/s and characteristic length 0.02 m is heated for a time of 60 s. What is the Fourier number?")
→ Fourier number = 1.5 1
Temperature of a lumped body cooling or heating in a fluidlumped_capacitance_temperature
T = \text{Tinf} + \left(T_{i} - \text{Tinf}\right) e^{\frac{-h A t}{\rho V c}}

Inputs

  • Tinf temperature of the fluid far from the surface [K]
  • Ti initial temperature of the body [K]
  • h convection heat transfer coefficient [W/(m^2*K)]
  • A surface area of the body [m^2]
  • t elapsed time [s]
  • rho density of the body [kg/m^3]
  • V volume of the body [m^3]
  • c specific heat of the body [J/(kg*K)]

Returns

  • T temperature of the body at time t [K]

Applies when

  • Biot number below about 0.1 (uniform internal temperature)
  • constant h and properties
  • small or highly conductive bodies

Example

m.ask("A small steel part with a volume of 0.000005 m^3, a surface area of 0.002 m^2, a density of 7800 kg/m^3 and a specific heat of 450 J/(kg*K) is initially at 300 °C. Treated as a lumped system, it cools in air at an ambient temperature of 25 °C with a heat transfer coefficient of 40 W/(m^2*K). What is its temperature after 120 s?")
→ temperature after = 457.287 K
Thermal time constant of a lumped bodylumped_time_constant
\tau = \frac{\rho V c}{h A}

Inputs

  • rho density of the body [kg/m^3]
  • V volume of the body [m^3]
  • c specific heat of the body [J/(kg*K)]
  • h convection heat transfer coefficient [W/(m^2*K)]
  • A surface area of the body [m^2]

Returns

  • tau thermal time constant [s]

Applies when

  • Biot number below about 0.1
  • constant h and properties
  • thermocouples and small bodies

Example

m.ask("A lumped steel part has a volume of 0.000005 m^3, a surface area of 0.002 m^2, a density of 7800 kg/m^3, a specific heat of 450 J/(kg*K) and a heat transfer coefficient of 40 W/(m^2*K). What is its time constant?")
→ time constant = 219.375 s
Questions

Frequently asked

What does thermofluids-ai999x do?

Thermofluids answers questions in thermofluids: fluid statics and dynamics, pipe flow, boundary layers, aerodynamics, heat conduction, convection and radiation, heat exchangers, thermodynamic cycles, psychrometrics and combustion. Each answer gives the value with its unit, the steps and the formula in LaTeX.

How do I install thermofluids-ai999x?

With pip: pip install thermofluids-ai999x. The same files are on Hugging Face (hf download AI999X/thermofluids-ai999x --local-dir thermofluids-ai999x) and GitHub.

Does it run offline?

Yes. It is a Python package that runs on an ordinary CPU without a network connection (Python >=3.10); no GPU and no API key are needed.

How many capabilities does thermofluids-ai999x have?

99 capabilities in 20 topics, including Pipe flow, Convection, Conduction, Gas processes, Heat exchangers.

Which field and tasks does it cover?

Field: Engineering. Tasks: Question Answering, Token Classification, Text Classification, Sentence Similarity, Feature Extraction.

What does an answer look like?

Asked "Water with density 998 kg/m^3 and dynamic viscosity 0.001 Pa*s flows at an average velocity of 1.5 m/s in a pipe of diameter 0.05 m. What is the Reynolds number?", it answers: Reynolds number = 74850 1.

What happens when a question cannot be answered?

It says so and names what is missing or out of range, instead of guessing a number.

More from AI999X

Explore every model.