(* 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; q = h * 1{PI} * D_1 * (T_1 - T_2); END convection_boundary; (* A sequence of radial losses in series *) MODEL radial_losses( n WILL_BE integer; ) REFINES radial_loss; loss[1..n] IS_A radial_loss; (* all the same length *) L, loss[1..n].L ARE_THE_SAME; (* the ID of the whole lot equals the ID for the first element *) D_1, loss[1].D_1 ARE_THE_SAME; (* the OD of the whole lot equals the OD of the last element *) D_2, loss[n].D_2 ARE_THE_SAME; FOR i IN [1..n] CREATE (* layers are touching *) loss[i].D_1, loss[i-1].D_2 ARE_THE_SAME; (* heat rate is uniform *) loss[i].q,loss[i-1].q ARE_THE_SAME; END FOR; END radial_losses; (* Sample model: a stainless steel pipe with lagging (aka insulation) and a thin steel sheel. *) MODEL test_lagged_pipe REFINES radial_losses( n IS_A integer_constant; ) n:=5; loss[1] IS_A convection_boundary; loss[2] IS_A wall_conduction; loss[3] IS_A wall_conduction; loss[4] IS_A wall_conduction; loss[5] IS_A convection_boundary; METHODS METHOD specify; FIX loss[1].h; FIX loss[2..4].k; FIX loss[5].h; FIX loss[1,3,5].D_1; END specify; METHOD values; 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[1].D_1 := 0.05 {m}; (* pipe interior *) loss[1].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 test_lagged_pipe;