(* ASCEND model library Copyright (c) 2006 Carnegie Mellon University This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *)(** This is a simple model for computing the steady-state temperature and heat loss profile of a multi-layered pipe-plus-insulation by John Pye *) REQUIRE "atoms.a4l"; REQUIRE "johnpye/thermo_types.a4c"; MODEL radial_loss; D_1 IS_A distance; D_2 IS_A distance; q IS_A energy_rate; L IS_A distance; T_1, T_2 IS_A temperature; METHODS METHOD specify; FIX D_1, D_2; END specify; END radial_loss; (* Wall conduction *) MODEL wall_conduction REFINES radial_loss; k IS_A thermal_conductivity; q = 2 * 1{PI} * L * k * (T_1 - T_2) / ln(D_2/D_1); END wall_conduction; (* Convection boundary *) MODEL convection_boundary REFINES radial_loss; h IS_A heat_transfer_coefficient; D_1, D_2 ARE_THE_SAME; (* heat loss is positive if T_1 > T_2 *) q = h * 1{PI} * D_1 * (T_1 - T_2); END convection_boundary; (** This modes a thick pipe with internal flow, surrounded by 100mm of insulation and a thin external metal shell. In other words, a fairly typical lagged high-temperature pipe as used in power and chemical plant applications. Solve the model, then examine the values of T_1 and T_2 for each layer. @TODO add ability to plot the temperature versus radial distance... *) MODEL pipe_test REFINES radial_loss; n IS_A integer_constant; n:==5; U IS_A heat_transfer_coefficient; q = U * (1{PI} * D_1) * (loss[1].T_2 - T_2); loss[1..5] IS_A radial_loss; loss[1] IS_REFINED_TO convection_boundary; loss[2] IS_REFINED_TO wall_conduction; loss[3] IS_REFINED_TO wall_conduction; loss[4] IS_REFINED_TO wall_conduction; loss[5] IS_REFINED_TO convection_boundary; L, loss[1..5].L ARE_THE_SAME; FOR i IN [2..n] CREATE (* layers are touching *) loss[i].D_1, loss[i-1].D_2 ARE_THE_SAME; (* steady state: heat rate is uniform *) loss[i].q,loss[i-1].q ARE_THE_SAME; loss[i].T_1, loss[i-1].T_2 ARE_THE_SAME; END FOR; loss[1].D_1, D_1 ARE_THE_SAME; loss[n].D_2, D_2 ARE_THE_SAME; loss[1].T_1, T_1 ARE_THE_SAME; loss[n].T_2, T_2 ARE_THE_SAME; loss[1].q, q ARE_THE_SAME; METHODS METHOD default_self; RUN reset; RUN values; END default_self; METHOD specify; FIX loss[1].h; FIX loss[2..4].k; FIX loss[5].h; FIX L; FIX T_1, T_2; FIX loss[2].D_1, loss[2].D_2; FIX loss[4].D_1, loss[4].D_2; END specify; METHOD values; L := 1 {m}; T_1 := 250 {K} + 273.15 {K}; T_2 := 25 {K} + 273.15 {K}; loss[1].h := 1000 {W/m^2/K}; loss[2].k := 40 {W/m/K}; (* 'alloy steel', Ashby & Jones, Eng Matls 2, p.11 *) loss[3].k := 0.05 {W/m/K}; (* Masud's figure for lagging *) loss[4].k := 240 {W/m/K}; (* aluminium, Ashby & Jones, Eng Matls 2, p.11 *) loss[5].h := 50 {W/m^2/K}; loss[2].D_1 := 0.05 {m}; (* pipe interior *) loss[2].D_2 := 0.07 {m}; (* pipe exterior *) loss[4].D_1 := 0.17 {m}; (* cover interior *) loss[4].D_2 := 0.19 {m}; (* cover exterior *) END values; END pipe_test;