CSTRHeatExchangeModel

Title: ODE & Excel CSTR Modeling with Heat Exchange

Authors: Jason Bourgeois, Michael Kravchenko, Nicholas Parsons, Andrew Wang

Date Presented: 10/3/06  Date Revised: 10/19/06


 * First round reviews for this page
 * Rebuttal for this page

Introduction
A CSTR (Continuous Stirred-Tank Reactor) is a chemical reaction vessel in which an impeller continuously stirs the contents ensuring proper mixing of the reagents to achieve a specific output. Useful in most all chemical processes, it is a cornerstone to the Chemical Engineering toolkit. Proper knowledge of how to manipulate the equations for control of the CSTR are tantamount to the successful operation and production of desired products.

The purpose of the wiki is to model dynamic conditions within a CSTR for different process conditions. Simplicity within the model is used as the focus is to understand the dynamic control process.

Assumptions
For the purposes of this Wiki, we have made the following assumptions to explain CSTR with heat exchange modeling.

Perfect mixing Single, 1st order reaction
 * The agitator within the CSTR will create an environment of perfect mixing within the vessel. Exit stream will have same concentration and temperature as reactor fluid.
 * To avoid confusion, complex kinetics are not considered in the following modeling.

$$ -r_a = kC_A\,$$

Parameters specified
 * We assume that the necessary parameters to solve the problem have been specified.

Volume specified
 * In a control environment, the size of the vessel is usually already specified.

Constant Properties
 * For this model, we have made the assumption that the properties of the species we are trying to model will remain constant over the temperature range at which we will be looking at. It is important to make this assumption, as otherwise we will be dealing with a much more complex problem that has a varying heat capacity, heat of reaction, etc.

ODE Modeling in Excel
To setup the model, the mass and energy balances need to be considered across the reactor. From these energy balances, we will be able to develop relationships for the temperature of the reactor and the concentration of the limiting reactant inside of it.

Variable Definitions
The following table gives a summary of all of the variables that we used in our mathematical formulas.

Mass Balance
From our energy and material balances coursework, we know that the general equation for a mass balance in any system is as follows:

$$(Rate\ Accumulation) = (Flow\ In) - (Flow\ Out) - (Rate\ Generation)\,$$

$$(Rate\ Accumulation) = V\frac{dC_A}{dt} $$

$$(Flow\ In) - (Flow\ Out) = \frac{m}{\rho}(C_{A0}-C_A) $$

$$(Rate\ Generation) = V(-r_a) = VC_Ak_0e^{-E/RT}\ $$

In the case of a CSTR, we know that the rate of accumulation will be equal to $$ V\frac{dC_A}{dt} $$. This comes from the fact that the overall number of moles in the CSTR is $$ VC_A\,$$, so the accumulation of moles will just be the differential of this. Since $$ V \,$$ is a constant, this can be pulled out of the differential, and we are left with our earlier result. We also know that the flow of moles in versus the flow of moles out is equal to $$ \frac{m}{\rho}(C_{A0}-C_A) $$, which is the mass flow rate, divided by the density of the flow, and then multiplied by the difference in the concentration of moles in the feed stream and the product stream. Finally, we can determine what the rate of generation of moles in the system is by using the Arrhenius Equation. This will give us the rate of generation equal to $$ VC_Ak_0e^{-E/RT}\,$$. Combining all of these equations and then solving for $$ \frac{dC_A}{dt} $$, we get that:

$$\frac{dC_A}{dt} = \frac{m}{\rho V}(C_{A0} - C_{A}) - k_{0}C_{A}e^{-E/RT}$$

Energy Balance
From our thermodynamics coursework, we know that the general equation for an energy balance in any system is as follows:

$$(Rate\ Energy Accumulation) = (Heat\ In) - (Heat\ Out) + (Rate\ Heat\ Generation) + (Heat\ Transfer)\, $$

$$(Rate\ Energy Accumulation) = V\rho C_p\frac{dT}{dt}$$

$$(Heat\ In) - (Heat\ Out) = m\Delta C_p(T_0-T)\ $$

$$(Rate\ Heat\ Generation) = -V\Delta H_{rxn}(-r_a) = -V\Delta H_{rxn}k_{0}C_{A}e^{-E/RT}$$

$$(Heat\ Transfer) = UA(T_C-T) $$

In the case of a CSTR, we know that the rate of energy accumulation within the reactor will be equal to $$ V\rho C_p\frac{dT}{dt} $$. This equation is basically the total number of moles (mass actually) in the reactor multiplied by the heat capacity and the change in temperature. We also know that the heat generated by this reaction is $$ -V\Delta H_{rxn}k_{0}C_{A}e^{-E/RT}\,$$, which is the rate of mass generation ($$-V r_a$$) times the specific heat of reaction ($$\Delta H_{rxn}$$). The overall rate of heat transfer into and out of the system is given by $$ m\Delta C_p(T_0-T)\,$$. This equation is the flow rate multiplied by the heat capacity and the temperature difference, which gives us the total amount of heat flow for the system. Finally, the amount of heat transferred into the system is given by $$ UA(T_C-T)\,$$. Combining all of these equations and solving the energy balance for $$ \frac{dT}{dt} $$, we get that:

$$\frac{dT}{dt} = \frac{m\Delta C_p(T_0-T) - V\Delta H_{rxn}C_Ak_{0}e^{-E/RT}+UA(T_C-T)}{V\rho\Delta C_p} $$

In a realistic situation in which many chemical processed deal with multiple reactions and heat effects slight changes to the modeled equation must be done. The diagram below evaluates the heat exchanger under heat effects in which there is an inlet and outlet temperature that is accounted for in the enthalpy term in the newly modeled equation.

To model a heat exchanger that accounts for multiple reactions simply take the deltaHrxn and deltaCp term and add the greek letter sigma for summation in front of the terms. When considering a case with multiple reactions and heat effects, the enthalpy and heat capacity of each reaction must be implemented in the energy balance, hence i and j represents the individual reaction species. The equation now looks something like this: $$\frac{dT}{dt} = \frac{m\sum\Delta C_{pij}(T_0-T)-V\sum\Delta H_{rxnij}C_Ak_{0}e^{-E/RT}+UA(T_C-T)}{V\rho\sum\Delta C_{pij}} $$

Euler's Method
In order to model an ODE in Excel, we will be using Euler's Method. The reason why we chose Euler's Method over other methods (such as Runge-Kutta) was due to the simplicity associated with Euler's. Trying to model with methods such as Runge-Kutta are much more difficult in Excel, while Euler's method is quite simple. We also checked the accuracy of our results using Euler's Method by comparing our answers with that of Polymath, a highly accurate ODE modeling program. We found that our answers were the same as that of Polymath, so we are quite comfortable using Euler's Method for our model. Here are the full details on Euler's Method. For this model, we will primarily be interested in the change in concentration of a reactant and the temperature of the reactor. These are the two differential equations that we were able to obtain from the mass and energy balances in the previous section. The following is an application of Euler's method for the CSTR on the change in concentration:

$$C_{Ai} = C_{A(i-1)} + \frac{dC_A}{dt}\Delta t$$

This same application can be made to the change in temperature with respect to time:

$$T_i = T_{i-1} + \frac{dT}{dt}\Delta t$$

Assuming that all values in the ODE's remain constant except for $$ T\ $$ and $$ C_A\ $$, the new value is then found by taking the pervious value and adding the differential change multiplied by the time step.

List of Equations
The following are a summary list of all of the equations to be used when modeling CSTR with a heat exchange.

$$ k = k_0e^{-E/RT}\,$$

$$\frac{dC_A}{dt} = \frac{m}{\rho V}(C_{A0} - C_{A}) - k_0C_{A}e^{-E/RT}$$

$$\frac{dT}{dt} = \frac{m\Delta C_p(T_0-T) - V\Delta H_{rxn}C_Ak_0e^{-E/RT}+UA(T_C-T)}{V\rho C_p} $$

$$C_{Ai} = C_{A(i-1)} + \frac{dC_A}{dt}\Delta t$$

$$T_i = T_{i-1} + \frac{dT}{dt}\Delta t$$

Combining Using Excel
To model the CSTR using Excel you use Euler's Method, Energy Balance and Mass Balance together to solve for the concentration at time $$ t $$.



Screenshot of Excel Model for CSTR with Heat Exchange

How to Use Our Model
In order to help facilitate understanding of this process, we have developed an Excel spreadsheet specifically for looking at the changes in concentration and temperature given some change in the input to the CSTR system. An example of a change to the system could be that the temperature of the feed stream has dropped by a given number of degrees, or that the rate at which the feed stream is being delivered has changed by some amount. By using our spreadsheet, you will be able to easily plug in your given parameters, and look at the trend of the concentration and temperature over a wide time interval.

The way in which this spreadsheet works is quite simple. Boxes are provided for you to input all of the given information for your CSTR problem. Various columns containing values for the temperature, concentration, etc., with respect to time have also been provided. There are then more columns that contain the values for the various differential equations from above. With the time derivative in hand, we are then able to predict the value of the temperature or concentration at the next given time interval.

Our easy-to-use Excel model is given here: [[Media:CSTR Excel Model Template.xls| CSTR Modeling Template]]. In our model, you will find a column of unknowns that must be specified in order to solve for the optimal conversion temperature and optimal concentration of A. There are then two cells that will display the optimal temperature and concentration. Graphs are also provided to look at the change in temperature and concentration over time. Most of the variables in the model are self-explanatory. One important feature of our model is the option to have a change in the temperature of the feed stream or the concentration of A after a given time t. You do not need to input a value for these cells if there is no change in the feed; it just provides a convenient way to look at the change of temperature and concentration of A. You are also provided with a cell for the time step, $$\Delta t\,$$. Depending on what size time step you choose, you may need to choose a larger value if your graphs do not reach steady state. If this is the case, the output cells will tell you to increase the time step.

Applications to Process Control
The model created can account for many different situations. However, in process control, it is very important for the following to be considered.

Exothermic reaction - In industry, the exothermic reaction is typically of more importance to controls as there is a safety factor involved. (i.e. explosive reactor conditions)

Volume constant - For CSTRs, liquids are mostly used.

The model developed can assist in controlling an actual process in many ways including the following, but not limited to:
 * Maintaining product concentration despite changes operating conditions
 * Predicting and preventing explosive reactor conditions
 * Flow rate optimization
 * Input concentration optimization
 * Operating temperature optimization
 * Coolant temperature optimization

This model is very useful for many simple reactor situations and will aid in the understanding of a process and how dynamic situations will affect operation.

In real-life applications, the reaction may not be first order or irreversible or involve multiple reactions. In all these cases, we modify the Energy and Mass Balance with additional rate law considerations.

Worked out Example 1
You are contracted by WOW Chemical to control the operation of their 3000 L jacketed CSTR. They desire to create chemical B from chemical A at an optimal conversion. What is the temperature at which the optimal conversion is achieved?

A &rarr; B is a first order, irreversible reaction.

Some information about the process:

Feed stream temperature = 400 K

Coolant temperature = 350 K

Heat of reaction = -200 J/mol

Inlet concentration of A = 9 mol/L

Inlet flow rate = 4 kg/s

Density of A = 1000 g/L

UA of the heat exchanger = 7 kcal/s

Rate constant = 1.97x1020 s-1

Activation energy = 166 kJ/mol

Overall change in Heat capacity = 1 kcal/kg-K.

Answer to Example Problem #1
From using our handy-dandy worksheet, we see that the optimal conversion occurs at 368.4 K. This comes from inputting all of the given information from the problem statement into the Excel sheet, and then reading off the value for the optimal temperature. Also, make sure you are converting to proper units, such as from kJ to J, for use of our model (just to see if you were paying attention to units).

[[Media:CSTR_Excel_Model_Example.xls| Example 1 Solution]]



Worked out Example 2
1. In the previous example, the plant was operating in the daytime. At night, there is a drop of 5 K in feed stream temperature. In order to maintain the same concentration do we need to...

A. Decrease the temperature of the cooling water in the heat exchanger.

B. Increase the temperature of the cooling water in the heat exchanger.

C. Maintain the same temperature of the cooling water in the heat exchanger.

2. At night, the inlet flow rate of the system also decreases due to the plant not operating at full capacity. What happens to the temperature of the reaction if concentration of A in the feed stream stays the same?

A. Decrease

B. Increase

C. Stay the same

3. Finally, if the rate constant doubled, what effect will this have on the overall concentration if temperature is held constant?

A. Increase

B. Decrease

C. Stay the same

Answers to Example Problem #2
1: B. Since the temperature of the feed stream has decreased, we will need to increase the temperature of the cooling stream in order to maintain the same temperature at which the CSTR was operating at before. Using the Excel spreadsheet from Example 1 and lowering the feed stream temperature by 5 K, we can first see that the temperature of the CSTR has fallen to 366.5 K.



We can then adjust the temperature of the feed stream and see that it must be raised by 3 K in order to return to the original operating temperature of 368.4 K.



2: A. Since there is less feed coming into the CSTR, the optimal temperature of the reactor will decrease as well. This can again be seen by using our Excel model from Example 1. We know that originally the temperature of the reactor was at 368.4 K. By decreasing the flow rate to 3 kg/s, we can see that the temperature of the reactor decreases by over 3 K down to 365.1 K.



3: B. We see in the equations for the differential equations that the rate constant has a negative effect on the conctration of A. By doubling its value, we will then be decreasing $$C_A$$ as well. This can also be seen in the Excel model from Example 1. We see that the original concentration of A is 6.3 mol/L. We can then double the value of the rate constant, and we see that the concentration of A drops down to 4.8 mol/L, which is what we had predicted would happen.