Click here to load reader

Computation - phase stabilit y analysis. 24 4.1.6 Up date of a metastable phase assem bly. 24 4.2 Computation of phase diagrams. 26 4.2.1 Com binations of co existing phases. 27 4.2.2

  • View
    1

  • Download
    0

Embed Size (px)

Text of Computation - phase stabilit y analysis. 24 4.1.6 Up date of a metastable phase assem bly. 24 4.2...

  • Computation of phase equilibriain uid mixtures by

    Egil Brendsdal Thesis submitted for partial ful�llmentof the requirements for the degree of

    Doktor Ingeni�r Avdeling for teknologiske fagH�gskolen i TelemarkPorsgrunn

  • AcknowledgmentsMy main supervisors have been prof. dr. techn. Sven J. Cyvin, present occupation full timephilatelist, and dr. ing. Tore Haug-Warberg. They both deserve special thanks for their contri-butions, both in discussions, guidance and for organizing the study. I would also like to thankMarsha Torsteinsen for helping me to prepare the document.Financial support for this project was provided by Norges Teknisk-NaturvitenskapligeForskningsr�ad, project number 221822, Norges Forskningsr�ad, project number 100591/410, andInstitutt for Energiteknikk.

  • SummaryThis thesis outlines a general approach to the computation of thermodynamic equilibrium andphase diagrams based on existing mathematical models for thermodynamic properties.The general equations governing thermodynamic equilibria are presented in a form suitablefor a uni�ed solution strategy, and the mathematical transforms enabling equilibrium computa-tions at alternate constraint speci�cations are explained. An algorithm for computation tasksis proposed. This algorithm requires analytical �rst and second-order derivatives of the thermo-dynamic models. The algorithm is based on a Newton-Lagrange scheme utilizing step lengthadjustment. The algorithm has second order convergence independent of constraint speci�ca-tions, and the phase stability problem is resolved by a method that can be speci�c to eachphase model. A trajectory method suitable for stability computations based on equation ofstate phase models is described. Computational results, including calculations of four-phaseequilibria at alternate constraint speci�cations and stability computation of partially open andreacting systems, are shown in the text.A simple procedure for the construction of phase diagrams is proposed. In addition tothe prerequisites of the algorithm for equilibrium computations, this procedure requires aninitial equilibrium point consisting of the maximum number of phases that can coexist in thethermodynamic system. The phase envelopes are described by ordinary di�erential equationsand the phase diagrams are computed by a simple predictor corrector scheme. Computationalresults, included a phase diagram of a near-critical azeotrope and a ternary system with afour-phase envelope, are reported.

    i

  • PrefaceI began studying thermodynamics, not inspired by any particular interest in the subject, butmore as a result of the annoyance of not understanding it. When trying to get accustomed tothe material, I found the postulational formulation of thermodynamics very useful. Althoughpostulates do not add anything to the understanding of thermodynamics, they provide themathematical basis for equilibrium computations. Computations, on the other hand, havealways fascinated me. In the process of learning, I also �nd developing algorithms very useful;First, as a prerequisite for all computations, one must gain enough knowledge of the material inorder to explain the problem to the mindless equipment commonly referred to as the computer.Next, when the algorithm is tried in action, the computer will relentlessly reveal the weak partsof the chosen strategy.Back in 1993, I started the dr. ing. project with the intention to investigate alternativenumerical schemes for equilibrium computations based on equations of state models. However,I gradually became more interested in the general nature of equilibrium thermodynamics. I alsorealized the ine�ciency in my approach to test alternative strategies of equilibrium computa-tions. I missed especially having a tool for rapid prototyping allowing easier investigation ofnew methods and general trouble-shooting. Being a novice to object oriented programming, Iassumed a class library suitable for prototyping could be achieved within the project period.However, this idea resulted in programming 4 500 general purpose functions before I returnedto the main objective of the project.Nearly at the end of the project, I suddenly realized that typesetting the thesis was themost challenging part of the job. According to the TEXbook [25], material requiring onemonth of experience is, upon completion of the thesis, still completely incomprehensible to me!Unfortunately, time did not allow any �ne-tuning of the mathematical formulae or layout of thetext.

    Premature optimization is the root of all evil{ Donald E. Knuthiii

  • Contents Summary iPreface iiiContents vNotation ix1 Introduction 11.1 Organization of the thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Theory 52.1 Equilibrium thermodynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.2 Computation of thermodynamic equilibria . . . . . . . . . . . . . . . . . . . . . 72.3 Calculation of phase diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 Existing methods 133.1 Computation of thermodynamic equilibria . . . . . . . . . . . . . . . . . . . . . 133.2 Phase diagram construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143.3 Stability testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143.4 Trajectory methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 Algorithms 174.1 Computation of phase and reaction equilibrium . . . . . . . . . . . . . . . . . . 174.1.1 Transformation of thermodynamic surfaces . . . . . . . . . . . . . . . . . 174.1.2 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204.1.3 Solution of the �rst-order conditions . . . . . . . . . . . . . . . . . . . . 204.1.4 Updating the phase assembly . . . . . . . . . . . . . . . . . . . . . . . . 224.1.5 Initialization of phase stability analysis . . . . . . . . . . . . . . . . . . . 244.1.6 Update of a metastable phase assembly . . . . . . . . . . . . . . . . . . . 244.2 Computation of phase diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . 264.2.1 Combinations of coexisting phases . . . . . . . . . . . . . . . . . . . . . . 274.2.2 Tracing of lines in phase diagrams . . . . . . . . . . . . . . . . . . . . . . 284.2.3 Locating points in a phase diagram . . . . . . . . . . . . . . . . . . . . . 304.3 Stability analysis by a trajectory method . . . . . . . . . . . . . . . . . . . . . . 324.3.1 Governing equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324.3.2 Numerical considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 Computational results 355.1 Phase diagrams of a binary system . . . . . . . . . . . . . . . . . . . . . . . . . 36v

  • vi Contents5.1.1 Pressure-composition diagram . . . . . . . . . . . . . . . . . . . . . . . . 365.1.2 Temperature-composition diagram . . . . . . . . . . . . . . . . . . . . . 375.1.3 Pressure-temperature diagram . . . . . . . . . . . . . . . . . . . . . . . . 385.2 Stability of minerals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405.2.1 Stability computation of reacting system . . . . . . . . . . . . . . . . . . 405.2.2 Phase diagram construction . . . . . . . . . . . . . . . . . . . . . . . . . 435.2.3 Thermodynamic models . . . . . . . . . . . . . . . . . . . . . . . . . . . 455.3 Phase diagrams with several critical points . . . . . . . . . . . . . . . . . . . . . 465.4 Critical azeotrope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485.4.1 Phase diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485.4.2 Equilibrium computations . . . . . . . . . . . . . . . . . . . . . . . . . . 505.5 Ternary mixture with tricritical point . . . . . . . . . . . . . . . . . . . . . . . . 515.5.1 Phase diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515.5.2 Equilibrium computations . . . . . . . . . . . . . . . . . . . . . . . . . . 535.6 Stability analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596 Discussion 63References 67A Models of thermodynamic properties 71A.1 Pure component chemical potential . . . . . . . . . . . . . . . . . . . . . . . . . 71A.2 Ideal gas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72A.3 Cubic equation of state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73A.3.1 Model speci�c parameters . . . . . . . . . . . . . . . . . . . . . . . . . . 73B Miscellaneous mathematical formulae 75B.1 Partial derivatives and matrix notation . . . . . . . . . . . . . . . . . . . . . . . 75B.2 Taylor's Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77B.3 Sherman-Morrison formula . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77B.4 Matrix identities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78B.5 Homogeneous functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78B.5.1 Functions of arbitrary degree of homogeneity . . . . . . . . . . . . . . . . 78B.5.2 First-order homogeneous functions . . . . . . . . . . . . . . . . . . . . . 79C Transforms of thermodynamic functions 81C.1 Legendre transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81C.1.1 De�nition of the Legendre transformation . . . . . . . . . . . . . . . . . 81C.1.2 The �rst-order derivatives of a Legendre transformed function . . . . . . 82C.1.3 Second order derivatives of Legendre-transformed function . . . . . . . . 82C.2 The inverse Legendre transformation . . . . . . . . . . . . . . . . . . . . . . . . 83C.3 Implicit functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84D Constrained optimization 87D.1 Constrained minimization co