11
This article appeared in a journal published by Elsevier. The attached copy is furnished to the author for internal non-commercial research and education use, including for instruction at the authors institution and sharing with colleagues. Other uses, including reproduction and distribution, or selling or licensing copies, or posting to personal, institutional or third party websites are prohibited. In most cases authors are permitted to post their version of the article (e.g. in Word or Tex form) to their personal website or institutional repository. Authors requiring further information regarding Elsevier’s archiving and manuscript policies are encouraged to visit: http://www.elsevier.com/copyright

Author's personal copy - energy.sdsu.edu · application named CyclePad [6] which allows users to construct and analyze a wide variety of thermodynamic cycles. None of ... Author's

  • Upload
    vuhuong

  • View
    216

  • Download
    0

Embed Size (px)

Citation preview

This article appeared in a journal published by Elsevier. The attachedcopy is furnished to the author for internal non-commercial researchand education use, including for instruction at the authors institution

and sharing with colleagues.

Other uses, including reproduction and distribution, or selling orlicensing copies, or posting to personal, institutional or third party

websites are prohibited.

In most cases authors are permitted to post their version of thearticle (e.g. in Word or Tex form) to their personal website orinstitutional repository. Authors requiring further information

regarding Elsevier’s archiving and manuscript policies areencouraged to visit:

http://www.elsevier.com/copyright

Author's personal copy

CALPHAD: Computer Coupling of Phase Diagrams and Thermochemistry 33 (2009) 343–352

Contents lists available at ScienceDirect

CALPHAD: Computer Coupling of Phase Diagrams andThermochemistry

journal homepage: www.elsevier.com/locate/calphad

Property evaluation in The Expert System for Thermodynamics (‘‘TEST’’) webapplicationSubrata (Sooby) Bhattacharjee a,∗, Christopher Paolini baMechanical Engineering, San Diego State University, San Diego, CA 92182, United Statesb Computational Thermodynamics Laboratory, San Diego State University, San Diego, CA 92182, United States

a r t i c l e i n f o

Article history:Received 22 September 2008Received in revised form28 October 2008Accepted 28 October 2008Available online 25 November 2008

Keywords:Thermodynamics softwareWeb applicationsPhase diagramJava appletsComputational thermodynamics

a b s t r a c t

Ever since its release, TEST has found use as thermodynamic courseware in many universities aroundthe world. TEST offers web-based analysis tools – java applets called daemons – for property evaluationof working substances, energy, entropy, and exergy analysis of generic open and closed systems, ICengines, gas and vapor power cycles, refrigeration, HVAC, combustion, chemical equilibrium, and gasdynamics. Other modules of TEST include animations, problems, examples, and system navigations thatare closely integrated with the daemon module to create a comprehensive analysis tool for engineeringthermodynamics. In this paper the methodology of thermodynamic state evaluation by TEST is discussedwith several examples.

© 2008 Elsevier Ltd. All rights reserved.

1. Introduction

In the last two decades, a number of software applications forthermodynamic analysis have been developed. The ASME providesa comprehensive database for thermodynamics analysis [1]. EES[2] is a comprehensive thermal-science programming languagethat runs in the Microsoft Windows environment. TPX [3] isan Excel plug-in where the core thermodynamic state can beevaluated by entering two independent properties. Thermoptim[4] is a Java application for analyzing thermodynamic cycles andcan be run over the web. A graphical menu driven installableprogram is GasCAD [5]. The Qualitative Reasoning Group atNorthwestern University has developed a Windows installableapplication named CyclePad [6] which allows users to constructand analyze a wide variety of thermodynamic cycles. None ofthese packages, however, are comprehensive enough to cover thediverse range of topics covered in engineering thermodynamics.For applications involving mostly gas phase equilibrium

computation such as combustion analysis, several commercialand freeware applications are available. GasEQ [7], writtenby Chris Morley, is a free tool that runs in a Windowsenvironment and can compute equilibrium distributions of

∗ Corresponding author. Tel.: +1 619 594 6080; fax: +1 619 594 3599.E-mail addresses: [email protected] (S. Bhattacharjee),

[email protected] (Subrata (Sooby) Bhattacharjee).

mixtures at fixed temperatures and pressures using Gibbsfree energy minimization or fixed temperatures and volumesusing Helmholtz free energy minimization. REACT [8], availableto Journal of Chemical Education subscribers on the GeneralChemistry Collection CD-ROM, is an MSDOS program developedin 1995. A similarly named program, REACT! [9], developed in1992, can be downloaded as a trial version from Yale University.Both of these packages run only in the Windows environmentand exhibit somewhat dated user interfaces and installationmethods. Developed by the Finnish company Outotec Oyj, thecommercial chemical simulation tool HSC Chemistry 6.1 [10]includes an extensive suite of simulation and modeling tools,including modules for performing equilibrium calculations. HSCChemistry includes two equilibrium solvers: GIBBS, a standardGibbs free energy minimization solver, and SOLGASMIX [11],developed by Gunnar Eriksson. The numerical method employedin SOLGASMIX has been incorporated into other commercialapplications such as FactSage [12] developed at the Centerfor Research in Computational Thermochemistry [13] at theUniversité de Montréal in Québec, Canada. FactSage runs onlyunderMicrosoftWindows and requires that a security key (dongle)is attached to the USB or printer port of the system on whichit is installed, or access to a network license server. FactSageincludes an equilibrium module called Equilib that employs astandard Gibbs energy minimization algorithm and allows one toperformconstrained equilibriumcomputationswith respect to anythermodynamic potential (e.g. U = U(S, V ), A = A(V , T ), andH = H(S, P) besides G = G(T , P)). Perhaps the most well-known

0364-5916/$ – see front matter© 2008 Elsevier Ltd. All rights reserved.doi:10.1016/j.calphad.2008.10.008

Author's personal copy

344 S. Bhattacharjee, C. Paolini / CALPHAD: Computer Coupling of Phase Diagrams and Thermochemistry 33 (2009) 343–352

Nomenclature

cp Specific heat capacity at constant pressure, kJ kg−1 K−1

cv Specific heat capacity at constant volume, kJ kg−1 K−1M Molar mass (or molecular weight), kg kmol−1p Pressure, kPaR Molar ideal gas constant≈ 8.314472 kJ K−1 kmol−1T Temperature, Ku Specific internal energy, kJ kg−1h Specific enthalpy, kJ kg−1j Specific flow energy, kJ kg−1s Specific entropy, kJ kg−1 K−1v Specific volume, m3 kg−1V Velocity, m s−1V Volume, m3x Mass fraction of a vapor in a saturated mixturexA Mass fraction of species A in a mixturey Volume fraction of a vapor in a saturated mixtureyA Mole fraction of species A in a mixturez Elevation, m

Greek Symbols

Φ Specific exergy, kJ kg−1ψ Specific flow exergy, kJ kg−1ρ Density, kg m−3

equilibrium computation software is Chemical Equilibrium andApplications (CEA) [14–16] developed by Sanford Gordon, Frank J.Zeleznik, and Bonnie J.McBride at theNASA JohnH. GlennResearchCenter. NASA CEA is open-source and can be downloaded free ofcharge from the CEAwebsite (NASA Computer Program– ChemicalEquilibriumwith Applications). Also well-known, especially in thecombustion community, is STANJAN [17] developed by ProfessorWilliam C. Reynolds II of the Mechanical Engineering departmentat Stanford University.Most of these applications are stand-alone applications and

must be installed before use. Also, many are geared towardsa specific set of working substances. TEST, on the other hand,is completely web driven and covers the entire range ofworking substances encountered in engineering thermodynamicsapplications.TEST is freely accessible to anyone online from

www.thermofluids.net. More than 16,000 students, educators andprofessionals have registered to use TEST. A visual manual for TESThas been published by Prentice Hall [18]. Some of the daemonshave been reviewed and included in various public domain edu-cational web sites such as the MERLOT project [19]. Judging fromthe comments received from educators, it is fair to say that TESThas the potential to become a very useful tool in thermodynam-ics education. Work is currently underway to develop a chemicalequilibrium module.An overview of the TEST portal can be found elsewhere [20].

In this work, we will first introduce the methodology TEST uses toclassifyworking substances into differentmodels,with eachmodelbased on a set of idealized assumptions. Two types of extendedstates – the system state and the flow state – will be developedto capture properties of a uniform system or a uniform flow. Indeveloping the algorithm to evaluate an extended state, the inter-relations among different types of properties will be discussed.The graphical user interface for a state and the representation ofstates on thermodynamic diagramswill be presented next. Finally,TEST codes that can be used to convert the GUI based solution intostorable structural codes, and vice versa, will be discussed. Severalexamples of state evaluationwith differentmaterialmodelswill bebriefly presented.

2. The TEST portal

TEST is a web-based suite of applications for analyzingengineering thermodynamic systems. Accessible from www.thermofluids.net, TEST offers twenty-two customized java applets,called daemons, for evaluation of states of different workingsubstances. These working substances include 50 common solidsand liquids, 65 phase-change fluids, 60 gases, and several gasmixtures.TEST has been developed using an object-oriented paradigm

in Java so that codes can be reused. All TEST daemons havebeen thoroughly tested under different versions of IE, Firefox,and Safari running on Windows, MacOS, and Linux platforms. Theonly browser plug-in required to run the daemons is version 4(or greater) of the Java Platform, available from www.java.com.An alternative way to run TEST is to install the software locallyfrom a CD distribution. The browser is then used to point towardsthe locally installed distribution or the index.html file containedon the CD itself. When locally installed, a daemon takes about2–5 s to load, whereas the load time may vary between 5 and20 s over the Internet depending on connection speed. The loadingtime, however, significantly decreases on subsequent access, asbrowsers cache reusablemodules of the daemons. Once loaded, thedaemons run just like any other native application installed on theclient machine.

2.1. Extended state algorithm

Because engineering systems often involve evaluation ofproperties in the interior as well as at the inlet and exit ports ofopen systems, TEST separates states into two types— system statesfor evaluating properties of a uniform system and flow states forevaluating properties of a uniform flow.An extended state provides a detailed snapshot of a state be-

yond the core thermodynamic properties describing a thermody-namic equilibrium. As shown in Fig. 1, an extended state buildsupon the thermodynamic state by adding extrinsic and systemproperties. At the core of any state are material properties – mo-lar mass, gas constant, etc. – which are intrinsic to a workingsubstance and are determined as soon as a substance is selected.Thermodynamic properties – p, T , v, u, h, and s –which are intrin-sic to an equilibrium state, also must be common to both systemand flow states. Extrinsic properties – properties such as elevationz, velocity V , specific stored energy e ≡ u + ke + pe, and specificflow energy j ≡ h + ke + pe – which depend on the observer’sspeed or location also appear in both types of extended states. Ofcourse, total properties or properties that depend on the extent ofa system –massm and volume V for instance – appear only in sys-tem states. These are replaced by the rate of transport of mass andvolume m and V , respectively, in the corresponding flow state.Each daemon provides an I/O (input/output) panel, where

properties that are not included as part of an extended state can becalculated after a state is evaluated. For instance, the total storedenergy in a uniform system at state-1, E1, can be calculated inthe I/O panel from the equation E1 = m1e1. Likewise, the rate ofentropy transport by a uniform flow at state-2 can be calculatedfrom S2 = m2e2 in the I/O panel after state-2 has been evaluated.The energy transported by a flow is not only due to the stored

energy carried by the flow, but also due to the flow work that isdone to sustain the flow:

E + WF = me+ pAV = me+ pvAVv= m (e+ pv)

= m (h+ ke+ pe) [kW] . (1)

Because the property group h + ke + pe appears often inopen system analysis, TEST introduces a new property symbol

Author's personal copy

S. Bhattacharjee, C. Paolini / CALPHAD: Computer Coupling of Phase Diagrams and Thermochemistry 33 (2009) 343–352 345

Fig. 1. Two types of extended states evaluated by TEST. They differ only in the outermost layer, where properties depend on system size.

Fig. 2. Property classifications.

j ≡ h+ ke+ pe to represent the net energy carried by a flow perunit mass. Known as the specific flow energy, (1) can be alsowritten as m (h+ ke+ pe) = mj = J . Specific enthalpy, therefore,can be interpreted as the specific flow energywhen the kinetic andpotential energies can be neglected in a flow.Given the large number of properties – some daemons display

as many as 23 properties – which can be used as an input by auser, classification of properties (see Fig. 2) plays an importantrole in the state algorithm. Once a working substance is selected,the material properties are obtained from a look-up table. Thefollowing property relations, which are applicable to all workingsubstances, are used to determine thermodynamic properties thatmay be indirectly supplied. For instance, if mass and volume aresupplied, the specific volume can be calculated:

m = ρV ; m = ρAV = ρV ; ρ =1v;

e = u+ ke+ pe; j = h+ ke+ pe; h = u+ pv.(2)

If a sufficient number of thermodynamic properties are known(entered by users or calculated from Eq. (2)), the complete setof thermodynamic properties are then obtained by using an

appropriate model as discussed in the next section. Once theintrinsic properties are found, general property relations of Eq. (2)are used in the reverse direction to populate the missing extrinsicand system properties.Extrinsic properties calculated by the daemons also include

specific stored exergy φ and specific flow exergy ψ:

φ = (e− e0)− T0(s− s0)+ p0(ν − ν0),ψ = (j− j0)− T0(s− s0).

(3)

Because the exergy of a system depends on its dead state [21],state-0 is designated in TEST as the dead state of a system. Toevaluate the dead state, ambient atmospheric temperature andpressure are used for state-0 along with a zero value of velocityand elevation. Once state-0 is computed, all other evaluated statesautomatically calculate φ and ψ .

2.2. Graphical user interface

TEST daemons employ an intuitive graphical user interface todisplay an array of properties as a complete snapshot of the state.A typical daemon is illustrated in Fig. 3 where a state daemon isused to calculate the flow state of steam flowing at 1000 kPa, 80%quality, and 50 m/s through a cross-section of diameter 10 cm.All state daemons share a similar graphical interface and appear

within a rectangular box containing five horizontal panels. Thepath name of the daemon such as State>Flow>PC-Model shown inFig. 3, and a version number are shown in the title panel. The rowof buttons below the title panel constitutes the global control panelwhich contains radio-buttons for the choice of units and a fewbuttons for global calculations (discussed later). Below the globalcontrol panel is a panel containing two tabs named the State Paneland I/O Panel which toggle the state and I/O panel, respectively,displayed between the tab panel and a message panel appearingat the bottom margin of the daemon. Hovering the mouse pointerover any hot spot brings up a helpful tip on themessage panel. Thestate panel is selected in the image displayed in Fig. 3.The state panel is sub-divided into three panels. The state

control panel consists of different control widgets such as a stateidentification menu, choices for thermodynamic plot, substanceselection, buttons for initialization and calculation, and a smalltextbox to display short messages — in this case the phasecomposition of the working fluid. Below the state control panelis the property panel where a number of properties are bundled.Below the property panel is an image panel depicting the state.Property labels are color coded — red for material properties,

blue for thermodynamic properties, green for extrinsic properties,

Author's personal copy

346 S. Bhattacharjee, C. Paolini / CALPHAD: Computer Coupling of Phase Diagrams and Thermochemistry 33 (2009) 343–352

Fig. 3. Image of the PC flow state daemon. The flow state, state-1, is evaluated for a flow of steam at 1000 kPa, 80% quality, flowing with a velocity of 50 m/s through a10 cm-diameter pipe.

and black for system properties. Each property object consists ofa checkbox, a property label, a textfield to display its value, anda choice for selecting a unit. The checkbox toggles the propertybetween the input and display mode. To enter a property, a userstarts by clicking its checkbox. A dependency analysis is run inthe background to ensure the property cannot be calculated fromother properties that have been entered already. If the property isfound to be an independent unknown, it goes into the input mode;otherwise, an appropriate error message is displayed and the useris prevented from over-specifying the state. In its input mode, theuser enters a property value, selects a unit from the unit menu, andpresses the Enter button. As shown in Fig. 4 for the temperatureobject, the background color of the property value changes oncethe value of 20 ◦C is read. Each time a new value is entered, thestate is updated until the complete state is obtained.In entering a value for property, simple mathematical expres-

sions can be used. The area A1 in Fig. 3, for instance, has been en-tered in terms of the diameter of the pipe. Calculated propertiesfrom another state can also be used as part of such expressions.For example, suppose state-2 is related to state-1 through a poly-tropic process pV 1.3 = c and the volume at state-2 is 0.5 m3. Thepressure at state-2 then can be entered through the expression‘= p1 ∗ (Vol1/0.5)1.35’.The I/O panel also serves as a calculator that recognizes

calculated variables and can be used to evaluate auxiliaryquantities. For state-1 displayed in Fig. 3, the transport rate ofkinetic energy, stored energy, flow energy, and flow work in kWare calculated in the I/O panel and shown in Fig. 5.

Fig. 4. Example of a property object — setting the temperature T1 of state-1.

2.3. Thermodynamic plots

Plotting calculated states on thermodynamic diagrams is assimple as picking the diagram type from the plot menu whichoffers p–v, p–h, T–v, T–s,h–s, p–T , v–T ,u–T ,h–T , and s–T diagrams.

Author's personal copy

S. Bhattacharjee, C. Paolini / CALPHAD: Computer Coupling of Phase Diagrams and Thermochemistry 33 (2009) 343–352 347

Fig. 5. Use of the I/O panel as a calculator to evaluate auxiliary variables. In this case, the flowwork (in kW) is calculated in two different ways for state-1 displayed in Fig. 3.

Fig. 6. After three states are calculated, constant pressure lines are drawn. Also, constant enthalpy lines drawn for state-2 indicating h2 = h3. Parking the pointer at anystate point – state-1 in this plot – shows its coordinates.

Fig. 6 shows three calculated states on a T–s plot. The plot windowprovidesmany convenient features. Constant property lines can bedrawn through any or all states by pressing the constant propertybuttons. Constant pressure and constant enthalpy lines plotted inthis figure reveal that states 1 and 2 have the same pressure, and2 and 3 have the same enthalpy. Hovering the pointer on top ofany point on the plot reveals its Cartesian coordinates. By changingthe left-bottom and top-right coordinates, the plot can be zoomedin or out, coordinates can be made logarithmic or linear by usingthe appropriate buttons, and the raw data used for the plot canbe displayed by clicking the Data Used button. This raw data can

be copied to a spreadsheet or another plotting routine for furtheranalysis.

2.4. TEST codes and what-if studies

The GUI used by states exposes all the properties of thermody-namic states to the user. Independent properties can be enteredin a myriad of possible combinations to calculate a state. Becauseproperties can be entered with relational expressions, a series ofstates related by certain constraints can be calculated. For exam-ple, the states shown in Fig. 6 are related to each other through

Author's personal copy

348 S. Bhattacharjee, C. Paolini / CALPHAD: Computer Coupling of Phase Diagrams and Thermochemistry 33 (2009) 343–352

Fig. 7. TEST-codes produced in the I/O panel by the Super-Calculate operation after the states shown in Fig. 6 are computed.

p2 = p1 and h3 = h2. All that is required to recalculate the statesfor a different value of p1 is to change p1 and then press the Super-Calculate button to update all the computed states.The Super-Calculate operation also produces a solution macro

called TEST-code which is shown in Fig. 7 for the states computedfor the plot shown in Fig. 6. The syntax of the macro code is similarto C, C++, and Java and is quite readable. The code describes whatis known about each state and can be copied and stored on disk forlater use.To reproduce a visual solution, TEST-codes can be copied back

into the I/O panel of the appropriate daemon and then pressingthe Load button which populates the GUI of the visual solution.The Problemsmodule of the TEST portal contains a large library ofexample TEST-codes.

2.5. Material models and solution algorithms

The numerous working substances used in engineering appli-cations are classified into several material models based on theirsimplifying sets of assumptions. These models are arranged in ahierarchicalmanner as shown in Fig. 8 to facilitate their encapsula-tion in an object-oriented manner. There are two broad categoriesinto which all the models are divided: pure substances and mix-tures.Pure substances are working substances with a constant

homogeneous chemical composition and are divided into threecategories: (a) solids and liquids, (b) real fluids with possibilitiesof phase change, and (c) gases. Mixtures of pure substances aredivided into two categories: binary and general mixtures.

2.5.1. SL modelThe SL (Solid/Liquid) model groups all solids and liquids and

is assumed to be incompressible with constant specific heats. AnS/L state daemon looks very similar to the PC flow state daemonshown in Fig. 3. As soon as a solid or liquid is selected from theworking substance selector, the material properties ρ, v, cv , and Mof the state are populated. Application of thermodynamic relationsproduces a set of equations relating u and swith T , and hwith p andT . Coupled with the general relations of (2), these equations setsare solved iteratively until the most number of unknowns basedon user input are calculated.In addition to common solids and liquids, the SL daemon allows

a user to define a custom solid or liquid by assigning the materialproperties cv , M , and ρ or v.

Table 1PC model phase determination for a given temperature and pressure.

Condition Phase composition Examplea

ptp < p ≤ pcr T > Tsat@p Superheated Vapor (V) State-1T < Tsat@p Subcooled Liquid (L) State-2T = Tsat@p Saturated mixture (M = L+ V) State-3

a See Fig. 9. Locating states on a T–s diagram for a given value of p and T .

Table 2PC model phase determination for a given pressure and one of {v, u, h, or s}.

Condition Phase composition Examplea

ptp < p ≤ pcr b > bf@p Superheated Vapor (V) State-1b < bf@p Subcooled Liquid (L) State-2bf@p ≤ b ≤ bg@p Saturated mixture (M) State-3

a See Fig. 9. Locating states on a T–s diagram for a given value of p and T .

2.5.2. PC ModelReal fluids such as water, hydrocarbons, and refrigerants can

exist as a compressed liquid, superheated vapor, or a mixtureof saturated liquid and saturated vapor. An image of the PCflow state daemon is shown in Fig. 3. In addition to the regularthermodynamic properties, two mixture properties – the qualityor the mass fraction x of vapor and the volume fraction y of vaporin a saturated mixture – are introduced by this daemon.The PC model handles sub-cooled liquids, saturated mixtures,

and super-heated vapors of a real fluid. The algorithmused is basedon a two-step process of finding the phase composition, followedby property evaluation from saturation and superheated data. Tosimplify the discussion, we assume the phase compositions to belimited to subcritical liquid, vapor, or saturated mixtures (ptp <p ≤ pcr).

Case A. Given p and T : From the saturation data, obtain Tsat@pand compare it with the given temperature to deduce the phasecomposition from Table 1.Note that while the phase composition of state-3 is found, its

relative location between the f and g states is an unknown at thispoint.

Case B. Given p and b (b stands for v, u, h, or s): From thesaturation data, obtain the saturation properties bf@p and bg@p anduse Table 2 to determine phase composition.

Case C. Given T and b (b stands for v, u, h, or s): The procedureis almost identical to the one described in Case Bwith the propertyp replaced with T .

Author's personal copy

S. Bhattacharjee, C. Paolini / CALPHAD: Computer Coupling of Phase Diagrams and Thermochemistry 33 (2009) 343–352 349

Fig. 8. Modeling working substances.

Fig. 9. Locating states on a T–s diagram for a given value of p and T .

CaseD. Given xor y: If the quality x or the vapor volume fractiony is given, the phase compositionmust be a saturatedmixture (M =L+ V) because these properties have meaning only in this region.

Case E. Given b1 and b2 (b stands for v, u, h, or s): Assumea pressure p and from the assumed p and b1, determine b2 byfollowing case B. Iterate over the entire range of pressures (ptp <p ≤ pcr) until the calculated b2 matches with the user supplied b2.Once a phase composition is determined, thermodynamic

properties for the vapor region are found from interpolationof the superheated data, which is downloaded along with theapplet during loading. For data outside the range of the table,appropriate approximations are made to extrapolate. Themessagepanel displays the assumptions used for such an extrapolation.For saturated mixtures, the vapor mass fraction x, if unknown, isdetermined byusing the following relation that expresses a genericmixture property b in terms of properties of a saturated liquid (f -state) and saturated vapor.

b = (1− x) bf + xbg . (4)

Once x is calculated, all other specific properties can becalculated by using Eq. (4) since p and T = Tsat@p are known. Thevolume fraction y is determined from

y ≡V gV=xvgv=

xvg@T(1− x) vf@T + xvg@T

. (5)

Since the intersection of the saturated liquid and saturatedvapor lines is the critical state, volume fraction can be determinedby assigning x = 0 (f -line) and y = 1 (g-line) in a PC daemon.Sub-cooled liquid is modeled by the simplifying assumption

that v, u, and s are functions of T only so that

v = vf@T , u = uf@T , s = sf@T , andh (p, T ) = uf@T + pvf@T .

(6)

Liquid properties, therefore, can be obtained from saturationdata. For water, TEST provides compressed liquid data that canbe used for higher accuracy. Sublimation data is also available to−40 ◦C.

2.5.3. Gas modelsThree different gas models are offered by TEST, as classified

in Fig. 3. The gas daemons look very similar to the PC flow statedaemon shown in Fig. 3.The well known ideal gas or IG model is based on the ideal gas

equation of state pv = RT . As a consequence of this equation, itcan be shown that the specific heats of an ideal gas are functions oftemperature only. Shomate polynomials [22] are used to correlatecp with T . The ranges of temperatures over which the polynomialcoefficients, obtained from the NIST Chemistry Webbook [23] arevalid, are shown on the message panel when a gas species isselected. Beyond that range, cp is assumed to be a constant.The IG daemon displays the material properties M and R for

any selected gas. Application of the ideal gas equation of state,the respective Shomate polynomial, and thermodynamic relationsproduces a set of equations relating cp, u, and h with T , and swith p and T . Coupled with the general relations of (2), thesesets of equations are solved iteratively until the most number ofunknowns based on user entered properties are found.The PG (perfect gas)model is based on an additional assumption

that specific heats are constant in addition to the ideal gasassumption. A perfect gas, therefore, is a simplified ideal gas. Thelist of material properties for a perfect gas includes M , R, cp, and cv .Specific heats, therefore, are material properties in the PG model.The solution algorithm follows the same steps as in the case of theIG daemons. A custom perfect gas can be created by the user byassigning a sufficient number of independent material properties.As in the case of any other input property, the daemon checks forindependence and sufficiency of the input material properties.

Author's personal copy

350 S. Bhattacharjee, C. Paolini / CALPHAD: Computer Coupling of Phase Diagrams and Thermochemistry 33 (2009) 343–352

Fig. 10. Image of the moist air system state daemon with a moist air state evaluated at 30 ◦C, 100 kPa, and 80% relative humidity in a chamber of volume 30 m3 . The massof water vapor calculated ism_v1 = 0.728 kg.

The RG (real gas) model introduces a deviation from the idealgas behavior at high pressure or low temperature through thecompressibility factor and enthalpy and entropy departure factors.The compressibility and the departure charts due to Lee and Kesler[24] as well as those due to Nelson and Obert [25] are both offeredby the RG daemons. In the state control panel, the user selects aparticular data set before selecting a working fluid. By using datafrom these charts, the daemon automatically creates the saturationtable and superheated table for any selected gas. Once these tablesare generated, the PC model algorithm is followed to obtain asolution.

2.5.4. Mixture modelsThe PG/PG and IG/IG binary mixture models are basically an

extension of the corresponding pure gas model with two speciesselectors A and B. Two new properties xA and yA specify themass and mole fraction of species A in the mixture. One of theseproperties must be entered to define a mixture. Based on mass ormole fractions, mixture properties are calculated, and temperaturetables are created for thermodynamic properties based on thePG or IG model. This table is interpolated for any temperature-dependent property. The rest of the solution follows the IG or PGmodel algorithm. Note that by entering a value of 1 or 0 for themass or mole fraction of A, the mixture can be made to consistpurely of A or B.The RG/RG model converts a binary mixture of real gases into

an equivalent pure real gas by applying Kay’s rule [26] to calculatecritical properties for themixture, based on themole fraction of thetwo components. Since themixture is treated as a pure real gas, therest of the algorithm follows the procedure of the RG model.The PC/PCmodel allows evaluation of a state of premixedblends

of refrigerants. The PC state daemons handle such blends indicatedby a percent symbol after the fluid name. For example, selecting R-410a% displays its composition as a 50–50 blend of R-32 and R-125on the message panel. The vapor pressure for a saturated mixtureis a function, not only of temperature, but also of the quality x ofthe mixture. This behavior is captured by using separate data forsaturated liquid and saturated vapor and interpolating those datafor amixture. The rest of the algorithm follows that of the standardPC model.Moist air is a mixture of dry air and water vapor and is an

important working fluid in HVAC applications. Because of the

low partial pressure of water vapor and the relatively moderatechange in temperature in most applications, water vapor can betreated as a perfect gas. However, the possibility of condensationor evaporation requires saturation data of water. The resultingmodel is called the MA (moist air) model, which is a modifiedPG/PG model. The MA state daemons introduce a number ofpsychrometric properties – pv , pa, pg , ω, φ, Tdp, Twb – in additionto the mixture properties, which are expressed per unit mass ofdry air following the psychrometric convention.The algorithm for finding a moist air state is straightforward

since the mixture of dry air and water vapor can be treatedusing the Dalton model. Once the partial pressure of water vaporis determined, the rest of the psychrometric properties can bereadily evaluated from their definitions. Saturation data for waterand ice is downloaded by the MA state daemons. States can becalculated down to −40 ◦C at any total pressure. The MA modelcan also be used to determine states of twelve other moist gasesincluding moist carbon dioxide, moist hydrogen, moist oxygen,etc. Psychrometric applications often require evaluation of statesof condensed water, saturated steam, and various refrigerants.The MA state daemons, therefore, also include the PC modelalgorithms.Fig. 10 displays a screenshot of the MA system state daemon

where the working substance selector can be seen to contain alist of moist gases as well as PC fluids such as water and differentrefrigerants. In Fig. 10, properties x and y are disabled becausemoist air is selected.When a PC fluid is selected, the psychrometricproperties are similarly disabled. The daemon in Fig. 10 calculatesthe mass of water vapor in a given volume of moist air at a giventemperature, pressure, and relative humidity. The psychrometricplot of the calculated state is shown in Fig. 11 where constant wetbulb temperature and constant relative humidity lines through thecalculated states are superimposed. By moving the pointer to theintersection of the Twb = c and φ = 100% lines, the wet bulbtemperature can be obtained from the coordinates displayed onthe plot.Finally, the general mixture model called the n-IG model can

be used to evaluate mixture states of any number of ideal gases. Ascreen shot of the n-IG system state daemon is shown in Fig. 12.The mixture is configured by specifying the amount (in kg, kmol,mass fraction, or mole fraction) of each component. When the first

Author's personal copy

S. Bhattacharjee, C. Paolini / CALPHAD: Computer Coupling of Phase Diagrams and Thermochemistry 33 (2009) 343–352 351

Fig. 11. As in any thermodynamic plot, constant property lines can be drawn on a psychrometric plot. In this figure, the wet bulb temperature for state-1 computed inFig. 10 can be deduced by parking the pointer over the intersection of the constant T_wb line and the saturation line (shown by the arrow).

Fig. 12. Image of the n-IG system state daemon evaluating the state of a gas mixture composed of 1 kmol of CO2 , 2 kmol of H2O, and 7.52 kmol of N2 .

component is selected, a mixture gas table is created, based on thematerial properties and Shomate polynomials of the selected gas.As a new component is added, mixture composition properties areupdated and the mixture property table is modified by includinga contribution from the newly added species. Once the mixture isfully configured, a state can be evaluated by following the sameprocedure used in the IG daemons. Note that formation enthalpycan be included or neglected in the state calculation.

3. Examples

Awide range of states involving working substances frequentlyencountered in engineering applications can be evaluated usingthe state daemons. In the TEST portal, Chapter 3 of the Problemsmodule contains a number of problems and examples of stateevaluation. TEST-codes are posted for each problem so the visualsolution can be reproduced. Because of the intuitive user interface,

Author's personal copy

352 S. Bhattacharjee, C. Paolini / CALPHAD: Computer Coupling of Phase Diagrams and Thermochemistry 33 (2009) 343–352

evaluating a state involves launching the appropriate daemon,entering the known properties in any unit, clicking the Calculatebutton, and then selecting a plot option.

4. Conclusions

Thermodynamic property calculators called state daemons forthe evaluation of properties of engineeringworking substances arepresented in this paper. These daemons can be browsed online orinstalled locally from CD to run in a stand-alone mode. The rangeof substances covered by these daemons include solids, liquids,ideal gases, real fluids with a possibility of phase change, mixtureof gases, mixture of real fluids, and moist air. Twelve differentmodels have been developed to capture the behavior of thisdiverse range of substances. An intuitive graphical user interfacehas been uniformly implemented for each of these models. Tocalculate a state, a user simply enters the independent propertiesin any available unit and then presses the Calculate button. Apowerful thermodynamic plotter can thendisplay calculated statesin any desired thermodynamic diagram and allow the user to drawconstant property lines on the plot.Algebraic expressions can be used to relate one state with

another, making it possible to compute a series of states in a cycle.Because the GUI visually exposes every property, so called what-ifstudies can be easily carried out by changing a property and thenupdating the entire solution. The visual solution can be convertedinto a few lines of TEST-code which specify the input propertiesin C language similar syntax. TEST-codes can be saved and reusedlater to regenerate a visual solution by simply pasting and loadingthe codes in a daemon’s I/O panel.Efforts are currently underway to deliver these state calculators

through Web Services to client side commercial applications suchas Microsoft Excel and MATLAB and programming languagessuch as FORTRAN and Java. State calculators then can be easilyintegrated into a variety of existing and future applications.

Acknowledgments

Continuing work on TEST is being supported by the NSFOffice of CyberInfrastructure CI-TEAM Grant 0753283. Also agrant from Prentice Hall for developing a multi-media module forthermodynamics is acknowledged. Grants from SunMicrosystemsand NASA, Glenn Research center are also acknowledged.

References

[1] American Society of Mechanical Engineering, Engineering Database – Ther-modynamics, Combustions and Chemical Balance Analysis, October 20, 2000.http://www.mecheng.asme.org/database/THERMO/MASTER.HTML (accessed21.09.08).

[2] F-Chart Software, Engineering Equation Solver, Middleton, WI 53562, 2008.[3] David G. Goodwin, TPX: Thermodynamic Properties for Excel, 2008, http://adam.caltech.edu/software/tpx.

[4] R. Gicquel, Applied Thermodynamics Software — Thermoptim, SystèmesÉnergétiques, Les presses de l’Ecole des Mines, Paris, 2001.

[5] ProMetric Technologies, GasCad and RealGas, 2008. http://www.prometrictech.com/demodown.html.

[6] Qualitative Reasoning Group, CyclePad, 2008. http://www.qrg.northwestern.edu/projects/NSF/cyclepad/cyclepad.htm (accessed 27.10.08).

[7] C. Morley, GasEQ: A Chemical Equilibrium Program for Windows, October 27,2007. http://www.gaseq.co.uk/.

[8] R.W. Ramette, REACT: Exploring practical thermodynamic and equilibriumcalculations, J. Chem. Educ. Software 8B1 (1995).

[9] UnitOOPS Software, REACT! – A Chemical Equilibrium Calculator, 1992.http://www.yale.edu/yaleche/chemeng/job/rxtinfo.htm (accessedOctober 27,2007).

[10] A. Roine, HSC Chemistry for Windows — Chemical Reaction and EquilibriumSoftware with Extensive Thermochemical Database, in: A. Roine (Ed.),Outokumpu, HSC chemistry forWindows— Chemical ReOutokumpu ResearchOy. Pori, 1999.

[11] G. Eriksson, Thermodynamic studies of high temperature equilibria. XII.SOLGASMIX, a computer program for calculation of equilibrium compositionsin multiphase systems, Chem. Scr. 8 (1975) 100–103.

[12] C.W. Bale, P. Chartrand, S.A. Degterov, G. Eriksson, K. Hack, R. Ben Mahfoud,J. Melançon, A.D. Pelton, S. Petersen, Factsage thermochemical software anddatabases, CALPHAD 26 (2002) 189–228.

[13] Thermochemistry, CRCT - Center for Research in Computational. http://www.crct.polymtl.ca (accessed 29.10.07).

[14] S. Gordon, B.J. McBride, Computer Program for Calculation of ComplexChemical Equilibrium Compositions and Applications – I, Analysis, NASAReference Publication 1311, 1994.

[15] B.J. McBride, S. Gordon, Computer Program for the Calculation of ComplexChemical Equilibrium Compositions and Applications – II, Users Manual andprogram Description, NASA Reference Publication 1311, 1996.

[16] NASA Glenn Research Center. http://www.grc.nasa.gov/WWW/CEAWeb/ (ac-cessed 07.11.07).

[17] W.C. Reynolds, The element-potential method for chemical equilibriumanalysis: Implementation in the interactive program STANJAN, TechnicalReport A-3391, Department of Mechanical Engineering, Stanford University,Palo Alto, CA, 1986.

[18] Subrata Bhattacharjee, The Expert System for Thermodynamics, Prentice Hall,2002.

[19] The MERLOT project. http://www.merlot.org.[20] Subrata Bhattacharjee, Test-The expert system for thermodynamics, in: Proc.

of the 2003 American Society for Engineering Education Annual Conference &Exposition, American Society for Engineering Education, Nashville, TN, 2003,p. 15.

[21] Michael J. Moran, Howard N. Shapiro, Fundamentals of Engineering Thermo-dynamics, 5th ed., Wiley, 2003.

[22] C.Howard Shomate, High-temperature heat contents of Magnesium Ni-trate, Calcium Nitrate and Barium Nitrate, J. Am. Chem. Soc. 66 (1944)928–929.

[23] National Institute of Standards and Technology, NIST Chemistry WebBook,June 2005. http://webbook.nist.gov/chemistry/ (accessed 09.03.08).

[24] B.I. Lee, M.G. Kesler, A generalized thermodynamic correlation based on three-parameter corresponding states, AIChE J. 21 (1975) 510–527.

[25] L.C. Nelson, E.F. Obert, Generalized pvT properties of gases, Trans. ASME 76(1954) 1057–1066.

[26] W.B. Kay, Density of hydrocarbon gases and vapors at high temperature andpressure, Ind. Eng. Chem. 28 (1936) 1014–1019.