/[ascend]/trunk/models/mix.a4l
ViewVC logotype

Contents of /trunk/models/mix.a4l

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2651 - (show annotations) (download) (as text)
Thu Dec 13 07:29:48 2012 UTC (11 years, 6 months ago) by jpye
File MIME type: text/x-ascend
File size: 3879 byte(s)
Fixing GPL header, removing postal address (rpmlint incorrect-fsf-address)
1 REQUIRE "stream_holdup.a4l";
2 (* => stream_holdup.a4l, thermodynamics.a4l, components.a4l, phases.a4l,
3 * atoms.a4l, measures.a4l, system.a4l, basemodel.a4l *)
4 PROVIDE "mix.a4l";
5
6 (*
7 * mix.a4l
8 * by Duncan Coffey
9 * Part of the ASCEND Library
10 * $Date: 1998/06/24 10:47:06 $
11 * $Revision: 1.2 $
12 * $Author: mthomas $
13 * $Source: /afs/cs.cmu.edu/project/ascend/Repository/models/mix.a4l,v $
14 *
15 * This file is part of the ASCEND Modeling Library.
16 *
17 * Copyright (C) 1998 Duncan Coffey
18 *
19 * The ASCEND Modeling Library is free software; you can redistribute
20 * it and/or modify it under the terms of the GNU General Public
21 * License as published by the Free Software Foundation; either
22 * version 2 of the License, or (at your option) any later version.
23 *
24 * The ASCEND Modeling Library is distributed in hope that it will be
25 * useful, but WITHOUT ANY WARRANTY; without even the implied
26 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
27 * See the GNU General Public License for more details.
28 *
29 * You should have received a copy of the GNU General Public License
30 * along with this program. If not, see <http://www.gnu.org/licenses/>.
31 *)
32
33
34 (* ***********************************+************************************ *)
35 (* ************************ Mixer **************************** *)
36 (* ***********************************+************************************ *)
37 MODEL mixer(
38 inputs WILL_BE set OF symbol_constant;
39 input[inputs] WILL_BE stream;
40 output WILL_BE stream;
41 )WHERE(
42
43 )REFINES cmumodel;
44
45 Ftot_scale ALIASES output.Details.flowscale;
46 Htot_scale ALIASES output.Details.H_flowscale;
47 cd ALIASES output.cd;
48
49 FOR j IN cd.components CREATE
50 output.f[j]/Ftot_scale=SUM[input[k].f[j] | k IN inputs]/Ftot_scale;
51 END FOR;
52
53 output.H_flow/Htot_scale=SUM[input[k].H_flow | k IN inputs]/Htot_scale;
54
55 METHODS
56 METHOD default_self;
57 Ftot_scale :=1000 {mol/s};
58 Htot_scale :=1e6 {J/s};
59 END default_self;
60
61 METHOD default_all;
62 RUN input[inputs].default_all;
63 RUN output.default_all;
64 RUN default_self;
65 END default_all;
66
67 METHOD check_self;
68
69 END check_self;
70
71 METHOD check_all;
72 RUN check_self;
73 END check_all;
74
75 METHOD bound_self;
76 END bound_self;
77
78 METHOD bound_all;
79 END bound_all;
80
81 METHOD scale_self;
82 END scale_self;
83
84 METHOD scale_all;
85 RUN input[inputs].scale_self;
86 RUN output.scale_self;
87 END scale_all;
88
89 METHOD seqmod;
90 RUN output.specify;
91 FREE output.T;
92 FOR i IN cd.components DO
93 FREE output.f[i];
94 END FOR;
95 END seqmod;
96
97 METHOD specify;
98 RUN input[inputs].specify;
99 RUN seqmod;
100 END specify;
101
102 END mixer;
103
104 MODEL mix_test;
105
106 cd IS_A components_data(['methanol','ethanol','water'],'water');
107 pdV IS_A phases_data('V', 'Pitzer_vapor_mixture', 'none', 'none');
108 pdL IS_A phases_data('L', 'none', 'UNIFAC_liquid_mixture','none');
109 pdVL IS_A phases_data('VL', 'Pitzer_vapor_mixture','UNIFAC_liquid_mixture', 'none');
110 equil IS_A boolean;
111
112 output IS_A stream(cd, pdVL, equil);
113
114 inputs IS_A set OF symbol_constant;
115 inputs :== ['input_1','input_2','input_3','input_4'];
116 input[inputs] IS_A stream(cd, pdVL, equil);
117 mix IS_A mixer(inputs, input, output);
118
119 METHODS
120 METHOD check_self;
121 RUN check_all;
122 END check_self;
123
124 METHOD check_all;
125 RUN mix.check_all;
126 END check_all;
127
128 METHOD default_self;
129 RUN default_all;
130 END default_self;
131
132 METHOD default_all;
133 RUN mix.default_all;
134 END default_all;
135
136 METHOD bound_self;
137 RUN bound_all;
138 END bound_self;
139
140 METHOD bound_all;
141 RUN mix.bound_all;
142 END bound_all;
143
144 METHOD scale_self;
145 RUN scale_all;
146 END scale_self;
147
148 METHOD scale_all;
149 RUN mix.scale_all;
150 END scale_all;
151
152 METHOD specify;
153 RUN mix.specify;
154 END specify;
155
156 METHOD values;
157 END values;
158
159 END mix_test;

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22