#*------------------------------------------------------------------- * 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. * *-------------------------------------------------------------------- * Model of cstr reactor *-------------------------------------------------------------------- * * * *---------------------------------------------------------------------- * Author: Paula B. Staudt * $Id: cstr.mso 77 2006-12-08 19:21:59Z paula $ *--------------------------------------------------------------------*# using "streams"; Model cstr_basic PARAMETERS ext NComp as Integer; NReac as Integer; stoic(NComp, NReac) as Real (Brief = "Stoichiometric Matrix"); VARIABLES in Inlet as stream; out Outlet as stream_therm; q as heat_rate; Vr as volume (Brief="Reacting Volume"); M as mol (Brief = "Molar total amount"); C(NComp) as conc_mol(Brief="Components concentration"); EQUATIONS "Molar fraction" Outlet.z * M = C * Vr; "Vapourisation Fraction" Outlet.v = Inlet.v; end Model cstr_yield as cstr_basic PARAMETERS yield(NReac) as fraction; EQUATIONS Outlet.z*Outlet.F = Inlet.z*Inlet.F * sumt(stoic*(1-yield)); "Reactor Energy Balance" diff(M*Outlet.h) = Inlet.F*Inlet.h - Outlet.F*Outlet.h - q; end Model cstr as cstr_basic VARIABLES r(NReac) as reaction_mol; Hr(NReac) as heat_reaction; EQUATIONS "Component Molar Balance" diff(Outlet.z*M) = (Inlet.F*Inlet.z - Outlet.F*Outlet.z) + sumt(stoic*r)*Vr; "Reactor Energy Balance" diff(M*Outlet.h) = Inlet.F*Inlet.h - Outlet.F*Outlet.h + sum(Hr*sum(stoic*r))*Vr - q; end