You are on page 1of 7

Process Modelling, Simulation and Control for Chemical Engineer-

ing. Solved problems. Chapter 4: Numerical methods.


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 scripts used in this chapter (Python) are available at:
https://drive.google.com/open?id=1dIXys9yC4gHTz72xuOROUNRcU81UrKRH

Problem 1
The example used will be the same presented earlier in the textbook, that is, find the bubble point temperature
for a mixture of 50% benzene and 50% toluene under a pressure of 760 [mm Hg]. Also the following values of
vapor pressures are known:

Component 100◦ C 125◦ C


Benzene 1360 2600
Toluene 550 1140

Assume that the vapor pressure dependence on temperature for every component can be modeled using the
following equation:
 
s Aj
Pj = exp + Bj
T

The false position algorithm is carried out in two stages. A first stage, which is similar to the interval halving
algorithm, during which the temperature estimate is updated by a fixed amount until it crosses the correct
value, and a second stage, during which the temperature estimate is updated using the recursive algorithm:
Tn − Tn−1
Tn+1 = Tn − f (Tn )
f (Tn ) − f (Tn−1 )

With T0 and T1 being the first pair of values that are at opposite sides of the correct value.
A computer program was developed to determine the bubble point temperature, the number of iterations re-
quired for different starting points and initial step sizes are the following:

X = 0.50 P = 760.00
Initial temp guess = 80.00, Initial temp step = 2.00
T = 92.19, Y = 0.7176, LOOP = 9
Initial temp guess = 80.00, Initial temp step = 4.00
T = 92.19, Y = 0.7177, LOOP = 15
Initial temp guess = 80.00, Initial temp step = 8.00
T = 92.19, Y = 0.7176, LOOP = 20
Initial temp guess = 100.00, Initial temp step = 2.00
T = 92.19, Y = 0.7176, LOOP = 6
Initial temp guess = 100.00, Initial temp step = 4.00
T = 92.19, Y = 0.7176, LOOP = 10
Initial temp guess = 100.00, Initial temp step = 8.00
T = 92.19, Y = 0.7176, LOOP = 13
Initial temp guess = 120.00, Initial temp step = 2.00
T = 92.19, Y = 0.7176, LOOP = 16
Initial temp guess = 120.00, Initial temp step = 4.00
T = 92.19, Y = 0.7176, LOOP = 25
Initial temp guess = 120.00, Initial temp step = 8.00
T = 92.19, Y = 0.7176, LOOP = 32

For the examples analyzed, it is observed that for a given initial step size, the convergence time is smaller for the
initial temperature guess that is closer to the correct value. Also for a given temperature guess, the convergence
time is smaller for the initial temperature step that is smaller. So, although a greater initial step size crosses

1
the correct solution in fewer steps (in other words the second part of the algorithm can be started earlier), the
greater deviation from the correct value that is produced, results in an overall greater convergence time.
Code(s) used: P1FalsePosition.py

Problem 2
The results are the following:

Interval halving
X1 = 0.100 X2 = 0.540 X3 = 0.300 X4 = 0.060 P = 75.000
Initial temp guess = 175.00, Initial temp step = 2.00
T = 209.07, Y1 = 0.3761, Y2 = 0.5451, Y3 = 0.0729, Y4 = 0.0059 LOOP = 26
Initial temp guess = 175.00, Initial temp step = 4.00
T = 209.07, Y1 = 0.3761, Y2 = 0.5451, Y3 = 0.0729, Y4 = 0.0059 LOOP = 18
Initial temp guess = 175.00, Initial temp step = 8.00
T = 209.07, Y1 = 0.3761, Y2 = 0.5451, Y3 = 0.0729, Y4 = 0.0059 LOOP = 15
Initial temp guess = 230.00, Initial temp step = 2.00
T = 209.07, Y1 = 0.3761, Y2 = 0.5451, Y3 = 0.0729, Y4 = 0.0059 LOOP = 19
Initial temp guess = 230.00, Initial temp step = 4.00
T = 209.07, Y1 = 0.3761, Y2 = 0.5451, Y3 = 0.0729, Y4 = 0.0059 LOOP = 15
Initial temp guess = 230.00, Initial temp step = 8.00
T = 209.07, Y1 = 0.3761, Y2 = 0.5451, Y3 = 0.0729, Y4 = 0.0059 LOOP = 13
Initial temp guess = 275.00, Initial temp step = 2.00
T = 209.07, Y1 = 0.3761, Y2 = 0.5451, Y3 = 0.0729, Y4 = 0.0059 LOOP = 41
Initial temp guess = 275.00, Initial temp step = 4.00
T = 209.07, Y1 = 0.3761, Y2 = 0.5451, Y3 = 0.0729, Y4 = 0.0059 LOOP = 26
Initial temp guess = 275.00, Initial temp step = 8.00
T = 209.07, Y1 = 0.3761, Y2 = 0.5451, Y3 = 0.0729, Y4 = 0.0059 LOOP = 19

Newton-Raphson
X1 = 0.100 X2 = 0.540 X3 = 0.300 X4 = 0.060 P = 75.00
Initial temp guess = 175.00
T = 209.07, Y1 = 0.3761, Y2 = 0.5451, Y3 = 0.0729, Y4 = 0.0059 LOOP 5
Initial temp guess = 230.00
T = 209.07, Y1 = 0.3761, Y2 = 0.5451, Y3 = 0.0729, Y4 = 0.0059 LOOP 3
Initial temp guess = 275.00
T = 209.07, Y1 = 0.3761, Y2 = 0.5451, Y3 = 0.0729, Y4 = 0.0059 LOOP 5

False position
X1 = 0.100 X2 = 0.540 X3 = 0.300 X4 = 0.060 P = 75.00
Initial temp guess = 175.00, Initial temp step = 2.00
T = 209.07, Y1 = 0.3761, Y2 = 0.5451, Y3 = 0.0729, Y4 = 0.0059 LOOP = 19
Initial temp guess = 175.00, Initial temp step = 4.00
T = 209.07, Y1 = 0.3761, Y2 = 0.5451, Y3 = 0.0729, Y4 = 0.0059 LOOP = 30
Initial temp guess = 175.00, Initial temp step = 8.00
T = 209.07, Y1 = 0.3761, Y2 = 0.5451, Y3 = 0.0729, Y4 = 0.0059 LOOP = 38
Initial temp guess = 230.00, Initial temp step = 2.00
T = 209.07, Y1 = 0.3761, Y2 = 0.5451, Y3 = 0.0729, Y4 = 0.0059 LOOP = 13
Initial temp guess = 230.00, Initial temp step = 4.00
T = 209.07, Y1 = 0.3761, Y2 = 0.5451, Y3 = 0.0729, Y4 = 0.0059 LOOP = 21
Initial temp guess = 230.00, Initial temp step = 8.00
T = 209.07, Y1 = 0.3761, Y2 = 0.5451, Y3 = 0.0729, Y4 = 0.0059 LOOP = 27
Initial temp guess = 275.00, Initial temp step = 2.00
T = 209.07, Y1 = 0.3761, Y2 = 0.5451, Y3 = 0.0729, Y4 = 0.0059 LOOP = 34
Initial temp guess = 275.00, Initial temp step = 4.00
T = 209.07, Y1 = 0.3761, Y2 = 0.5451, Y3 = 0.0729, Y4 = 0.0059 LOOP = 53
Initial temp guess = 275.00, Initial temp step = 8.00
T = 209.07, Y1 = 0.3761, Y2 = 0.5451, Y3 = 0.0729, Y4 = 0.0059 LOOP = 65

2
For the examples analyzed, the convergence time is smaller for the initial temperature guess that is closer to the
correct value. The Newton-Raphson algorithm converges faster than both interval halving and false position
algorithms. For false position, as discussed in Problem 1, the convergence is faster for smaller initial step sizes,
the opposite is observed for the interval halving algorithm, these characteristics results in smaller convergence
times for the false position algorithm (compared to interval halving) at smaller initial step sizes, whereas the
opposite is true at greater initial step sizes.
Code(s) used: P2FalsePosition.py P2IntervalHalving.py P2Newton.py

Problem 3
A sketch of the ejector is shown in Figure 1. The system of equations that describe the ejector are: three mass
fluxes (considering As = Ad ):

7000 = As ρs vs (1)
5000 = Am ρm vm (2)
12000 = As ρd vd (3)

As Ad
Am

Figure 1: Ejector.

Ideal gas expressions for calculating the density:


Pm Mm
ρm = (4)
RTm
Pd Md
ρd = (5)
RTd
The density at suction (ρs ) is known. Isentropic compression expressions for calculating ”intermediate temper-
atures” for use at the energy balance:
  γ−1
Pd γ
Ts∗ = Ts (6)
Ps
  γ−1
Pd γ
Tm

= Tm (7)
Pm

An energy balance:

12000Td = 5000Tm

+ 7000Ts∗ (8)

and finally a momentum balance:

As Ps + 7000vs + Am Pm + 5000vm = As Pd + 12000vd (9)

This leaves us with 11 unknowns (As , vs , Am , ρm , vm , ρd , vd , Pm , Td , Ts∗ , Td∗ ) and 9 equations. A design
procedure as the one suggested in Perry’s Chemical Engineer’s Handbook relies on determining an optimum
discharge over motive area ratio (Ad /Am ) and suction over motive flow ratio (ws /wm ), given a discharge over
suction pressure ratio (Pd /Ps ) and suction over motive pressure ratio (Ps /Pm ) using a design curve (Figure 2).
Here two additional relations will be used to complete the system of equations:

Ps /Pm = 0.20 (10)


As /Am = 100 (11)

The system of equations is solved using the successive substitution method, first the variables than can be solved
directly:

3
Figure 2: Design curves for optimum single-stage ejectors.

• Pm from Eq. (10).


• Ts∗ from Eq. (6).
• Tm

from Eq. (7).
• ρm from Eq. (4).
• ρd from Eq. (5).
• Td from Eq. (8).
second, an iterative procedure is carried out:
1. Guess As .
2. Calculate vs from Eq. (1).
3. Calculate Am from Eq. (11).
4. Calculate vm from Eq. (2).
5. Calculate vd from Eq. (3).
6. Calculate As,calc from Eq. (9).
7. Update As = As + β(As,calc − As ).
The results of the iteration procedure are the following (The starting value of As and β where found by trial
and error to assure convergence). The iteration stops when As,calc and As differs by less than one percent
.
A s guess v s A m v m v d A s calc
ft^2 ft/s ft^2 ft/s ft/s ft^2 %
0 10.00000 0.23924 0.10000 2.51691 0.31281 7.50006 24.99937
1 5.00013 0.47847 0.05000 5.03370 0.62560 3.75022 24.99748
2 2.50031 0.95684 0.02500 10.06639 1.25107 1.87549 24.98992
3 1.25066 1.91290 0.01251 20.12466 2.50113 0.93850 24.95973
4 0.62634 3.81965 0.00626 40.18460 4.99421 0.47076 24.83944
5 0.31518 7.59055 0.00315 79.85633 9.92468 0.23838 24.36594
6 0.16159 14.80560 0.00162 155.76215 19.35839 0.12509 22.58767
7 0.08859 27.00537 0.00089 284.10965 35.30964 0.07355 16.97427

4
8 0.05851 40.88534 0.00059 430.13374 53.45776 0.05465 6.60415
9 0.05079 47.10744 0.00051 495.59319 61.59318 0.05049 0.57900

The final results are:

A s ft^2 : 0.05079
v s ft/s : 47.11
A m ft^2 : 0.00051
rho m lbm/ft^3 : 5.52
v m ft/s : 495.59
rho d lbm/ft^3 : 1.07
v d ft/s : 61.59
P m psi : 750
T d F : 292
T s star F : 409
T m star F : 127

Code(s) used: P3EjectorDesign.py

Problem 4
The compressor power requirements are given by:
"  γ−1 #
γRTin Pout γ
wcomp =F −1
γ−1 Pin
Where F is the molar flow through the compressor (calculated dividing the reaction heat by the heat of
vaporization of the mixture), and γ will be assumed equal to 1.2. The pressure at the inlet is given by the liquid
composition and temperature inside the reactor.
Pin = PCs 3 xC3 + PiC
s
x
4 iC4

The outlet pressure is the bubble point pressure at the temperature of the condenser (because we expect at that
temperature a total condensation to occur).
Pout = PCs 3 yC3 + PiC
s
y
4 iC4

Where yj is the gas composition at the reactor (equal to the liquid composition at the condenser). Data for
vapor pressure dependency on temperature according to1 (T [K], P [Pa]):
B
ln(P ) = A + + C ln(T ) + DT E
T
is given:

Component A B C D E
Propane 59.078 -3492.6 -6.0669 1.0919 ∗ 10−5 2
Butane 66.343 -4363.2 -7.046 9.4509 ∗ 10−6 2

Data for enthalpy of vaporization dependency on temperature according to (T [K], ∆Hv [J/kmol]):
2
∆Hv = C1 (1 − Tr )C2 +C3 Tr +C4 Tr
with Tr = T /Tc , is given:

Component C1 C2 C3 C4 Tc
Propane 2.9209 ∗ 107 0.78237 -0.77319 0.39246 369.83
Butane 3.6238 ∗ 107 0.8337 -0.82274 0.39613 425.12

The different quantities involved in the calculation, and the power requirement are plotted against the liquid
composition of propane in the reactor (a base of Q = 1055 [J/h] was used) on Figures 3 to 5.
It can be observed that the minimum work requirement corresponds to x1 = 0, meaning that the reactor is
filled only with butane, as compared to using only propane, the greater molar flow due to the smaller heat of
vaporization of propane increases the work done by the compressor.
Code(s) used: P4Optimization.py
1 Perry’s Chemical Engineer’s Handbook. 8th edition.

5
Figure 3: Inlet and outlet pressure.

Figure 4: Molar flow.

Donations
If you want to make a donation, use my PayPal account: francisco.angel.rod@gmail.com

6
Figure 5: Work at compressor.

You might also like