#*------------------------------------------------------------------- * EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC. * * This LIBRARY is free software; you can distribute it and/or modify * it under the therms of the ALSOC FREE LICENSE as available at * http://www.enq.ufrgs.br/alsoc. * * EMSO Copyright (C) 2004 - 2007 ALSOC, original code * from http://www.rps.eng.br Copyright (C) 2002-2004. * All rights reserved. * * EMSO is distributed under the therms of the ALSOC LICENSE as * available at http://www.enq.ufrgs.br/alsoc. *---------------------------------------------------------------------- * Author: Gerson Balbueno Bicca * \$Id: heater.mso 284 2007-06-16 22:23:13Z bicca \$ *--------------------------------------------------------------------*# using "streams.mso"; Model Heater_Cooler_Basic ATTRIBUTES Pallete = false; Brief = "Heater or Cooler Basic Equations"; Info = "Determines thermal and phase conditions of outlet stream"; PARAMETERS outer PP as Plugin (Brief="Physical Properties", Type="PP"); outer NComp as Integer (Brief="Number of Components"); Ninlet as Integer (Brief="Number of Inlet Streams",Lower=1); VARIABLES in Inlet(Ninlet) as stream (Brief="Inlet Streams"); out Outlet as streamPH (Brief="Outlet Stream"); Q as power (Brief = "Heat Transfer"); Vfrac as fraction (Brief = "Vapor fraction Outlet Stream"); Lfrac as fraction (Brief = "Liquid fraction Outlet Stream"); EQUATIONS "Flow" Outlet.F = sum(Inlet.F); for j in [1 : NComp] "Composition" Outlet.F*Outlet.z(j) = sum(Inlet.F*Inlet.z(j)); end "Vapor fraction Outlet Stream" Vfrac = Outlet.v; "Liquid fraction Outlet Stream" Lfrac = 1-Vfrac; end Model heater as Heater_Cooler_Basic ATTRIBUTES Pallete = true; Brief = "Model of a Heater"; Info = "This model determines thermal and phase conditions of outlet stream"; EQUATIONS "Heat Duty" Q = Outlet.F*Outlet.h-sum(Inlet.F*Inlet.h); end Model cooler as Heater_Cooler_Basic ATTRIBUTES Pallete = true; Brief = "Model of a Cooler"; Info = "This model determines thermal and phase conditions of outlet stream"; EQUATIONS "Heat Duty" Q = sum(Inlet.F*Inlet.h)- Outlet.F*Outlet.h; end