Sie sind auf Seite 1von 12

Process Modelling, Simulation and Control for Chemical

Engineering. Solved problems. Chapter 5: Simulation ex-


amples.
This document contains my own solutions to the problems proposed at the
end of each chapter of the book ”Process Modelling, Simulation and Control
for Chemical Engineers” Second Edition, by William L. Luyben. As such, I
can’t guarantee that the proposed solutions are free from errors. Think about
them as a starting point for developing or as a means of checking your own
solutions. Any comments or corrections will be appreciated. Contact me at
francisco.angel.rod@gmail.com
The computer programs developed for this chapter (Matlab) are available at:
https://www.dropbox.com/sh/75grbnmy4t7nfh9/AABEsHvjNdKm-xvGjWwiJ9pca?dl=0

Problem 1
Simulate the nonisothermal CSTR of Sec. 5.3, using Euler and fourth-order
Runge-Kutta, and compare maximum step sizes and computation times that
give 0.1% accuracy.

Solution
The system corresponds to a non-isothermal CSTR, cooled by fluid circulating
inside a jacket, modelled by the following equations:
dV
= F0 − F (1)
dt
d(V CA )
= F0 CA0 − F CA − V kCA (2)
dt
d(V T ) λV kCA U AH
= F0 T0 − F T − − (T − Tj ) (3)
dt ρCp ρCp
dTj Fj (Tj0 − Tj ) U AH
= + (T − Tj ) (4)
dt Vj ρj Cp,j Vj
k = αe−E/RT (5)
F = 40 − 10(48 − V ) (6)
Fj = 49.9 − Kc (600 − T ) (7)

(1) and (2) are total and by-species mass balances at reactor, (3) is the energy
balance, (4) is the energy balance for the jacket, (5) is a kinetic equation, (6)
and (7) are control equations for reactor discharge rate and cooling fluid flow
rate. Both reactor and jacket are treated as CSTR’s. Values of the parameters
are as following:

1
F0 = 40f t3 /h Vj = 3.85f t3 T0 = 530 ◦ R
E = 30000BT U/lbmol Cp = 0.75BT U/lbm ◦ R U = 150BT U/hf t2 ◦ R
Tj0 = 530 ◦ R ρ = 50lbm/f t3 Kc = 4f t/h ◦ R
α = 7.08 ∗ 1010 h−1 R = 1.99BT U/lbmol ◦ R Ah = 250f t2
λ = −30000BT U/lbmol Cp,j = 1BT U/lbmol ◦ R ρj = 62.3lbm/f t3
Starting values of the variables correspond to steady state values for CA0 =
0.50, the perturbation corresponds to an increase in feed concentration to CA0 =
0.55.
First, the results for the solution of the problem using the parameters given
in the text, this is using a time step of 0.1 and the Euler method, are shown in
Figure 1.

Figure 1: Results for ∆t = 0.1, Euler method.

It is observed that using this time step the results of all monitored variables
converge to steady state values approximately for t = 5 [h]. The code was mod-
ified to perform the calculation using a variable time step (∆t), the calculation
interval considered was between 0 and 5 [h]. For each calculation around 20
points were returned. The accuracy calculation was determined comparing the
solution for a given ∆t, with the values for CA , T and Tj obtained using a time
step equal to 0.5 ∗ ∆t. For the Runge-Kutta method, a maximum ∆t equal to
0.015298 gave the following values for the error (%):
Error CA T Tj
Average 2.8 ∗ 10−4 3.5 ∗ 10−3 0.028
Max. 2.1 ∗ 10−3 0.014 0.11
The results are shown in Figure 2. It can be observed that the greatest
error are obtained for the results corresponding to the jacket temperature (Tj ).
Althought the graphical results suggest a great deviation, the relative error is
small because of the magnitudes involved (the variation in Tj is around 1 ◦ F ,
whereas the value of Tj is around 600 ◦ F ), 327 time steps were performed,
equivalent to 1308 derivative evaluations.
For the Euler method, a maximum ∆t equal to 0.010996 gave the following
values for the error (%):

2
Figure 2: Results for ∆t = 0.015298, Runge-Kutta method.

Error CA T Tj
Average 4.5 ∗ 10−3 3.7 ∗ 10−3 0.028
Max. 0.024 0.012 0.10
The results are shown in Figure 3. Again, the jacket temperature presents
the greatest error values, the graphical results show that the value of Tj starts to
oscillate with increasing amplitude at the end of the interval considered, which
suggest that if a greater time interval for the calculation were to be considered,
a smaller ∆t would be required, 455 time steps were performed, equivalent to
455 derivative evaluations. From the results obtained, in this particular case,
the Euler method solves the problem under the constraints imposed using fewer
derivative evaluations.

Figure 3: Results for ∆t = 0.010996, Euler method.

Code(s) used: P1 non isothermal cstr.m P1 error analysis.m

Problem 2
Simulate the ideal binary distillation column of Sec. 5.4, using Euler and fourth-
order Runge-Kutta and compare computation times.

3
Solution
The systems corresponds to an ideal binary distillation column with liquid hold
up, which is modelled by the following equations:

dMn
= Ln+1 − Ln (1)
dt
d(Mn xn )
= Ln+1 xn+1 + V yn−1 − Ln xn − V yn (2)
dt
αxn
yn = (3)
1 + (α − 1)xn
Mn − Mn∗
Ln = L∗n + (4)
β

(1) and (2) corresponds to total and by-component mass balances at each
tray, (3) is vapor-liquid phase equilibrium equation, and (4) is a liquid hydraulic
relationship. The perturbation corresponds to an increase in feed composition
from Z = 0.50 to Z = 0.55, both the reboiler and condenser composition are
controlled varying the vapor flow rate V and reflux rate R, respectively, with
set point values of 0.02 and 0.98.
First, the results for the solution of the problem using the parameters given
in the text, this is using a time step of 0.005 and the Euler method are shown
in Figure 4.

Figure 4: Results for ∆t = 0.005, Euler method.

The code was modified in the same way as for Problem 1, the accuracy was
determined comparing the values obtained for reboiler composition (XB) and
condenser composition (XD), between the solution using a time step equal to
∆t and the solution obtained using a time step equal to 0.5 ∗ ∆t, considering a
criterion of 0.1%.
For the Runge-Kutta method, a maximum ∆t of 0.0274925 gave the following
values for the error(%):

4
Error XB XD
Average 0.037 2.2 ∗ 10−4
Max. 0.10 7.1 ∗ 10−4

The results are shown in Figure 5. The greatest values for the error corre-
sponds to the results for reboiler composition XB. It can be observed that the
results are in good agreement with those shown in Figure 4, 909 time steps were
performed, equivalent to 3636 derivative evaluations.

Figure 5: Results for ∆t = 0.0274925, Runge-Kutta method.

For the Euler method, a maximum ∆t of 0.0135 gave the following values
for the error (%):

Error XB XD
Average 0.021 1.4 ∗ 10−4
Max. 0.10 5.9 ∗ 10−4

The results are shown in Figure 6. Again the geatest values for the error
correponds to XB. As in the case of Runge-Kutta method, the results are in good
agreement with the ones shown in Figure 4, 1852 time steps were performed,
equivalent to 1852 derivative evaluations.
For this particular problem, the Euler method solves the problem under the
constraints imposed using fewer derivative evaluations.
Code(s) used: P2 binary distillation.m P2 error analysis.m

Problem 3
The initial startup of an adiabatic, gas-phase packed tubular reactor makes a
good example on how a distributed system can be lumped into a series of CSTRs
in order to study the dynamic response. The reactor is a cylindrical vessel (3
feet ID by 20 feet long) packed with a metal packing. The packing occupies
5 percent of the total volume, provides 50 f t2 of area per f t3 of total volume
(a), weighs 400 lbm /f t3 and has a heat capacity of 0.1 BT U/lbm ◦ F . The heat
transfer coefficient between the packing and the gas is 10 BT U/hf t2 ◦ F .

5
Figure 6: Results for ∆t = 0.0135, Euler method.

The reaction occuring is first order:


k
A−
→B
A dilute mixture of reactant A in product B is fed into the reactor at y0
mole fraction A and temperature T0 = 500 ◦ F . The heat of reaction is -30000
BT U/lbmol A. The specific reaction rate is given by:

k = 4 ∗ 102 e−15000/RT
Assume perfect gases with molecular weights of 40 and heat capacities equal
to 0.15 BT U/lbm ◦ F
The pressure at the inlet of the reactor is 100 psia. The pressure drop over
the reactor is 5 psi and the design superficial velocity is 1 ft/s at inlet conditions.
Assume that this distributed system can be adequately modeled by a five-
lump model of equal lengths. Inside each lump the gas temperature and the
composition vary with time, as does the packing temperature.
The packing and gas in each section are initially at 500 ◦ F with no reactant
in the system. At time zero, y0 is raised to 0.10 mole fraction A. Simulate the
system on a digital computer and find the dynamic changes in temperatures
and concentrations in all the sections.

Solution
The equations that allow to model the system are: mass balance for component
A:
dCA,i
Vg = A (CA,i−1 vi−1 − CA,i vi ) − V akCA,i
dt
where the reaction was considered to occur at the surface of the packing,
Ri = AkCA,i , the packing temperature was used to calculate the specific reac-
tion rate.

6
Energy balance for gas phase (the heat of reaction was considered to be
absorbed entirely by the gas phase):

dTg,i
Cp,g Mg = −V ah(Tg,i − Tp,i ) − V aλkCA,i
dt
+ ACp,g (vi−1 ρi−1 Tg,i−1 − vi ρi Tg,i )

And the energy balance for the packing:


dTp,i
Cp,p Mp = V ah(Tg,i − Tp,i )
dt
The velocity was determined assuming a constant mass flow across each sec-
tion, based on the conditions at the entrance of the reactor. Pressure drop was
assumed negligible. The results for concentration are shown in Figure 7, steady
state values are reached after approximately 400 seconds. The concentration
values increase in a short period, of approximately 5 seconds, as can be seen
in Figure 8. An overshoot can be observed in the concentration values (mostly
for Lump 1), this is due to the fast kinetics, which would require the use of a
time step too small to afford a reasonable calculation time with the algorithm
used (Runge-Kutta). So a slightly bigger time step was used, knowing that the
transient response calculated will not be accurate. The final values obtained are
Ci = (0.1066, 0.0161, 0.0025, 0.0004, 0.0001) 10−3 lbmol/f t3 , respectively.

Figure 7: Concentration.

The results for packing temperature are shown in Figure 9, whereas the re-
sults for gas temperature are shown in Figure 10. The profiles looks almost
identical, this is due to the high value of the heat transfer coefficient. The fi-
nal values obtained for gas temperature are Ti = (921, 988, 998, 1000, 1000) ◦ F ,
the values for packing temperatures are similar. The temperature values reach

7
Figure 8: Concentration.

steady state in approximately 1000 seconds, this also influences the concen-
tration profile (due to the change in kinetic constant), but this effect is small
compared to the effect of the jump in concentration entering the reactor.

Figure 9: Packing temperature.

Code(s) used: P3 lumped.m

Problem 4
A 6 [in] ID pipe, 300 feet long, connects two process units. The liquid flows
through in esentially plug flow conditions, so the pipe acts as a pure dead time.
This dead time varies with the flow rate through the pipe. From time equals

8
Figure 10: Gas temperature.

zero, the flow rate is 1000 gpm for 2 minutes. Then it drops to 500 gpm and
hold constant for 3 minutes. Then it jumps to 2000 gpm for 2 minutes and
finally returns to 1000 gpm. Liquid density is 50 lbm /f t3 .
While these flow rate changes are occurring, the temperature of the fluid
entering the pipe varies sinusoidally:

Tin(t) = 100 + 10sin(ωt)


where Tin = inlet temperature, ◦ F .
ω = 3 radians per minute.
Write a digital computer program that gives the dynamic changes in the
temperature of the liquid leaving the pipe, Tout(t) , for this variable time dead
time process.
Hint: The easiest way to handle dead time in a digital simulation is to set
up an array for the variable to be delayed. At each point in time you use the
variable at the bottom of the array as the delayed variable. Then each value is
moved down one position in the array and the current undelayed value is stuffed
into the top of the array. For fixed step sizes and fixed dead times, this is easy
to program. For variable step sizes and variable dead times, the programming
is more complex.

Solution
The inlet temperature as a function of time is shown in Figure 11.
For every flow rate, the fluid velocity inside the pipe can be calculated as:
q
v=
Ap

9
Figure 11: Inlet temperature.

Where q is the flow rate and Ap is the cross-sectional area of the pipe. The
results for velocity as a function of time are shown in Figure 12.

Figure 12: Fluid velocities.

For the fluid entering the pipe at time t, the time required for it to exit at
the other end (travel time) was determined. A recursive function (ttime t) was
used:
• The inputs of the function are: t: time at which the fluid enters the pipe;
tstart: an array containing the times at which the various velocity regimes
start (Figure 12); vel: the velocity values for each regime; ind: and index
indicating at which velocity regime the fluid enters the pipe and finally L:

10
the distance that the fluid needs to travel before reaching the end of the
pipe.
• First, it is assumed that the fluid reaches the end of the pipe under the
same velocity regime at which entered.
• It is verified that the travel time obtained this way is consistent with the
previous assumption, this is if t + ttime < tstart(ind + 1).
• If the fluid travels through the pipe under more than one velocity regime,
then a recursive call to ttime t is done, and the travel time corresponds
to the actual velocity regime part tstart(ind + 1) − t and the rest of the
travel (recursive call with t∗ , ind∗ and L∗ values).
The algorithm is shown in Figure 13.

Figure 13: Algorithm for determining travel time.

The outlet temperature at t + ttime corresponds to the inlet temperature at


time t. The results are shown in Figure 14. It can be noted that in the transition

11
from a flow rate of 1000 gpm to 500 gpm the outlet oscillations look wider (as
compared to inlet oscillations), because of the retardation experienced by the
signal. The contrary is observed in the transition from 500 gpm to 2000 gpm,
where the outlet oscillations looks thinner. It must be remembered that for a
single dead time value, the oscillations travel the pipe unchanged, regardless the
value of the velocity with which they are travelling.

Figure 14: Outlet temperature.

Code(s) used: P4 deadtime.m

12

Das könnte Ihnen auch gefallen