Ind. Eng. Chem. Res. 1989,28, 876-877
876
Numerical Method for Determining the Optimum Temperature Profile of Tubular Reactors with Complex Boundary Conditions A method is presented for using readily available computer library routines with Pontryagin's maximum principle to determine the optimum temperature profiles of tubular reactors with complex boundary conditions. Boundary conditions are used to create an artificial objective function. Unknown variables at the inlet of the reactor are chosen as search variables and are manipulated by a multivariable search method to zero the artificial objective function. The Hamiltonian function is maximized along the length of the reactor using a single-variable search method. The procedure is illustrated with a tubular reactor with several chemical reactions followed by a separation device that returns a recycle stream to the inlet of the reactor. In this paper, a method is described for using Pontryagin's maximum principle and three readily available, general purpose computer routines for determining the optimum temperature profile of a tubular reactor with several chemical reactions followed by a separation device that returns a recycle stream to the reactor inlet. The routines that are needed are a single-variable search method, a multivariable search method (Kuester and Mize, 1973), and a method for solving a set of first-order differential equations given a set of initial conditions (Carnahan et al., 1969). The amount of code required for these routines is about 150 lines. Typically, these routines are available as computer library routines, which reduces the amount of code that must be written for an application. Search variables are chosen in a manner such that the differential equations that describe the extent of the reaction and the adjoint functions can be solved numerically starting at the inlet of the reactor and finishing at the exit of the reactor. The values of variables at the exit of the reactor along with other conditions are used to create an artificial objective function. The multivariable search method manipulates the search variable so as to zero the artificial objective function. As the numerical solution of the differential equations progresses along the reactor length, the temperature is manipulated by the singlevariable search routine so as to maximize the Hamiltonian function. The advantage of this approach is that fewer search variables are required than a computational method that requires iteration of the temperature at a large number of points along the length of the reactor. Example The procedure is illustrated with the following simplified example. A feed stream of known molar rate of flow and composition is combined with a recycle stream and introduced into a plug flow reactor where the following reaction occurs: Component A is the principle component of the feed, B is the desired component, and C is an undesirable byproduct. I t is desired that the production of B within the reactor be maximized. The reactor effluent flows into a separation device that is designed and operated such that the ratio of mole fractions of a component in the recycle stream of the separation device to that of the product stream is specified, i.e., a separation factor: =
xi,w/xi,p
xi,o = Zi,$F/(F
+ W) + Xi#W/(W + F / s J
(1)
The molar rate of flow of the recycle is denoted by Wand is specified. If the rate of recycle is specified, then separation factors can be specified for only two components; components A and B are chosen. Material balances are written for components A and B around the separation 0888-5885/89/2628-0876$01.50/0
i = 1,2 (2)
It is supposed that the dependencies of the mole fractions of A and B on the fractional length of the reactor are given by the following differential equations: dxl/dz = f , = [ x 2 exp(-368.393/2') x1 exp(-184.1965/T)]/(F
+ W)
(3)
dx2/dz = f 2 = [xl exp(-184.1965/T) x 2 exp(-368.393/T) - x2 exp(-276.295/2')] / ( F + W) (4) The differential equations that relate the change of the adjoint functions along the length of the reactor are dAl/dz = [(A, - A2 - 1) exp(-184.196/T)]/(F
+ W) (5)
dA,/dz = [(A, + l)(exp(-276.2947/2') + exp(-368.393/2')) - A1 exp(-368.393/T)]/(F
+ W) (6)
The boundary conditions for the adjoint functions can be written as A1,o
= Ai,oW/(F + W/si)
(7)
A2,o
= A2,oW/(F + W/SJ
(8)
The Hamiltonian function can be written as
H = Y+Ajl
AzB--+C
Si
device and then around the point where fresh feed and recycle are mixed. These results are combined to yield expressions for the mole fractions of A and B at the inlet of the reactor (xi,o)as a function of its mole fraction in the feed ( x i , J ,the reactor effluent (xi,o),the recycle rate, and the fresh feed rate. Steady-state operation requires the molar rate of feed and product be equal. This result is
+ Ad2
(9)
where Y is the integrand contained in the objective function y = x 2 ( e ) - x2(0) =
0
J0 (dx2/dz) dz =
At each point along the length of the reactor, the temperature is chosen in order to maximize H. For this example, it is also required that the temperature be chosen between TL and TH. A comprehensive development of equations like (5)-(10) for this recycle reactor system is available elsewhere (Beveridge and Schechter, 1970). The adjoint functions, AI and A,, and the mole fractions, xl and x2, all of the reactor inlet, are chosen as search 0 1989 American Chemical Society
I n d . Eng. Chem. Res. 1989, 28, 877-880
Table I. ComDuted Resultsa 2
0.00 0.10 0.20 0.30 0.40 0.50 0.60 0.70 0.80 0.90 1.00
A1
A2
X1
x2
H
0.2775 0.2667 0.2538 0.2384 0.2212 0.2034 0.1851 0.1663 0.1469 0.1261 0.1036
-0.5275 -0.4971 -0.4635 -0.4264 -0.3889 -0.3546 -0.3226 -0.2923 -0.2634 -0.2334 -0.2017
0.8350 0.7991 0.7661 0.7357 0.7085 0.6850 0.6642 0.6455 0.6285 0.6123 0.5969
0.1088 0.1391 0.1653 0.1878 0.2068 0.2227 0.2364 0.2483 0.2590 0.2685 0.2772
0.049 95 0.049 95 0.049 95 0.049 95 0.049 94 0.049 94 0.049 94 0.049 94 0.049 93 0.049 93 0.049 93
T 825 825 825 825 554 431 364 321 300 300 300
877
Nomenclature F = fresh feed rate, M T = absolute temperature, K W = recycle rate of flow, M Y = integrand of the objective function H = Hamiltonian function f = right-hand sides of (3) and (4) s = separation factor y = objective function x = mole fraction z = independent variable (fractional distance down the reactor)
Feed rate: 1.0. Recycle rate: 0.6. Feed mole fractions: 0.98, 0.01, 0.01. Separation factors: 1, 1. Maximum temperature: 825 K. Minimum temperature: 300 K.
Greek Symbols X = adjoint function { = value of the artificial objective function
variables. The artificial objective function is created from the boundary conditions on the adjoint functions, (7) and (8), and the material balances, (2). This result is
Subscripts f = reactor feed p = product w = recycle 0 = reactor inlet 1 = chemical species A 2 = chemical species B
r = [~,,e/~,,o
W / ( F + W/S1)l2 + [X,,O/X,,OW/(F + W/s2)12 + [xi,o/xi,e - xi,fF/((F + W)xi,e) W / ( F + W/S1)12 + [ x z , o / x 2 , 0 - x,,,F/((F + WIx2,e) - W / ( F + W/s2)I2 (11) -
r
At the solution, will be zero or sufficiently close to zero and positive at other points. The computed results for the example along with other parameters are shown in Table I. The amount of nonlibrary code that had to be written for this example was about 75 lines. For this example, 154 evaluations of the objective function were required; the amount of CPU time was 26.6 s. This technique has been successfully tested with a variety of reactor problems. The above requirements are typical provided the usual precautions are taken in formulating the objective function. It is desirable-that the objective function be formed so that perturbations in the search variables yield roughly the same changes in the objective function.
6 = exit of reactor
Literature Cited Beveridge, G. S. G.; Schechter, R. S. Optimization: Theory and Practice; McGraw-Hill: New York, 1970. Carnahan, B.; Luther, H. A.; Wilkes, J. 0. Applied Numerical Methods; Wiley: New York, 1969. Kuester, J. L.; Mize, J. H. Optimization Techniques with Fortran; McGraw-Hill New York, 1973.
Clayton P.Kerr Department of Chemical Engineering Tennessee Technological University Cookeville, Tennessee 38505 Received for review September 8, 1988 Revised manuscript received March 2, 1989 Accepted March 29, 1989
Preparation of Copper Sulfide Powders and Thin Films by Thermal Decomposition of Copper Dithiocarbamate Complexes Copper dialkyldithiocarbamates 2a-d (Cu(S2CNk),, where R = ethyl (Et), 2a; butyl (Bu), 2b; hexyl (Hex), 2c; 2-ethylhexyl (Oct), 2d) decomposed up to 320 "C into Cu2S. In contrast, (P-hydroxyethy1)methyldithiocarbamate 2e ( C U ( S & N M ~ ( C H ~ C H ~ O Hinitially ))~) released 3-methyloxazolidine-2-thione and gave CuS up to 230 "C. CuS thus formed was further converted into Cu2S between 300 and 400 "C. Although 2d and 2e gave pure Cul&3 phase, the sulfide mixture phase consisting of &Cu2S and Cu1.&3 was obtained from 2a-c. The preparation of Cu2S thin films on glass substrate also became possible via solution pyrolysis of 2e a t 250 and 300 "C for 1 h under Ar atmosphere, using DMSO solution (5 w t %). Copper sulfide is widely used as a semiconductor device material, especially for optoelectronics and photovoltaics, and several thin film processes have already been established (Yoshikawa et al., 1980; Rastogi and Salkalachen, 1982; Iborra et al., 1987). In general, large-area copper sulfide layers for terrestrial solar cells were prepared by chemical methods such as spray pyrolysis (Gadgil et al., 1987; Orban de Xivry et al., 1987), electrochemical deposition (Garcia-Camarero et al., 1986; Engelken and McCloud, 1985, and chemical bath deposition (Pramanik et al., 1987; Fatas et al., 1985). However, the yields of the target sulfide thin films still remain low in such chemical processes with respect to the precursor material fed 0888-5885/ 8912628-0877$O1.50/0
amounts. In particular, large proportions of the spray solution were exhausted from the chamber unused in spray pyrolysis, and the deposition efficiency decreased with a lowering of the concentration of the precursors in electrochemical deposition. In our continuous studies on the preparation and utilization of metal dithiocarbamate complexes, we have proposed a new and facile preparation procedure for certain metal dithiocarbamate complexes via direct condensation using metal oxides together with dithiocarbamic acids as starting materials (Nomura et al., 1986, 1987a). Since metal dithiocarbamates are soluble materials, the copper dithiocarbamate complexes prepared by the direct 1989 American
Chemical Society