CSTRHeatExchangeModel
From ControlsWiki
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
Contents |
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
- 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.
Single, 1st order reaction
- To avoid confusion, complex kinetics are not considered in the following modeling.
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.
Symbol | Meaning | Symbol | Meaning |
---|---|---|---|
V | Volume of Reactor | ρ | Density of Stream |
m | Mass Flow Rate | CA0 | Original Concentration |
CA | Current Concentration | T0 | Original Temperature |
T | Current Temperature | TC | Coolant Temperature |
ΔHrxn | Heat of Reaction | ΔCp | Overall change in Heat Capacity |
k0 | Rate Law Constant | E | Activation Energy |
R | Ideal Gas Constant | UA | Overall Heat Transfer Coefficient |
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:




In the case of a CSTR, we know that the rate of accumulation will be equal to . This comes from the fact that the overall number of moles in the CSTR is
, so the accumulation of moles will just be the differential of this. Since
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
, 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
. Combining all of these equations and then solving for
, we get that:

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








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:

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:

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

Assuming that all values in the ODE's remain constant except for and
, 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.
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: 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, . 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 → 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. |