1 | #*------------------------------------------------------------------- |
---|
2 | * EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC. |
---|
3 | * |
---|
4 | * This LIBRARY is free software; you can distribute it and/or modify |
---|
5 | * it under the therms of the ALSOC FREE LICENSE as available at |
---|
6 | * http://www.enq.ufrgs.br/alsoc. |
---|
7 | * |
---|
8 | * EMSO Copyright (C) 2004 - 2007 ALSOC, original code |
---|
9 | * from http://www.rps.eng.br Copyright (C) 2002-2004. |
---|
10 | * All rights reserved. |
---|
11 | * |
---|
12 | * EMSO is distributed under the therms of the ALSOC LICENSE as |
---|
13 | * available at http://www.enq.ufrgs.br/alsoc. |
---|
14 | * |
---|
15 | *------------------------------------------------------------------- |
---|
16 | * Author: Rafael de Pelegrini Soares |
---|
17 | * Maurício Carvalho Maciel |
---|
18 | * $Id: mixer.mso 574 2008-07-25 14:18:50Z rafael $ |
---|
19 | *--------------------------------------------------------------------*# |
---|
20 | |
---|
21 | using "streams"; |
---|
22 | |
---|
23 | Model mixer |
---|
24 | ATTRIBUTES |
---|
25 | Pallete = true; |
---|
26 | Icon = "icon/mixer"; |
---|
27 | Brief = "Model of a mixer"; |
---|
28 | Info = |
---|
29 | "== Assumptions == |
---|
30 | * static |
---|
31 | * adiabatic |
---|
32 | |
---|
33 | == Specify == |
---|
34 | * the inlet streams"; |
---|
35 | |
---|
36 | VARIABLES |
---|
37 | in Inlet1 as stream (Brief = "Inlet stream 1", PosX=0, PosY=0.25, Symbol="_{in1}"); |
---|
38 | in Inlet2 as stream (Brief = "Inlet stream 2", PosX=0, PosY=0.75, Symbol="_{in2}"); |
---|
39 | out Outlet as streamPH (Brief = "Outlet stream", PosX=1, PosY=0.5059, Symbol="_{out}"); |
---|
40 | |
---|
41 | EQUATIONS |
---|
42 | |
---|
43 | "Flow" |
---|
44 | Outlet.F = Inlet1.F + Inlet2.F; |
---|
45 | |
---|
46 | "Composition" |
---|
47 | Outlet.F*Outlet.z = Inlet1.F*Inlet1.z + Inlet2.F*Inlet2.z; |
---|
48 | |
---|
49 | "Energy Balance" |
---|
50 | Outlet.F*Outlet.h = Inlet1.F*Inlet1.h + Inlet2.F*Inlet2.h; |
---|
51 | |
---|
52 | "Pressure" |
---|
53 | Outlet.P = min([Inlet1.P, Inlet2.P]); |
---|
54 | end |
---|
55 | |
---|
56 | Model mixer_n |
---|
57 | ATTRIBUTES |
---|
58 | Pallete = true; |
---|
59 | Icon = "icon/mixer"; |
---|
60 | Brief = "Model of a mixer"; |
---|
61 | Info = |
---|
62 | "== Assumptions == |
---|
63 | * static |
---|
64 | * adiabatic |
---|
65 | |
---|
66 | == Specify == |
---|
67 | * the inlet streams"; |
---|
68 | |
---|
69 | PARAMETERS |
---|
70 | outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); |
---|
71 | Ninlet as Integer (Brief = "Number of Inlet Streams", Lower = 1, Default = 2); |
---|
72 | |
---|
73 | VARIABLES |
---|
74 | in Inlet(Ninlet) as stream (Brief = "Inlet streams", PosX=0, PosY=0.5, Symbol="_{inMix}"); |
---|
75 | out Outlet as streamPH (Brief = "Outlet stream", PosX=1, PosY=0.5059, Symbol="_{out}"); |
---|
76 | |
---|
77 | EQUATIONS |
---|
78 | |
---|
79 | "Flow" |
---|
80 | Outlet.F = sum(Inlet.F); |
---|
81 | |
---|
82 | for i in [1:NComp] do |
---|
83 | |
---|
84 | "Composition" |
---|
85 | Outlet.F*Outlet.z(i) = sum(Inlet.F*Inlet.z(i)); |
---|
86 | end |
---|
87 | |
---|
88 | "Energy Balance" |
---|
89 | Outlet.F*Outlet.h = sum(Inlet.F*Inlet.h); |
---|
90 | |
---|
91 | "Pressure" |
---|
92 | Outlet.P = min(Inlet.P); |
---|
93 | end |
---|