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 | * Model of cstr reactor |
---|
17 | *-------------------------------------------------------------------- |
---|
18 | * Author: Paula B. Staudt |
---|
19 | * $Id: cstr.mso 403 2007-11-16 15:43:31Z arge $ |
---|
20 | *--------------------------------------------------------------------*# |
---|
21 | |
---|
22 | using "streams"; |
---|
23 | |
---|
24 | Model cstr_basic |
---|
25 | |
---|
26 | ATTRIBUTES |
---|
27 | ATTRIBUTES |
---|
28 | Pallete = false; |
---|
29 | Brief = "Basic model for a CSTR reactor"; |
---|
30 | |
---|
31 | PARAMETERS |
---|
32 | |
---|
33 | outer NComp as Integer (Brief = "Number Of Components"); |
---|
34 | NReac as Integer (Brief = "Number Of Reactions"); |
---|
35 | stoic(NComp, NReac) as Real (Brief = "Stoichiometric Matrix"); |
---|
36 | |
---|
37 | VARIABLES |
---|
38 | |
---|
39 | in Inlet as stream (Brief="Inlet Stream", PosX=0, PosY=0, Symbol="_{in}"); |
---|
40 | out Outlet as streamPH (Brief="Outlet Stream", PosX=1, PosY=1, Symbol="_{out}"); |
---|
41 | |
---|
42 | q as heat_rate (Brief="Heat"); |
---|
43 | Vr as volume (Brief="Reacting Volume"); |
---|
44 | M as mol (Brief = "Molar total amount"); |
---|
45 | C(NComp) as conc_mol (Brief="Components concentration"); |
---|
46 | |
---|
47 | EQUATIONS |
---|
48 | |
---|
49 | "Molar Concentration" |
---|
50 | Outlet.z * M = C * Vr; |
---|
51 | |
---|
52 | "Molar fraction" |
---|
53 | sum(Outlet.z) = 1; |
---|
54 | end |
---|
55 | |
---|
56 | Model cstr_yield as cstr_basic |
---|
57 | |
---|
58 | ATTRIBUTES |
---|
59 | ATTRIBUTES |
---|
60 | Pallete = true; |
---|
61 | Icon = "icon/cstr"; |
---|
62 | Brief = "Model of a CSTR with given yield"; |
---|
63 | |
---|
64 | PARAMETERS |
---|
65 | |
---|
66 | yield(NReac) as fraction (Brief="Yield"); |
---|
67 | |
---|
68 | EQUATIONS |
---|
69 | |
---|
70 | Outlet.z*Outlet.F = Inlet.z*Inlet.F * sumt(stoic*(1-yield)); |
---|
71 | |
---|
72 | "Reactor Energy Balance" |
---|
73 | diff(M*Outlet.h) = Inlet.F*Inlet.h - Outlet.F*Outlet.h - q; |
---|
74 | |
---|
75 | end |
---|
76 | |
---|
77 | |
---|
78 | Model cstr as cstr_basic |
---|
79 | |
---|
80 | ATTRIBUTES |
---|
81 | Pallete = true; |
---|
82 | Icon = "icon/cstr"; |
---|
83 | Brief = "Model of a generic CSTR"; |
---|
84 | Info = " |
---|
85 | Requires the information of: |
---|
86 | * Reaction values |
---|
87 | * Heat of reaction |
---|
88 | "; |
---|
89 | |
---|
90 | VARIABLES |
---|
91 | |
---|
92 | r(NReac) as reaction_mol (Brief="Molar Reaction Rate"); |
---|
93 | Hr(NReac) as heat_reaction (Brief="Heat Reaction"); |
---|
94 | |
---|
95 | EQUATIONS |
---|
96 | |
---|
97 | "Component Molar Balance" |
---|
98 | diff(Outlet.z*M) = (Inlet.F*Inlet.z - Outlet.F*Outlet.z) + sumt(stoic*r)*Vr; |
---|
99 | |
---|
100 | "Reactor Energy Balance" |
---|
101 | diff(M*Outlet.h) = Inlet.F*Inlet.h - Outlet.F*Outlet.h +sum(Hr*sum(stoic*r))*Vr - q; #FIXME sum(sum()) |
---|
102 | |
---|
103 | end |
---|