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: Maurício Carvalho Maciel |
---|
17 | * $Id: mixer.mso 400 2007-11-09 21:41:38Z bicca $ |
---|
18 | *--------------------------------------------------------------------*# |
---|
19 | |
---|
20 | using "streams"; |
---|
21 | |
---|
22 | Model mixer |
---|
23 | ATTRIBUTES |
---|
24 | Pallete = true; |
---|
25 | Icon = "icon/mixer"; |
---|
26 | Brief = "Model of a mixer"; |
---|
27 | Info = |
---|
28 | "== Assumptions == |
---|
29 | * static |
---|
30 | * adiabatic |
---|
31 | |
---|
32 | == Specify == |
---|
33 | * the inlet streams"; |
---|
34 | |
---|
35 | PARAMETERS |
---|
36 | outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); |
---|
37 | Ninlet as Integer (Brief = "Number of Inlet Streams", Lower = 1, Default = 2); |
---|
38 | |
---|
39 | VARIABLES |
---|
40 | in Inlet(Ninlet) as stream (Brief = "Inlet streams", PosX=0, PosY=0.5, Symbol="_{inMix}"); |
---|
41 | out Outlet as streamPH (Brief = "Outlet stream", PosX=1, PosY=0.5059, Symbol="_{out}"); |
---|
42 | |
---|
43 | EQUATIONS |
---|
44 | |
---|
45 | "Flow" |
---|
46 | Outlet.F = sum(Inlet.F); |
---|
47 | |
---|
48 | for i in [1:NComp] |
---|
49 | |
---|
50 | "Composition" |
---|
51 | Outlet.F*Outlet.z(i) = sum(Inlet.F*Inlet.z(i)); |
---|
52 | end |
---|
53 | |
---|
54 | "Energy Balance" |
---|
55 | Outlet.F*Outlet.h = sum(Inlet.F*Inlet.h); |
---|
56 | |
---|
57 | "Pressure" |
---|
58 | Outlet.P = min(Inlet.P); |
---|
59 | end |
---|