[78] | 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. |
---|
[1] | 14 | *---------------------------------------------------------------------- |
---|
| 15 | * Author: Gerson Balbueno Bicca |
---|
| 16 | * $Id: heater.mso 284 2007-06-16 22:23:13Z bicca $ |
---|
| 17 | *--------------------------------------------------------------------*# |
---|
| 18 | |
---|
| 19 | using "streams.mso"; |
---|
| 20 | |
---|
| 21 | Model Heater_Cooler_Basic |
---|
[139] | 22 | |
---|
| 23 | ATTRIBUTES |
---|
| 24 | Pallete = false; |
---|
| 25 | Brief = "Heater or Cooler Basic Equations"; |
---|
| 26 | Info = |
---|
[197] | 27 | "Determines thermal and phase conditions of outlet stream"; |
---|
[26] | 28 | |
---|
[1] | 29 | PARAMETERS |
---|
[176] | 30 | outer PP as Plugin (Brief="Physical Properties", Type="PP"); |
---|
[133] | 31 | outer NComp as Integer (Brief="Number of Components"); |
---|
| 32 | Ninlet as Integer (Brief="Number of Inlet Streams",Lower=1); |
---|
[1] | 33 | |
---|
| 34 | VARIABLES |
---|
[133] | 35 | in Inlet(Ninlet) as stream (Brief="Inlet Streams"); |
---|
[179] | 36 | out Outlet as streamPH (Brief="Outlet Stream"); |
---|
[133] | 37 | Q as power (Brief = "Heat Transfer"); |
---|
| 38 | Vfrac as fraction (Brief = "Vapor fraction Outlet Stream"); |
---|
| 39 | Lfrac as fraction (Brief = "Liquid fraction Outlet Stream"); |
---|
[1] | 40 | |
---|
| 41 | EQUATIONS |
---|
| 42 | |
---|
| 43 | "Flow" |
---|
| 44 | Outlet.F = sum(Inlet.F); |
---|
| 45 | |
---|
| 46 | for j in [1 : NComp] |
---|
| 47 | |
---|
| 48 | "Composition" |
---|
| 49 | Outlet.F*Outlet.z(j) = sum(Inlet.F*Inlet.z(j)); |
---|
| 50 | |
---|
| 51 | end |
---|
| 52 | |
---|
[135] | 53 | "Vapor fraction Outlet Stream" |
---|
| 54 | Vfrac = Outlet.v; |
---|
[26] | 55 | |
---|
| 56 | "Liquid fraction Outlet Stream" |
---|
| 57 | Lfrac = 1-Vfrac; |
---|
[1] | 58 | |
---|
| 59 | end |
---|
| 60 | |
---|
[168] | 61 | Model heater as Heater_Cooler_Basic |
---|
[139] | 62 | |
---|
| 63 | ATTRIBUTES |
---|
| 64 | Pallete = true; |
---|
[284] | 65 | Brief = "Model of a Heater"; |
---|
[139] | 66 | Info = |
---|
[284] | 67 | "This model determines thermal and phase conditions of outlet stream"; |
---|
[139] | 68 | |
---|
[1] | 69 | EQUATIONS |
---|
| 70 | |
---|
| 71 | "Heat Duty" |
---|
| 72 | Q = Outlet.F*Outlet.h-sum(Inlet.F*Inlet.h); |
---|
| 73 | |
---|
| 74 | end |
---|
| 75 | |
---|
[168] | 76 | Model cooler as Heater_Cooler_Basic |
---|
[139] | 77 | |
---|
| 78 | ATTRIBUTES |
---|
| 79 | Pallete = true; |
---|
[284] | 80 | Brief = "Model of a Cooler"; |
---|
[139] | 81 | Info = |
---|
[284] | 82 | "This model determines thermal and phase conditions of outlet stream"; |
---|
[139] | 83 | |
---|
[1] | 84 | EQUATIONS |
---|
| 85 | |
---|
| 86 | "Heat Duty" |
---|
| 87 | Q = sum(Inlet.F*Inlet.h)- Outlet.F*Outlet.h; |
---|
| 88 | |
---|
| 89 | end |
---|