source: trunk/eml/heat_exchangers/heater.mso @ 316

Last change on this file since 316 was 316, checked in by gerson bicca, 15 years ago

modified heater/cooler model: included energy stream

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.0 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* Author: Gerson Balbueno Bicca
16* $Id: heater.mso 316 2007-07-18 18:50:58Z bicca $
17*--------------------------------------------------------------------*#
18
19using "streams.mso";
20
21Model heater
22
23ATTRIBUTES
24        Pallete         = true;
25        Icon            = "icon/heater";       
26        Brief   = "Heater or Cooler";
27        Info            =
28        "Determines thermal and phase conditions of an outlet stream";
29       
30PARAMETERS
31        outer PP                        as Plugin               (Brief="Physical Properties", Type="PP");
32        outer NComp     as Integer      (Brief="Number of Components");
33                        Ninlet          as Integer      (Brief="Number of Inlet Streams");
34       
35SUBMODELS
36        in  Inlet(Ninlet )  as stream                           (Brief="Inlet Streams");
37        out Outlet              as streamPH                             (Brief="Outlet Stream");
38        in InletHeat            as energy_stream                (Brief ="Inlet Heat Stream");
39        out OutletHeat  as energy_stream                (Brief ="Outlet Heat Stream");
40
41VARIABLES
42        QDuty                                   as power                        (Brief = "Actual Duty");
43        Vfrac                                   as fraction             (Brief = "Vapor fraction Outlet Stream");
44        Lfrac                                           as fraction             (Brief = "Liquid fraction Outlet Stream");
45        Kvalue(NComp)   as Real                         (Brief = "Phase Equilibrium K-values");
46       
47EQUATIONS
48
49"Flow"
50        Outlet.F = sum(Inlet.F);       
51
52for j in [1 : NComp]
53       
54"Composition"
55        Outlet.F*Outlet.z(j) = sum(Inlet.F*Inlet.z(j));
56       
57end
58
59"Vapor fraction Outlet Stream"
60        Vfrac = Outlet.v;
61
62"Liquid fraction Outlet Stream"
63        Lfrac = 1-Vfrac;
64
65"Heat Duty"
66        QDuty = Outlet.F*Outlet.h - sum(Inlet.F*Inlet.h);
67
68"Net Duty"
69        OutletHeat.Q = InletHeat.Q - QDuty;
70
71"Phase Equilibrium"
72        Kvalue*(Outlet.x) = Outlet.y;
73
74end
75
Note: See TracBrowser for help on using the repository browser.