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

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

added a switcher parameter for Kvalues options: must be fixed later

  • 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* Author: Gerson Balbueno Bicca
16* $Id: heater.mso 319 2007-07-19 18:37:06Z 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        Kvalues          as Switcher (Brief="Option for Display Phase Equilibrium K-values",Valid=["yes","no"], Default="yes");
35       
36SUBMODELS
37        in  Inlet(Ninlet )  as stream                           (Brief="Inlet Streams");
38        out Outlet              as streamPH                             (Brief="Outlet Stream");
39        in InletHeat            as energy_stream                (Brief ="Inlet Heat Stream");
40        out OutletHeat  as energy_stream                (Brief ="Outlet Heat Stream");
41
42VARIABLES
43        QDuty                                   as power                        (Brief = "Actual Duty");
44        Vfrac                                   as fraction             (Brief = "Vapor fraction Outlet Stream");
45        Lfrac                                           as fraction             (Brief = "Liquid fraction Outlet Stream");
46        Kvalue(NComp)   as Real                         (Brief = "Phase Equilibrium K-values");
47       
48EQUATIONS
49
50"Flow"
51        Outlet.F = sum(Inlet.F);       
52
53for j in [1 : NComp]
54       
55"Composition"
56        Outlet.F*Outlet.z(j) = sum(Inlet.F*Inlet.z(j));
57       
58end
59
60"Vapor fraction Outlet Stream"
61        Vfrac = Outlet.v;
62
63"Liquid fraction Outlet Stream"
64        Lfrac = 1-Vfrac;
65
66"Heat Duty"
67        QDuty = Outlet.F*Outlet.h - sum(Inlet.F*Inlet.h);
68
69"Net Duty"
70        OutletHeat.Q = InletHeat.Q - QDuty;
71
72switch Kvalues # Fix for better convergence !!!
73        case "yes":
74"K-values Phase Equilibrium"
75        Kvalue*(Outlet.x) = Outlet.y;
76
77        case "no":
78"K-values Phase Equilibrium"
79        Kvalue = 1;
80
81end
82       
83end
84
Note: See TracBrowser for help on using the repository browser.