Professional Documents
Culture Documents
Using Spreadsheets and Visual Basic Applications: As Teach NG Aids For A Unit Operations Course
Using Spreadsheets and Visual Basic Applications: As Teach NG Aids For A Unit Operations Course
,~
••ij_:j._c_l_a_s_s_~_o_o_m__________,)
USING SPREADSHEETS
AND VISUAL BASIC APPLICATIONS
As Teaching Aids for a Unit Operations Course
T
he design of separation processes frequently uses in- During this course, we initially lectured on the fundamen-
tensive trial-and-error procedures as well as graphi- tals of the calculation methods and presented illustrative ex-
cal methods such as McCabe-Thiele, Ponchon- amples. These first examples were solved using the trial-and-
Savarit, and Triangular diagrams. Using process simulation error and graphical procedures. Then we presented a solu-
design packages such as ChemCAD, HYSYS , or AspenPLUS tion to the same problem using spreadsheets and VBA. We
facilitates the design of complex processes, but students of- discussed the details on how to program the spreadsheets and
ten treat simulators as black-boxes and tend to accept the re- elaborate the macros. Once the students had learned how to
sults they obtain without further analysis. lIJ Additionally simu- use these tools, we asked them to develop their own Excel
lators may not provide the user with knowledge of all calcu- Macros and VBA programs to solve problems for homework.
lations that are performed or the respective algorithms. On We used a process simulator (ChemCAD) during some of
the other hand, manual step-by-step calculations and graphi- the lectures and compared results obtained from both ap-
cal methods, while allowing students to understand the fun- proaches. As a final project, we asked the students to create a
damentals of the design process, do not equip them with the more complex algorithm for the design of an absorber. We
ability to adapt software tools to the solution of chemical were very pleased to see that the students had developed very
engineering problems or to critically use existing simulation creative, user-friendly computer programs. By the end of the
packages. Tools such as MS Excel Macros and small Visual course, 76% of the students used some kind of Excel spread-
Basic Applications (VBA) bridge the gap between the previ- sheets and Macros to solve their homework, compared to
ous alternatives. 11.5% at the beginning of the semester.
At Tulane University, spreadsheets have been intensively
used as teaching aids in undergraduate courses.l2·31 Using Juan P. Hinestroza is Assistant Professor at North
Carolina State University, Department of Textile
spreadsheets and VBA to solve chemical engineering prob- Engineering, Chemistry, and Science. He received
lems requires a deep understanding of the concepts behind his PhD from Tulane University in 2002. His re-
the calculations, while the extensive and time-consuming trial- search interests are in the development, testing,
and modeling of novel protective clothing and bar-
and-error procedures are left to the computer. The interactive rier materials.
nature of the spreadsheets and VBA programs allows "what
if' analyses in which the parameter values are changed and
the results are immediately displayed .l21 One advantage of
using spreadsheets as teaching tools is that the instructor can Kyrlakos 0. Papadopoulos is Professor of
Chemical Engineering at Tulane University, hav-
spend significantly more time discussing the fundamentals ing joined its faculty in 1981 and served as De-
of mass transfer and the conceptual and quantitative descrip- partment Chair from 1998 to 2001 . He obtained
tion of processes, as well as the engineering insight that is his DEngSc from Columbia University in 1982.
His research focuses on some of the phenom-
needed in designing distillation, absorption, and other sepa- ena that are important in the separation, trans-
rations, by spending less class time on the details of solving port, and reaction processes of particulate sys-
tems, with emphasis on drug delivery, lubricant-
problems graphically and by trial-and-error. 141 technology, and environmental applications.
• Currently an Assistant Professor at North Carolina State University. © Copyright ChE Division of ASE,E 2003
B C D E F G H K L M N
Figure 1. Spreadsheet used for ilustrating absorption of acetone in a countercurrent stage tower.
C O E G K
0.350
0.300
Sub INTERPHASE_COMPOSITION ()
Range("G27'') .Select
0.1 50
SolverOk SetCell:="$E$19" , MaxMlnVal:=3, ValueOf:=·o·, ByChange:="$E$16"
SolverSolve
0.100 SolverOk SetCell :="$F$19'', MaxMinVal:=3, ValueOf:="0", ByChange:="$F$16"
y = 8.1 414x' -1.4766x' + 0.6184x-0.0022
SolverSolve
0.050 R' = 0.9994 SolverOk Se1Cell:="$G$19", MaxMinVal:=3, ValueOf:•"0", ByChange:="$G$16"
SotverSotve
SolverOk SetCell:="$H$19", MaxMinVal:=3, ValueOf:="0", ByChange:="$H$16"
0.000 - - - - - - - - - - - - - - - - - -.....
0.140 0.240 0.290 0.340 SolverSolve
0.090 0.190
End Sub
X
Figure 2. Spreadsheet and Macro used for interative calculation of interface compositions in interphase mass transfer.
In Figure 2, cells D13-D19 display the equations and col- Due to the ease of modification of spreadsheets, the cells
umns E - H display results from four iterations. Once the containing the equations can be copied and pasted into the
initial guesses are selected (cells El 1 and E12) , the slope for next columns as many times as necessary. In this example,
the line connecting the bulk concentration and the assumed four iterations provide a reliable answer (less than 0.1 % be-
interfacial concentrations is calculated, as shown in cell EIS. tween the latest and penultimate calculated values).
With the slope from EIS and point P (the bulk concentration What-if' scenarios in this example include how an increase
in cells D6 and D7) on the x-y plot in the lower-right comer in the liquid-film mass-transfer coefficient will readily show
of Figure 2, an equation for a straight line is deduced as shown that the value for the interfacial concentrations xAi and y Ai
in cell D 17 . A third-order polynomial was used to fit the equi- increase and how a large decrease in the bulk concentration
librium data (cell D18). will produce a significant decrease in xAi and yAi" In order to
The Excel function "SOLVER' is used to solve simulta- automate the iteration process, a MACRO was created using
C D
Rectification of a Benzene-Toluene Mixture
1.0
DESIGN PARAMETERS
,F ,.,
zoo moVh -- -~
0.9
"', w 0.t 5
0.1
CLICK HERE TO SOLVE FOR THE I
R
Ult•nt Heal
•
320ff KJ/Kg
OVERALL MASS BALANCE AND
THE INTERCEPT BE1WEEN THE Q) 0.8
151 KJ/Kg-mol AN D ENRICHING LINE
T, 327.1 K
T, 31i&.700K
0.7
•FORECAST(D7 ,M35:M4J
1.330-404331 =(03- E24)1{08-E23) Number of Plates 7.373l452!i2 ,135:143) 0.1
-0.033040433 • E2,t-C31 "E23
Figure 3. Spreadsh eet and Ma cro used for distillation of a benzene-toluene mixture.