mathematical modeling of cstr for polystyrene production

Upload: dwb5307

Post on 16-Oct-2015

45 views

Category:

Documents


0 download

DESCRIPTION

Mathematical modeling of CSTR

TRANSCRIPT

Mathematical Modeling of CSTR and PFR for Polystyrene Production

Mathematical Modeling of CSTR and PFR for Polystyrene ProductionChE 360 Project

David William BeliasDavid BeliasAustin GoewertDavid Kozak5/1/2014

Table of Contents

Introduction2Results5Mathematical Modeling of Polystyrene Formation using CSTR5

IntroductionModeling processes in chemical engineering often require the use of analytical mathematical methods. Throughout the 360 course, various methods have been used to solve systems of ordinary and partial differential system of equations. Each method contains its limitations. In this project, students were required to utilize their problem solving skills to create the most effective model to represent the system. Different mathematical methods were used with each reactor to obtain the most accurate solutions.The first problem involves a monomer reacting exothermically with an initiator to produce polystyrene, which can be seen in Figure 1. A cooling jacket was run around a continuously stirred tank reactor to control the temperature. Perfect mixing, constant volume, and constant properties were assumed. Figure 1: Continuous polymerization reactor (CSTR)

This problem had to be solved by modeling the mathematical equations from Figure 2. First, the three steady states were evaluated with respect to the given conditions. The steady state analysis involved using Newtons Method. Afterwards, these states were compared to the dynamic process at two different reactor temperatures (350 K and 300 K). These changes were used to investigate the effects of temperature change on the reaction. The dynamic process was evaluated using Eulers Explicit method in which the stiffness value was found to be of magnitude one. Figure 2: CSTR equations

The second problem involved a jacketed plug flow reactor, which is diagrammed in Figure 3. The main difference pertaining to the plug flow reactor was the lack of complete mixing within the reactor. This reactor differed spatially from the CSTR and was thus described by the equations below in Figure 4. Figure 3: Continuous polymerization reactor (plug flow)

Figure 4: Plug flow equations

This problem was initially solved to find the reactor temperature along the reactor length steady states. These values were calculated using the Finite Differences method. The second analysis for this problem was to evaluate the startup process of the reactor to investigate the effects it had on the steady state concentrations and jacket temperature. To solve for these equations, both Eulers Explicit and Eulers Implicit methods were used. Note: All calculations were done in Matlab. See the Appendix for all of the scripts.

Results

Mathematical Modeling of Polystyrene Formation using CSTRSteady-State Analysis:The first problem posed for the CSTR reactor was to find the three steady state conversions that the mathematical model produces. The given model for this reactor was a system of four coupled differential equations, written for the initiator concentration, the monomer concentration, the reactor temperature, and the cooling jacket temperature. The steady state parameter allowed the systems differential equations to be transformed into a system of nonlinear algebraic equations. Newtons method was used to solve this system of equations. Newtons method involves the formulation of the Jacobian Matrix. In this problem, the Jacobian Matrix was a four by four matrix, consisting of the partial derivatives taken with respect to each variable for each of the equations. The partial derivatives were evaluated using Matlab, and then formulated into a matrix within the program created to perform Newtons Method, which can be seen in Appendix 1. Once this program was able to run the correct Newton iterations, the steady state solutions could be found. The problem stated that there would be three steady state conversions: high, low, and medium. In order to find these different steady states the initial guesses given to the program need to be altered accordingly. To find the high conversion, the initiator and monomer concentrations have to be low, because a high conversion implies the consumption of the reactants. Also, because the reaction is exothermic, the expected reactor and jacket temperatures were guessed to be high for high conversion. To find the low conversion, the initial guesses followed the opposite thinking. The concentrations of the initiator and monomer were guessed to be high, because there would be less consumption of the reactants. The temperature of the reactor and jacket were guessed to be low, because the less reaction would take place with a low conversion. To find the medium conversion, the guesses would be somewhere in between the low and high conversion guesses. It did take a number of guesses before the medium conversion steady state was found. The initial guesses and the subsequent conversions that were produced are summarized in Table 1. The actual steady state values for each conversion can be found in Table 2.ConversionInitial Guess for Initiator Concentration (mol/l)Initial Guess for Monomer Concentration (mol/l)Initial Guess for Reactor Temperature (K)Initial Guess for Jacket Temperature (K)

High Conversion0.80090.0020.5400360

Medium Conversion0.22320.023340320

Low Conversion0.0.04550.25320300

Table 1: A summary of the initial guesses used to find each of the steady states for the CSTR model for producing polystyrene.

ConversionSteady State Initiator Concentration (mol/l)Steady State Monomer Concentration (mol/l)Steady State Reactor Temperature (K)Steady State Jacket Temperature (K)

High Conversion0.80090.00080.6927406.2144334.6012

Medium Conversion0.22320.06152.7027343.0869312.1228

Low Conversion0.0.0455Table 2: The actual values found at each steady state using Newton iteration.

0.0683.3245323.1681305.1681

Once these steady state conversions were found, the stability of each was analyzed. Stability of a steady state can be determined by calculating the eigenvalues of the Jacobian Matrix at the given steady state. The eigenvalues at each steady state were found using the Matlab eig function. The resulting eigenvalues define the stability of each steady state. For example, the eigenvalues calculated at the high conversion steady state were all negative or complex numbers with negative real parts. This set of eigenvalues implies that the high conversion steady state is stable and attractive. This particular steady state is known as a stable focus. The eigenvalues produced for each steady state and the corresponding stability analysis is summarized in Table 3. Eigenvalue 1Eigenvalue 2Eigenvalue 3Eigenvalue 4StabilityAttractivityType of Critical PointStiffness Value

High Conversion-0.0066-0.0002 +0.0001i-0.0002-0.0001i0stableattractivefocus148.2183

Low Conversion-0.0367-0.0881-0.1026 +0.0060i-0.1026 -0.0060istableattractivefocus2.8004

Medium Conversion0.9879-0.7216 +0.1936i-0.7216 -0.1936i-0.9318unstableunattractivesaddle1.3222

Table 3: The eigenvalues and stability for each steady state conversion

As can be seen in Table 3, the medium conversion steady state was determined to be unstable, due to a positive eigenvalue. This explains why the medium conversion steady state was initially hard to find. The initial guesses needed to be especially close to the medium conversion steady state values. The stability of these steady state values will be revisited later in the dynamic analysis of this CSTR reactor.Dynamic Analysis:The dynamic analysis of this mathematical model involved the solution of four coupled ordinary differential equations. The method that was used to solve these differential equations was Eulers Explicit Method. Euler's Explicit method is acceptable if the system is not stiff. Because each of the ordinary differential equations is nonlinear, it is impossible to determine the overall stiffness of the system. However, it is possible to get a very good estimate of the systems stiffness if it is evaluated around each of the steady states. The stiffness of the system around each of the steady states was determined using Equation 1.

Equation 1: equation for stiffness, where denotes an eigenvalue for a given state.

If the stiffness value is close in magnitude to one then the system can be considered not stiff. If the stiffness value is much greater than one, then the system is stiff. The stiffness values for each steady state were low enough to consider the system as not stiff. The precise stiffness values can be seen in Table 3. This stiffness evaluation allowed the analysis to proceed accurately with Eulers Explicit Method. This method allows the ordinary differential equations to be discretized in space, creating a large system of linear algebraic equations that can be solved explicitly. The low conversion steady state values for concentration and temperature were used as initial conditions for the dynamic analysis. However, the feed temperature was set at 350 K, so the profile did not remain at the steady state points. The program designed to run this dynamic analysis was created in Matlab and listed in Appendix 1. The maximum time for any dynamic process can be calculated by using Equation 2 below.

The maximum time step for the low conversion was found to be 11.35 seconds, but a time step of 5 seconds was used. This ensures a more accurate dynamic analysis. After running the analysis, the concentration and temperature profiles were plotted. The results for concentration and temperature profiles can be seen in Figure 5.Figure 5: a) Concentration of initiator (blue) and monomer (green) for low conversion values. b) Reactor temperature (blue) and jacket temperature (green).

As can be seen in Figure 5a, the concentration of the monomer (green) begins at the initial steady state concentrations and drops sharply. This shows that the monomer is reacting to form polystyrene. The slight increase is due to the reaction of monomer slowing down, and fresh monomer being added to the CSTR. Since fresh monomer is being added, and the reaction is not as large, the monomer concentration in the reactor increases. Eventually, the addition of monomer is neutralized by the polymerization reaction and a steady state concentration is reached. The initiator concentration begins at the steady state value and after approximately five hours, the initiator concentration drops to zero where it remains for the duration of the process. The initiator concentration drops at the same time that the monomer concentration reaches a minimum. This is expected because once there is no more initiator in the reactor, the consumption of the monomer for the polystyrene polymerization reaction slows down. As a result, the addition of fresh monomer increases the monomer concentration in the reactor. Eventually, no more reaction is taking place and the monomer concentration remains steady as the flow rate in and out of the reactor are the same, so equal amounts of monomer are entering and leaving. These concentrations are also affected by the reactor temperature. Although the reactor is initially at a low conversion steady state, the warmer feed heats up the reactor enough to force the reactor to a new, high steady state, at a conversion of 0.8509. Figure 5b shows the reactor temperature (blue) and jacket temperature (green) profiles. At about five hours, the reactor temperature reaches a maximum. It should be noted that this initial spike in reactor temperature is most likely unsafe. In order to diminish this effect, a decreased jacket temperature would be recommended to absorb some of the heat created by the initial spike in the reaction. This increase in temperature is expected because the monomer concentration is at a minimum at this point. The reaction is exothermic, so a large amount of heat is being produced, thus increasing the reactor temperature. This also means that the monomer is being consumed in the reaction, so its concentration will decrease drastically. Due to the increase in reactor temperature, the jacket temperature also increases during this time. After this maximum, the reactor temperature begins to decline due to decreased initiator concentration, and due to an influx of fresh feed that is now below the reactor temperature. As the initiator is consumed, the system begins to reach a steady state, and equilibrium is reached between the heat produced by the reaction and the heat transferred into the cooling jacket. The jacket temperature also reaches a steady state at this time.The process was then analyzed at the medium conversion steady state. The feed temperature was changed to 300 K, so the dynamics could be analyzed. The maximum time step was analyzed using Equation 2 shown above. The maximum time step was found to be 1.012 seconds, so a time step of 0.1 seconds was chosen. Figure 6 below shows the concentration and temperature profiles of this dynamic analysis.Figure 6: a) Concentration of initiator (blue) and monomer (green) for medium conversion values. b) Reactor temperature (blue) and jacket temperature (green).

Looking at Figure 6, it can be seen that the conditions result in a diminished reaction. The reactor was initially at 343 K; however the feed entered at 300 K. The colder feed causes the reactor temperature to decrease. The temperature of the reactor and the jacket then converged to new steady state temperatures, which were much lower than the initial temperature. Since the reactor temperature evolved to a much lower steady state temperature, a lower conversion ensued. A lower conversion implies an increase in monomer concentration throughout the reactor, which can be seen in Figure 6a. The initiator concentration increased slightly as the process continued, which was due to the feed stream entering and adding more initiator. However, initiator was not being used up because reaction was happening at a lower magnitude. Although the reactor is initially at the medium conversion steady state the cold feed causes the reactor to move to a new, lower steady state, at a conversion of 0.0031. The conversions for both of the dynamic analyses were plotted against the reactor temperature. The results are displayed below in Figure 7 below.Figure 7: Conversion versus reactor temperature for the low and medium conversion dynamic processes.

Figure 7 shows two strands of a phase portrait, one for the reactor initially at the medium conversion steady state (leftmost) and another for the reactor initially at the low conversion steady state (rightmost). It can be seen that the leftward strand diverges from the medium conversion steady state at 0.2232 to a much lower conversion steady state at around 0.0031. This lower conversion also is accompanied by a decreasing temperature. On the other hand, the right ward strand is initially at the low conversion steady state, but the influx of warm feed causes the reaction to accelerate and reach a new steady state at a conversion of 0.8509. Although it was expected that perturbing the reactor by adding feeds at different temperatures could result in the reactor moving to a new steady state, it was unexpected that these steady states would not be the same as the ones found in the steady state analysis. However, this dilemma is resolved when the conditions for which those initial steady states were calculated. In the steady state analysis of this system the feed temperature was taken to be constant at 330 K, however, in the dynamic analysis above the feed was varied at 300 and 350, leading to new steady states. In fact, most likely if the initial conditions for the reactor are varied then three new steady states could be found for each of the altered feed temperatures. Figure 8: Phase-plane portrait of conversion at varying initial reactor temperatures for a feed entering at 340 K.

The above phase plane portrait shows the steady state conversion tendencies for the CSTR reactor at varying initial temperatures. This phase portrait was created for a feed entering at 330 K; the same conditions as in the steady state analysis. As can be seen in Figure 8, the initial reactor temperature will determine if the reactor will tend toward any of the three steady state conversions: high medium or low. If the reactor temperature is initially greater than around 343 K the reactor will most likely proceed to the high conversion steady state of 0.8009, and a temperature of 406 K. However, if the reactor is initially below 343 K then the reactor tends toward the low conversion steady state of 0.0455, and a temperature of 323 K. These two steady states are stable to slight perturbation of initial reactor temperatures. This stability makes sense when the eigenvalues around these critical points are revisited. The eigenvalues all had negative real parts, and there were imaginary parts in a couple of them. This set of eigenvalues is distinctive for critical points that are known as stable focus points. Stable focus points show characteristic spirals which can be seen for the high and low conversion steady states. The last steady state is the medium conversion steady state, which appears in Figure 8 to be unstable. There does seem to be one strand of the phase portrait that appears to converge to the medium conversion steady state. This strand represents the dynamics of a reactor that begins at 343 K, which is in fact the medium conversion steady state reactor temperature. This means that the only way the reactor will converge to this steady state is if the initial conditions of the reactor are very close to the steady state conditions. When looking at the eigenvalues, this instability is expected, because one of the eigenvalues is positive and real. Positive eigenvalues are characteristic of unstable critical points. Overall, the dynamic analysis gave an insight to the importance of initial reactor conditions in the convergence to steady states. Specifically, as the initial reactor temperature is lowered the low convergence steady state becomes more favorable, but as the initial reactor temperature is increased the high conversion steady state becomes more favorable. Also, this dynamic analysis displayed the importance of feed temperature on steady state values. Specifically, as the feed temperature is increased the reactor will converge to higher conversion steady states, but as the feed temperature is lowered the reactor will converge to lower conversion steady states.