Process Modelling, Simulation and Control For Chemical Engineering. Solved Problems. Chapter 4 Numerical Methods
Process Modelling, Simulation and Control For Chemical Engineering. Solved Problems. Chapter 4 Numerical Methods
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:
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.
An energy balance:
12000Td = 5000Tm
∗
+ 7000Ts∗ (8)
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:
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.
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
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
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.
Donations
If you want to make a donation, use my PayPal account: francisco.angel.rod@gmail.com
6
Figure 5: Work at compressor.