Application of Residue Theorem to evaluate real integrations.pptx
Proc sim escape21
1. Use of Advanced Educational Technologies in a
Process Simulation Course
Mordechai Shacham
Department of Chemical Engineering.
Ben-Gurion University of the Negev
Beer-Sheva, Israel
2. Typical Process Simulation Course Characteristics
Commercial simulators (such as HYSIS, AspenPlus and PRO
II) are used to model the steady state or dynamic operations of
processes.
Benefits: The process simulator "provides a time-efficient and
effective way for students to examine cause-effect
relationships“* among various parameters of the process
Pedagogical drawbacks: "it is possible for students to
successfully construct and use models without really
understanding the physical phenomena within each unit
operation“*
"the majority of students see simulations merely as
sophisticated calculators that save time.Ӡ
*Dahm et al., CEE, 36, 192 (2002) †Rockstraw, CEE, 39, 68 (2005)
3. Course Objectives
At the completion of this course the students should be able to:
1. Convert the mathematical models of the unit operations into
"unit modules" with consistent sets of input and output
variables.
2. Utilize up to date physical property databases for retrieving
property data and equations to be included in the unit modules;
3. Identify optimal computational sequence in a process flow-sheet
using various partitioning and tearing algorithm;
4. Identify the most efficient recycle convergence algorithm;
5. Identify suitable integration algorithms for various stages of a
dynamic process;
6. Use a commercial simulator to verify simulation results.
4. New Techniques and Tools Utilized
1. An interface to the DIPPR physical property database, which
enables transferring the data and the correlations directly into a
computer code.
2. A new technique for grouping the equations and data
according to their role in the model instead of computational
sequencing requirements.
3. Automatic conversion of Polymath equation sets into MATLAB
programs.
4. Using the most recent tools available for numerical solution of
problems.
5. Self-recording of the lectures using a Tablet PC
5. Semi-Batch Distillation of a Binary Organic Mixture* - An
Example
Prenosil, J. E., Chem. Eng. J. 12, 59-68 (1976)
10.991 mol n – octane
4.169 mol n - decane
Steam at 99.2 ºC
2.31 mol/min flow-rate
738 Torr, ambient press.
6. Problem Statement
Initially M = 0.015 kmol of organics with composition x1
= 0.725 is charged into the still. The initial temperature in the
still is T0 = 25 °C. Starting at time t = 0 steam of temperature
Tsteam = 99.2 °C is bubbled continuously through the organic
phase at the rate of MS = 3.85e-5 kmol/s. All the steam is
assumed to condense during the heating period. The ambient
temperature is TE = 25 °C and the heat transfer coefficient
between the still and the surrounding is U = 1.05 J/s-K. The
ambient pressure is P = 9.839E+04 Pa.
Assumptions: 1) Ideal behavior of all components in
pure state or mixture; 2) Complete immiscibility of the water
and the organic phases; 3) Ideal mixing in the boiler and 4)
Equilibrium between the organic vapor and its liquid at all times.
For standard state for enthalpy calculations pure liquids at 0 °C
and 1 atm. can be used.
7. Problem Statement
a) Calculate and plot the still temperature (T), component mole
fractions inside the still (x1,x2, y1 and y2) and the component
mole fractions in the distillate(x1dist and x2dist), as function of
time, using the data and the initial values provided.
b) The requirement is for the distillate to contain 90% of n-
octane. Determine the lowest n-octane mole fraction in the feed
that can yield the required distillate concentration. Compute the
percent recovery of n-octane in the distillate as function of
its concentration in the feed. Vary the feed concentration in the
range where the requirement for the n-octane concentration in
the distillate is attainable.
8. Semi-Batch Distillation - Heating Period Equations
Mass balance on the water phase yields
Water mass balance
Enthalpy balance
Phase equilibrium
Bubble point equation
9. Semi-Batch Distillation - Distillation Period Equations
Water mass balance
Organics mass balance
Vapor flow rate from
enthalpy balance
Temperature in still must follow the bubble point curve
10. Semi-Batch Distillation - Physical Property Needs and
Sources for the Original Reference*
*Prenosil, J. E., Chem. Eng. J. 12, 59-68 (1976)
12. Polymath Interface to the DIPPR Database – Property
Data Reports
Range of applicability
13. Steam Distillation –Heating Period - Polymath Model
Model Equations
Pure Component Properties
Mixture Properties
Problem Specific Data,
Initial and Final Values
)( 2211 pLpLpLww
LwSS
cxcxmcm
QHHW
dt
dT
S
W
W
dt
dm
)( TTUAQ E
P
Px
y 11
1
P
Px
y 22
2
01)( 21 WyyyTf
Grouping Equations and Data According to their Role
14. Steam Distillation –Heating Period - Results
Variable
Initial
value
Minimal
value
Maximal
value
Final
value
16 t 0 0 181.72 181.72
19 Temp 25 25 90.65594 90.65594
2 fT 0.953485 2.64E-05 0.953485 2.64E-05
13 MW 0 0 0.006996 0.006996
23 VP_C10H22 181.0043 181.0043 6461.373 6461.373
24 VP_C8H18 1870.976 1870.976 3.42E+04 3.42E+04
25 VP_H2O 3170.386 3170.386 7.19E+04 7.19E+04
26 x1 0.725 0.725 0.725 0.725
27 x2 0.275 0.275 0.275 0.275
28 Y1 0.013787 0.013787 0.251608 0.251608
29 Y2 0.000506 0.000506 0.01806 0.01806
30 YW 0.032223 0.032223 0.730306 0.730306
Final time obtained by trial and error
15. Steam Distillation – Distillation Period - Polymath Model
Model Equations
Pure Component Properties
Mixture Properties
No. Equation/ # Comment
1 # Distillation period model equations
2 d(MW)/d(t) = MS - V * YW # Eq. 6. Mass of water in the still (kmol) from mass balance
3 d(Mx1)/d(t) = -V * Y1 # Eq. 7. Mass of n-octane in the still (kmol) from mass balance
4 d(Mx2)/d(t) = -V * Y2 # Eq. 7. Mass of n-decane in the still (kmol) from mass balance
5 V =(MS*(HS-HL_H2O)+ Q) / (HV - (HL_H2O * YW + (Y1 * HL_C8H18 + Y2 * HL_C10H22)))
# Eq. 8. Vapor flow rate (kmol/s)
6 d(Temp)/d(t) = 1000 * eps # Eq. 9. Still temperature by controlled integration
7 M = Mx1 + Mx2 # Organic mass in the still (kmol)
8 x1 = Mx1 / M # n-octane organic liquid mole fraction
9 x2 = Mx2 / M # n-decane organic liquid mole fraction
10 Q = U* (Ta - Temp) # Eq. 3. Heat removed from the still (J/s)
11 Y1= VP_C8H18* x1 / P # Eq. 4. n-octane vapor mole fraction
12 Y2 = VP_C10H22* x2 / P # Eq. 4. n-decane vapor mole fraction
13 YW =VP_H2O / P # Water vapor mole fraction
14 eps = 1 - (Y1 + Y2 + YW) # Eq. 5A. Error used in controlled integration
15 M1dist = M0 * x01 - Mx1 # Mass of n-octane in the distillate (kmol)
16 M2dist = M0 * x02 - Mx2 # Mass of n-decane in the distillate (kmol)
17 MWdist = MS * t - MW # Mass of water in the distillate (kmol)
18 Mdist = M1dist + M2dist # Distilled organic phase (kmol)
19 x1dist = If (Mdist > 0) Then (M1dist / Mdist) Else (0) # n-octane distillate mole fraction
20 x2dist = If (Mdist > 0) Then (M2dist / Mdist) Else (0) # n-decane distillate mole fraction
21 TK = Temp + 273.15 # Absolute temperature (K)
22 #
23 #Pure compound property equations
- lines 13 - 22 in Table 3
24 HV1 = (135540*TK + 443100 *1635.6* (coth(1635.6 / TK)) - 305400 *746.4* (tanh(746.4 / TK))-
4.928E+08) # n-octane vapor enthalpy (J/kmol)
25 HV2= (167200*TK+ 535300 * 1614.1*(coth(1614.1 / TK)) - 378200 *742* (tanh(742 / TK)) -
5.791E+08) # n-decane vapor enthalpy (J/kmol)
26 HVW = (33363*TK + 26790 *2610.5* (coth(2610.5 / TK)) ^ 2 + 8896 * 1169*(tanh(1169 / TK)) -
4.471E+07) # Water vapor enthalpy (J/kmol)
27 #
28 #Mixture property equations
- lines 25 - 26 in Table 3
29 HV = YW * HVW + Y1 * HV1 + Y2 * HV2 # Vapor phase enthalpy (J/kmol)
30 #
WS
W
VyW
dt
dm
1
1
Vy
dt
mxd
2
2
Vy
dt
mxd
)( 2211 LLLwwV
LwSS
hyhyhyH
QHHW
V
cK
dt
dT
Wyyy 211
Controlled Integration
17. Heating Period – Automatic Conversion of the Polymath
Model into a MATLAB Program
The model is converted into a MATLAB
function
Equations reordered into a computational
sequence
MATLAB syntax is used
18. Heating Period – Secant Method Iterations on the Final
Time when fT = 0
The matrix yd stores the values of the
differential variables for both periods of
the distillation
19. Distillation Period – Use of Fully Implicit Integration Algorithm
and Secant Method Iterations on tfinal until x1dist <=0.9
Use the end points of the heating period as
starting points of the distillation period
res(1,1) = 1 - (Y1 + Y2 + YW);
res(2,1) = - (V * Y1)-dMx1dt;
res(3,1)= - (V * Y2)-dMx2dt;
res(4,1) = MS-V*YW-dMWdt ;
20. Temperature and Mole Fractions Variation during Batch
20
30
40
50
60
70
80
90
100
0 5 10 15 20 25 30
Time (min)
Temperature(Deg.C)
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0 5 10 15 20 25 30
Time (min)
Molefraction
x1 x2 y1 y2
Distillation (x1 = 0.725)
Heating Period
Distillation Period
Results are compared with
results of Aspen
21. Percent Recovery of n-octane in Distillate (90 % Purity)
as Function of its Initial Mole Fraction in the Feed
0
10
20
30
40
50
60
70
80
90
100
0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95
n-octane mol fraction in feed
Percentrecoveryofn-octane
22. Conclusions
1) The broad content and wide diversity of the course material
require that the students review, enhance, update and make
practical use of their knowledge of programming, material and
energy balances, thermodynamics, numerical methods and
reaction engineering.
2) Covering such a broad content is made possible by the
introduction of advanced instructional technologies and new,
time efficient problem solving techniques and tools
3) Optimal utilization of state of the art problem solving tools in
education requires continuous development of new problems
and modification of existing ones so that their level of
complexity, detail and the required precision follow the
advancement of the capabilities of the problem solving tools.