Material Balance around a Chemical Reactor. I I A. K. S. Murthy Allied Chemical Corporation, Morristown, New Jersey 07960
An earlier paper dealt with t h e problem of adjusting the raw data so as to satisfy t h e mass balance around a chemical reactor w h e n t h e reactions are unknown or do not impose additional constraints to t h e data adjustment procedure. W h e n t h e reactions are known and there are additional constraints, such as certain reactions being irreversible and certain species being inert, t h e procedure developed in this paper is useful. In developing this procedure t h e dimensionality of the problem is reduced to a minimum by taking advantage of t h e sparseness in t h e system of equations. A numerical example is given to illustrate t h e computational procedure.
Introduction In an earlier paper (Murthy, 1973) a simple procedure to adjust the measured flow rates of the various species entering and leaving a chemical reactor so as to satisfy the element conservation equations was presented. This method does not require any knowledge of the chemical reactions that take place within the reactor. However, very often the chemical reactions that take place are known, a t least partially, and as a result there may be additional constraints to the data adjusting procedure. For example, some of the reactions may be irreversible or some of the species in the system may be inert under the reactor conditions. It is important that the data adjustment be consistent with these requirements. When the chemical reactions that take place are known, it is better to formulate the data adjustment problem using a set of independent reactions. Vaclavek (1969) has considered the problem of achieving material balance around a chemical reactor in which a single reaction takes place. His method requires the solution to a large, but sparse, system of simultaneous algebraic equations. The procedure developed in this paper is formulated to handle multiple reactions and the number of simultaneous equations to be solved is reduced to a minimum. The problem at hand can be solved in a number of ways; the methods differ in the objective function minimized and the technique used to minimize the objective function. A popular objective function is the least-squares criterion, uiz., a weighted sum of the squares of the deviations, since it can be shown to be theoretically sound when certain frequently used assumptions (Hunter, 1967) regarding the probability density function of the errors are valid. Even when the underlying assumptions are not valid, often the least-squares criterion is adopted since a number of computational procedures have been developed for this objective function and the user is not concerned about the statistical validity of the procedure. Since the advent of the digital computer several mathematical programming techniques have evolved to determine the minimum (or the maximum) of an objective function which may be subject t o constraints (Himmelblau, 1972). Since only linear constraints are involved in the problem under consideration, one could select a linear objective function and use linear programming which is a fairly common mathematical programming technique. The purpose of this paper is to present a set of simple formulas satisfying the least-squares criterion which may be used to adjust raw data and achieve material balance around a chemical reactor in which several known chemi-
cal reactions take place. In developing these formulas the dimensionality of the problem is reduced to a minimum by formulating it differently and taking advantage of the sparseness in the system of algebraic equations. Mathematical Formulation Consider a chemical reactor involving N species and L chemical elements. The chemical nature of the species can be represented by an element matrix E such that e , , is the number of j t h element contained in a molecule of the ith species. A convenient method of representing the chemical reactions occurring in a system is to use a stoichiometric coefficient matrix A , such that the absolute value of a,, is the stoichiometric coefficient of the j t h species in the ith reaction and the sign of a,, is positive if the species appears on the right-hand side of the chemical equation and negative otherwise. Readers who are not familiar with this representation may refer to recent texts on reaction kinetics, for example Aris (1965). The law of conservation of elements requires N
for all i and k
c c l i J e j k= 0
(1)
j=l
In matrix notation
AE = 0
(2 )
and hence R, the rank of A, can be a t most N minus the rank-of E. If there are more than R reactions in the system any convenient independent set of R reactions may be used in the following procedure. In the following paragraphs A is assumed to be the stoichiometric coefficient matrix of an independent set of reactions. Any composition change in the system from the inlet to the outlet can be represented by a set of effective extents z L of the R independent reactions. If x L and y L are, respectively, the moles of the ith species entering and leaving the system in unit time, then
c R
vi = xi
+
j
(3
cljiZj
=1
If f , and 4, are the measured flow rates of the ith species entering and leaving the system, respectively, and u L and u, are the weights associated with the measurements, the problem is to minimize the objective function
s
.v
=
2Ui(Xi -
-
Xi)’
+
ri(yi
-
- 2
Si)
(4 )
i=l
subject to the constraints given by eq 3 or, more directly, minimize the unconstrained objective function Ind. Eng. Chem., Process Des. Develop., Vol. 13, No. 4, 1974
347
Table I
Corrected flow rates
Measured flow rates
1.1
N1 0 2
Method of Solution A necessary condition for the function 5' to be a minimum a t a point is that all the first-order derivatives must be zero a t that point.
NO NO2 H20 NH,
This procedure
Earlier procedure
Inlet Outlet
Inlet
Outlet
Inlet
Outlet
8 0 . 0 79.0 20.0 6.0 0.0 8.2 1.7 0.0 0 . 0 15.8 10.0 0 . 0
79.530 79.470 79.500 79.500 19.964 6.036 19.939 6.061 0.000 8.453 0.000 8.400 1.971 0.000 1.931 0.000 0.000 15.458 0.000 15.496 10,305 0,000 10.331 0.000
(b) The set of linear algebraic equations given by eq 13 are then solved simultaneously to obtain the values of zI R
(i = 1 , 2 , . .,R)
= bi
CijZj
(13)
j=l
as = azk
N
2
('{aki
(Xi
R
+
i=l
j
Fi) = 0
-1
(c) The values of corrected inlet flow rates given by eq 8 which may be rearranged as -
R
-
Xi = ( U i X i + Z'iyi - Z'i
aj$j)/(zLi j
+
2'i)
-1
.
(i = 1 , 2 , . .,AT)
(14)
(d) Finally, the exit flow rates are calculated using eq 3.
+
The above N R linear equations can be solved simultaneously to obtain the values of x L and zl and then y L can be calculated using eq 3, but it is possible to reduce the problem to that of solving only R simultaneous equations given by
Numerical Example When this procedure was applied to the example problem on chlorination of methane given in the earlier paper, the corrections were identical with those obtained using the earlier procedure. An example involving catalytic oxidation of ammonia using air is given here to illustrate this procedure and to show how it can handle certain constraints which cannot be met by the earlier procedure. Consider a chemical reactor with measured flow rates given in Table I. The corrected values given by the earlier procedure are shown in Table I. The first step in using this procedure is to obtain a set of independent reactions. There are six chemical species in this system and rank of the element matrix is three. Hence there can be a t most three independent chemical reactions. In the absence of the catalyst the following three overall reactions can take place. 4NH3
+
502 = 4 N 0
6H20
(a)
+ ?02= 4NO2 + 6 H 2 0 4NH3 + 3 0 2 = 2N2 + 6H2O
(b)
A
4NH3
The kth equation of eq 10 is obtained by subtracting from the kth equation of eq 9 the sum of N products which are obtained by multiplying the ith equation of eq 8 by v , a k r / (u, u l ) , the subscript i ranging from 1 to N. Equation 10 gives the values of 2, which may be used in eq 8 to obtain the values of x , .
The catalyst is known to suppress reaction c and hence there are only two independent reactions in this system. Other reactions such as
Computational Procedure ( a ) The first step is to set up the R simultaneous equations for zL as given by eq 10. The coefficients on the lefthand side form a symmetric matrix C, whose elements are given by
are linear combinations of the first two reactions. Procedures to obtain a set of independent reactions are described in recent texts on chemical kinetics, e . g . , h i s (1965). The stoichiometric coefficient matrix A , representing reactions a and b is
+
N
N Cij
'k2'k
=
2N0
"ik'jk
O
Nz
k.1
+
1
02 = 2N02
2 02
(C)
3
4
5
NO NO2 H20
6
NH,
and the right-hand side values are calculated as
2
( O0
-- 5 7
0
O4
6 - -4) 4
The next step is to solve the following set of two simul348
Ind. Eng. C h e m . , Process Des. Develop., Vol. 13, No. 4 , 1974
taneous equations given by eq 11, 12, and 13. To keep the numerical example simple, the weights u k and u k are Set equal to unity for nonzero flows and infinitely large for zero flows.
80.521 - 5.522 = 2 0 2 . 6 -
5.521
+
8.522 = - 6 . 0
(15) (16)
The solution is 21 = 2.5827 and 22 = 0.9653. Finally the corrected inlet and exit flow rates are calculated using eq 14 and 3, respectively. The numerical values are given in Table I. When reaction c is included in the set of reactions that take place in the reactor, the corrected flow rates are identical with those obtained using the earlier procedure. The extent of reaction c corresponding to these corrected values is negative. Negative values for the extent of reaction means that the reaction proceeded in the reverse direction. Thus the corrected flow rates using the earlier procedure and inconsistent not only with the requirement that reaction c is impossible but also with the constraint that reaction c is possible but irreversible. Discussion If the number of independent chemical reactions in the system is equal to the possible maximum (which is equal to the number of chemical species minus the rank of the element matrix) and if the independent reactions are all reversible, the corrections obtained using this procedure are identical with those given by the earlier procedure. Since the earlier procedure is much simpler, the procedure presented here should be used only when these conditions are not met. The problem as formulated here does not ensure that the extents of irreversible reactions be nonnegative. A general procedure recommended to handle this problem is as follows. Select the set of independent reactions such that reversible reactions are included as much as possible. If any of the irreversible reactions has a negative extent, that reaction may be assumed not to have taken place and the problem is resolved leaving that reaction out of the set of possible reactions. This procedure does not ensure that all the corrected flow rates for any given set of weights be all nonnegative. If any of the corrected flow rates is negative the problem can be resolved by assigning higher weight to that measured flow rate. The occurrence of negative flows is very rare if the weights are selected, as men-
tioned in the earlier paper, to minimize the sum of the squares of the relative errors rather than those of the absolute errors. If any of the flows should be kept a t the measured rate, infinitely large weights should be assigned to them. When u k ) in eq 11 and either u k or u k is m, the factor U k U k / ( U k 12 becomes unity. If U A = a ,then x, = f,. If u k = a,then
+
j
-1
If all the known reactions are considered without checking whether they are linearly independent, the matrix formed by the coefficients cI, may be singular. In fact, this matrix will be singular if the set of reactions is not independent, but the set of equations given by eq 13 will be compatible and hence any one set of solutions may be used to obtain the corrected flow rates. The purpose of using an independent set of reactions is to minimize the number of simultaneous equations to be solved. Nomenclature a,, = stoichiometric coefficient of the j t h species in the
ith reaction e,] = number of j t h element in a molecule of the ith species N = number of chemical species in the system R = number of independent reactions u L = weight for the flow rate of the ith species entering the system u, = weight for the flow rate of the ith species leaving the system x f = measured molar flow rate of the ith species entering the system y f = measured molar flow rate of the ith species leaving the system z L = extent of the ith reaction Literature Cited Aris, R . . "Introduction to the Analysis of Chemical Reactors." pp 9-14, Prentice-Hall, Englewood Cliffs, N. J.,.1965. Himrnelblau. D. M . . "Applied Nonlinear Programming," McGraw-Hill, New York, N. Y.. 1972. Hunter, W. G., lnd. Eng. Chem., Fundam.. 6 4 6 1 (1967). Murthy. A. K. S., Ind. Eng. Chern., Process Des. Develop., 12, 246 (1973). Vaclavek. V.. Collect. Czech. Chem. Commun.. 34, 2662 (1969)
Received for reuiew October 15, 1973 Accepted May 15,1974
Ind. Eng. Chem., P r o c e s s D e s D e v e l o p . , Vol. 13, No. 4,1974
349