You are on page 1of 8

education for chemical engineers 6 ( 2 0 1 1 ) e114e121

Contents lists available at SciVerse ScienceDirect


Education for Chemical Engineers
j our nal homepage: www. el sevi er . com/ l ocat e/ ece
Teaching advanced equations of state in applied
thermodynamics courses using open source programs
ngel Martn

, Mara Dolores Bermejo, Fidel A. Mato, Mara Jos Cocero


Department of Chemical Engineering and Environmental Technology, University of Valladolid, Doctor Mergelina s/n 47011 Valladolid,
Spain
a b s t r a c t
Many advanced equations of state have been developed in the last decades which fulll important needs of the
industry. However, these equations frequently are not taught in applied thermodynamic courses, in part due to the
lack of educational resources for including application exercises. This article presents a set of computer programs
for the calculation of phase equilibrium and other thermodynamic properties using different equations of state
(classical cubic equations, cubic equations with excess Gibbs energy mixing rules, group contribution equations and
SAFT equations). All the programs are open-source and allow for different learning approaches, from application
exercises with these equations, to correlation of equation parameters or implementation of modied equations and
calculationalgorithms for more advancedcourses. The programs runinthe commercial computing software MATLAB
as well as in the free, open-source programOctave. The programs have been designed to be easily reusable using an
object-oriented programming methodology, and they may have some applications in research. Authors also present
their experiences in the application of the programs in applied thermodynamic courses at a Masters level.
2011 The Institution of Chemical Engineers. Published by Elsevier B.V. All rights reserved.
Keywords: Phase equilibrium; Open source programs; Cubic equations of state; Statistical associating uid theory
SAFT; Group contribution; Education; MATLAB; Octave
1. Introduction
Applied thermodynamics is a core subject in chemical engi-
neering. A thorough study of the fundamentals and the
calculation of uid phase equilibrium and thermodynamic
properties of uids is one of the distinctive aspects of chem-
ical engineering with respect to other elds of engineering.
This is due to the relevance of these properties in chemical
engineering applications, such as phase equilibrium-driven
separations, heat transfer operations, etc.
For many years, excess Gibbs energy G
E
models and cubic
equations of state have been the tools of choice for chemical
engineers when phase equilibriumcalculations. In particular,
cubic equations of state such as SoaveRedlichKwong (Soave,
1972) or PengRobinson (Peng and Robinson, 1976) are fre-
quently used for applications at moderate or high pressures,
or for calculating derived thermodynamic properties, applica-
tions in which excess Gibbs energy models are not accurate
enough. Still today, continuous improvements of cubic equa-

Corresponding author. Tel.: +34 983184934; fax: +34 983423013.


E-mail address: mamaan@iq.uva.es (. Martn).
Received16 March2011; Receivedinrevisedform22 August 2011; Accepted29 August 2011
tions of state are in course, including the implementation of
complex mixing rules or the development of three- or four-
parameter equations. Even though cubic equations of state
have some evident shortcomings (limited applicability for
phase equilibrium calculations involving complex systems,
poor accuracy when estimating some thermodynamic prop-
erties, etc.), they are still widely used and most probably they
will remain so for years to come (Valderrama, 2003).
The development of new and improved equations of state
is driven by the demands of the chemical industry. Recently,
Hendriks et al. (2010) reported the results of a survey carried
out by the European Working Party on Thermodynamic and
Transport Properties, regarding the requirements of indus-
try for modern thermodynamic models. Such models are
expected to describe systems of increasing complexity, as
mixtures involving asymmetric or associating compounds, or
mixtures with components requiring a special treatment like
chain molecules or polydisperse compounds. Existing mod-
els must be adapted or new models must be created in order
1749-7728/$ see front matter 2011 The Institution of Chemical Engineers. Published by Elsevier B.V. All rights reserved.
doi:10.1016/j.ece.2011.08.003
education for chemical engineers 6 ( 2 0 1 1 ) e114e121 e115
to deal with newtypes of systems, such as supercritical uids
(Pereda et al., 2009) or ionic liquids (Bermejoet al., 2010). Indus-
try also requests models able to describe multicomponent
systems, suitable to provide a coherent description of multi-
ple aspects of the process with a single model (i.e., calculation
of different types of phase equilibrium as well as thermody-
namic properties with the same model), and predictive rather
than correlative models.
Since inmany cases cubic equations of state cannot accom-
plish all these objectives, new models are being developed.
Recent studies are directed towards equations of state with
solidtheoretical foundations rather thansemi-empirical mod-
els like the cubic equations of state (Wei and Sadus, 2000).
In particular, equations based on the Statistical Associating
Fluid Theory (SAFT, Chapman et al., 1990) have shown very
promising results. By explicitly incorporating a theoretically
sound description of the behaviour and interactions between
molecules in the uid, these equations become less depen-
dent on correlated parameters, thus approaching the desired
goal of a completely predictive model. These new equations
currently coexist with models based on the group contribu-
tion concept, as well as with classical and improved cubic
equations of state.
Many of these advanced thermodynamic models already
are mature tools suitable for practical applications in
academia and industry. For instance, the growing importance
and applicability of these new thermodynamic models is
reected in the increasing number of such models imple-
mented in commercial process simulators. Therefore, these
developments must be accompanied by modications in
the teaching of applied thermodynamics courses. Chemical
engineering students need to be trained in the practical appli-
cations of these models, including a basic knowledge of the
theoretical foundations, knowledge of the information and
parameters required to apply the different models, criteria
attaining selection and assessment of appropriate models
for specic applications and ability to use the models in
practice.
Teachers need resources in order to include these new
contents in their courses. Several thermodynamic textbooks
include a detailed discussion of equations of state, in many
cases mostly devoted to cubic equations of state, and in
some cases including programs for calculations with cubic
equations of state in different programming languages (e.g.,
Sandler, 2006; Walas, 1985; Smith et al., 2005; Elliott and
Lira, 1999). More recently, a book edited by Goodwin et al.
(2010) presented a detailed revision of many modern thermo-
dynamic models. Binous (2008) also presented Mathematica
notebooks for thermodynamic calculations with the Peng-
Robinson equation of state. The XSEOS Excel add-in (Castier
and Amer, 2011) is another very useful utility which includes
phase equilibriumand thermodynamic property calculations
with several cubic equations of state and G
E
models, as
well as specic models for the petrochemical industry. The
software PE 2000, developed by Pfohl et al. (1998), is a very
exhaustive androbust package, including several cubic, group-
contribution and associating equations of state. Moreover,
this package includes a user-friendly graphical interface, it
includes utilities for estimating properties by group contribu-
tion methods as well as for correlating parameters, and allows
user to programnew equations of state in Fortran. As already
mentioned, several commercial process simulators such as
Aspen Plus, Hysys or ProMax include comprehensive libraries
of modern thermodynamic models.
There is a certain lack of resources for teaching the appli-
cation of non-cubic or even modern cubic equations of state.
Most freely available software packages are limited to sim-
ple cubic equations of state. Moreover, commercial process
simulators may not be available in certain universities, and
even if they are, the application of these simulators in an
applied thermodynamics course may not be possible, since
most chemical engineering degrees are organized considering
thermodynamic courses as a pre-requisite to process simu-
lation courses rather than the opposite, being thus taught
in a previous step. In addition, and most probably as a con-
sequence of the lack of educational software tools, many
exercises proposed in textbooks are limited to simple ther-
modynamic models and basic equations of state. If students
are taught about modern thermodynamic models froma mere
theoretical perspective, they are likely to develop distrust
towards these models andto be reluctant to apply themduring
their professional practice. However, the authors experience
indicates that learning the application of modern equations of
state is not much more difcult for students than learning to
use classical cubic equations of state, provided that adequate
learning tools are available.
This article presents a set of tools for incorporating prac-
tical exercises using complex equations of state in applied
thermodynamic courses. These tools include Matlab com-
puter programs for calculation of phase equilibrium and
thermodynamic properties of uid mixtures using several
equations of state representative of some of the most
relevant developments in this eld, including two- and three-
parameter cubic equations of state with classical and G
E
mixing rules, group contribution equations of state and SAFT
equations of state (a summary of all available models is pre-
sented in Table 1), complemented with documentation and
sample application exercises. These equations can be used to
calculate uid phase equilibrium through bubble point, dew
point and isothermal ash algorithms, as well as to obtain
uid density. A main design consideration for the develop-
ment of this software has been to implement a modular
structure in the programs, to facilitate the addition of new
Table 1 Thermodynamic models included.
Reference
Cubic equations of state
Soave Redlich Kwong Soave (1972)
Peng Robinson Peng and Robinson (1976)
Peng Robinson with
BostonMathias alpha
function
Boston and Mathias (1980)
Peng Robinson with StryjekVera
alpha function
Stryjek and Vera (1986)
Peng Robinson with
WongSandler mixing rules
Wong and Sandler (1992)
PatelTeja Patel and Teja (1982)
ValderramaPatelTeja Valderrama (1990)
Group contribution equations of state
Predictive SoaveRedlichKwong Holderbaumand Gmehling
(1991)
Group-contribution Skjold-Jorgensen (1984)
Chain equations of state
Perturbed hard-sphere-chain Song et al. (1994)
SAFT equations of state
Statistical associating uid
theory SAFT
Chapman et al. (1990)
Perturbed chain PC-SAFT Gross and Sadowski (2001)
e116 education for chemical engineers 6 ( 2 0 1 1 ) e114e121
Fig. 1 Class hierarchy.
equations of state as well as of additional calculation algo-
rithms by students or instructors. The programs are freely
available for download as supplementary material, and are
completely open-source software, which can be browsed or
modied by students. Moreover, authors present their experi-
ences with the application of these tools during their teaching
practice, together withseveral applicationexamples. Based on
authors experience, these tools are best suited to be incor-
porated in an advanced applied thermodynamics course at
a Masters level, although some of the most basic features
and models may also be useful for Bachelor courses. These
programs may also nd some applications in research.
2. Equations of state implementation in
Matlab
The thermodynamic models have been implemented using
the Matlab (c) programming language with an object-oriented
approach (Register, 2007). This methodology has been chosen
because it allows for a more intuitive use of the programs, and
it facilitates the addition of new equations of state or addi-
tional calculation algorithms to the package. Matlab version
2006a or higher is required to run the programs. Alternatively,
the programs can also be run using the free, open-source com-
puting software Octave-3.2.4 or higher, both in Windows and
in Linux platforms (http://www.gnu.org/software/octave/).
Fig. 1 presents a schematic representation of the class
hierarchy used to build the programs. This hierarchy is struc-
tured around four main classes. The rst one is the class
substance, whichis used to store physical properties of com-
ponents required for application of the equations of state
(general properties such as name of the substance and its
molecular weight, properties required by cubic equations such
as critical temperature and pressure, etc.). Mixture objects
containthe array of substance objects corresponding to each
component in the mixture. The programs are prepared to
handle mixtures with any number of components. Mixture
objects also store the molar composition of the mixture, as
well as interactioncoefcients betweensubstances. Uptonine
coefcients can be stored, and it is also possible to dene
variable interaction coefcients as a function of temperature.
The third class, denominated Ideal Equation of State, imple-
ments the algorithms for the calculation of phase equilibrium
and thermodynamic properties, and it can perform calcula-
tions with these algorithms using the ideal gas equation of
state and Raoults law. Other equations of state are derived
fromthe IdealEOS class making use of two simple concepts
of object oriented programming: inheritance and overriding
of functions. Inheritance means that all functions dened in
the base class (in this case, IdealEOS) can be used by every
class derived from it (in this case, all derived equation of
state classes). Function overriding is used when it is necessary
to provide a specic implementation of some of the func-
tions of the base IdealEOS. In general, an equation of state
is programmed overriding (or superseding) the methods of
calculation of the fugacity and compressibility coefcients of
the IdealEOS root class. More details about the implemen-
tation are provided in the related documentation, included as
supplementary material.
Authors experience indicates that students do not need
a previous knowledge of object-oriented programming tech-
niques in order to use the code (although, of course, this
knowledge is required for advanced tasks such as implement-
ing a new equation of state). On one hand, this methodology
allows the use of very intuitive Matlab commands, as
CO
2
.Tc =304.2 to dene the critical temperature of a sub-
stance object representing CO
2
in a mixture. On the other
hand, structuring the programs using classes makes it pos-
sible to explicitly incorporate the relationships between the
different equations of state in the programs. For example,
as illustrated in Fig. 1, the class hierarchy shows that phase
equilibrium calculation algorithms can be identical for any
equation of state. If, for example, these algorithms are to
be used with the PengRobinson equation of state, it is only
necessary to create a equation of state class derived fromIde-
alEOS andto implement the calculationof compressibility and
fugacity coefcients corresponding to PengRobinson EOS. If
a further modication of PengRobinson EOS is to be pro-
grammed, as for example the BostonMathias alpha function,
this can be done creating a new class derived from the stan-
dard PengRobinson EOS, and simply overriding the function
used to calculate the alpha function.
From the point of view of an instructor in charge of the
development of application exercises with the programs, an
advantage of the object-oriented approach is the possibility to
produce more reusable programs. In addition to the possibili-
ties for deriving newequations of state fromexisting programs
described in the previous paragraphs, if the need arouse to
modify or improve an existing algorithm, or to incorporate
a new function (e.g., for calculating another thermodynamic
property), it is only necessary to incorporate the newfunction
in the IdealEOS base class. Automatically, the new function
education for chemical engineers 6 ( 2 0 1 1 ) e114e121 e117
Fig. 2 P-xy diagramof CO
2
ethanol mixtures generated
with the programshown in Fig. S1.
is made available for being used with every equation of state
derived fromIdealEOS without any further modication of the
code.
The phase equilibrium algorithms implemented include
standard bubble point, dew point and isothermal ash algo-
rithms for multi-component two-phase equilibria. These
algorithms have been implemented seeking simplicity rather
than computational efciency. They correspond to the algo-
rithms described by Walas (1985), which are very frequently
used, as described in the documentation of the programs
included as supplementary material. Besides the algorithms
for calculating individual equilibrium points, programs also
include utilities for generating the common P-xy and T-xy
phase diagrams. In addition to these simple two-phase algo-
rithms, a multi-phase algorithm based in a Gibbs energy
minimization method is also included (Gupta et al., 1991).
However, authors experience about the use of this algorithm
for teaching is limited to a fewstudent research projects, since
it has never been included in their seminars.
3. Sample calculations
Fig. S1 presents the code of a simple program used to calcu-
late a pressure-composition P-xy phase equilibrium diagram
of CO
2
ethanol mixtures using the standard PengRobinson
equation of state and quadratic mixing rules. This programis
included in supplementary material (le CO
2
EtOH Pxy.m). The
programis structuredinthe following sections: rst all compo-
nents present in the mixture and their properties are dened.
The second step consists of dening the mixture formed by
these components, as well as mixture parameters. Inthis case,
the binary interaction parameters between CO
2
and ethanol
are dened as a function of temperature. Then the equation
of state to be used is specied (in this case, the standard
PengRobinson equation). Finally, the calculations required
are performed. In this example, a P-xy diagram is calculated
with the PxyDiagram function, which is one of the functions
included in the IdealEOS base class. Detailed instructions for
using this function are provided in the documentation of the
programs, andare also available throughthe Matlab command
screen using standard Matlab help functions (e.g., help PxyDi-
agram). This program generates the P-xy diagram shown in
Fig. 2.
The second example, shown in Fig. S2, calculates the
density of liquid hexadecane using the Group-Contribution
equation of state of Skjold-Jorgensen (1984), a non-cubic
equation of state (le hexadecane density.m included in
supplementary material). As shown in Fig. S2, the same four
main sections of the previous example can be identied even
if a different equation of state is used: denition of compo-
nents, denition of the mixture, specication of the equation
of state, and calculations (in this case, using the Density func-
tion, which is another function of the IdealEOS base class). A
distinctive feature of this programis the denitionof the group
decompositionof the molecule inline 6. It is possible to manu-
ally introduce all group parameters and to dene newgroups.
However, most application exercises can be solved with the
standard groups already dened for this equation, and in the
programs the groups and their parameters as presented in the
recent revision of Fornari (2007) are included and identied
with the number codes specied by Fornari in her article (e.g.,
group number 1 for CH
3
and group number 2 for CH
2
).
The third example, presented in Fig. S3 (le
corr met hex PCSAFT.m included in supplementary
information) shows the correlation of a binary interaction
parameter of the PC-SAFT equation of state using experi-
mental phase equilibriumdata. As in previous examples, the
rst section denes the components, the second section the
mixture and the third section the equation of state. It must
be noted in this case that the binary interaction parameter
to be correlated is dened as a variable, allowing to run the
program testing different values of this parameter. The next
section is the matrix of experimental phase equilibriumdata,
taken from Lin et al. (1977). The core of the program is the
next section, in which the program calculates a bubble point
corresponding to each experimental temperature and liquid
composition data, and then compares the experimental and
calculated equilibrium pressure according to the following
objective function:
Objective =
1
ndata

ndata
i=1

P
exp
P
calc

P
exp
(1)
Finally, the last section represents the experimental and
calculated results in a plot to provide visual information about
the progress of the correlation.
Executed as a standalone program, the program shown in
Fig. S3 calculates equilibriumpressures using the value of the
interactionparameter specied by the user as aninput param-
eter, andreturns the objective functionpresentedinEq. (1) as a
quantitative estimation of the difference between experimen-
tal and calculated results. The programcan be combined with
one of the built-in Matlab or Octave minimization functions,
in order to nd the value of the interaction parameter which
minimizes the objective function, for example, with the com-
mand fminsearch(corr met hex PCSAFT.m, 0). A value of 0.023
is obtained as the optimal interaction coefcient, which is in
good agreement with the value of 0.021 obtained by Gross and
Sadowski (2001) using a larger experimental database. Fig. 3
shows a comparisonbetweenthe experimental andcalculated
equilibrium pressures using the PC-SAFT equation with the
correlated interaction coefcient.
4. Application in equation of state
seminars at the university of Valladolid
In our university, the seminars of application of equations of
state are a part of a course about highpressure technology and
supercritical uids. This course is offered as an elective sub-
ject to MSc students of Chemical Engineering, and it is usually
taken by about 1015 students every year. Usually these stu-
e118 education for chemical engineers 6 ( 2 0 1 1 ) e114e121
Fig. 3 Comparison between experimental (circles, Lin
et al., 1977) and calculated (lines) equilibriumpressures of
the methanehexane systemat T=273.16K. The PC-SAFT
equation of state with a correlated interaction coefcient of
0.023 has been used for the calculations.
dents have basic notions of Matlab programming and phase
equilibrium algorithms from their previous applied thermo-
dynamic courses.
The rst part of this course deals with the physical proper-
ties of uids at high pressure, particularly supercritical uids,
including thermodynamic and phase equilibrium properties.
Seminars complements the expositive lectures. They consist
of a two and a half hour session at the classroom, used to
teach how to use the programs by solving several exercises,
several additional application exercises to which students are
expected to dedicate approximately 4h of personal work, and
an additional session of 1h for correction of the exercises.
Since seminars are integrated in a course about supercritical
uids, most application examples presented in this section
are related to this topic. However, the programs can of course
be used to solve equivalent examples without supercritical
uids, as this section only intends to illustrate one possible
application of the programs.
The rst exercise proposed is the calculation of a bub-
ble point of CO
2
ethanol mixtures using the standard
PengRobinson equation of state, setting the interaction coef-
cients equal to zero. This is done using the le CO
2
EtOH.m
in supporting material. This exercise is used to explain the
general structure of the programs (denition of components,
mixture, equation of state and calculations, as described in
Section 3). Moreover, a brief explanation of the bubble point
algorithmis presented (Fig. 2), with a particular emphasis on
the implementation of the algorithm (function BubblePoint.m
of the IdealEOS class).
The second exercise consists of the correlation of the
binary interaction parameter of CO
2
ethanol mixtures to
experimental phase equilibrium data taken from Chiehming
et al. (1998), again using the PengRobinson equation of
state (le corr CO
2
EtOH PR.m in supporting material). This
serves to introduce students to the general correlation proce-
dures as well as the available Matlab optimization functions.
After running the correlation, as personal work students
are requested to build a program in order to calculate P-xy
diagrams of CO
2
ethanol mixtures using the interaction coef-
cients obtained with the correlation (possible solution: le
CO
2
EtOH Pxy.m, described in Section 3).
The next session is connected to the presentation of the
common modications of cubic equations of state in expos-
itive lectures: use of additional constants, modication of
alpha functions as well as mixing rules. As an example
of G
E
mixing rules, the application of the PengRobinson
equation of state with WongSandler mixing rules to the
calculation of vapourliquid equilibrium of waterethanol
system is shown (program H
2
O EtOH PRWS.m in supporting
material). In particular, it is shown that PengRobinson with
WongSandler mixing rules is able to predict the azeotrope
of this system, as well as the evolution of the position of
the azeotrope when pressure is increased. As personal work,
students are requested to build a program to calculate P-
xy diagrams of CO
2
H
2
O mixtures with the PengRobinson
WongSandler equation. Students are provided with all the
parameters required to apply the equation to this system,
taken from Martin et al. (2007). A possible solution is shown
in le CO
2
H
2
O PRWS.m in supporting material.
The next seminar exercise deals again with the CO
2
H
2
O
system, in this case using the PC-SAFT equation of state
(le CO
2
H
2
O PCSAFT.m in supporting material). The novel
aspect introduced with this exercise is the use of associ-
ation schemes with PC-SAFT. In this exercise, a simple 2B
association scheme according to the classication of Huang
and Radosz (1990) is used for water. This means that water
molecules are considered to have two association sites (A
and B), allowing associations between different sites (AB)
but not between equivalent sites (AA or BB). Although ana-
lytical solutions are available for different SAFT association
schemes, the programs use a general matrix denitionof asso-
ciation schemes which is less computationally efcient but, in
authors opinion, has more educational value. The matrix can
be easily constructed assigning non-zero association param-
eters to allowed associations, and zero to the remaining ones.
Examples of such matrixes for 2B and 4C association schemes
(the 4C scheme consisting of four association sites, allowing
associations AC, AD, BCand BD) are showninFig. 4. Again,
the required parameters are taken fromthe literature (Martin
et al., 2009).
The last seminar is dedicated to the calculation of solid
solubility in gases, which is particularly important for super-
critical uid extractions. The solid phase fugacity calculation
according to the method described by Shariati and Peters
(2002) is rst presentedtostudents. The example studiedis the
correlation of the solubility of mandelic acid in supercritical
carbon dioxide with the PengRobinson equation of state (le
mandelic ESG.min supporting material), using available exper-
imental data (Cheng et al., 2002). In addition to the calculation
of the fugacity of a solid phase, another feature of this exer-
cise is the need to estimate the critical properties of mandelic
acid, which of course cannot be determined experimentally.
The group contributionmethod of Jobak as described by Poling
et al. (2001) is taught to students for this purpose, using the
Excel sheet Critical Properties.xls provided as supplementary
material. This serves as a general introduction to group con-
tribution methods, which may differ in their purpose and the
groups dened, but share the same methodology for obtaining
the group decomposition of molecules.
In this exercise, only binary interaction coefcients are
used to correlate the gas solubility of mandelic acid in CO
2
. As
personal work, students are requested to correlate the data
again, using the enthalpy of fusion of mandelic acid as well
as the interaction coefcients treated as correlated parame-
ters. With the additional parameter, a much better correlation
education for chemical engineers 6 ( 2 0 1 1 ) e114e121 e119
Fig. 4 PC-SAFT association matrixes corresponding to an association scheme 2B (left) and 4C (right).
with a lower deviation between experimental data and model
results is obtained, but the correlated enthalpy of fusion is
negative. This exercise serves to illustrate that care must be
taken in order to ensure that the parameters obtained by cor-
relation make physical sense.
Finally, as personal work, students must correlate the
solubility of caffeine in CO
2
with the PengRobinson equa-
tion of state. Experimental data are provided to the students
(Johannsen and Brunner, 1994). Again, students must esti-
mate the critical properties of caffeine by group contribution,
build a programand run the correlation (possible solution: le
caffeine ESG.m in supporting material). Students are asked to
correlate the experimental data at a temperature of T=313K,
and then to test the extrapolation capabilities of the equation
at other temperatures (T=333K and T=353K).
5. Learning outcomes
As previously discussed, the seminar is taught to students
with a previous basic knowledge of Matlab programming.
Students also have previous knowledge of applied thermo-
dynamics, including the basic features of cubic equations of
state, as well as of the calculation of phase equilibriumprop-
erties by phiphi and gammaphi methods. Moreover, prior to
the seminar, the fundamentals of the equations of state used
in the seminar are presented in a theoretical lecture.
The mainobjective of this course is tocomplement this the-
oretical lecture withapplicationexercises, inorder toteachthe
application of the equations of state in practical applications.
With this general objective, the specic learning outcomes
sought with the seminar are:
(1) Teach students to differentiate between the equations of
state presented, in terms of their accuracy and applicabil-
ity to different situations, and the amount of experimental
information and parameters required to apply them. For
this, students are asked to reproduce the behaviour of a
certain system (e.g., CO
2
+H
2
O) with different equations
of state, in order to directly compare the performance of
the different equations and the parameters required to
apply them. Exercises with systems with a strongly non-
ideal behaviour are also presented (e.g., H
2
O+ethanol,
CO
2
+ethanol). With these exercises students have the
opportunity to observe that simple equations fail to rep-
resent the behaviour of such systems and more advanced
equations are thus required to describe them.
(2) Obtain the parameters required for application of the
equations of state. In the seminar, two basic method-
ologies are presented: group contribution methods, and
correlationof parameters by minimizationof the deviation
with respect to experimental data.
(3) Study the implementation of calculation algorithms in a
computer program. Inparticular, inthe seminar the bubble
point algorithmis presented, comparing the blockdiagram
taught in theoretical lectures with the implementation of
this algorithm in the programs, but any other algorithm
implemented in the programs can be presented to stu-
dents in a similar way.
(4) In addition to the previous general learning outcomes,
specic outcomes canbe includeddepending onthe orien-
tationof the course. For example, inthe seminar presented
in this work a strong emphasis is made in the calcula-
tion of solidgas equilibrium. This type of equilibrium is
very important for supercritical uid applications, since
it governs one of the main industrial applications of this
technology, the supercritical extraction, but is probably
less relevant than other types of thermodynamic prop-
erties for a general applied thermodynamic course. As
previously described, the programs have been designed
with a modular structure, in order to make it easier for
teachers toaddspecic functionalities as requiredfor their
courses.
(5) Making use of the modular structure of the programs, stu-
dents can also study with more detail the calculation of
thermodynamic properties with equations of state, mak-
ing their own implementations of other equations of state
or calculation algorithms. Such learning outcome is out-
side the scope of the seminar presented in this work due
to the lack of time, but it can be included as a part of a
longer student work or research project.
6. Users feedback
Students opinions about the software package and the
equation of state seminar have been collected through an
anonymous online survey. Questions in this survey have been
designed to evaluate both the extent to which the learning
outcomes have been achieved, as well as the suitability of the
exercises and the computer programs used in the seminar for
this purpose.
Table 2 presents the results obtained. The survey has been
completed by 29 students between years 2008 and 2010, cor-
responding to approximately 60% of the total number of
students of the seminar along these years. In addition to the
questions presented in Table 2, students suggestions have
been collected both through the survey and through informal
conversations.
As shown in Table 2, the perception of the seminar by stu-
dents is in general positive. In particular, according to the
results of the survey students consider that the seminar has
contributed to teach them the practical application of equa-
tions of state for phase equilibrium calculations and how to
obtain the parameters of the equations by correlation and
group contribution. The function of the seminar as a comple-
e120 education for chemical engineers 6 ( 2 0 1 1 ) e114e121
Table 2 Results of the students opinion survey,
questions ranked from1 (strongly disagree) to 5
(strongly agree).
Question Average mark
1. The seminar teaches how to calculate phase
equilibriumand thermodynamic properties
with equations of state
3.5
2. The seminar is useful for learning the
characteristics of several equations of state
(applicability, parameters required, etc.)
3.0
3. The seminar gives information for selecting
appropriate equations of state for specic
applications
2.9
4. The programs are easy to use 3.3
5. The proposed exercises are illustrative and
easy to understand
3.7
6. After completing the seminar, I amable to
modify the programs in order to perform
similar calculations as those proposed in the
seminar
3.2
7. After completing the seminar, I amable to
calculate the parameters required by
equations of state (by correlation, group
contribution, etc.)
3.5
8. After completing the seminar, I can
understand the algorithms used in the
programs
3.2
9. After completing the seminar, I can
understand the code of the programs
3.0
10. The seminar contributes to make the
theoretical part of the course easier to
understand
3.6
ment of the theoretical part of the course is also favourably
evaluated. With respect to the questions addressing the han-
dling of the programs, the evaluation of the simplicity and
clarity of the examples (question 4), the ability to modify these
programs for other applications (question 6), the understand-
ing of the algorithms (question 8) and the understanding of
program code (question 9) obtain decreasing evaluations in
this order, which is reasonable considering that each of these
questions address aspects of increasing complexity. Questions
regarding the selection of equations of state for specic appli-
cations (questions 2 and 3) obtain a lower evaluation. Many
students suggestions have stressed the importance of hav-
ing a detailed documentation of the programs as well as a
large database of example programs, aspects that have been
improved over the years resulting in the documentation and
the example programs provided as supplementary material.
Students have also contributed valuable suggestions for appli-
cation exercises, as for example the study of the correlation
and description of phase behaviour of a certain system with
several equations of state, in order to observe the differences
in the required input data and accuracy of each equation, or
the application of correlated parameters for extrapolation.
The results of the survey showin general a good agreement
with the objectives of the seminar. As described in Section 4,
a particular emphasis is made in the learning of the applica-
tion of equations of state for phase equilibrium calculations
as well as parameter correlation, which are the aspects best
evaluated by students. On the other hand, the specic focus
on supercritical uid systems is a drawback for teaching how
to select appropriate equations of state for other applications.
The experiences obtained by authors in these seminars can
serve as an indication of the exibility of the programs and
the possibilities for adapting themin order to teach different
skills depending on the requirements of the course.
7. Conclusions and outlook
Applied thermodynamics courses should reect the progress
in this eld. Among other aspects, they should serve to
teach students how to work with relatively recent, but well-
established thermodynamic models like group contribution
equations of state, SAFT equations, etc. A course with appli-
cation exercises limited to simple models and basic cubic
equations of state may not prepare students to work with
these new tools, which are included in several commercial
process simulators and are able to fulll some important
demands of the industry. The lack of educational resources
for proposing and solving application exercises with these
equations may be one of the biggest obstacles to include this
content in courses.
Authors experiences with the software package presented
in this work have generally been positive. Some obvious
advantages are the inclusion of interactivity with more varied
application exercises, which is always appreciated by stu-
dents, and the addition of updated contents in the courses,
particularly in a subject such as thermodynamics, which is
sometimes wrongly perceived as stagnated. Additionally,
the software tools presented in this work are open-source
programs. The entire code of the programs is available for
students to browse and to modify. This allows for different
levels of learning: fromstudents who only need to learn about
the models from a users point of view, to students who will
be interested in investing more time modifying the programs
and adding new functions, for instance as part of a research
project. The programs are exible and can be adapted to teach
different skills: application of the equations of state for phase
equilibrium calculations, parameter correlation, selection of
equations for specic applications, implementation of algo-
rithms, etc. The programs can be run using the commercial
software MATLAB as well as its free, open-source alternative
Octave.
With respect to instructors, the structure of the programs,
based on an object-oriented methodology, intends to promote
the reusability of the code andthe possibilities for sharing new
functions. It is possible to implement a new equation of state
deriving it froman already programmed equation of state and
reusing the parts of the code which are equivalent in both
equations. Just programming the calculation of the fugacity
andcompressibility coefcients of the newequationwill make
it possible to use every calculation algorithm included in the
package with a new equation of state. Conversely, it is pos-
sible to program a new function, such as an improved phase
equilibriumalgorithmor an additional thermodynamic prop-
erty calculation, and simply adding this function to the base
equation of state class will make it available for every already
programmed equation of state as well as for any other equa-
tion which may be programmed in the future.
In addition to the stable version of the package
provided as supplementary material of this article,
authors maintain and distribute an updated version
of the programs through the following web page:
http://www.iq.uva.es/hpp/en/download/download.html.
Every suggestion and contribution will be highly appreci-
ated.
education for chemical engineers 6 ( 2 0 1 1 ) e114e121 e121
Acknowledgements
. Martn thanks the Spanish Ministry of Science and Innova-
tion for a Ramn y Cajal research fellowship. Partially nanced
by the Spanish Ministry of Science and Innovation through
project CTQ2010-15475.
Appendix A. Supplementary data
Supplementary data associated with this article can be found,
in the online version, at doi:10.1016/j.ece.2011.08.003.
References
Bermejo, M.D., Mndez, D., Martn, A., 2010. Application of a
group-contribution equation of state for the thermodynamic
modeling of gas +ionic liquid mixtures. Ind. Eng. Chem. Res.
49, 49664973.
Binous, H., 2008. Applications of the PengRobinson equation of
state using mathematica. Chem. Eng. Educ. 42, 4751.
Boston, J.F., Mathias, P.M., 1980. Phase equilibria in a
third-generation process simulator. In: 2nd International
Conference on Phase Equilibria and Fluid Properties in the
Chemical Industry, Berlin, Germany.
Castier, M., Amer, M., 2011. XSEOS: an evolving tool for teaching
chemical engineering thermodynamics. Educ. Chem. Eng. 6,
e62e70.
Chapman, W.G., Gubbins, K.E., Jackson, G., Radosz, M., 1990. New
reference equation of state for associating liquids. Ind. Eng.
Chem. Res. 29, 17091721.
Chiehming, C.J., Kou-Lung, C., Chang-Yih, D., 1998. A new
apparatus for the determination of P-x-y diagrams and
Henrys constants in high pressure alcohols with critical
carbon dioxide. J. Supercrit. Fluids 12, 223237.
Cheng, K.W., Tang, M., Chen, Y.P., 2002. Solubilities of benzoin,
propyl 4-hydroxybenzoate and mandelic acid in supercritical
carbon dioxide. Fluid Phase Equilib. 201, 7996.
Elliott, J.R., Lira, C.T., 1999. Introductory Chemical Engineering
Thermodynamics. Prentice-Hall, Upper Saddle River, New
Jersey.
Fornari, T., 2007. Revision and summary of the group
contribution equation of state parameter table: application to
edible oil constituents. Fluid Phase Equilib. 262, 187209.
Goodwin, A., Sengers, J., Peters, C.J., 2010. Applied
Thermodynamics of Fluids. RSC Publishing, Cambridge.
Gross, J., Sadowski, G., 2001. Perturbed-chain SAFT: an equation
of state based on a perturbation theory for chain molecules.
Ind. Eng. Chem. Res. 40, 12441260.
Gupta, A.K., Bishnoi, P.R., Kalogerakis, N., 1991. A method for the
simultaneous phase equilibria and stability calculations for
multiphase reacting and non-reacting systems. Fluid Phase
Equilib. 63, 6589.
Hendriks, E., Kontogeorgis, G.M., Dohrn, R., de Hemptinne, J.C.,
Economou, I.G., Zilnik, L.F., Vesovic, V., 2010. Industrial
requirements for thermodynamics and transport properties.
Ind. Eng. Chem. Res 49, 1113111141.
Holderbaum, T., Gmehling, J., 1991. PSRK: a group contribution
equation of state based on UNIFAC. Fluid Phase Equilib. 70,
251265.
Huang, S.H., Radosz, M., 1990. Equation of state for small, large,
polydisperse and associating molecules. Ind. Eng. Chem. Res.
29, 22842294.
Johannsen, M., Brunner, G., 1994. Solubilities of the xanthines
caffeine, theophylline and theobromine in supercritical
carbon dioxide. Fluid Phase Equilib. 94, 215226.
Lin, Y.N., Chen, R.J.J., Chappelear, P.S., Kobayashi, R., 1977. Vapor
liquid equilibriumof the methane-n-hexane systemat low
temperature. J. Chem. Eng. Data 22, 402408.
Martin, A., Bouchard, A., Hoand, G.W., Witkamp, G.J., Cocero,
M.J., 2007. Mathematical modeling of the mass transfer from
aqueous solutions in a supercritical uid during particle
formation. J. Supercrit. Fluids 41, 126137.
Martin, A., Pham, H.M., Kilzer, A., Kareth, S., Weidner, E., 2009.
Phase equilibria of carbon dioxide+poly ethylene
glycol +water mixtures at high pressure: measurements and
modelling. Fluid Phase Equilib. 286, 162169.
Patel, N.C., Teja, A.S., 1982. A new cubic equation of state for
uids and uid mixtures. Chem. Eng. Sci. 37, 463473.
Peng, D.Y., Robinson, D.B., 1976. A new two-constant equation of
state. Ind. Eng. Chem. Fundam. 15, 5964.
Pereda, S., Brignole, E.A., Bottini, S.B., 2009. Advances in phase
equilibriumengineering of supercritical reactors. J. Supercrit.
Fluids 47, 336343.
Pfohl, O., Petkov, S., Brunner, G., 1998. Usage of PE A Programto
Calculate Phase Equilibria. Herbert Utz Verlag, Mnchen.
Poling, B.E., Prausnitz, J.M., OConnell, J.P., 2001. The Properties of
Gases and Liquids, 5th ed. McGraw-Hill, New York.
Register, A.H., 2007. A Guide to MATLAB Object-Oriented
Programming. Chapman&Hall/CRC, Boca Raton, FL.
Sandler, S.I., 2006. Chemical, Biochemical and Engineering
Thermodynamics, 4th ed. Wiley, New York.
Shariati, A., Peters, C.J., 2002. Measurements and modeling of the
phase behavior of ternary systems of interest for the GAS
process. I. The systemcarbon dioxide+1-propanol +salicylic
acid. J. Supercrit. Fluids 23, 195208.
Skjold-Jorgensen, S., 1984. Gas-solubility calculations. II.
Application of a new group-contribution equation of state.
Fluid Phase Equilib. 16, 317351.
Smith, J.M., van Ness, H.C., Abbott, M.M., 2005. Introduction to
Chemical Engineering Thermodynamics, 7th ed. McGraw-Hill,
New York.
Soave, G., 1972. Equilibriumconstants froma modied
RedlichKwong equation of state. Chem. Eng. Sci. 27,
11971203.
Song, Y., Lambert, S.M., Prausnitz, J.M., 1994. A perturbed
hard-sphere-chain equation of state for normal uids and
polymers. Ind. Eng. Chem. Res. 33, 10471057.
Stryjek, R., Vera, J.H., 1986. PRSV: an improved PengRobinson
equation of state for pure compounds and mixtures. Can. J.
Chem. Eng. 64, 323333.
Valderrama, J.O., 1990. A generalized PatelTeja equation of state
for polar and nonpolar uids and their mixtures. J. Chem. Eng.
Jpn. 23, 8791.
Valderrama, J.O., 2003. The state of the cubic equations of state.
Ind. Eng. Chem. Res. 42, 16031618.
Walas, S.M., 1985. Phase Equilibria in Chemical Engineering.
Butterword-Heinemann, Newton, MA.
Wei, Y.S., Sadus, R.J., 2000. Equations of state for the calculation
of uid-phase equilibria. AIChE J. 46, 169196.
Wong, S.S.H., Sandler, S.I., 1992. A Theoretically correct mixing
rule for cubic equations of state. AIChE J. 38, 671680.

You might also like