(263f) Combining Various Software Tools for Enhancing Programming and Numerical Problem Solving Capabilities | AIChE

(263f) Combining Various Software Tools for Enhancing Programming and Numerical Problem Solving Capabilities

Authors 

Cutlip, M. B. - Presenter, University of Connecticut
Shacham, M., Ben Gurion University of the Negev
This paper deals with the calculation of the Adiabatic Flame Temperature (AFT) for the combustion of gas mixtures in air with a variety of software packages and data sources. This will provide insight into how different mathematical software packages can be used as students proceed through their Chemical Engineering studies. The overall problem statement, needed data, useful equations and several solutions are given in an internet link.

At the Ben-Gurion University, first year students are required to take the introductory “Modelling and Computation” course where the mathematical software packages: POLYMATH (http://www.polymath-software.com) and MATLAB (http://www.mathworks.com) the Excel spreadsheet and the DIPPR (https://dippr.aiche.org) physical property database that is typically provided with POLYMATH are taught. The “Modeling and Computation Course” is described in detail by Shacham (2005). In a more advanced “Process Simulation” course, MATLAB and DIPPR are used for modeling individual unit operations. UniSim (https://www.honeywellprocess.com) process simulation program is used for simulation of complete processes. This course is described in more detail by Shacham (2011).

The use of the different software packages will be demonstrated here by calculating the “Adiabatic Flame Temperature (AFT)” for Ethane and Methane natural gas mixtures (presented as problem 2.13 in Cutlip and Shacham, 2007, a copy of the problem definition is available at the ftp site: ftp://ftp.bgu.ac.il/shacham/AIChE_19/Appendix_A.pdf ) . Physical property data (heats of combustion and heat capacity equations and values) are typically available from classical thermodynamic books. The solution of most problems usually start using POLYMATH whose desirable properties are mentioned, for example, by Mahecha-Botero et al. (2011) who advise that the program is appropriate “for solving systems of algebraic and ordinary differential equations because it requires minimal computer programming skills and is extremely simple to use.”

Exercise 1 (1st year CHEG students)

In this exercise the students are required to formulate the POLYMATH program for calculating AFT for one particular value of x (th air-to-fuel ratio) and a value of y (inlet ethane concentration). The POLYMATH program, which is self-explanatory, is shown in Figure B-1. (Note: the Figures and Tables won’t be included here in this paper, but they are available at the FTP site ftp://ftp.bgu.ac.il/shacham/AIChE_19/Appendix_B.pdf ). The solution for AFT involves solution of a nonlinear algebraic equation (NLE) which can be easily solved by pressing the pink arrow when the problem coding from Figure B–1 has been entered. Solutions obtained are, for example, AFT = 2198.0 K, for air-to fuel ratio of x=0.5 and 2503.3 K, for x = 1.

Exercise 2 (1styear CHEG students)


The next exercise is to obtain and plot AFT values for various air to fuel ratios and natural gas compositions. MATLAB and Excel are more suitable for such an assignment, consequently the POLYMATH options of exporting the problem statement to MATLAB and Excel are used.

A typical MATLAB function (as generated by POLYMATH) for this Exercise is shown in Figure B-2. The students are required to prepare a main program that calls the MATLAB function and carries out the calculations for large sets of x and y values. The requested MATLAB program is shown in Figure B-3 and the resulting plot of AFT vs air-to- fuel ratio, generated by this program, is shown in Figure B-4. Students find that learning MATLAB programming by modifying an existing, working program is much easier than starting from scratch.

In solving Exercise 2 with Excel, an error-prone and difficult task is to replace the POLYMATH variable names in the data base equations by appropriate cell addresses. This can be expedited by exporting the POLYMATH code to Excel as shown in Figure B-5. In column “B” of the Excel spreadsheet the original variable names are shown and in column “D” the original equations. The modified equations, in which the variable names were replaced by their addresses, are inserted in column “C”. The solution for AFT is obtained by using the “Solver” or “Goal Seek” tools to minimize the contents of cell “C19” by changing the value that appears in cell C18. Starting with a correct spreadsheet representation of the problem definition, it is necessary to generate tabular and graphical representations of the AFT results for different parameter values.

Exercise 3 (3rd year CHEG students)

The accuracy of the physical property data (heat of combustion and heat capacity correlations) included in the problem statement can be compared with the AFT obtained using the “Conversion Reactor” unit of the UniSim commercial process simulation program. The results of the UniSim calculations are shown in Figure B-6, for the parameter values x =. 1 and y = 0.75. The exit temperature from the conversion reactor is 2044 °C = 2317 K. The AFT temperature calculated, using the POLYMATH program for the same conditions is: 2503 K. Thus there is 8.03 % difference between the two solutions.

It is assumed that the significant difference between the AFT calculated by UniSim and the Excel model is caused by the difference in the precision of the physical property data used. This assumption can be checked by replacing the heat of combustion data and the heat capacity correlations in the POLYMATH model are replaced with up-to-date data from the DIPPR Physical Property Database. Note that a subset of 113 components from the DIPPR database are accessible from POLYMATH. This subset includes the six compounds included in the exercises.

The POLYMATH program, in which the heat of combustion data and the heat capacity correlations were replaced with the data and correlations from the DIPPR database, is shown in Figure B-7. The reported uncertainty for the heat of combustion data of CH4 and C2H6 is: < 0.2 %. The uncertainty for the ideal gas heat capacity correlations for all the compounds is reported as < 1 %. The AFT calculated, using the program shown in Figure B-7 for the parameter values x = 0. 1 and y = 0.75, was AFT = 2313 K, thus the difference from the value obtained by UniSim is only 1.12%. Thus, using more accurate physical property data brings the solution much closer to the value obtained with UniSim.

Conclusions

The problem solving of the Adiabatic Flame Temperature (AFT) for Ethane and Methane Mixtures in Air provides a real system for a host of calculations that can be conducted with a variety of commonly used PC software packages and process simulators. Use of POLYMATH, Excel, MATLAB, DIPPR Database and the UniSim Process Simulator are integrated into a progression of problem solving of increasing complexity that can be introduced progressively within the Chemical Engineering curriculum. Students enjoy this relatively gradual approach that builds up their capabilities and understanding of both the problem and the required problem solver that is being used. The POLYMATH export to MATLAB and Excel considerably speeds up the learning of these software packages. The good results of the comparison with a Process Simulator’s results (with its internal data base) increases the student’s| confidence in the correctness of the problem solutions and helps to verify the results.

References

  1. Cutlip, M. B. and Shacham, M. Problem Solving In Chemical and Biochemical Engineering with Polymath, Excel and MATLAB. Prentice-Hall, Upper Saddle River, New-Jersey, 2007.
  2. Mahecha-Botero, A., Reaume, S., Grace, J.R., Ellis, N., “Independent research as a teaching tool in graduate chemical reaction engineering. Case study: modelling isomerization of unsaturated fatty acids with catalyst deactivation”. Educ. Chem. Eng. 6 (1), e1–e9 (2011).
  3. Shacham, M., “An Introductory Course of Modeling and Computation for Chemical Engineers”. Comput. Appl. Eng. Educ. 13, 137-145(2005)
  4. Shacham, M., “Use of Advanced Educational Technologies in a Process Simulation Course”. Computer Aided Chemical Engineering, 29, 1135-1139(2011).