60 |
q = h * 1{PI} * D_1 * (T_1 - T_2); |
q = h * 1{PI} * D_1 * (T_1 - T_2); |
61 |
|
|
62 |
END convection_boundary; |
END convection_boundary; |
63 |
|
|
64 |
(* |
MODEL pipe_test REFINES radial_loss; |
65 |
A sequence of radial losses in series |
|
66 |
*) |
n IS_A integer_constant; |
67 |
MODEL radial_losses( |
n:==5; |
68 |
n WILL_BE integer; |
|
69 |
) REFINES radial_loss; |
loss[1..5] IS_A radial_loss; |
70 |
|
|
71 |
loss[1..n] IS_A radial_loss; |
loss[1] IS_REFINED_TO convection_boundary; |
72 |
|
loss[2] IS_REFINED_TO wall_conduction; |
73 |
(* all the same length *) |
loss[3] IS_REFINED_TO wall_conduction; |
74 |
L, loss[1..n].L ARE_THE_SAME; |
loss[4] IS_REFINED_TO wall_conduction; |
75 |
|
loss[5] IS_REFINED_TO convection_boundary; |
76 |
(* the ID of the whole lot equals the ID for the first element *) |
|
77 |
D_1, loss[1].D_1 ARE_THE_SAME; |
L, loss[1..5].L ARE_THE_SAME; |
78 |
|
|
|
(* the OD of the whole lot equals the OD of the last element *) |
|
|
D_2, loss[n].D_2 ARE_THE_SAME; |
|
|
|
|
79 |
FOR i IN [1..n] CREATE |
FOR i IN [1..n] CREATE |
80 |
(* layers are touching *) |
(* layers are touching *) |
81 |
loss[i].D_1, loss[i-1].D_2 ARE_THE_SAME; |
loss[i].D_1, loss[i-1].D_2 ARE_THE_SAME; |
82 |
(* heat rate is uniform *) |
|
83 |
|
(* steady state: heat rate is uniform *) |
84 |
loss[i].q,loss[i-1].q ARE_THE_SAME; |
loss[i].q,loss[i-1].q ARE_THE_SAME; |
85 |
END FOR; |
END FOR; |
86 |
|
|
87 |
END radial_losses; |
METHODS |
88 |
|
METHOD default_self; |
89 |
|
RUN reset; RUN values; |
90 |
|
END default_self; |
91 |
|
|
|
(* |
|
|
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 |
|
92 |
METHOD specify; |
METHOD specify; |
93 |
FIX loss[1].h; |
FIX loss[1].h; |
94 |
FIX loss[2..4].k; |
FIX loss[2..4].k; |
109 |
loss[4].D_1 := 0.17 {m}; (* cover interior *) |
loss[4].D_1 := 0.17 {m}; (* cover interior *) |
110 |
loss[4].D_2 := 0.19 {m}; (* cover exterior *) |
loss[4].D_2 := 0.19 {m}; (* cover exterior *) |
111 |
END values; |
END values; |
112 |
END test_lagged_pipe; |
END pipe_test; |