#*--------------------------------------------------------------------- * 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. * *---------------------------------------------------------------------- * Sample of a Gibbs reactor *---------------------------------------------------------------------- * * This sample file needs VRTherm (www.vrtech.com.br) to run. * *---------------------------------------------------------------------- * * This is a sample based on a problem of the book "Introduction to * Chemical Engineering Thermodynamics" by Smith, Van Ness and Abbott, * 5th ed., 1996. * *---------------------------------------------------------------------- * Author: Rodolfo Rodrigues * $Id$ *--------------------------------------------------------------------*# using "reactors/gibbs"; #*--------------------------------------------------------------------- * Problem 15.13 - p.543 (Brazilian edition) * * System in gasosous fase contents CH4, H2O, CO, CO2, and H2 * * Initial conditions * 1bar, 1000K, 2mol of CH4 and 3mol of H2O * * Specify * Outlet.T * Outlet.P * * Return * Outlet.z ---------------------------------------------------------------------*# FlowSheet sample_gibbs_vap PARAMETERS PP as Plugin(Brief="External physical properties", Type="PP", Components = ["methane","water","carbon monoxide","carbon dioxide","hydrogen"], LiquidModel = "IdealLiquid", VapourModel = "Ideal"); NComp as Integer; NElem as Integer; DEVICES Fin as source; R as gibbs_vap; # gibbs reactor CONNECTIONS Fin.Outlet to R.Inlet; SET NComp = PP.NumberOfComponents; # CH4, H2O, CO, CO2, H2 NElem = 3; # C, O, H R.na(:,1) = [1.0, 0.0, 4.0]; # CH4 R.na(:,2) = [0.0, 1.0, 2.0]; # H2O R.na(:,3) = [1.0, 1.0, 0.0]; # CO R.na(:,4) = [1.0, 2.0, 0.0]; # CO2 R.na(:,5) = [0.0, 0.0, 2.0]; # H2 SPECIFY Fin.Outlet.F = 5*'kmol/h'; Fin.Outlet.z = [0.4, 0.6, 0.0, 0.0, 0.0]; Fin.Outlet.P = 1*'atm'; Fin.Outlet.T = 1000*'K'; R.Outlet.F = 5*'kmol/h'*sqrt(R.Tank.Level/'m'); R.Outlet.P = 1*'atm'; R.Outlet.T = Fin.Outlet.T; R.Tank.Across = 5*'m^2'; R.Tank.L = 1.5*'m'; INITIAL R.Outletm.T = 1000*'K'; R.M = [2, 3, 0, 0, 0]*'kmol'; OPTIONS Dynamic = false; NLASolver(File="sundials", RelativeAccuracy=1e-6, AbsoluteAccuracy=1e-8); end