source: branches/gui/sample/reactors/sample_gibbs.mso @ 832

Last change on this file since 832 was 426, checked in by Rodolfo Rodrigues, 16 years ago

Updated to use vol_tank.mso

File size: 2.7 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* Sample of a Gibbs reactor
17*----------------------------------------------------------------------
18*
19* This sample file needs VRTherm (www.vrtech.com.br) to run.
20*
21*----------------------------------------------------------------------
22*
23*       This is a sample based on a problem of the book "Introduction to
24* Chemical Engineering Thermodynamics" by Smith, Van Ness and Abbott,
25* 5th ed., 1996.
26*
27*----------------------------------------------------------------------
28* Author: Rodolfo Rodrigues
29* $Id$
30*--------------------------------------------------------------------*#
31
32using "reactors/gibbs";
33
34
35#*---------------------------------------------------------------------
36* Problem 15.13 - p.543 (Brazilian edition)
37*
38* System in gasosous fase contents CH4, H2O, CO, CO2, and H2
39*
40* Initial conditions
41*   1bar, 1000K, 2mol of CH4 and 3mol of H2O
42*
43* Specify
44*       Outlet.T
45*       Outlet.P
46*
47* Return
48*       Outlet.z
49---------------------------------------------------------------------*#
50
51FlowSheet sample_gibbs_vap
52        PARAMETERS
53        PP              as Plugin(Brief="External physical properties", Type="PP",
54                        Components = ["methane","water","carbon monoxide","carbon dioxide","hydrogen"],
55                        LiquidModel = "IdealLiquid",
56                        VapourModel = "Ideal");
57        NComp   as Integer;
58        NElem   as Integer;
59       
60        DEVICES
61        Fin     as source;
62        R               as gibbs_vap; # gibbs reactor
63
64        CONNECTIONS
65        Fin.Outlet      to R.Inlet;
66       
67        SET
68        NComp = PP.NumberOfComponents; # CH4, H2O, CO, CO2, H2
69        NElem = 3; # C, O, H
70       
71        R.na(:,1) = [1.0, 0.0, 4.0]; # CH4
72        R.na(:,2) = [0.0, 1.0, 2.0]; # H2O
73        R.na(:,3) = [1.0, 1.0, 0.0]; # CO
74        R.na(:,4) = [1.0, 2.0, 0.0]; # CO2
75        R.na(:,5) = [0.0, 0.0, 2.0]; # H2
76
77        SPECIFY
78        Fin.Outlet.F = 5*'kmol/h';
79        Fin.Outlet.z = [0.4, 0.6, 0.0, 0.0, 0.0];
80        Fin.Outlet.P = 1*'atm';
81        Fin.Outlet.T = 1000*'K';
82       
83        R.Outlet.F = 5*'kmol/h'*sqrt(R.Tank.Level/'m');
84        R.Outlet.P = 1*'atm';
85        R.Outlet.T = Fin.Outlet.T;
86
87        R.Tank.Across = 5*'m^2';
88        R.Tank.L = 1.5*'m';
89       
90        INITIAL
91        R.Outletm.T = 1000*'K';
92        R.M = [2, 3, 0, 0, 0]*'kmol';
93       
94        OPTIONS
95        Dynamic = false;
96        NLASolver(File="sundials",
97                          RelativeAccuracy=1e-6,
98                          AbsoluteAccuracy=1e-8);
99end
Note: See TracBrowser for help on using the repository browser.