JSFiddle - React, Tailwind, and code Playground
JavaScript
V=25/3600 // flow rate, m³/s
d=0.1 // diameter, meters
t1=-30 // fluid inlet temperature
t2=4.9 // fluid outlet temperature
ts=5 // tube surface temperature
tf=(t1+t2)/2 // fluid temperature
document.write(`tf = ${tf} °C<br>`)
// values from http://www.mhtl.uwaterloo.ca/old/onlinetools/airprop/airprop.html :
nu=1.2246*10**-5 // kinematic viscosity
Prf=0.72275 // prandtl number for fluid temperature
Prs=0.71866 // prandtl number for tube surface temperature
la=0.023096 // thermal conductivity
rho=1.3558 // density
Cp=1.0054*10**3 // specific heat capacity, J/kg*K
f=Math.PI*d**2/4 // cross-sectional area
w=V/f // velocity of the fluid, m/s
Re=w*d/nu // reynolds number
if (Re <= 2300) {
document.write('Re <= 2300<br>')
} else {
document.write(`Re = ${Re}<br>`)
el=1 // for L/d >= 50 el=1
ep=0.93 // from table 3.3
Nus=0.021*Re**0.8*Prf**0.43*(Prf/Prs)**0.25*el*ep // nusselt number
al=Nus*la/d // heat transfer coefficient
G=V*rho // mass flow rate, kg/s
Q=G*Cp*(t2-t1) // heat flow, W
lmtd=(t2-t1)/Math.log((ts-t1)/(ts-t2)) // logarithmic mean temperature difference
l=Q/(al*lmtd*Math.PI*d)
if (l/d < 50) {
document.write('L/d < 50.<br>')
} else {
document.write(`l = ${l}<br>`)
}
}