source: branches/gui/eml/mixers_splitters/mixer.mso @ 991

Last change on this file since 991 was 739, checked in by gerson bicca, 14 years ago

updates (changes in icons/models/samples)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.2 KB
Line 
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 739 2009-02-27 22:18:32Z bicca $
19*--------------------------------------------------------------------*#
20
21using "streams";
22
23Model mixer2
24        ATTRIBUTES
25        Pallete         = true;
26        Icon            = "icon/mixer";
27        Brief           = "Model of a mixer with 2 inputs";
28        Info            =
29"== Assumptions ==
30* static
31* adiabatic
32
33== Specify ==
34* the inlet streams";
35       
36VARIABLES
37
38in  Inlet1 as stream (Brief = "Inlet stream 1", PosX=0, PosY=0.25, Symbol="_{in1}");
39in  Inlet2 as stream (Brief = "Inlet stream 2", PosX=0, PosY=0.75, Symbol="_{in2}");
40out Outlet as streamPH (Brief = "Outlet stream", PosX=1, PosY=0.5059, Symbol="_{out}");
41       
42EQUATIONS
43       
44"Flow"
45        Outlet.F = Inlet1.F + Inlet2.F;
46
47"Composition"
48    Outlet.F*Outlet.z = Inlet1.F*Inlet1.z + Inlet2.F*Inlet2.z;
49
50"Energy Balance"
51        Outlet.F*Outlet.h = Inlet1.F*Inlet1.h + Inlet2.F*Inlet2.h;
52
53"Pressure"
54        Outlet.P = min([Inlet1.P, Inlet2.P]);
55       
56end
57
58Model mixer3
59        ATTRIBUTES
60        Pallete         = true;
61        Icon            = "icon/mixer";
62        Brief           = "Model of a mixer with 2 inputs";
63        Info            =
64"== Assumptions ==
65* static
66* adiabatic
67
68== Specify ==
69* the inlet streams";
70       
71VARIABLES
72in  Inlet1 as stream (Brief = "Inlet stream 1", PosX=0, PosY=0.25, Symbol="_{in1}");
73in  Inlet2 as stream (Brief = "Inlet stream 2", PosX=0, PosY=0.5059, Symbol="_{in2}");
74in  Inlet3 as stream (Brief = "Inlet stream 3", PosX=0, PosY=0.75, Symbol="_{in3}");
75out Outlet as streamPH (Brief = "Outlet stream", PosX=1, PosY=0.5059, Symbol="_{out}");
76       
77EQUATIONS
78       
79"Flow"
80        Outlet.F = Inlet1.F + Inlet2.F + Inlet3.F;
81
82"Composition"
83    Outlet.F*Outlet.z = Inlet1.F*Inlet1.z + Inlet2.F*Inlet2.z + Inlet3.F*Inlet3.z;
84
85"Energy Balance"
86        Outlet.F*Outlet.h = Inlet1.F*Inlet1.h + Inlet2.F*Inlet2.h + Inlet3.F*Inlet3.h;
87
88"Pressure"
89        Outlet.P = min([Inlet1.P, Inlet2.P , Inlet3.P]);
90
91end
92
93Model mixer_n
94        ATTRIBUTES
95        Pallete         = false;
96        Icon            = "icon/mixer";
97        Brief           = "Model of a generic mixer (NOT Handled By the GUI) ";
98        Info            =
99"== Assumptions ==
100* static
101* adiabatic
102
103== Specify ==
104* the inlet streams";
105       
106        PARAMETERS
107outer NComp as Integer (Brief = "Number of chemical components", Lower = 1);
108          Ninlet as Integer (Brief = "Number of Inlet Streams", Lower = 1, Default = 2);
109       
110        VARIABLES
111in  Inlet(Ninlet) as stream (Brief = "Inlet streams", PosX=0, PosY=0.5, Symbol="_{inMix}");
112out Outlet                      as streamPH (Brief = "Outlet stream", PosX=1, PosY=0.5059, Symbol="_{out}");
113       
114        EQUATIONS
115       
116        "Flow"
117        Outlet.F = sum(Inlet.F);
118
119        for i in [1:NComp] do
120       
121                "Composition"
122        Outlet.F*Outlet.z(i) = sum(Inlet.F*Inlet.z(i));
123    end
124
125        "Energy Balance"
126        Outlet.F*Outlet.h = sum(Inlet.F*Inlet.h);
127
128        "Pressure"
129        Outlet.P = min(Inlet.P);
130end
Note: See TracBrowser for help on using the repository browser.