I am trying to simulate the laminar flow with heat transfer problem in a square duct with fixed wall temperature. The flow is hydrodynamically developped (fully developped velocity profile imposed at inlet) and thermally developping. The script and mesh are here https://github.com/bragostin/Fenics
I use two methods to calculate the average heat transfer coefficient:
- Integration of local values:
Area = assemble(T/T*ds_bc(association_table["noslip"]))
LMDT = ((Tw - T_out_avg) - (Tw - T_in_avg)) / ln((Tw - T_out_avg) / (Tw - T_in_avg))
htc_avg = assemble(dot(k*grad(T), n)*ds_bc(association_table["noslip"])) / Area / LMDT
yielding 34 W/m2 K
2. Global value:
ds_bc = ds(subdomain_data=boundaries)
U = sqrt(dot(u,u))
u_in_avg = assemble(U*ds_bc(association_table["inlet"])) / (We * He)
u_out_avg = assemble(U*ds_bc(association_table["outlet"])) / (We * He)
T_in_avg = assemble(U*T*ds_bc(association_table["inlet"])) / (u_in_avg * We * He)
T_out_avg = assemble(U*T*ds_bc(association_table["outlet"])) / (u_out_avg * We * He)
DT_avg = T_out_avg - T_in_avg
Heat_Load = u_in_avg * We * He * rho * cp * DT_avg
htc_avg = Heat_Load / (Area * LMDT)
yielding 234 W/m2 K.
I think the second value is wrong, but I still cannot understand why this difference, they should be equal.