CE 530 Molecular Simulation

Slides:



Advertisements
Similar presentations
Properties of a Pure Substance
Advertisements

The thermodynamics of phase transformations
Simulazione di Biomolecole: metodi e applicazioni giorgio colombo
Hypothesis testing Another judgment method of sampling data.
Molecular Dynamics at Constant Temperature and Pressure Section 6.7 in M.M.
Thermodynamics of surface and interfaces
Mechanical & Aerospace Engineering West Virginia University Phase Diagram (1)
1 CE 530 Molecular Simulation Lecture 8 Markov Processes David A. Kofke Department of Chemical Engineering SUNY Buffalo
Chapter 6 PHASE EQUILIBRIA
CE 400 Honors Seminar Molecular Simulation Prof. Kofke Department of Chemical Engineering University at Buffalo, State University of New York Class 4.
1 CE 530 Molecular Simulation Lecture 16 Dielectrics and Reaction Field Method David A. Kofke Department of Chemical Engineering SUNY Buffalo
Observables. Molar System The ratio of two extensive variables is independent of the system size.  Denominator N as particle  Denominator N as mole.
1 CE 530 Molecular Simulation Lecture 2 David A. Kofke Department of Chemical Engineering SUNY Buffalo
Chapter 3 Properties of a Pure Substance
Advanced Thermodynamics Note 9 Vapor/Liquid Equilibrium: Introduction
1 CE 530 Molecular Simulation Lecture 7 David A. Kofke Department of Chemical Engineering SUNY Buffalo
Advanced methods of molecular dynamics Monte Carlo methods
Physical Transformations of Pure Substances
Chemical Thermodynamics II Phase Equilibria
Free energies and phase transitions. Condition for phase coexistence in a one-component system:
CHEE 311J.S. Parent1 1. Science of Thermodynamics Concerned with knowing the physical state of a system at equilibrium. A concise (mathematical) description.
1 Effect of the Range of Interactions on the Properties of Fluids Equilibria of CO 2, Acetone, Methanol and Water Ivo Nezbeda 1,2, Ariel A. Chialvo 3,2,
1 CE 530 Molecular Simulation Lecture 17 Beyond Atoms: Simulating Molecules David A. Kofke Department of Chemical Engineering SUNY Buffalo
1 CE 530 Molecular Simulation Lecture 18 Free-energy calculations David A. Kofke Department of Chemical Engineering SUNY Buffalo
PETE 310 Lecture # 5 Phase Behavior – Pure Substances.
4.The Grand Canonical Ensemble 1.Equilibrium between a System & a Particle-Energy Reservoir 2.A System in the Grand Canonical Ensemble 3.Physical Significance.
1 CE 530 Molecular Simulation Lecture 6 David A. Kofke Department of Chemical Engineering SUNY Buffalo
For a new configuration of the same volume V and number of molecules N, displace a randomly selected atom to a point chosen with uniform probability inside.
Ensembles II: 1.The Gibbs Ensemble (Chap. 8) Bianca M. Mladek University of Vienna, Austria
1 Statistical Mechanics and Multi- Scale Simulation Methods ChBE Prof. C. Heath Turner Lecture 14 Some materials adapted from Prof. Keith E. Gubbins:
1 CE 530 Molecular Simulation Lecture 22 Chain-Molecule Sampling Techniques David A. Kofke Department of Chemical Engineering SUNY Buffalo
1 M.Sc. Project of Hanif Bayat Movahed The Phase Transitions of Semiflexible Hard Sphere Chain Liquids Supervisor: Prof. Don Sullivan.
1. (1.3) (1.8) (1.11) (1.14) Fundamental equations for homogeneous closed system consisting of 1 mole:
1 Statistical Mechanics and Multi- Scale Simulation Methods ChBE Prof. C. Heath Turner Lecture 25 Some materials adapted from Prof. Keith E. Gubbins:
Properties of Pure Substances Chapter 3. Why do we need physical properties?  As we analyze thermodynamic systems we describe them using physical properties.
Fluid-substrate interactions; structure of fluids inside pores.
Physical Property Modeling from Equations of State David Schaich Hope College REU 2003 Evaluation of Series Coefficients for the Peng-Robinson Equation.
6. Coping with Non-Ideality SVNA 10.3
Chapter 8: The Thermodynamics of Multicomponent Mixtures
1 CE 530 Molecular Simulation Lecture 10 Simple Biasing Methods David A. Kofke Department of Chemical Engineering SUNY Buffalo
HEAT TRANSFER FINITE ELEMENT FORMULATION
1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo
CHEE 311J.S. Parent1 4. Chemical Potential in Mixtures When we add dn moles of a component to n moles of itself, we will observe (?) a change in Gibbs.
Interacting Molecules in a Dense Fluid
An Introduction to Monte Carlo Methods in Statistical Physics Kristen A. Fichthorn The Pennsylvania State University University Park, PA
Pressure – Volume – Temperature Relationship of Pure Fluids.
Monte Carlo in different ensembles Chapter 5
Generalized van der Waals Partition Function
Other Partition Functions
1 Statistical Mechanics and Multi- Scale Simulation Methods ChBE Prof. C. Heath Turner Lecture 19 Some materials adapted from Prof. Keith E. Gubbins:
Introduction to phase equilibrium
Solution thermodynamics theory
Thermodynamics I Inter - Bayamon Lecture 3 Thermodynamics I MECN 4201 Professor: Dr. Omar E. Meza Castillo
1 CE 530 Molecular Simulation Lecture 21 Histogram Reweighting Methods David A. Kofke Department of Chemical Engineering SUNY Buffalo
8. Solute (1) / Solvent (2) Systems 12.7 SVNA
Statistical Mechanics and Multi-Scale Simulation Methods ChBE
SOLUTION THERMODYNAMICS:
Systematic errors of MC simulations Equilibrium error averages taken before the system has reached equilibrium  Monitor the variables you are interested.
Solution of Thermodynamics: Theory and applications
The Stability of Phases
Lecture 49 More on Phase Transition, binary system
Partial Molar Variables, Chemical Potential, Fugacities, Activities, and Standard States Partial molar thermodynamic variables with respect to species.
PURE SUBSTANCE Pure substance: A substance that has a fixed chemical composition throughout. Air is a mixture of several gases, but it is considered to.
Hemin Hasary MSc. Pharmaceutical sciences
Chapter 4 Revision.
Phase Diagram.
CE 530 Molecular Simulation
Chapter 3: Evaluating Properties
Presentation transcript:

CE 530 Molecular Simulation Lecture 20 Phase Equilibria David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

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 Ta = Tb Pa = Pb mia = mib, i = 1,…,C

Phase Diagrams Phase behavior is described via phase diagrams 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 two-phase regions two-phase lines isobar critical point critical point e.g., temperature Field variable Field variable (pressure) L tie line V L L+V V L+S S S triple point S+V Density variable Field variable (temperature)

Approximate Methods for Phase Equilibria by Molecular Simulation 1. 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 Try it out with the LJ NPT-MC applet isobar L Temperature Pressure Hysteresis V L V S L+V L+S S Metastable region S+V Density Temperature

Approximate Methods for Phase Equilibria by Molecular Simulation 2. 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 Try it out with the SW NVT MD applet Temperature V L L+V L+S S S+V Density

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 T constant Simulation data 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 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 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 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 T constant Coexistence 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 Many simulations to get one point on phase diagram T constant Coexistence Pressure + Chemical potential  L V S Simulation data or equation of state Pressure Temperature

Gibbs Ensemble 1. Panagiotopoulos in 1987 introduced a clever way to simulate coexisting phases without an interface Thermodynamic contact without physical contact How? Two simulation volumes

Gibbs Ensemble 2. MC simulation includes moves that couple the two simulation volumes Try it out with the LJ GEMC applet Particle exchange equilibrates chemical potential Volume exchange equilibrates pressure Incidentally, the coupled moves enforce mass and volume balance

Gibbs Ensemble Formalism Partition function Limiting distribution 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 Detailed specification of trial moves and probabilities Forward-step trial probability Reverse-step trial probability Scaled volume c is formulated to satisfy detailed balance

Molecule-Exchange Trial Move Analysis of Detailed Balance Forward-step trial probability Reverse-step trial probability Detailed balance pi pij pj pji = Limiting distribution

Molecule-Exchange Trial Move Analysis of Detailed Balance Forward-step trial probability Reverse-step trial probability Detailed balance pi pij pj pji = Limiting distribution

Molecule-Exchange Trial Move Analysis of Detailed Balance Forward-step trial probability Reverse-step trial probability Detailed balance pi pij pj pji = Acceptance probability

Volume-Exchange Trial Move Analysis of Trial Probabilities Take steps in l = ln(VA/VB) Detailed specification of trial moves and probabilities Forward-step trial probability Reverse-step trial probability

Volume-Exchange Trial Move Analysis of Detailed Balance Forward-step trial probability Reverse-step trial probability Detailed balance pi pij pj pji = Limiting distribution

Volume-Exchange Trial Move Analysis of Detailed Balance Forward-step trial probability Reverse-step trial probability Detailed balance pi pij pj pji = Limiting distribution

Volume-Exchange Trial Move Analysis of Detailed Balance Forward-step trial probability Reverse-step trial probability Detailed balance pi pij pj pji = Acceptance probability

Gibbs Ensemble in the Molecular Simulation API

Gibbs Ensemble MC Examination of Java Code. General public class IntegratorGEMC extends Integrator //Performs basic GEMC trial //At present, suitable only for single-component systems public void doStep() { int i = (int)(rand.nextDouble()*iTotal); //select type of trial to perform if(i < iDisplace) { //displace a randomly selected atom if(rand.nextDouble() < 0.5) {atomDisplace.doTrial(firstPhase);} else {atomDisplace.doTrial(secondPhase);} } else if(i < iVolume) { //volume exchange trialVolume(); else { //molecule exchange if(rand.nextDouble() < 0.5) { trialExchange(firstPhase,secondPhase,firstPhase.parentSimulation.firstSpecies); else { trialExchange(secondPhase,firstPhase,firstPhase.parentSimulation.firstSpecies);

Gibbs Ensemble MC Examination of Java Code. Molecule Exchange public class IntegratorGEMC extends Integrator /** * Performs a GEMC molecule-exchange trial */ private void trialExchange(Phase iPhase, Phase dPhase, Species species) { Species.Agent iSpecies = species.getAgent(iPhase); //insertion-phase speciesAgent Species.Agent dSpecies = species.getAgent(dPhase); //deletion-phase species Agent double uNew, uOld; if(dSpecies.nMolecules == 0) {return;} //no molecules to delete; trial is over Molecule m = dSpecies.randomMolecule(); //select random molecule to delete uOld = dPhase.potentialEnergy.currentValue(m); //get its contribution to energy m.displaceTo(iPhase.randomPosition()); //place at random in insertion phase uNew = iPhase.potentialEnergy.insertionValue(m); //get its new energy if(uNew == Double.MAX_VALUE) { //overlap; reject m.replace(); //put it back return; } double bFactor = dSpecies.nMolecules/dPhase.volume()//acceptance probability * iPhase.volume()/(iSpecies.nMolecules+1) * Math.exp(-(uNew-uOld)/temperature); if(bFactor > 1.0 || bFactor > rand.nextDouble()) { //accept iPhase.addMolecule(m,iSpecies); //place molecule in phase else { //reject

Gibbs Ensemble MC Examination of Java Code. Volume Exchange public class IntegratorGEMC extends Integrator private void trialVolume() { double v1Old = firstPhase.volume(); double v2Old = secondPhase.volume(); double hOld = firstPhase.potentialEnergy.currentValue() + secondPhase.potentialEnergy.currentValue(); double vStep = (2.*rand.nextDouble()-1.)*maxVStep; //uniform step in volume double v1New = v1Old + vStep; double v2New = v2Old - vStep; double v1Scale = v1New/v1Old; double v2Scale = v2New/v2Old; double r1Scale = Math.pow(v1Scale,1.0/(double)Simulation.D); double r2Scale = Math.pow(v2Scale,1.0/(double)Simulation.D); firstPhase.inflate(r1Scale); //perturb volumes secondPhase.inflate(r2Scale); double hNew = firstPhase.potentialEnergy.currentValue() //acceptance probability + secondPhase.potentialEnergy.currentValue(); if(hNew >= Double.MAX_VALUE || Math.exp(-(hNew-hOld)/temperature + firstPhase.moleculeCount*Math.log(v1Scale) + secondPhase.moleculeCount*Math.log(v2Scale)) < rand.nextDouble()) { //reject; restore volumes firstPhase.inflate(1.0/r1Scale); secondPhase.inflate(1.0/r2Scale); } //accept; nothing more to do

Gibbs Ensemble Example Applications Seen in first lecture

Water and Aqueous Solutions GEMC simulation of water/methanol mixtures Strauch and Cummings, Fluid Phase Equilibria, 86 (1993) 147-172; Chialvo and Cummings, Molecular Simulation, 11 (1993) 163-175.

Phase Behavior of Alkanes Panagiotopoulos group Histogram reweighting with finite-size scaling

Critical Properties of Alkanes Siepmann et al. (1993)

Alkane Mixtures Siepmann group Ethane + n-heptane

Gibbs Ensemble Limitations Limitations arise from particle-exchange requirement Molecular dynamics (polarizable models) Dense phases, or complex molecular models Solid phases N = 4n3 (fcc) and sometimes from the volume-exchange requirement too ?

Approaching the Critical Point 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 isotherm Pressure C V L L+V L+S S S+V Density

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

Gibbs-Duhem Integration GD equation can be used to derive Clapeyron equation 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 critical point Field variable (pressure) L V S Field variable (temperature)

GDI Predictor-Corrector Implementation Given initial condition and slope (= –h/Z), predict new (p,T) pair. Evaluate slope at new state condition… …and use to correct estimate of new (p,T) pair lnp  lnp  lnp 

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.

Gibbs-Duhem Integration in the Molecular Simulation API

Finite step of integrator GDI Sources of Error Three primary sources of error in GDI method Stochastic error Finite step of integrator Stability 1 1 2 Incorrect initial condition lnp  2 Uncertainty in slopes due to uncertainty in simulation averages 1 ? 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 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

Semigrand Ensemble Thermodynamic formalism for mixtures Rearrange Legendre transform Independent variables include N and Dm2 Dependent variables include N2 must determine this by ensemble average ensemble includes elements differing in composition at same total N Ensemble distribution

GDI/GE with the Semigrand Ensemble Governing differential equation (pressure-composition plane) Simple LJ Binary

GDI with the Semigrand Ensemble Freezing of polydisperse hard spheres appropriate model for colloids Integrate in pressure-polydispersity plane Findings upper polydisersity bound to freezing re-entrant melting solid fluid Composition (Fugacity) Diameter m2 (n)

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

Tracing of Azeotropes Lennard-Jones binary, variation with intermolecular potential s11 = 1.0; s12 = 1.05; s22 = variable e11 = 1.0; e12 = 0.90; e22 = 1.0 T = 1.10

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