CE 530 Molecular Simulation Lecture 20 Phase Equilibria David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu
2 Thermodynamic Phase Equilibria Certain thermodynamic states find that two (or more) phases may be equally stable thermodynamic phase coexistence Phases are distinguished by an order parameter; e.g. density structural order parameter magnetic or electrostatic moment Intensive-variable requirements of phase coexistence T a = T b P a = P b µ i a = µ ib, i =,,C
Phase Diagrams Phase behavior is described via phase diagrams two-phase regions two-phase lines 3 Field variable e.g., temperature isobar V critical point tie line L+V triple point S+V Density variable Gibbs phase rule F = 2 + C P F = number of degrees of freedom independently specified thermodynamic state variables C = number of components (chemical species) in the system P = number of phases Single component, F = 3 P L L+S S Field variable (pressure) S L critical point V Field variable (temperature)
Approximate Methods for Phase Equilibria by Molecular Simulation. 4 Adjust field variables until crossing of phase transition is observed e.g., lower temperature until condensation/freezing occurs Problem: metastability may obsure location of true transition isobar Temperature V Hysteresis L+V S+V L L+S S Pressure S L V Metastable region Density Temperature Try it out with the LJ NPT-MC applet
Approximate Methods for Phase Equilibria by Molecular Simulation 2. 5 Select density variable inside of two-phase region choose density between liquid and vapor values Problem: finite system size leads to large surface-to-volume ratios for each phase bulk behavior not modeled Metastability may still be a problem Temperature V L+V L L+S S S+V Density Try it out with the SW NVT MD applet
Rigorous Methods for Phase Equilibria 6 by Molecular Simulation Search for conditions that satisfy equilibrium criteria equality of temperature, pressure, chemical potentials Difficulties evaluation of chemical potential often is not easy tedious search-and-evaluation process T constant Chemical potential Simulation data Simulation data or equation of state Pressure
Rigorous Methods for Phase Equilibria 7 by Molecular Simulation Search for conditions that satisfy equilibrium criteria equality of temperature, pressure, chemical potentials Difficulties evaluation of chemical potential often is not easy tedious search-and-evaluation process T constant Chemical potential Simulation data or equation of state Pressure
Rigorous Methods for Phase Equilibria 8 by Molecular Simulation Search for conditions that satisfy equilibrium criteria equality of temperature, pressure, chemical potentials Difficulties evaluation of chemical potential often is not easy tedious search-and-evaluation process T constant Chemical potential Simulation data or equation of state Pressure
Rigorous Methods for Phase Equilibria 9 by Molecular Simulation Search for conditions that satisfy equilibrium criteria equality of temperature, pressure, chemical potentials Difficulties evaluation of chemical potential often is not easy tedious search-and-evaluation process T constant Chemical potential Simulation data or equation of state Pressure
Rigorous Methods for Phase Equilibria 0 by Molecular Simulation Search for conditions that satisfy equilibrium criteria equality of temperature, pressure, chemical potentials Difficulties evaluation of chemical potential often is not easy tedious search-and-evaluation process Coexistence T constant Chemical potential Simulation data or equation of state Pressure
Rigorous Methods for Phase Equilibria by Molecular Simulation Search for conditions that satisfy equilibrium criteria equality of temperature, pressure, chemical potentials Difficulties evaluation of chemical potential often is not easy tedious search-and-evaluation process Coexistence T constant Many simulations to get one point on phase diagram Chemical potential Simulation data or equation of state Pressure S L + V Pressure Temperature
Gibbs Ensemble. 2 Panagiotopoulos in 987 introduced a clever way to simulate coexisting phases without an interface Two simulation volumes Thermodynamic contact without physical contact How?
Gibbs Ensemble 2. 3 MC simulation includes moves that couple the two simulation volumes Particle exchange equilibrates chemical potential Volume exchange equilibrates pressure Incidentally, the coupled moves enforce mass and volume balance Try it out with the LJ GEMC applet
Gibbs Ensemble Formalism 4 Partition function GE Q ( N, V, T ) = dv Q( N, V, T ) Q( N N, V V, T ) Limiting distribution N V N = 0 0 N N N 2 V V V 2 3N N N N 2 N2 N N U( s, V) N2 N2 U( s, V2) = GE 2 N Λ π ( r, N, V ) dvds ds V ds e V ds e Q General algorithm. For each trial: with some pre-specified probability, select molecules displacement/rotation trial volume exchange trial molecule exchange trial conduct trial move and decide acceptance
Molecule-Exchange Trial Move Analysis of Trial Probabilities 5 Detailed specification of trial moves and probabilities Event [reverse event] Select box A [select box B] Select molecule k [select molecule k] Probability [reverse probability] /2 /2 /N A [/(N B +)] Forward-step trial probability Reverse-step trial probability ds min(, χ) N 2 A ds min(, ) 2 N + χ B Move to r new [move back to r old ] Scaled volume ds/ [ds/] Accept move [accept move] min(,χ) [min(,/χ)] χ is formulated to satisfy detailed balance
6 Molecule-Exchange Trial Move Analysis of Detailed Balance Forward-step trial probability ds min(, χ) N 2 A Reverse-step trial probability ds min(, ) 2 N + χ B Detailed balance π i π ij = π j π ji 3N N N Limiting N N ( A, ) ( B, ) (,, ) A NB NA NA U VA NB NB U VB A A A GE A B distribution N V dv d d Λ V d e Q V d e π s = s r s s s s
7 Molecule-Exchange Trial Move Analysis of Detailed Balance Forward-step trial probability ds min(, χ) N 2 A Reverse-step trial probability ds min(, ) 2 N + χ B Detailed balance π i π ij = π j π ji old new U N A N NB NB U NA NA NB+ NB+ e V min(, ) min(, ) A ds VB ds dv d A ds χ e VA ds VB ds dv s A χ 3N GE 2N = 3N GE Λ Q A Λ Q 2( NB + ) 3N N N Limiting N N ( A, ) ( B, ) (,, ) A NB NA NA U VA NB NB U VB A A A GE A B distribution N V dv d d Λ V d e Q V d e π s = s r s s s s
Molecule-Exchange Trial Move Analysis of Detailed Balance 8 Forward-step trial probability ds min(, χ) N 2 A Reverse-step trial probability ds min(, ) 2 N + χ B Detailed balance π i π ij = π j π ji old new U N A N NB NB U NA NA NB+ NB+ e V min(, ) min(, ) A ds VB ds dv d A ds χ e VA ds VB ds dv s A χ 3N GE 2N = 3N GE Λ Q A Λ Q 2( NB + ) e old new V χ = e N V N + U U B A A B V χ = V B A NA e N + B Δ U tot Acceptance probability
Volume-Exchange Trial Move Analysis of Trial Probabilities 9 Take steps in λ = ln(v A /V B ) ( ) V V V A V V dλ = + dv = dv dv A = V A B A B V V dλ A B Detailed specification of trial moves and probabilities A Step to λ new [step to λ old ] Event [reverse event] Accept move [accept move] Probability [reverse probability] dλ/δ dλ/δ min(,χ) [min(,/χ)] Forward-step trial probability Reverse-step trial probability dλ min(, χ) Δ dλ min(, ) Δ χ
20 Volume-Exchange Trial Move Analysis of Detailed Balance Forward-step trial probability dλ min(, χ) Δ Reverse-step trial probability dλ min(, ) Δ χ Detailed balance π i π ij = π j π ji Limiting distribution 3N N N N N ( A, ) ( B, ) (,, ) A N dλλ B NA NA U VA NB NB U V π N B A VA dλd d + s V GE A d e + s r s s = s VB ds e VQ
2 Volume-Exchange Trial Move Analysis of Detailed Balance Forward-step trial probability dλ min(, χ) Δ Reverse-step trial probability dλ min(, ) Δ χ old Detailed balance π i π ij = π j π ji new N A+ NA B+ NB U NA+ N NB+ B U N N e V min(, ) Ai, ds VBi, ds dλmin(, χ) e V d Aj, d VB, j d λ s s χ = 3N GE 3N GE Λ Q Δ Λ Q Δ Limiting distribution 3N N N N N ( A, ) ( B, ) (,, ) A N dλλ B NA NA U VA NB NB U V π N B A VA dλd d + s V GE A d e + s r s s = s VB ds e VQ
Volume-Exchange Trial Move Analysis of Detailed Balance 22 Forward-step trial probability dλ min(, χ) Δ Reverse-step trial probability dλ min(, ) Δ χ old Detailed balance π i π ij = π j π ji new N A+ NA B+ NB U NA+ N NB+ B U N N e V min(, ) Ai, ds VBi, ds dλmin(, χ) e V d Aj, d VB, j d λ s s χ = 3N GE 3N GE Λ Q Δ Λ Q Δ U old new NA+ NB+ U NA+ NB+ Ai, Bi, χ = Ai, Bi, e V V e V V N + new NB+ VB old VB new A V χ = A old VA e ΔU tot Acceptance probability
27 Gibbs Ensemble Limitations Limitations arise from particle-exchange requirement Molecular dynamics (polarizable models) Dense phases, or complex molecular models Solid phases N = 4n 3 (fcc)?
Approaching the Critical Point 28 Critical phenomena are difficult to capture by molecular simulation Density fluctuations are related to compressibility Correlations between fluctuations important to behavior in thermodynamic limit correlations have infinite range in simulation correlations limited by system size surface tension vanishes P ρ = 0 V ρ κ = = V P ρ P T Pressure V isotherm C L+V L L+S S σ 2 ρ κ S+V Density
29 Critical Phenomena and the Gibbs Ensemble Phase identities break down as critical point is approached Boxes swap identities (liquid vs. vapor) Both phases begin to appear in each box surface free energy goes to zero
30 Gibbs-Duhem Integration GD equation can be used to derive Clapeyron equation ln p σ = Δh ΔZ equation for coexistence line Treat as a nonlinear first-order ODE use simulation to evaluate right-hand side Trace an integration path the coincides with the coexistence line Field variable (pressure) S L critical point V Field variable (temperature)
GDI Predictor-Corrector Implementation 3 Given initial condition and slope (= Δh/ΔZ), predict new (p,t) pair. lnp Evaluate slope at new state condition lnp and use to correct estimate of new (p,t) pair lnp
32 GDI Simulation Algorithm Estimate pressure and temperature from predictor Begin simultaneous NpT simulation of both phases at the estimated conditions As simulation progresses, estimate new slope from ongoing simulation data and use with corrector to adjust p and T Continue simulation until the iterations and the simulation averages converge Repeat for the next state point Each simulation yields a coexistence point. Particle insertions are never attempted.
33 GDI Sources of Error Three primary sources of error in GDI method Stochastic error Finite step of integrator Stability lnp Incorrect initial condition? Uncertainty in slopes due to uncertainty in simulation averages 2 2 True curve 2 Quantify via propagation of error using confidence limits of simulation averages Smaller step Integrate series with every-other datum Compare predictor and corrector values Stability can be quantified Error initial condition can be corrected even after series is complete
GDI Applications and Extensions 34 Applied to a pressure-temperature phase equilibria in a wide variety of model systems emphasis on applications to solid-fluid coexistence Can be extended to describe coexistence in other planes variation of potential parameters inverse-power softness stiffness of polymers range of attraction in square-well and triangle-well variation of electrostatic polarizability as with free energy methods, need to identify and measure variation of free energy with potential parameter mixtures A = λ U λ
Semigrand Ensemble Thermodynamic formalism for mixtures d( A) = Ud PdV + µ dn+ µ 2dN2 + µ dn2 µ dn2 Rearrange d( A) = Ud PdV + µ d( N+ N2) + ( µ 2 µ ) dn2 Legendre transform = Ud PdV + µ dn + Δµ dn ( ) 2 2 d Y d( A Δµ N ) 2 2 ( ) = Ud PdV + µ dn N d Δµ 2 2 35 Independent variables include N and Δµ 2 Dependent variables include N 2 must determine this by ensemble average ensemble includes elements differing in composition at same total N Ensemble distribution π N N N N (,, 2) 2 2 (,, N E p r N N 2 ) e e + Δµ r p = 3N Υ h N!
36 GDI/GE with the Semigrand Ensemble Governing differential equation (pressure-composition plane) ln p x = Δ µ Δ ΔZ 2 T, σ 2 Simple LJ Binary σ = ε = σ 2 = ε 2 = 0.75 σ 22 = ε 22 = Pressure 0.0 0.09 0.08 0.07 0.06 Gibbs Ensemble Gibbs-Duhem Integration 0.0 0.2 0.4 0.6 0.8 Mole Fraction of Species 2.0
GDI with the Semigrand Ensemble Freezing of polydisperse hard spheres appropriate model for colloids Integrate in pressure-polydispersity plane 37 Findings upper polydisersity bound to freezing re-entrant melting dp dν sat 2 Δm2 /2 ν = Δ( V / N).4.3 c = Composition (Fugacity) Density.2. solid c 2 =.0 fluid m 2 (ν) 0.9 0.0 0. 0.2 0.3 0.4 Polydispersity 0.5 0.6 0.7 Diameter
38 Other Views of Coexistence Surface Dew and bubble lines Residue curves Azeotropes semigrand ensemble formulate appropriate differential equation integrate as in standard GDI method right-hand side involves partial molar properties Δ Δ + = Δ Δ Δ Δ Δ µ µ µ µ µ µ µ,,,,,, ) ( P P azeo sat P P azeo X Y d dp P Y P X Y X d d ) ( V L V L azeo sat v v h h d dp =
Tracing of Azeotropes Lennard-Jones binary, variation with intermolecular potential σ =.0; σ 2 =.05; σ 22 = variable ε =.0; ε 2 = 0.90; ε 22 =.0 T =.0 0.0545 39 Coexistence pressure, P* 0.0525 0.0505 0.0485 0.0465 0.0445 0.0425 0 0. 0.2 0.3 0.4 0.5 X2, Y2
40 Summary Thermodynamic phase behavior is interesting and useful Obvious methods for evaluating phase behavior by simulation are too approximate Rigorous thermodynamic method is tedious Gibbs ensemble revolutionized methodology two coexisting phases without an interface Gibbs-Duhem integration provides an alternative to use in situations where GE fails dense and complex fluids solids Semigrand ensemble is useful formalism for mixtures GDI can be extended in many ways