[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 738 2009-02-27 04:26:23Z bicca $ |
---|
| 17 | *--------------------------------------------------------------------*# |
---|
| 18 | |
---|
[325] | 19 | using "streams"; |
---|
[1] | 20 | |
---|
[738] | 21 | Model heater |
---|
[139] | 22 | |
---|
[325] | 23 | ATTRIBUTES |
---|
[738] | 24 | Pallete = true; |
---|
| 25 | Icon = "icon/heater"; |
---|
| 26 | Brief = "Heater"; |
---|
[139] | 27 | Info = |
---|
[358] | 28 | "Determines thermal and phase conditions of an outlet stream. |
---|
[738] | 29 | |
---|
| 30 | == Specify == |
---|
| 31 | * The Inlet stream |
---|
| 32 | * Specify: |
---|
| 33 | **The outlet temperature and the outlet pressure or |
---|
| 34 | ** The outlet temperature and the inlet energy stream or |
---|
| 35 | ** The outlet pressure and the inlet energy stream |
---|
[358] | 36 | "; |
---|
[316] | 37 | |
---|
[325] | 38 | PARAMETERS |
---|
[602] | 39 | outer PP as Plugin (Brief="Physical Properties", Type="PP"); |
---|
[325] | 40 | outer NComp as Integer (Brief="Number of Components"); |
---|
[602] | 41 | Kvalues as Switcher (Brief="Option for Display Phase Equilibrium K-values",Valid=["yes","no"], Default="yes"); |
---|
[325] | 42 | |
---|
| 43 | VARIABLES |
---|
[602] | 44 | Duty as power (Brief = "Actual Duty",Symbol="Q_{Duty}"); |
---|
| 45 | Vfrac as fraction (Brief = "Vapor fraction Outlet Stream",Symbol="V_{frac}"); |
---|
| 46 | Lfrac as fraction (Brief = "Liquid fraction Outlet Stream",Symbol="L_{frac}"); |
---|
| 47 | Kvalue(NComp) as Real (Brief = "Phase Equilibrium K-values",Lower=1E-30,Upper=1E30,Symbol="K_{value}"); |
---|
| 48 | Pratio as positive (Brief = "Pressure Ratio", Symbol ="P_{ratio}"); |
---|
| 49 | Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P"); |
---|
| 50 | |
---|
[738] | 51 | in Inlet as stream (Brief = "Inlet Stream", PosX=0, PosY=0.40, Symbol="^{in}"); |
---|
| 52 | out Outlet as streamPH (Brief = "Outlet Stream", PosX=1, PosY=0.40, Symbol="^{out}"); |
---|
| 53 | in Heat as power (Brief ="Inlet Heat Stream", PosX=0.5, PosY=1, Symbol="_{out}"); |
---|
| 54 | |
---|
[325] | 55 | EQUATIONS |
---|
[1] | 56 | |
---|
[325] | 57 | "Flow" |
---|
[602] | 58 | Outlet.F = Inlet.F; |
---|
[316] | 59 | |
---|
[574] | 60 | for j in [1 : NComp] do |
---|
[1] | 61 | |
---|
[325] | 62 | "Composition" |
---|
[602] | 63 | Outlet.F*Outlet.z(j) = Inlet.F*Inlet.z(j); |
---|
[1] | 64 | |
---|
[325] | 65 | end |
---|
[1] | 66 | |
---|
[325] | 67 | "Vapor fraction Outlet Stream" |
---|
[135] | 68 | Vfrac = Outlet.v; |
---|
[26] | 69 | |
---|
[325] | 70 | "Liquid fraction Outlet Stream" |
---|
[26] | 71 | Lfrac = 1-Vfrac; |
---|
[1] | 72 | |
---|
[325] | 73 | "Heat Duty" |
---|
[602] | 74 | Duty = Outlet.F*Outlet.h - Inlet.F*Inlet.h; |
---|
[139] | 75 | |
---|
[372] | 76 | "Pressure Drop" |
---|
| 77 | Outlet.P = Inlet.P - Pdrop; |
---|
| 78 | |
---|
| 79 | "Pressure Ratio" |
---|
| 80 | Outlet.P = Inlet.P * Pratio; |
---|
| 81 | |
---|
[325] | 82 | switch Kvalues # Fix for better convergence !!! |
---|
[602] | 83 | |
---|
[319] | 84 | case "yes": |
---|
[325] | 85 | "K-values Phase Equilibrium" |
---|
[326] | 86 | Kvalue*Outlet.x = Outlet.y; |
---|
[316] | 87 | |
---|
[319] | 88 | case "no": |
---|
[325] | 89 | "K-values Phase Equilibrium" |
---|
[319] | 90 | Kvalue = 1; |
---|
| 91 | |
---|
[325] | 92 | end |
---|
[602] | 93 | |
---|
[738] | 94 | "Duty Specification" |
---|
| 95 | Heat = Duty; |
---|
| 96 | |
---|
[1] | 97 | end |
---|
[325] | 98 | |
---|
[738] | 99 | Model cooler |
---|
[325] | 100 | |
---|
| 101 | ATTRIBUTES |
---|
| 102 | Pallete = true; |
---|
[738] | 103 | Icon = "icon/cooler"; |
---|
| 104 | Brief = "Cooler"; |
---|
[325] | 105 | Info = |
---|
[358] | 106 | "Determines thermal and phase conditions of an outlet stream. |
---|
[325] | 107 | |
---|
[358] | 108 | == Specify == |
---|
[602] | 109 | * The Inlet stream |
---|
[358] | 110 | * Specify: |
---|
| 111 | **The outlet temperature and the outlet pressure or |
---|
| 112 | ** The outlet temperature and the inlet energy stream or |
---|
| 113 | ** The outlet pressure and the inlet energy stream |
---|
| 114 | "; |
---|
| 115 | |
---|
[738] | 116 | PARAMETERS |
---|
| 117 | outer PP as Plugin (Brief="Physical Properties", Type="PP"); |
---|
| 118 | outer NComp as Integer (Brief="Number of Components"); |
---|
| 119 | Kvalues as Switcher (Brief="Option for Display Phase Equilibrium K-values",Valid=["yes","no"], Default="yes"); |
---|
| 120 | |
---|
[325] | 121 | VARIABLES |
---|
[738] | 122 | Duty as power (Brief = "Actual Duty",Symbol="Q_{Duty}"); |
---|
| 123 | Vfrac as fraction (Brief = "Vapor fraction Outlet Stream",Symbol="V_{frac}"); |
---|
| 124 | Lfrac as fraction (Brief = "Liquid fraction Outlet Stream",Symbol="L_{frac}"); |
---|
| 125 | Kvalue(NComp) as Real (Brief = "Phase Equilibrium K-values",Lower=1E-30,Upper=1E30,Symbol="K_{value}"); |
---|
| 126 | Pratio as positive (Brief = "Pressure Ratio", Symbol ="P_{ratio}"); |
---|
| 127 | Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P"); |
---|
[325] | 128 | |
---|
[738] | 129 | in Inlet as stream (Brief = "Inlet Stream", PosX=0, PosY=0.615, Symbol="^{in}"); |
---|
| 130 | out Outlet as streamPH (Brief = "Outlet Stream", PosX=1, PosY=0.615, Symbol="^{out}"); |
---|
| 131 | out Heat as power (Brief ="Inlet Heat Stream", PosX=0.5, PosY=0, Symbol="_{out}"); |
---|
[546] | 132 | |
---|
[325] | 133 | EQUATIONS |
---|
[546] | 134 | |
---|
[738] | 135 | "Flow" |
---|
| 136 | Outlet.F = Inlet.F; |
---|
[602] | 137 | |
---|
[738] | 138 | for j in [1 : NComp] do |
---|
| 139 | |
---|
| 140 | "Composition" |
---|
| 141 | Outlet.F*Outlet.z(j) = Inlet.F*Inlet.z(j); |
---|
| 142 | |
---|
| 143 | end |
---|
[1] | 144 | |
---|
[738] | 145 | "Vapor fraction Outlet Stream" |
---|
| 146 | Vfrac = Outlet.v; |
---|
[325] | 147 | |
---|
[738] | 148 | "Liquid fraction Outlet Stream" |
---|
| 149 | Lfrac = 1-Vfrac; |
---|
[325] | 150 | |
---|
[738] | 151 | "Heat Duty" |
---|
| 152 | Duty = Outlet.F*Outlet.h - Inlet.F*Inlet.h; |
---|
[358] | 153 | |
---|
[738] | 154 | "Pressure Drop" |
---|
| 155 | Outlet.P = Inlet.P - Pdrop; |
---|
[325] | 156 | |
---|
[738] | 157 | "Pressure Ratio" |
---|
| 158 | Outlet.P = Inlet.P * Pratio; |
---|
| 159 | |
---|
| 160 | switch Kvalues # Fix for better convergence !!! |
---|
[546] | 161 | |
---|
[738] | 162 | case "yes": |
---|
| 163 | "K-values Phase Equilibrium" |
---|
| 164 | Kvalue*Outlet.x = Outlet.y; |
---|
[546] | 165 | |
---|
[738] | 166 | case "no": |
---|
| 167 | "K-values Phase Equilibrium" |
---|
| 168 | Kvalue = 1; |
---|
| 169 | |
---|
| 170 | end |
---|
| 171 | |
---|
| 172 | |
---|
[602] | 173 | "Duty Specification" |
---|
| 174 | Heat = -Duty; |
---|
| 175 | |
---|
[325] | 176 | end |
---|