11
2 nd Mercosur Congress on Chemical Engineering 4 th Mercosur Congress on Process Systems Engineering 1 CHEMICAL PROCESS SIMULATION USING MS EXCEL C. A. Henao 1 * , J. A. Velásquez 1 1 Facultad de Ingeniería Químicas Universidad Pontificia Bolivariana Abstract. Nowadays there are commercial applications such as HYSYS ® and ASPEN PLUS ® that allows the user to simulate chemical plants in a very realistic way. Generally speaking, these applications are very expensive and do not indicate exactly the simplifications upon which the simulation models are based. However, using a low cost tool as MS Excel ®, it is possible to build and solve simulation models that duplicate the results obtained using commercial simulators. In order to develop practical simulations in Excel ®, engineers must use detailed mathematical models of unit operations, computer code for the calculation of thermodynamic properties, and a computational tool designed to solve the highly nonlinear equation systems involved in such models . This work presents the mathematical models of the most common unit operations used in Chemical Engineering, the Excel add-in TermoPTVPR designed to calculate thermodynamic properties using the Patel-Teja-Valderrama (PTV) EOS, and the Excel add-in HomoSolver designed for the solution of non linear algebraic equation systems using homotopy continuation methods. With some examples it is show how the integration of these elements in an Excel workbook can provide simulation results equivalent to those obtained through commercial simulators. Keywords: Models, Simulation, Excel. 1. Introduction Presently, there are some free computer programs designed to construct and solve simulation models. Among them, Ascend IV (Piela et al., 1985) is a powerful mathematical modeling software with some thermodynamics and distillation libraries; however, its interface is not very user friendly, an aspect that causes some problems to the beginner. Chemical process simulation involves the integration of three basic elements: Mathematical models of unit operations, Thermodynamic properties calculation methods, Numerical methods for the solution of non-linear equations systems. Many papers present mathematical models for particular units in particular conditions, but it is difficult to find works grouping general models that shear the same style and notation. Additionally, even though there are many theoretical presentations (Sandler 1999, Prausnitz 1999), there are only a few low cost tools for the calculation of thermodynamic properties of mixtures. Among them, BibPhy®-ProSim and ProdeProperties®- Prode are two examples that allow thermodynamic properties calculations using Excel®. Finally, some commercial tools such as MATLAB ® and MAPLE ® allow the solution of general equations systems; however, these packages are relatively expensive and use traditional numerical methods that can be inadequate for the solution of the highly non-linear equations involved in the simulation of chemical processes (Seader et al., 1990). * To whom all correspondence should be addressed. Address: Universidad Pontifícia Bolivariana A.A. 56006, Medellín, Colombia. e-mail: [email protected] :

1255 Chemical Process Simulation Using Ms Excel

Embed Size (px)

DESCRIPTION

chemical engineering

Citation preview

Page 1: 1255 Chemical Process Simulation Using Ms Excel

2nd Mercosur Congress on Chemical Engineering

4th Mercosur Congress on Process Systems Engineering

1

CHEMICAL PROCESS SIMULATION USING MS EXCEL C. A. Henao1*, J. A. Velásquez 1

1Facultad de Ingeniería Químicas – Universidad Pontificia Bolivariana Abstract. Nowadays there are commercial applications such as HYSYS ® and ASPEN PLUS ® that allows the user to simulate chemical plants in a very realistic way. Generally speaking, these applications are very expensive and do not indicate exactly the simplifications upon which the simulation models are based. However, using a low cost tool as MS Excel ®, it is possible to build and solve simulation models that duplicate the results obtained using commercial simulators. In order to develop practical simulations in Excel ®, engineers must use detailed mathematical models of unit operations, computer code for the calculation of thermodynamic properties, and a computational tool designed to solve the highly nonlinear equation systems involved in such models . This work presents the mathematical models of the most common unit operations used in Chemical Engineering, the Excel add-in TermoPTVPR designed to calculate thermodynamic properties using the Patel-Teja-Valderrama (PTV) EOS, and the Excel add-in HomoSolver designed for the solution of non linear algebraic equation systems using homotopy continuation methods. With some examples it is show how the integration of these elements in an Excel workbook can provide simulation results equivalent to those obtained through commercial simulators.

Keywords: Models, Simulation, Excel.

1. Introduction

Presently, there are some free computer programs designed to construct and solve simulation models. Among

them, Ascend IV (Piela et al., 1985) is a powerful mathematical modeling software with some thermodynamics

and distillation libraries; however, its interface is not very user friendly, an aspect that causes some problems to

the beginner.

Chemical process simulation involves the integration of three basic elements:

• Mathematical models of unit operations,

• Thermodynamic properties calculation methods,

• Numerical methods for the solution of non-linear equations systems.

Many papers present mathematical models for particular units in particular conditions, but it is difficult to

find works grouping general models that shear the same style and notation. Additionally, even though there are

many theoretical presentations (Sandler 1999, Prausnitz 1999), there are only a few low cost tools for the

calculation of thermodynamic properties of mixtures. Among them, BibPhy®-ProSim and ProdeProperties®-

Prode are two examples that allow thermodynamic properties calculations using Excel®. Finally, some

commercial tools such as MATLAB ® and MAPLE ® allow the solution of general equations systems;

however, these packages are relatively expensive and use traditional numerical methods that can be inadequate

for the solution of the highly non-linear equations involved in the simulation of chemical processes (Seader et

al., 1990).

* To whom all correspondence should be addressed. Address: Universidad Pontifícia Bolivariana A.A. 56006, Medellín, Colombia. e-mail: [email protected]:

Page 2: 1255 Chemical Process Simulation Using Ms Excel

2nd Mercosur Congress on Chemical Engineering

4th Mercosur Congress on Process Systems Engineering

2

Due to its low cost and highly acceptance in industry and academy, MS Excel is and ideal platform for the

construction and solution of mathematical models (Mathias 2004). The present work presents how the three

elements descried above can be integrated in MS Excel, offering a practical method that allow the simulation of

unit operations and complete processes at a fraction of the cost of commercial process simulators. In order to

reach this objective, the authors have developed two MS Excel Add-Ins: TermoPTVPR (Henao et al, 2004b) and

HomoSolver (Henao et al, 2005a).

2. Mathematical Models

The models presented here consider systems of NC components. The mass balances are posed using

component molar flows (Fi) instead of products between total molar flows (F) and molar fractions (xi). This

simplifies the mass balances and helps the numerical methods to converge during the numerical solution.

However, the energy balances involve total molar flows and some other calculations involve molar fractions.

Thus, it is necessary to include equations like (1) for every stream in every model.

NCiConFFxFF ii

NC

i i ,...,1/,1

===∑ = (1)

Additionally, thermodynamics establishes relations between thermodynamic the properties of a stream (h, s,

v) and its conditions (T, P, x1,...,xNC). In other words, when a thermodynamic model is used in a simulation,

there are equations like (2) for every stream in every model.

),...,,,(ˆ,),...,,,(,),...,,,(,),...,,,( 1111 NCiNCNCNC xxPTffxxPTfsxxPTfhxxPTfv ==== (2)

Equations (1) and (2) have to be considered in a model during the estimation of its degrees of freedom.

2.1. Reactors

Simulation of continuous reactors is generally based on two ideal configurations: Continuous Stirred Tank

Reactors (CSTR) and Plug Flow Reactors (PFR). Besides, due to the equivalence between a PFR and a series of

CSTR, the mathematical model of a CSTR is the only one presented here. Regarding the Figure 1 and supposing

a homogeneous reaction media in steady state, the following equations can be posed (Henao et al, 2004c):

Mass Balances

NCiraVFFNR

jjijRxnIiOi ,...,1con

1]] =⋅⋅+= ∑

=

(3)

NCiFF FTIiFTOi ,...,1con]] == (4)

Energy Balances

Page 3: 1255 Chemical Process Simulation Using Ms Excel

2nd Mercosur Congress on Chemical Engineering

4th Mercosur Congress on Process Systems Engineering

3

( )∑=

⋅∆⋅−+⋅=⋅NR

jjjRxnIIOO rhVQhFhF

1

(5)

FTOFTOFTIFTI hFQhF ⋅=−⋅ (6) Additional Expressions

NRjconTCCfr OONCOj ,...,1),,...,( ]]1 == (7)

NCiconvFFC OOOiOi ,...,1)/(]] =⋅= (8)

RIO PPP ∆−= (9)

FTFTIFTO PPP ∆−= (10)

( ) ( )( ) ⎟⎟⎠

⎞⎜⎜⎝

⎛−−

−−−=∆∆⋅⋅=OFTI

OFTOOFTIOFTOLMLM TT

TTLnTTTTTTAUQ , (11)

( ) NCiconFFFX IiOiIii ,...,1]]] =−= (12)

Degrees of Freedom (DOF): An analysis of the model indicates DOF=2.NC+9.

Fig. 1. Non adiabatic CSTR

2.2. Separation Towers

Simulation of distillation, absorption and liquid-liquid extraction can be based on a general model for the

stage wise separation system presented in Figure 2, In this figure Φ1 indicates light phase streams (vapor o light

liquid) and Φ2 indicates heavy phase streams (liquid or heavy liquid). Supposing steady state and

thermodynamic equilibrium between phases in each stage, the following equations can be posed (Henao et al,

2005a):

Mass Balances

( ) ( ) N1,...,n , NC1,...,iCon0)(1])(1])(2])(2]

)1(1])1(2])(]==

=+−+−

++

ΦΦΦΦ

+Φ−Φ

nXininXini

nininFi

FFFFFFF (13)

Energy Balances

TI PI FI xi]I Fi]I

TO PO FO xi]O Fi]O

T=TO P= PO xi =xi]O VRxn

TFTI PFTI FFTI xi]FTI Fi]FTI

TFTO PFTO FFTO xi]FTO Fi]FTO

Q

Page 4: 1255 Chemical Process Simulation Using Ms Excel

2nd Mercosur Congress on Chemical Engineering

4th Mercosur Congress on Process Systems Engineering

4

( )( )

N1,...,nCon0

)(1)(1)(1)(1

)(2)(2)(2)(2

)()1(1)1(1)1(2)1(2)()(

=

=⋅+⋅−

⋅+⋅−

+⋅+⋅+⋅

ΦΦΦΦ

ΦΦΦΦ

+Φ+Φ−Φ−Φ

nXnXnn

nXnXnn

nnnnnnFnF

hFhFhFhF

QhFhFhF (14)

Additional Expressions

NnconTTT nnn ,...,1)()(1)(2 === ΦΦ (15)

NnconPPP nnn ,...,1)()(1)(2 === ΦΦ (16)

N1,...,n , 1..NCi)(1])(2] === ΦΦ conff nini

)) (17)

NnTTTT nXnnXn ,...,1Con, )(1)(1)(2)(2 === ΦΦΦΦ (18)

NnPPPP nXnnXn ..1Con, )(1)(1)(2)(2 === ΦΦΦΦ (19)

]

]

]

]N1,...,n , 1..NCiCon,

)(1

)(1)(1

)(2

)(2)(2 ====

Φ

ΦΦ

Φ

ΦΦ

ni

nXinX

ni

nXinX F

FS

FF

S (20)

Degrees of Freedom (DOF): An analysis of the model indicates DOF=N.(NC+6).

Fig. 2. General stage wise separation system.

2.3. Heat exchangers

Simulation of heat exchangers (counter flow or parallel flow) is based on the general configuration presented

in Figure 3. In this figure, H indicates hot streams and C indicates cold streams. Supposing steady state and

linear temperature profiles (T Vs. h) for every stream in every stage, the following equations can be posed

(Henao et al, 2005b):

N-1

Φ2(N-1)

N

Φ2X(N-1) Φ1(N)

Φ1X(N)

Φ1(N-1)

Φ1X(N-1) Φ2(N-2)

Q (N-1) F(N-1)

Q (N) F(N)

1

Φ1(1)

Q (1) F(1)

2

Φ1(2)

Φ1X(2) Φ2(1)

Φ2X(1)

Q (2) F(2)

Φ1(3) Φ2X(2)

Φ2(2)

Φ2(N)

Φ1X(1)

Φ2X(N)

Page 5: 1255 Chemical Process Simulation Using Ms Excel

2nd Mercosur Congress on Chemical Engineering

4th Mercosur Congress on Process Systems Engineering

5

Mass Balances

( ) ( ) N1,...,n , NC1,...,icon1]] === −nCinCi FF (21)

( ) ( ) N1,...,n , NC1,...,icon1]] === +nHinHi FF (22)

Energy Balances

( ) ( )( ) ( ) ( )( ) ( ) N..nQhFhF nnCnCnCnC ,.,1con11 =+⋅=⋅ −− (23)

( ) ( )( ) ( ) ( )( ) ( ) N..nQhFhF nnHnHnHnH ,.,1con11 ==−⋅=⋅ ++ (24)

Additional Expressions

( ) ( ) ( ) ( ) ( ) NnconAP

APPPPEx

CnnCnCnCnC ,...,1,1 =

∆⋅=∆∆−= −

(25)

( ) ( ) ( ) ( ) ( ) NnconAP

APPPPEx

HnnHnHnHnH ,...,1,1 =

∆⋅=∆∆−= +

(26)

( ) ( )( ) ( )( ))1()()()1(

)1()()()1()(

1)()()()()()( ,...,1Con,,

−+

−+

=

−−

−−−=∆

===∆⋅⋅= ∑

nCnHnCnH

nCnHnCnHnLM

n

nnEx

EXnnLMnnn

TTTTLnTTTT

T

NnQQNAATAUQ

(27)

Degrees of Freedom (DOF): An analysis of the model indicates DOF=2.NC+N+7.

Fig. 3. General counter flow heat exchanger.

3. Thermodynamic Properties Calculation

The use of Excel® as a low cost platform for chemical process simulation requires a tool that allows a direct

and efficient calculation of thermodynamic properties such as molar volume molar (v), molar enthalpy (h),

molar entropy (s) and partial fugacity ( if)

). The thermodynamic model based on the Patel-Teja-Valderrama

equation of state (Valderrama 1990) with Panagiotopoulos-Reid mixing rules (Panagiotopoulos et al, 1985)

allows the calculation of properties for ideal and non-ideal mixtures. However, due to the complexity of the

equations involved, a practical use of such model requires a computer code. The add-in TermoPTVPR defines a

series of functions which can be used to calculate the mentioned properties providing some pure substance

2 n1 N

H(3) H(n+1) HO = H(1) H(2) H(N) H(n) H(N+1) = HI

C(N) = CO CI = C(0) C(1) C(2) C(n-1) C(n) C(N-1)

Q(1) Q(2) Q(n) Q(N)

A(1) A(2) A(N) A(n)

Page 6: 1255 Chemical Process Simulation Using Ms Excel

2nd Mercosur Congress on Chemical Engineering

4th Mercosur Congress on Process Systems Engineering

6

parameters (Tc, Pc, Vc, ω, kij, ect.) and the conditions of the mixture (T, P, x1,...,xNC). The equations behind

this add-in and a complete list of such functions are presented elsewhere (Henao et al, 2004b).

4. Solution of Nonlinear Equations Systems

The use of Excel® as a low cost platform for chemical process simulation also requires a tool designed to

solve the highly nonlinear equations involved. Classical numerical methods such us Newton’s method have been

widely used for the solution of general equations systems; however, convergence of such methods highly

depends on initial values. On the contrary, homotopy continuation methods allow, at least in theory, to solve a

general equations system using almost any set of initial values. There are papers (Seader et al, 1990, Shacham

1978, Vickery et al, 1988, Wayburn et al, 1984, Wayburn et al, 1987) that highlight the power of homotopy

continuation methods for the solution of the equations involved in chemical process simulation. The use of such

methods is not new and some computer codes have been developed (Watson et al, 1987); however, none of them

has been developed as an Excel® add-in

A general equations system can be presented as:

( ) ( ) ( )[ ] 0,...,,,...,,,...,, 21212211 =NnNN xxxfxxxfxxxf L (28)

In order to pose such a system in an Excel workbook, two sets of cells have to be used. The first set is

composed by N cells associated to the unknown variables of the problem. This cells store the values of the

unknown variables during the numerical solution of the model, changing from the initial values (x1[0],

x2[0],…,xn

[0] supplied by the user) to the final solution. The second set is composed by N cells that stores

formulas for fi(x1, x2,…,xn) involving the addresses of the cells in the first set. To solve the system, the values of

the cells associated to the unknowns have to be modified until the values of the cells associated to fi(x1, x2,…,xn)

becomes cero. At this point the cells associated to the unknown variables store the solution of the problem.

HomoSolver is an Excel add-in that automatically performs the solution procedure mentioned above. The

details behind HomoSolver are presenter elsewhere (Henao et al, 2004a).

5. Example

Production of styrene (C8H8) from Ethyl Benzene (C8H10) involves the following vapor phase catalyzed

reactions:

[ ] 1 Rxn,117591,kmol

kJ1288108 =∆+⇔ hHHCHC

[ ] 2 Rxn,105497.8,kmol

kJ24266108 =∆+⇒ hHCHCHC

[ ] 3 Rxn,-54680,kmol

kJ34872108 =∆+⇒+ hCHHCHHC

Considering the properties of the fixed bed catalyst, the kinetics can be presented as (Snyder et al, 1994):

Page 7: 1255 Chemical Process Simulation Using Ms Excel

2nd Mercosur Congress on Chemical Engineering

4th Mercosur Congress on Process Systems Engineering

7

( )

[ ] [ ]( ) ( )

-0.00183,3.81,-13068.5

-15.4,

90834.82,10595315.1 11

1

11

3

288108

===

=⋅+⋅++=

==

⋅−⋅⋅=

⋅⋅

dcb

aTdTLncTbaKLn

EaAo

KPPPeAor Eq

kmolkJ

kPabedmhkmol

EqHHCHCTR

Ea (29)

[ ] [ ]kmolkJ

kPabedmhkmol

HCTR

Ea

EaAoPeAor 207860,6.485e12, 22

2

22 3108==⋅⋅=

⋅⋅⋅ (30)

[ ] [ ]kmolkJ

kPabedmhkmol

HHCTR

Ea

EaAoPPeAor 91458.4,915516468.2, 33

3

33 232108==⋅⋅⋅=

⋅⋅⋅ (31)

It is requested to calculate the component molar flow profiles for an adiabatic PFR involved in the described

reaction process and fed by a stream with the following characteristics:

[ ][ ]

[ ][ ]

[ ][ ]

[ ][ ]

[ ][ ] 6.179

0,,

00

,,

00

,,

038.12

,,

2400800

8

7

6

5

4

3

2

1

=

=

=

=

=

=

=

=

==

hkmol

hkmol

hkmol

hkmol

hkmol

hkmol

hkmol

hkmol

kPa

K

FF

FF

FF

FF

PT

Subscripts 1, 2, 3, 4, 5, 6, 7, 8, are associated to Ethyl Benzene (C8H10), Styrene (C8H8), Hydrogen (H2), Benzene

(C6H6), Ethylene (C6H6), Toluene (C6H6), Methane (CH4) and Water (H2O), respectively. Consider the PFR can

be simulated as a series of 20 CSTR, each one having 0.5 m³ of packed catalyst and a pressure drop of 0.5 kPa.

Table 1. Parameters used by TermoPTVPR for the calculation of thermodynamic properties.

TC PC vC ω Ab Bb Cb[K] [kPa] [m3/kmol] [kJ/kmol.K] [kJ/kmol.K] [K]

1 E-benzene 617,098 3607,12 0,374 3,01E-01 113,50 263,36 1877,5392 Styrene 636 3840 0,351999 2,97E-01 113,66 235,03 1966,7733 Hydrogen 33,44 1315,5 0,0515 -1,20E-01 28,52 3,99 3014,9244 Benzene 562,098 4924,39 0,25999 2,15E-01 70,00 182,84 1835,8915 Ethylene 282,359 5031,79 1,29E-01 8,50E-02 42,36 78,99 2232,8336 Toluene 591,799 4100,04 0,316 2,60E-01 91,29 223,89 1886,7117 Methane 190,699 4640,68 9,90E-02 1,15E-02 35,63 59,16 2478,9798 H2O 647,299 22120 0,0571 3,44E-01 33,73 14,59 2913,810

1 2 3 4 5 6 7 81 0,00000 0,00030 -2,69287 -0,00145 0,00058 0,00254 -0,01584 -0,017522 0,00066 0,00000 -11,57713 -0,00305 -0,01258 0,00220 -0,06232 -0,004893 -4,55574 -13,70195 0,00000 -6,67540 -0,87012 -3,79868 -0,25031 -61,573714 -0,00014 -0,00175 -4,82326 0,00000 0,00197 -0,00054 0,01006 -0,017525 -0,00090 -0,01511 -0,80195 0,00240 0,00000 -0,00539 0,01240 0,018516 0,00113 0,00067 -2,90559 -0,00304 -0,00472 0,00000 0,02467 -0,015437 -0,03639 -0,06485 -0,14120 -0,00155 0,01394 0,01048 0,00000 -0,097598 1,67664 0,87135 -47,77559 1,67664 0,02629 1,68358 -0,03815 0,00000

Compounds

kij

To solve this problem, equations (3), (6), (9), (29), (30), (31) are used to simulate each stage as an adiabatic

CSTR (Q=0). Besides, some additional equations have to be included to relate partial pressures in equations

(29), (30), (31) to total pressures and mol fractions inside each stage.

Table 1 presents the parameters used by TermoPTVPR in the calculation of thermodynamic properties. Table

2 shows the Excel format used to simulate the first CSTR in the series; the rest of them can be simulated by

analogous formats. In this case, Subscript (n) is associated to the outlet stream.

Page 8: 1255 Chemical Process Simulation Using Ms Excel

2nd Mercosur Congress on Chemical Engineering

4th Mercosur Congress on Process Systems Engineering

8

Table 2. Excel format for the simulation of the first CSTR in the series that constitute a PFR.

T(n-1)(°K) 800,0 T(n)(K) 779,3 a1 -1,536E+01P(n-1) (kPa) 2400,0000 P(n) (kPa) 2399,5000 a2 -1,307E+04F(n-1) (kmol/h) 192,0 F(n) (kmol/h) 194,5 a3 3,808E+00F1](n-1) (kmolh) 1,238E+01 F1](n) (kmolh) 9,080E+00 a4 -1,826E-03F2](n-1) (kmolh) 0,000E+00 F2](n) (kmolh) 8,023E-01 KEq1 (kPa) 2,761E-04F3](n-1) (kmolh) 0,000E+00 F3](n) (kmolh) 2,522E-04 AO1 (kmol/(m3_bed.kPa 4,238E+06F4](n-1) (kmolh) 0,000E+00 F4](n) (kmolh) 1,700E+00 AO2 (kmol/(m3_bed.kPa 2,594E+12F5](n-1) (kmolh) 0,000E+00 F5](n) (kmolh) 1,700E+00 AO3 (kmol/(m3_bed.kPa 6,207E+06F6](n-1) (kmolh) 0,000E+00 F6](n) (kmolh) 8,020E-01 Ea1 (kJ/kmol) 9,083E+04F7](n-1) (kmolh) 0,000E+00 F7](n) (kmolh) 8,020E-01 Ea2 (kJ/kmol) 2,079E+05F8](n-1) (kmolh) 1,796E+02 F8](n) (kmolh) 1,796E+02 Ea3 (kJ/kmol) 9,146E+04x1](n-1) 0,0645 x1](n) 0,0467 r1(n) (kmol/(m3_bed.h)) 1,605E+00x2](n-1) 0,0000 x2](n) 0,0041 r2(n) (kmol/(m3_bed.h)) 3,400E+00x3](n-1) 0,0000 x3](n) 0,0000 r3(n) (kmol/(m3_bed.h)) 1,604E+00x4](n-1) 0,0000 x4](n) 0,0087 ∆HRxn1 (GJ/kmol) 0,117591x5](n-1) 0,0000 x5](n) 0,0087 ∆HRxn2 (GJ/kmol) 0,105498x6](n-1) 0,0000 x6](n) 0,0041 ∆HRxn3 (GJ/kmol) -0,054680x7](n-1) 0,0000 x7](n) 0,0041 VR(n) (m3) 0,50x8](n-1) 0,9355 x8](n) 0,9234 ∆P(n) (kPa) 0,50h(n-1) (GJ/kmol) 0,0233 h(n) (GJ/kmol) 0,0218 Q(n) (GJ/h) 0,000R (kJ/kmol.K) 8,314

UNKNOWNS xi

-1,655E-10 7,793E+021,471E-10 9,080E+001,466E-10 8,023E-011,783E-11 2,522E-041,783E-11 1,700E+005,299E-13 1,700E+005,299E-13 8,020E-010,000E+00 8,020E-01

Energy B. 1,510E-08 1,796E+02//F(X)// 1,50974E-08

F1](n-1)+VR(n).(-r1(n)-r2(n)-r3(n))-F1](n)

F2](n-1)+VR(n).r1(n)-F2](n)

F3](n-1)+VR(n).(r1(n)-r3(n))-F3](n)

F4](n-1)+VR(n).r2(n)-F4](n)

F6](n-1)+VR(n).r3(n)-F6](n)

F7](n-1)+VR(n).r3(n)-F7](n)

F8](n-1)-F8](n)

F(n-1).h(n-1)+Q(n)-VR(n).(r1(n).∆HRxn1+r2(n).∆HRxn2+r3(n).∆HRxn3)-F(n).h(n)

Component Balances F5](n-1)+VR(n).r2(n)-F5](n)

SEGMENT 1 (n=1)VARIABLES AND UNKNOWNS

Stream (n-1) (In)

FUNCTIONS fi(X)

CSTRStream (n) (out)(*)(*)

(*)(*)

(*)(*)(*)(*)(*)(*)

(*)

(**)

(**)(**)(**)(**)(**)(**)(**)(**)

(*)(*)(*)(*)(*)(*)

(*)(*)(*)

(*)

(*)(*)(*)(*)(*)(*)

-1

1

3

5

7

9

11

13

0 5 10 15 20

Segment Number

Com

pone

nt M

olar

Flo

ws

(km

ol/h

)

E. Benzene (Excel)Styrene (Excel)Benzene (Excel)E. Benzene (HYSYS)Styrene (HYSYS)Benzene (HYSYS)

Fig. 4. Component molar flow profiles.

Page 9: 1255 Chemical Process Simulation Using Ms Excel

2nd Mercosur Congress on Chemical Engineering

4th Mercosur Congress on Process Systems Engineering

9

The cells marked as (*) are associated to specified values, the cells marked as (**) are associated to unknown

variables and the rest of the cells includes formulas that relate them to other cells. The (*) cells within the

section “Variables and Unknowns” include formulas relating them to the cells in the section “Unknowns”. This

is necessary because Homosolver needs all the “Unknown” cells to be adjacent (Henao et al, 2004a).

The format presented in Table 2 does not include all fi(X) functions associated to the equations of the model.

Particularly, equations (9), (29), (30) y (31) are not included in the section “Functions fi(X)”, but they are used

to calculate Keq]1, r1(n), r2(n), r3(n), P(n), F(n-1), F(n), xi(n-1), xi(n) from the specified values and the main unknowns

in the model (T(n), F1(n),…, FNC(n)). In this way the model is simplified, helping the numerical solution.

The component molar flow profiles calculated by Excel® and HYSYS ® are presented in Figure 4. The

results are almost identical. Additional tests have shown the deviations are caused by the difference in the

thermodynamic models used. In this case, Excel uses the EOS PTVPR and HYSYS uses the EOS PRSV.

Notation A : Exchange area [m²] Ab : Bureš equation parameter [kJ/(kmol.K)] Ao : Frequency factor. aij : Stoichiometric coefficient of species “i” in reaction “j” [kmol“i”]. Bb : Bureš equation parameter [kJ/(kmol.K)] C : Molar concentration [kmol/m3] Cb : Bureš equation parameter [K] Ea : Activation energy [kJ/kmol] F : Molar flow [kmol/h] f : Fugacity [kmol/h] h : Molar enthalpy [kJ/kmol] Keq : Equilibrium constant. kij : Binary e interaction coefficient. N : Number of PFR segments.

: Number of separation unit stages. : Number of heat exchanger segments.

NC : Total number of components. NR : Total number of reactions. P : Pressure or partial pressure [kPa] Q : Heat flow [kJ/h] R : Ideal gas constant = 8.314 [kJ/(kmol.K)] S : Molar flow ratio. rj : Velocity of reaction “j”. [1/(h.m³)] ó [1/(h.m³lecho)] T : Temperature [K] U : Heat transfer global coefficient [kJ/(h.m².K)] v : Molar volume [m³/kmol] V : Volume [m³] x : Mol fraction X : Conversion Greek letters ∆P : Pressure drop [kPa] ∆h : Heat of reaction [kJ/kmol]. ∆TLM : Log mean temperature difference [K].

Page 10: 1255 Chemical Process Simulation Using Ms Excel

2nd Mercosur Congress on Chemical Engineering

4th Mercosur Congress on Process Systems Engineering

10

Φ1 : Light phase (liquid or vapor) Φ1X : Light phase side draw (liquid or vapor) Φ2 : Heavy phase (liquid or heavy liquid) Φ2X : Heavy phase side draw (liquid or heavy liquid) ω : Acentricity Subscripts C : Critical property. : Cold stream. Ex : Heat exchanger. H : Hot stream. F : Feed stream. FTI : Intel thermal fluid stream. FTO : Outlet thermal fluid stream. I : Inlet stream. i : Component “i”. j : Reaction “j “. (n) : “nth” segment or “nth”stage. : “nth” segment outlet stream or “nth”stage outlet stream. O : Outlet stream. R : Reactor. FT : Thermal fluid. Rxn : Reaction medium. LM : log mean.

References

Bureš, M. M., (1986). A nonlinear equation describing the molar heat capacity of gases as a function of temperature. Int.

Chem. Eng., 26, 160.

Elliott, J. R., Lira, C. T. (1999). Introductory Chemical Engineering Thermodynamics. Prentice Hall, Upper Sadle River.

Henao, C. A., Velásquez, J. A. (2004a). Simulación de Procesos Químicos Empleando MS Excel® (I) -Aplicación de

Métodos Homotópicos. Ingeniería Química (Uruguay). 3, 16.

Henao, C. A., Velásquez, J. A. (2004b). Simulación de Procesos Químicos Empleando MS Excel® (II) -Aplicación de la Eos

Patel-Teja-Valderrama. Sent for review Ingeniería Química (Uruguay).

Henao, C. A., Velásquez, J. A. (2004c). Simulación de Procesos Químicos Empleando Ms Excel® (III) - Simulación de

Reactores. Sent for review Ingeniería Química (Uruguay).

Henao, C. A., Velásquez, J. A. (2005a). Simulación de Procesos Químicos Empleando Ms Excel® (IV) - Simulación de

Torres. Sent for review Ingeniería Química (Uruguay).

Henao, C. A., Velásquez, J. A. (2005b). Simulación de Procesos Químicos Empleando Ms Excel® (V) - Simulación de

Intercambiadores de Calor. Sent for review Ingeniería Química (Uruguay).

Mathias, P. M. (2004). Applied Thermodynamics in Chemical Technology: Current Practice and Future Challenges. Fluid

Phase Eq., In Press.

Panagiotopoulos, A. Z., Reid, R. C. (1985). A New Mixing Rule for Cubic Equation of State for Highly Polar, Asymmetric

System. Presented at the 189th American Chemical Society Meeting Miami Beach FL. April 29-Mayo 3.

Piela, P. C., Epperly, T. G., Westerberg, K. M. and Westerberg, A. W. (1991). ASCEND: an Object-oriented Computer

Environment for Modeling and Analysis: The modeling language. Comput. Chem. Eng., 15, 53.

Page 11: 1255 Chemical Process Simulation Using Ms Excel

2nd Mercosur Congress on Chemical Engineering

4th Mercosur Congress on Process Systems Engineering

11

Prausnitz, J. M. (1999). Molecular Thermodynamics of Fluid-Phase Equilibria, 3rd Edition. Prentice-Hall, Upper Saddle

River

Sandler, S. I. (1999). Chemical and Engineering Thermodynamics. 3rd Edition. Jhon Wiley, New York.

Seader, J. D., Kuno, M., Lin, W. J., Johnson, S. A., Unsworth, K. and Wiskin, J. W. (1990). Mapped Continuation Methods

for Computing all Solutions to General Systems of Non-Linear Equations. Comput. Chem. Eng., 14, 71.

Shacham, M. (1978). Solution of Steady State Reactor Models Using the Continuation Method and Feasible Starting Point.

Comput. Chem. Eng., 2, 197.

Snyder J., Subramanian B. 1994. Novel Reverse Flow Strategy for Ethyl benzene Dehydrogenation in a Packed-Bed Reactor.

Chem Eng. Sci.. 49, 5584.

Valderrama, J. O. 1990. A Generalized Patel-Teja Equation of State for Polar and Nonpolar Fluids and Mixtures. Journal of

Chemical Engineering Japan. 23, 87.

Vickery, D. J., Ferrari, J. J., Taylor, R. (1988). An Efficient Continuation Method for the Solution of Difficult Equilibrium

Stage Separation Process Problems. Comput. Chem. Eng., 12, 99.

Watson, L. T., et al. (1987). Algorithm 652, HOMOPACK: a suite of codes for globally convergent homotopy algorithms

Trans. Math. Software, 13, 281

Wayburn, T. L., Seader, J. D., (1984). . Solution of Systems of Interlinked Distillation Columns by Differential Homotopy-

Continuation Methods. In Proceedings of the Second International Conference on Foundations of Computer-aided

Process Design. CAChE. Univ. of Michigan, Ann Arbor, Mich.

Wayburn, T. L., Seader, J. D., (1987). . Homotopy Continuation Methods for Computer-Aided Process Design. Computers

and Chemical Engineering. Comput. Chem. Eng., 11, 7.