Sunteți pe pagina 1din 18

Dynamics of a Continuously Stirred Tank Reactor

By: Mason Anderson, Ahmed Alasiri, Faiz Alanzi, and Travis Lindsay

Group 5

December 10, 2018


Abstract:

Using dimensionless quantities the impact of time on temperature and conversion within

a continuous stirred tank reactor (CSTR) were analyzed. The dimensionless quantities α and

β/Tss were evaluated with respect to the change in θ to observe the impact of time on conversion

and temperature in the CSTR. The program explained herein can be used for any CSTR system

following the same assumptions regardless of scale and throughput. With program inputs

consisting of a Damkohler number for reaction, Damkohler number for heat transfer, and the

Arrhenius factor for the reaction; if these values are known for a reaction then disturbances in α

and β/Tss can be graphed as functions of time using the program defined as Code 1.

Also, the steady-state temperature values for an example CSTR with coolant was created

and examined using arbitrary parameters. Using material and energy balance for the CSTR and

coolant allows for construction of a two ODE system. The final result displays the highest

steady-state temperature possible with the given assumptions, which will afford the highest

conversion.
Introduction:

A continuous-flow stirred tank reactor (CSTR) is a well-known

reactor type in chemical and bio-engineering plants. In CSTR, the

reactants are fed to the reactor where there is a stirrer to insure uniform

composition and homogenies mixture. The concentration of the outlet is

the same as the reactor itself. The reactor has a cooling jacket to

maintain the temperature. At steady state condition, the inlet and outlet

flows are equal to keep the level of the reactor constant. CSTR is used commonly in biological

processes. Fermenters and high density animal cell culture are some of the uses of CSTR. CSTRs

come in different size with different types of stirrers and cooling jackets.

Usually the reactor runs on steady state condition. However, if there is a disturbance in

the temperature or conversion, the reactor typically responds to these disturbances but no all the

time. This report shows how the reactor behave under disturbance and the deviation from steady

state.

Equations:

𝑑𝛼 𝛽
= 𝑎𝛼 + 𝑏 (𝑇 ) Equation 1
𝑑𝜃 𝑠𝑠

𝛽
𝑑( ) 𝛽
𝑇𝑠𝑠
= 𝑐𝛼 + 𝑑 (𝑇 ) Equation 2
𝑑𝜃 𝑠𝑠

𝑎 = −(1 + 𝐷𝑎)

𝑏 = 0.01 ∗ 𝛾 ∗ 𝐷𝑎

𝑐 = −𝐷𝑎𝑓 ∗ 𝐷𝑎
𝑑 = −0.01 ∗ 𝐷𝑎 ∗ 𝛾 ∗ 𝐷𝑎𝑓

𝑡
𝜃= 𝑡̅

a,b,c,d: Constants based on values of parameters

𝑡̅: is the mean residence time where 𝑡̅ = V/Q .

V is the volume of the reactor.

Q is the volumetric flow rate of the reactor.

Da: Damkohler number for reaction. Ratio of reaction rate to bulk transport rate.

𝐸
𝛾: Arrhenius factor = 𝑅𝑇𝑠 . It measures the sensitivity of the reaction to temperature.

𝐷𝑎𝑓 : Damkohler number for heat transfer. It measures relative magnitude of heat generated in

the reactor to heat flow out of the reactor.


Algorithm Development:

Code 1:

Basic Structure/Flow Chart:

Figure 1. A flow chart for the development of Code 1 for the project. The algorithm developed began with initialization of the
function with user input for parameter values being requested. And if statement was implemented to ensure that each user
input for each parameter fell into the potential range of values for that parameter. Once all the parameters were inputted; two
differential equations were defined representing Equations 1 and 2, defined in the introduction. These two equations were then
solved with resulting plots for each variable being plotted as a function of time.

The basic structure of the algorithm developed for differentiation of the equations defined

in the introduction as Equation 1 and Equation 2 involved initializing the function in the

command window followed by user input for parameter values; the code for this program can be

seen in Figure 2 with explanations for each line of code in Figure 3. User input will be requested

for values of “Da”, “Daf”, and “gamma”; Da corresponds to the Damkohler number for the

reaction, Daf corresponds to the Damkohler number for heat transfer, and gamma corresponds to

the Arrhenius factor. The user input will be denied by the program if a value is inputted that falls

outside of the range outlined in the theory for this project; if a user inputs a value outside of the

specified range then the program will remind the user of the acceptable range of values and

request a new user input.


Once three acceptable parameter values are entered the program will form a two row

column vector with each row corresponding to the differentiable equations for Alpha and Beta

divided by Temperature at steady state that are outlined in the introduction (Equations 1 and 2);

with the parameter values inputted by the user being utilized as constant values in the equations.

These two differentiable equations were defined with Alpha and Beta divided by Temperature at

Steady state both being defined as the variable “u”; However, Alpha corresponds to the first

column of array “u” and Beta divided by Temperature at Steady State corresponds to the second

column of array “u”. This was done so that the matlab function known as “dsolve” was not

needed to be used; “dsolve” is what matlab recommends for solving system of differentiable

equations. However, due to the stiffness of our data this solver kept returning chaotic results with

lots of extra noise in the resulting plots as well as negative values for time being obtained. This

lead to the development of the algorithm used for this program; which defined both unknowns as

the same variable (u); allowing for any of the ODE solvers to be used. After trials with multiple

ODE solvers being used; “ODE15s” was determined to be the most efficient solver that produced

the most theoretically expected results and was utilized in the program.

“ODE15s” works by integrating a system of differential equations for a specified time

span given initial conditions. The “s” in “ODE15s” indicates that the performance of this solver

is best for stiff equations which include some terms that can lead to rapid variation in the

solution obtained. Due to this stiffness of the equations iteration was not implemented that took

in multiple user inputs for combinations of the parameters for Da, Daf, and gamma. This was due

to the large dependence of the solution on these parameters values; with each combination of

parameters resulting in such a unique graph it was not useful to plot multiple on one graph. For

this program we specified a time span of 0-250. This large timespan was chosen due to some
combinations of parameters resulting in a much longer time intervals being required to reach

steady state compared to other combinations of parameters.

Extra Program: Finding Steady State Temperature:

The previous program allows for the use of dimensionless quantities, θ, α, and β/TSS in

order to find the impact on the temperature (β) and conversion (α) versus the ratio of actual time

to residence time (θ). In the modern world the use of dimensionless quantities is of extreme

value, but for a CSTR the impact of time on temperature/conversion is most impactful when the

steady state temperature can be found and used to base the temperature disturbances around. In

order to model the CSTR to find the steady state temperatures (Tss), several constants and

assumptions for the reaction must either be known or calculated. For the process to be properly

modeled using polynomic methods, the CSTR must be assumed to be steady state (no

accumulation), perfectly mixed (no local concentration differences), and that the volume, heat

capacities, and densities are all constant. The CSTR will be modeled as assuming an exothermic

reaction with a cooling coil, allowing for energy balance calculations to be used. For the use of

the program the required parameters for the reactor are: reactor volume, reaction rate constant,

activation energy, reactant feed temperature, coolant feed temperature, heat of reaction, specific

heat of reactant, specific heat of coolant, density of reactant, density of coolant, feed

concentration, and heat transfer coefficient. Derived from material and energy balances about the

CSTR produces the set of two ordinary differential equations:

𝑎4
𝑑𝑇
= 𝑎1 (𝑇0 − 𝑇) + 𝑎2 ∗ 𝑘1 ∗ 𝐶𝐴 + 𝑎3 ∗ 𝑞𝑐 ∗ (1 − 𝑒 𝑞𝑐 ) ∗ (𝑇𝑐0 − 𝑇) …1
𝑑𝑡

𝑑𝐶𝐴
= 𝑎1 ∗ (𝐶𝐴0 − 𝐶𝐴 ) − 𝑘1 ∗ 𝐶𝐴 …2
𝑑𝑡
The constants of an are described as such:

𝑞 −∆𝐻 𝜌𝑐 ∗𝑐𝑝𝑐 −ℎ𝑎


𝑎1 = 𝑉 𝑎2 = 𝜌∗𝑐 𝑎3 = 𝜌∗𝑐 𝑎4 = 𝜌
𝑝 𝑝 ∗𝑉 𝑐 ∗𝑐𝑝𝑐

Where q, V, ΔH, ρ, ρc, cp, cpc are flow rate (L/min), volume (L), heat of reaction (cal/mol),

density of reactant (g/L), density of coolant (g/L), reactant specific heat (cal/(g*K)), and coolant

specific heat (cal/(g*K)) respectively.

Result and Discussion:

Due to alpha being defined as the departure from conversion at steady state we expected

this value to range anywhere from 1 to -1. However; we did not expect these extreme values to

be reached due to conversion being defined as a ratio of outlet and inlet concentrations. With

only small differences being seen between this ratio at the systems operating temperature and

this ratio at steady state; we did not expect the extreme values of 1 and -1 to be reached. Due to

beta being a defined as the departure in temperature from steady state; beta divided by

temperature at steady state represents a ratio of the departure in temperature from steady state

temperature to the temperature at steady state. We expected the maximum magnitude in

departure from steady state temperature to be equal in magnitude to steady state temperature;
resulting in an expected ratio anywhere from 1 to -1; with the maximum of value 1

corresponding to a time step of zero (when departure from steady state is a maximum).

The following output will be seen from Code 1 for parameter values of Da=1, Daf=0.05,

and gamma=20; these are all the minimum values for the parameters.

Figure 2. Figure 2 shows Alpha graphed as a function of time for the minimum parameter values.
Figure 3. Displays beta divided by temperature at steady state graphed as a function of time for the minimum parameter values.
The following results will be obtained for parameter values of Da=50, Daf=0.2, and gamma=40;

these are the maximum values for all parameters.

Figure 4. Displays alpha graphed as a function of time for the maximum parameter values.
Figure 5.Displays beta divided by temperature at steady state as a function of time for the maximum parameter values.

Comparing graphs of alpha for the minimum and maximum values of the parameters

shows the large dependence the solution for alpha has on the values of the parameters; this large

dependence on inputted parameter values can also be seen in the graphs for beta divided by

temperature at steady state. The expected values for Alpha and Beta divided by temperature at

steady state were obtained for both the minimum and maximum values for all the parameters.

The maximum parameter values resulted in the system reaching steady state for both Alpha and

Beta divided by temperature at steady state at a much faster rate relative to the minimum

parameter values.
Supplementary Code Calculating Steady State Temperature:

The non-linearity of the function can be seen in the reaction rate (k1) that can be

calculated using the Arrhenius law. Using the equations and parameters mentioned above the

following graph can be constructed by plotting the heat generated by the reaction (Qr) and the

heat removed from the reaction (Qa) versus temperature, the places at which the two functions

cross are the steady state temperatures. From the functions above the following figure can be

constructed showing the three steady state temperatures. There are two steady-state temperatures

and one unsteady-state temperature as illustrated by the middle point. The greatest steady-state

temperature will be the temperature at which the greatest conversion occurs. From the figure and

code the highest steady-state temperature will be 456.17K with the assumptions used in the

program.
The use of this code with the known parameters of the reaction and coolant can afford a

maximum operable steady-state temperature; yielding the highest possible conversion of

reactant. In conjunction with the code discussed previously, the operating conditions and time

required for the greatest conversion of a reactant using a CSTR can be found and applied.

Conclusion:

Code 1 plotted the differential equations listed as Equations 1 and 2 in the introduction

with respect to θ; with θ corresponding to time divided by the mean residence time in the reactor.

Resulting plots show the large dependence that each of the variables plotted has on the

parameters that are inputted by the user. With maximum parameter values resulting in the system

reaching its steady state temperature at a much faster rate.

The supplementary code was able to find the highest steady-state temperature as well as

the maximum percent conversion of the reactants for the given values. If the constant parameters

were changed to fit a different CSTR system the code would still be viable so long as the

assumptions remained valid. The supplementary code in conjunction with Code 1 helps establish

an effective two-part program for modeling CSTR dynamics.


Appendix:

Code 1:

function [u]=AlphaBeta()
Da=input('Enter a Value for Da')
if Da<1 | Da>50
Da=input('Range of values goes froom 1-50; Pick a new value.')
else
Da=Da
end
Daf=input('Enter a value for Daf')
if Daf<0.05 | Daf>0.2
Daf=input('Range of values coes from 0.05-0.2. Pick a new value')
else
Daf=Daf
end
gamma=input('Enter a value for gamma')
if gamma<20 | gamma>40
gamma=input('Range of values goes from 20-40.Pick a new value')
else
gamma=gamma
end
u1i=0
u2i=1
tspan=[0 250]
function dudt=uhoh(t,u)
dudt=[(-(1+Da)*u(1)+(0.01*gamma*Da*u(2)));((-Daf)*Da*u(1))+(-
0.01*Da*gamma*Daf*u(2))]
end
[t,u]=ode15s(@uhoh,tspan,[u1i u2i]);
figure(1)
plot(t,u(:,1),'r')
xlim([-5 250])
%ylim([-0.05 0.5])
xlabel('Time/Mean Residence Time in Reactor')
ylabel('Alpha')
title('Alpha as a Function of Time')
figure(2)
plot(t,u(:,2),'k')
xlim([-5 250])
%ylim([-0.1 1.1])
xlabel('Time/Mean Residence Time in Reactor')
ylabel('Beta/Temperature at Steady State')
title('Beta/Temperature at Steady State as a Function of Time')
end
Figure 2. Displays Code 1 for our project. Explanation of each line can be in the algorithm development section.

Line 1: Defines the function with its output being array “u”.
Line 2: requests user input for variable defined as “Da”.
Lines 3-7: If statement specifying range of values for “Da” from 1-50. If user inputs value outside of this
range a new value is requested from the user until a value within the range is inputted.
Line 8: Requests user input for a value of “Daf”.
Lines 9-13: If statement specifying range of values for “Daf” from 0.05-2. If user inputs value outside of
this range a new value is requested from the user until a value within the range is inputted.
Line 14: Requests user input for variable defined as “gamma”.
Lines 15-19: If statement specifying range of values for “gamma” from 20-40. If user inputs value outside
of this range a new value is requested from the user until a value within the range is inputted.
Line 20: Defines initial condition for alpha as zero.
Line 21: Defines initial condition value for Beta/Temperature at Steady State as 1.
Line 22: Defines the timespan for differentiation as 0-100.
Lines 23-25: Defines system of differentiated equations as “dudt” with “u” corresponding to both Alpha
and Beta divided by Temperature at Steady state. “u(1)” corresponds to Alpha while “u(2)” corresponds
to Beta divided by Temperature at Steady State; with the 1 and 2 corresponding to the first and second
columns of “u” respectively.
Line 26: Solves the system of differentiated equations using Matlab’s built in “ODE15s” solver.
Lines 27-33: Plots Alpha as a function of the time divided by the mean residence time in the reactor and
adds various details to the resulting plot.
Lines 34-40: Plots Beta divided by Temperature at steady state as a function of time divided by the mean
residence time in the reactor and adds various details to the resulting graphs.
Figure 3. Displays explanations for each line of Code 1.

Supplementary Code Calculating Steady State Temperature:

%Finds the Steady State Temperature for a CSTR with Coolant Stream Given a
Number of Constans and Assumptions
%Assumptions- Reactant is perfectly mixed and volume/heat capacity/density
%of the solution does not change much during residence in the reactor
%Constants
v=100; %Volume-L
T0=350; %Reactant Feed Temp-K
q=100; %Flow rate of CSTR solution-L/min
qc=80; %Flow rate of coolant solution-L/min
deltaH=-(2*10^5); %Heat of reaction (assumed to be exothermic)-cal/mol
rho=(1*10^3); %Densiy of reactant-g/L
cp=1; %Specific heat of reactant-cal/(g*K)
k0=7.2*(10^10); %Reaction rate constant-1/min
ca0=1; %Feed concentration-mol/L
EoverR=(10^4); %Activation energy over gas constant-K
rhoc=1000; %Density of coolant-g/L
cpc=1; %Specific heat of coolant-cal/(g*K)
ha=7*10^5; %Heat transfer coefficient-cal/(K*min)
T=300; %Initializing low end of tested temperatture range-K
z=1; %Iterative factor
Trs=zeros(200:1); %Reactant-Zero vector for each temperature value for a
range of 200 T values
Qrs=zeros(200:1); %Reactant-Zero vector for each heat value for a range of
200 Q values (K/min)
a1=q/v; %Calculated constant-1/min
a2=(-deltaH)/(rho*cp); %Calculated constant-(L*K)/mol
a3=(rhoc*cpc)/(rho*cp*v); %Calculated Constant-1/L
a4=(-ha/rhoc*cpc); %Required flow of coolant-L/min

%Qr-Heat Generated by Reaction


while T<=500
k1=k0*(exp(-(EoverR)/T)); %Calculates the rate constant of reaction using the
Arrhenius law
cas=(a1*ca0)/(a1+k1);
Ts=(a1*T0+a2*k1*cas+a3*qc*T0*(1-exp(a4/qc)))/(a1+a3*qc*(1-exp(a4/qc)));
Qr=a2*k1*cas;
Qrs(z)=Qr;
Trs(z)=T;
T=T+1;
z=z+1;
end

%Qa-Heat Removed by Coolant


Qas=zeros(200:1);
Tas=zeros(200:1);
Ta=300;
za=1;
while Ta<=500
k1=k0*(exp(-(EoverR)/Ta));
cas=(a1*ca0)/(a1+k1);
Ts=(a1*T0+a2*k1*cas+a3*qc*T0*(1-exp(a4/qc)))/(a1+a3*qc*(1-exp(a4/qc)));
Qa=(a1+a3*qc*(1-exp(a4/qc)))*Ts-(a1*T0+a3*qc*(1-exp(a4/qc)))-273.15;
Qas(za)=Qa;
Tas(za)=Ts;
Ta=Ta+1;
za=za+1;
end
plot(Trs,Qrs,Tas,Qas,'--')
ylim([-5 225])
legend('Qr(T)-Heat Generated in Reactor','Qa(T)-Heat Removed from Reactor')
title('Reactor Heat Balance')
xlabel('T(K)')
ylabel('Qr(T) and Qa(T) (K/min)')
grid on

QrsTrs=polyfit(Trs,Qrs,3); %makes a polynomial of power 3 for Qrs


QasTas=polyfit(Tas,Qas,1); %makes a polynomial of power 1 for Qas
QasTas2=[0 0 QasTas]; %Creates a new array of polynomial coefficients to
equal length of QrsTrs
QsTs=QrsTrs-QasTas2; %Finds difference after equating them
S=roots(QsTs); %Finds roots of the new array
Tss=max(S);
disp('Steady State Temperature is')
disp(Tss) %displays maximum steady state temperature
References:
Matlab Documentation. Mathworks Incorporated. Nested Functions.

Vojtesek, J. (n.d.). MATLAB program for Simulation and Control of the Continuous Stirred

Tank Reactor. Retrieved December 8, 2018, from

https://pdfs.semanticscholar.org/8433/1e551144157d66b1505109bc47593f4c0ca8.pdf

S-ar putea să vă placă și