source: trunk/eml/reactors/cstr.mso @ 233

Last change on this file since 233 was 208, checked in by Argimiro Resende Secchi, 16 years ago

Fix more sample problems to new language.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.3 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* Model of cstr reactor
17*--------------------------------------------------------------------
18* Author: Paula B. Staudt
19* $Id: cstr.mso 208 2007-03-15 05:18:39Z arge $
20*--------------------------------------------------------------------*#
21
22using "streams";
23
24Model cstr_basic
25
26ATTRIBUTES
27        Pallete         = false;
28        Brief           = "Brief";
29        Info            =
30        "write some information";
31       
32PARAMETERS
33
34outer   NComp                                           as Integer      (Brief = "Number Of Components");
35                NReac                                           as Integer      (Brief = "Number Of Reactions");
36                stoic(NComp, NReac)     as Real                 (Brief = "Stoichiometric Matrix");
37
38VARIABLES
39
40in              Inlet   as stream               (Brief="Inlet Stream");
41out     Outlet  as streamPH     (Brief="Outlet Stream");
42
43        q                       as heat_rate    (Brief="Heat");
44        Vr                      as volume               (Brief="Reacting Volume");
45        M                       as mol                  (Brief = "Molar total amount");
46        C(NComp)        as conc_mol     (Brief="Components concentration");
47
48EQUATIONS
49
50"Molar Concentration"
51        Outlet.z * M = C * Vr;
52
53"Molar fraction"
54    sum(Outlet.z) = 1;
55end
56
57Model cstr_yield as cstr_basic
58
59ATTRIBUTES
60        Pallete         = true;
61        Brief           = "Brief";
62        Info            =
63        "write some information";
64       
65PARAMETERS
66       
67        yield(NReac) as fraction (Brief="Yield");
68       
69EQUATIONS
70
71        Outlet.z*Outlet.F = Inlet.z*Inlet.F * sumt(stoic*(1-yield));
72
73"Reactor Energy Balance"
74        diff(M*Outlet.h) = Inlet.F*Inlet.h - Outlet.F*Outlet.h - q;
75
76end
77
78
79Model cstr as cstr_basic
80       
81ATTRIBUTES
82        Pallete         = true;
83        Brief           = "Brief";
84        Info            =
85        "write some information";
86
87VARIABLES
88       
89        r(NReac)        as reaction_mol         (Brief="Molar Reaction Rate");
90        Hr(NReac)       as heat_reaction        (Brief="Heat Reaction");
91       
92EQUATIONS
93
94"Component Molar Balance"
95        diff(Outlet.z*M) = (Inlet.F*Inlet.z - Outlet.F*Outlet.z) + sumt(stoic*r)*Vr;
96
97"Reactor Energy Balance"
98        diff(M*Outlet.h) = Inlet.F*Inlet.h - Outlet.F*Outlet.h +sum(Hr*sum(stoic*r))*Vr - q; #FIXME sum(sum())
99
100end
Note: See TracBrowser for help on using the repository browser.