#*-------------------------------------------------------------------
* 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: Rafael de Pelegrini Soares
* $Id: sample_methanol.mso 83 2006-12-08 20:29:34Z paula $
*--------------------------------------------------------------------*#
FLOWRATE as Real(Default=500, Lower=0, Upper=100000);#,Unit="kmol/h");
EXTENT as Real(Default=500, Lower=-1000000, Upper=1000000);
MOLEFRACTION as Real(Default=0.2, Lower=0, Upper=1);
PRESSURE as Real(Default=10, Lower=0, Upper=1000); #,Unit="bar");
Model MESEPARATOR
PARAMETERS
ext NoComp;
VARIABLES
in FLOWIN(NoComp) as FLOWRATE;
out FLOWOUT1(NoComp) as FLOWRATE;
out FLOWOUT2(NoComp) as FLOWRATE;
TOTAL1 as FLOWRATE;
TOTAL2 as FLOWRATE;
X3 as MOLEFRACTION; X4 as MOLEFRACTION;
Y3 as MOLEFRACTION; Y4 as MOLEFRACTION;
EQUATIONS
"Balanco Global"
FLOWOUT1 + FLOWOUT2 = FLOWIN;
"Total flows"
TOTAL1 = sum (FLOWOUT1);
TOTAL2 = sum (FLOWOUT2);
"Fracoes molares"
X3 * TOTAL1 = FLOWOUT1(3);
X4 * TOTAL1 = FLOWOUT1(4);
Y3 * TOTAL2 = FLOWOUT2(3);
Y4 * TOTAL2 = FLOWOUT2(4);
"Equilibrium fraction"
Y3 = 3.8E-3 * X3;
Y4 = 8.0E-4 * X4;
FLOWOUT1([1,2,5,6,7]) = 0;
end
Model FEEDERMB # Feed stream definition (material balance only)
PARAMETERS
ext NoComp;
VARIABLES
out FLOWOUT(NoComp) as FLOWRATE;
X(NoComp) as MOLEFRACTION;
TOTAL as FLOWRATE;
EQUATIONS
# Total feed flow
TOTAL = sum (FLOWOUT);
# Material fractions of feed stream
X * TOTAL = FLOWOUT;
end
Model MEREACTOR
PARAMETERS
ext NoComp;
Temp as Real(Default=500, Lower=300);
Pressure as Real(Default=100);
VARIABLES
in FLOWIN(NoComp) as FLOWRATE;
out FLOWOUT(NoComp) as FLOWRATE;
TOTAL as FLOWRATE;
EXTENT1 as EXTENT;
EXTENT2 as EXTENT;
X(NoComp) as MOLEFRACTION;
KJ1 as Real(Default=0.6);
KJ2 as Real(Default=1);
KX1; KX2; KP10;
KP20;
EQUATIONS
# Definition of equilibrium constants
KJ1 = 0.6 + 1.5E-3 * (Temp - 473);
KP10 = 10.0^(9.218 + 3971/Temp - 7.492 * log(Temp)
+ 1.77E-3 * Temp - 3.11E-8 * Temp^2);
KX1 = KP10/KJ1 * Pressure^2;
KJ2 = 0.89 + 4.0E-4 * (Temp-463);
KP20 = 10.0^(1.664 - 1850/(Temp+10));
KX2 = KP20/KJ2;
# Outlet flows from extent and stoichiometry
FLOWOUT(1) = FLOWIN(1) - EXTENT1 + EXTENT2;
FLOWOUT(2) = FLOWIN(2) - 2 * EXTENT1 - EXTENT2;
FLOWOUT(3) = FLOWIN(3) + EXTENT1;
FLOWOUT(4) = FLOWIN(4) + EXTENT2;
FLOWOUT(5) = FLOWIN(5) - EXTENT2;
FLOWOUT(6) = FLOWIN(6);
FLOWOUT(7) = FLOWIN(7);
# Total outlet flow
TOTAL = sum (FLOWOUT);
# Mole fractions
TOTAL * X = FLOWOUT;
# Reaction equilibria
X(3) = X(1) * X(2)^2 * KX1;
X(1) * X(4) = X(5) * X(2) * KX2;
end
Model SPLITMB # TWO Stream SPLITTER (MATERIAL BALANCE ONLY)
PARAMETERS
ext NoComp;
VARIABLES
out FLOWOUT2(NoComp) as FLOWRATE;
in FLOWIN(NoComp) as FLOWRATE;
out FLOWOUT1(NoComp) as FLOWRATE;
TOTAL1 as FLOWRATE;
TOTAL2 as FLOWRATE;
X1(NoComp) as MOLEFRACTION;
X2(NoComp) as MOLEFRACTION;
FRACTION as MOLEFRACTION;
EQUATIONS
# Stream split
FLOWOUT1 = FLOWIN * FRACTION;
# Component material balance
FLOWIN = FLOWOUT1 + FLOWOUT2;
# Total flows of output streams
TOTAL1 = sum (FLOWOUT1);
TOTAL2 = sum (FLOWOUT2);
# Material fractions of output streams
X1 * TOTAL1 = FLOWOUT1;
X2 * TOTAL2 = FLOWOUT2;
end
Model MAKEUPMB # MIXER of TWO StreamS (MATERIAL BALANCE ONLY)
PARAMETERS
ext NoComp;
VARIABLES
out FLOWOUT(NoComp) as FLOWRATE;
in FLOWIN1(NoComp) as FLOWRATE;
in FLOWIN2(NoComp) as FLOWRATE;
TOTAL as FLOWRATE;
TOTALMAKE as FLOWRATE;
TOTALR as FLOWRATE;
X(NoComp) as MOLEFRACTION;
RATIO as Real(Default=1e-3);
EQUATIONS
# Component material balances
FLOWIN1 + FLOWIN2 = FLOWOUT;
# Total flow of output stream
TOTAL = sum (FLOWOUT);
# Material fractions of output stream
X * TOTAL = FLOWOUT;
# Specification of recycle ratio
TOTALMAKE = sum (FLOWIN1);
TOTALR = sum (FLOWIN2);
TOTALR = RATIO * TOTALMAKE;
end
FlowSheet MethanolProcess
PARAMETERS
NoComp as Integer(Brief="Number of Components");
DEVICES
Mixer as MAKEUPMB;
Feeder as FEEDERMB;
Reactor as MEREACTOR;
Purge as SPLITMB;
Separator as MESEPARATOR;
CONNECTIONS
Feeder.FLOWOUT to Mixer.FLOWIN1;
Mixer.FLOWOUT to Reactor.FLOWIN;
Reactor.FLOWOUT to Separator.FLOWIN;
Separator.FLOWOUT2 to Purge.FLOWIN;
Purge.FLOWOUT2 to Mixer.FLOWIN2;
SPECIFY
Feeder.TOTAL = 6000;
Feeder.X(2:NoComp) = [0.146, 0.720, 0, 0.001, 0.06, 0.032];
Purge.FRACTION = 0.08776;
SET
NoComp = 7;
Reactor.Temp = 533.15;
Reactor.Pressure = 120;
OPTIONS
mode = "steady";
end