Computation of phase equilibria: Difference between revisions

From SklogWiki
Jump to navigation Jump to search
mNo edit summary
m (→‎See also: Added a couple of internal links)
 
(69 intermediate revisions by 5 users not shown)
Line 1: Line 1:
The '''computation of phase equilibria''' using [[Computer simulation techniques |computer simulation]] can follow a number of different strategies. Here we will focus mainly on [[first-order transitions]] in fluid phases, usually [[Gas-liquid phase transitions |liquid-vapour]] equilibria.
Thermodynamic equilibrium implies, for two phases <math> \alpha </math> and <math> \beta </math>:
Thermodynamic equilibrium implies, for two phases <math> \alpha </math> and <math> \beta </math>:
* equal [[temperature]]s: <math> T_{\alpha} = T_{\beta} </math>
* equal [[pressure]]s: <math> p_{\alpha} = p_{\beta} </math>
* equal [[chemical potential]]s: <math> \mu_{\alpha} = \mu_{\beta} </math>
== Independent simulations for each phase at fixed temperature  in the [[canonical ensemble]]  ==
Simulations can be carried out  using either the [[Monte Carlo]] or the [[molecular dynamics]] technique.
Assuming that one has some knowledge on the [[phase diagrams | phase diagram]] of the system, one can try the following recipe:
# Fix a temperature and a number of particles
#Perform a limited number of simulations in the low density region (where the gas phase density is expected to be)
# Perform a  limited number of simulations in the moderate to high density region (where the liquid phase should appear)
# In these simulations we can compute for each density (at fixed temperature) the values of the pressure and the chemical potentials (for instance using the [[Widom test-particle method]])
===== A quick 'first guess' method =====
Using the previously obtained results the following, somewhat unsophisticated, procedure can be used to obtain a first inspection of the possible phase equilibrium:
#Fit the simulation results for each branch by using appropriate functional forms: <math> \left. \mu_{v}(\rho) \right. ; p_v(\rho);\mu_l(\rho); p_l(\rho) </math>
#Use the fits to build, for each phase, a table with three entries: <math> \rho, p, \mu </math>, then plot for both tables <math> \mu </math> as a function of <math> p </math> and check to see if the two lines intersect.
#The crossing point provides  (to within statistical uncertainty, the errors due to [[finite size effects]], etc.) the coexistence conditions.
===== Improving the 'first guess' method =====
It can be useful to take into account classical thermodynamics to improve the previous analysis. This is
because is is not unusual have large uncertainties in the results for the properties.
The basic idea is to use [[thermodynamic consistency]] requirements to improve the analysis.
== Methodology in the [[Isothermal-isobaric ensemble|NpT]] ensemble ==
=== Low temperature: <math> \left. T << T_c \right. </math> ===
For temperatures well below the [[critical points | critical point]], provided that the calculation of the chemical potential
of the liquid phase using [[Widom test-particle method]] gives precise results, the following strategy can be used to obtain a 'quick' result:
#Perform an <math> NpT </math> simulation of the liquid phase at zero pressure, i.e. <math> p \simeq 0 </math>
#Arrive at an initial estimate, <math> \mu^{(1)} </math> for the coexistence value of the chemical potential by computing, in the liquid phase: <math> \left. \mu^{(1)} = \mu_l (N,T,p=0) \right. </math>
#Make a first estimate of the coexistence pressure, <math> p^{(1)} </math>, by computing, either via simulation or via the [[Virial coefficients of model systems |virial coefficients]] of the gas phase, the pressure at which the gas phase fulfils: <math> \left. \mu_g(N,T, p^{(1)} ) = \mu^{(1)} \right. </math>
#Refine the results, if required, by performing a simulation of the liquid phase at <math> \left.  p^{(1)} \right.  </math>, or use estimates of <math> \left( \partial V / \partial p \right)_{N,T,p=0} </math> (from the initial simulation) and the gas equation of state data to correct the initial estimates of pressure and chemical potential at coexistence.
Note that this method works only if the liquid phase remains metastable at zero pressure.
=== Weak first order transitions ===
There are situations where other strategies based on [[Isothermal-isobaric ensemble|NpT]] ensemble simulations can be used.
Similar approaches have also been applied in the [[Monte Carlo in the grand-canonical ensemble|Grand Canonical]] ensemble.
In practice, the ''free energy barrier'' between the two phases has to be low enough to allow the simulated system
to cross from one phase to the other when it is being simulated. Somehow, the situation is now the opposite to that
described in Section 2.1.
Taking into the account the classical partition function in the [[isothermal-isobaric ensemble|NpT]] ensemble it can be written:


* Equal [[temperature]]: <math> T_{\alpha} = T_{\beta} </math>
: <math> \left. P(V|N,p,T) \propto \exp \left[ - \frac{ p V}{k_B T} \right] \exp \left[ - \frac{A(N,V,T)}{k_B T} \right] \right. </math> ,
 
* Equal [[pressure]]: <math> p_{\alpha} = p_{\beta} </math>
 
* Equal [[chemical potential]]: <math> \mu_{\alpha} = \mu_{\beta} </math>
 
The computation of phase equilibria using computer simulation can follow a number of different strategies.
== Independent simulations for each phase at fixed <math> T </math> in the [[canonical ensemble]]  ==
Simulations can be carried out either using [[Monte Carlo]] or [[Molecular dynamics]] techniques.
Assuming that one has some knowledge on the phase diagram of the system, one can try the following recipe:


- Fix a temperature and a number of particles
where <math> \left. P(V|N,p,T) \right. </math> stands for the probability of the volume <math> \left. V \right. </math> at given
conditions <math> \left. N,P,T \right. </math>. Let <math> p_{eq} </math> the pressure at which the phase transition occurs. In such a
case the following scenario is expected for <math> \left. P(V|N,p,T) \right. </math>:
*<math> \left. P(V|N,p_{eq},T) \right. </math> has two maxima, corresponding to the liquid and vapor pure phases, with <math> \left. P(V_v|N,p_{eq},T) = P(V_l|N,p_{eq},T) = P_{v/l} \right. </math>


- Perform a limited number of simulations in the low density region (where the gas phase density is expected to be)
*The probability of a given intermediate volume at <math> \left. p_{eq} \right. </math>  can be estimated (from macroscopic arguments) as:


- Perform a  limited number of simulations in the moderate to high density region (where the liquid phase should appear)
:<math> \left. P(V|N,p_{eq},T)  \simeq P_{v/l} \times \exp \left[ - \frac{ \gamma(T) \mathcal A }{k_B T } \right]          \right. </math>,


- In these simulations we can compute for each density (at fixed temperature) the values of the pressure and the
where <math> \left. \gamma(T) \right. </math> is the [[surface tension]] of the vapor-liquid interface,
chemical potentials (for instance using the [[Widom test-particle method]])
and <math> \left. {\mathcal A} \right. </math> is the  
==== A quick 'first guess' method ====
surface area, which depends on the thermodynamic
Using the previously obtained results the following somewhat unsophisticated procedure can be used to obtain a first inspection of the possible phase equilibrium.
variables <math> \left. (N,V,T) \right.  </math> and the geometry of the [[Periodic boundary conditions |simulation box]].
For small values of the surface tension, small system sizes and good simulation algorithms it could be possible for
pressures close to <math> p_{eq} </math> to sample in a simulation the whole region of densities between
vapour and liquid densities. If such is the case the phase equilibria conditions can be computed
by reweighing techniques applied on the volume histograms of the simulation.
==== Simple reweighing of the volume probability distribution ====
Suppose that a precise <math> \left. NpT \right. </math> simulation has been carried out at pressure <math> \left. p_0 \right. </math>. From that simulation a volume probability distribution,  <math> \left. P_0(V|N,p_0,T) \right. </math>
has been computed. It is possible to use this function to estimate the distributions of volume for pressure values
close to <math> \left. p_0 \right. </math>;


Fit the simulation results for each branch by using appropriate functional forms:
: <math> \left. P(V|N,p,T) \propto \exp \left[ - \frac{ (p-p_0) V }{k_B T } \right] P_0(V|N,p_0,T) \right. </math>


:<math> \left. \mu_{v}(\rho) \right. ; p_v(\rho);\mu_l(\rho); p_l(\rho) </math>
Using this reweighing procedure we can estimate the value of <math> \left. p_{eq} \right. </math>; that is: the value
of pressure for which the volume distribution presents two peaks of equal height.
The analysis of the form of the distributions at the equilibrium conditions for different system sizes (i.e.
in the current case for different values of <math> \left. N \right. </math>) can be useful to distinguish between
continuous and first order [[phase transitions]].
=== See also ===
[[Surface tension]]
== Van der Waals loops in the [[canonical ensemble|canonical ]]  ensemble ==
It is possible to compute the liquid-vapour equilibrium without explicit calculations of the chemical potential (or the pressure)
by performing a number of simulations sampling appropriately the vapour, liquid, and intermediate regions.
As an example, consider a simple fluid at a given subcritical temperature (<math> \left. T < T_c \right. </math>). We can perform a number of simulations for a given number of particles, <math> \left. N \right. </math> and different densities:


Use the fits to build, for each phase, a table with three entries: <math> \rho, p, \mu </math>, then plot for both tables
: <math> \rho_i = i \times \Delta \rho; \;  \; \; \;  i=1, 2, \cdots, m </math>
<math> \mu </math> as a function of <math> p </math> and check if the two lines intersect. The crossing point
provides  (to within statistical uncertainty, the errors due to [[finite size effects]], etc.) the coexistence conditions.
==== Improving the 'first guess' method ====
It can be useful to take into account classical thermodynamics to improve the previous analysis. This can be useful
because is is not unusual have large uncertainties in the results of the properties.
The basic idea is to use [[thermodynamic consistency]] requirements to improve the analysis.


== Methodology in the [[Isothermal-isobaric ensemble|NpT]] ensemble ==
In these simulations, we can compute the pressure (or the chemical potential) and fit the result to an appropriate equation.
With such an ''equation of state'' the phase equilibria can be estimated.
If two phase equilibria exists, a ''loop'' in the representation of <math> \left. p = p (\rho) \right. </math> (or  <math> \left. \mu = \mu (\rho) \right. </math>)
should appear.
* Computing <math> \left. \mu(\rho) \right. </math> from the equation of state given as <math> \left. p(\rho) \right. </math>:
For fixed temperature and number of particles:


For temperatures well below the critical point, provided that the calculation of the chemical potential
: <math> \left. d A = -  p d V \right. </math>
of the liquid phase using [[Widom test-particle method]] gives precise results, the following strategy can be used to obtain a quick result.
: <math> \left. d  A = \frac{ p N }{\rho^2} d \rho ; \; \; \; \; d a = \frac{ p }{\rho^2} d \rho \right. </math>


*Perform an <math> NpT </math> simulation of the liquid phase at zero pressure, i.e. <math> p \simeq 0 </math>
where <math> \left. A \right. </math> is the [[Helmholtz energy function]] and
<math> \left. a = A/N \right. </math>, integrating:


*Arrive at an initial estimate, <math> \mu^{(1)} </math> for the coexistence value of the chemical potential by computing, in the liquid phase:
:<math> \left. a(\rho) = a(\rho_0) + \int_{\rho_0}^{\rho} \frac{ p(\rho') }{(\rho')^2} d \rho' \right. </math>


: <math> \left. \mu^{(1)} = \mu_l (N,T,p=0) \right. </math>
On the other hand


*Make a first estimate of the coexistence pressure, <math> p^{(1)} </math>, by computing --either via simulation or via the [[Virial coefficients of model systems |virial coefficients]] of the gas phase--  the pressure at which the gas phase fulfills:
:<math> \left. A = -  p V + \mu N ; \; \;  \; a = - p/ \rho + \mu \right. </math>


: <math> \left. \mu_g(N,T, p^{(1)} ) = \mu^{(1)} \right. </math>
therefore:  


* Refine the results, if required, by performing a simulation of the liquid phase at <math> \left. p^{(1)} \right. </math>, or use estimates of <math> \left( \partial V / \partial p \right)_{N,T,p=0} </math> (from the initial simulation) and the gas equation of state data to correct the initial estimates of pressure and chemical potential at coexistence. Note that this method works only if the liquid phase remains metastable at zero pressure.
: <math> \left. \mu(\rho) - p(\rho)/\rho = \mu(\rho_0) - p(\rho_0)/\rho_0 + \int_{\rho_0}^{\rho} \frac{ p(\rho') }{(\rho')^2} d \rho' \right. </math>
: <math> \left. \mu(\rho) = \mu(\rho_0) +  p(\rho)/\rho  - p(\rho_0)/\rho_0 + \int_{\rho_0}^{\rho} \frac{ p(\rho') }{(\rho')^2} d \rho' \right. </math>


== Van der Waals loops, in the [[canonical ensemble|canonical ]] ensemble ==
A similar procedure can be built up to compute <math> \left. p(\rho) \right. </math>
from <math> \left. \mu(\rho) \right. </math>.
Once <math> \left. p(\rho) \right. </math> and <math> \left. \mu(\rho) \right. </math> are known  it is straightforward to compute the coexistence point.
==== Practical details ====
Some precautions should be taken if this procedure is used:
* The precision of the simulation results in the two phase region will be poor (so, large simulations are required to have a good estimation of the equation of state)
*  The simulation results in the two phase region will depend dramatically on the system size (calculations with different number of particles become convenient to check the quality of the phase equilibria results)
== Direct simulation of the two phase system==
[[Image:direct_coexistence.png|300px|right]]
Direct simulation of the two phase system was first implemented by Abraham <ref>[http://dx.doi.org/10.1103/PhysRevB.23.6145 Farid F. Abraham "Two-dimensional melting, solid-state stability, and the Kosterlitz-Thouless-Feynman criterion", Physical Review B '''23''' pp. 6145-6148 (1981)]</ref>.
It has since been applied to the [[Lennard-Jones model]] <ref>[http://dx.doi.org/10.1063/1.1474581 James R. Morris and Xueyu Song "The melting lines of model systems calculated from coexistence simulations", Journal of Chemical Physics '''116''' 9352 (2002)]</ref>
and [[water]]
<ref>[http://dx.doi.org/10.1063/1.2183308 Ramón García Fernández, José L. F. Abascal, and Carlos Vega "The melting point of ice Ih for common water models calculated from direct coexistence of the solid-liquid interface", Journal of Chemical Physics '''124''' 144506 (2006)]</ref>.


== Direct simulation of the two phase system in the [[Canonical  ensemble]] ==
== Gibbs ensemble Monte Carlo for one component systems==
 
The [[Gibbs ensemble Monte Carlo]] method is often considered as a smart variation of the standard canonical ensemble procedure (See <ref>[http://dx.doi.org/10.1080/00268978700101491 Athanassios Panagiotopoulos "Direct determination of phase coexistence properties of fluids by Monte Carlo simulation in a new ensemble", Molecular Physics '''61''' pp. 813-826 (1987)]</ref>).  
== Gibbs ensemble Monte Carlo ==
 
This method is often considered as a 'smart' variation of the standard canonical ensemble procedure.  
The simulation is, therefore, carried out at constant volume, temperature and number of particles.
The simulation is, therefore, carried out at constant volume, temperature and number of particles.
However the whole system is divided in two non-interacting parts (each one has its own simulation
The whole system is divided into two non-interacting parts, each one has its own simulation
box with its own [[periodic boundary conditions]]).
box with its own [[periodic boundary conditions]].
The basic idea is to separate the two phases in different boxes in order to suppress any interfacial effects.
This separation of the two phases into different boxes is in order to suppress any influence due to  [[interface | interfacial]] effects.
The two subsystems can interchange volume and particles. The rules of these interchanges are
The two subsystems can interchange volume and particles. The rules for these interchanges are
built up so as to  guarantee that the conditions of chemical and mechanical equilibrium between  
built up so as to  guarantee conditions of both chemical and mechanical equilibrium between  
the two phases.
the two phases.
If the overall conditions are of phase separation, it is expected that two phases will appear in
If the overall conditions are of phase separation, it is expected that two phases will appear in
different simulation boxes.
different simulation boxes.
*[http://dx.doi.org/10.1080/00268978700101491 Athanassios Panagiotopoulos "Direct determination of phase coexistence properties of fluids by Monte Carlo simulation in a new ensemble", Molecular Physics '''61''' pp. 813-826 (1987)]
====External links====
*[http://kea.princeton.edu/jerring/gibbs/ Gibbs ensemble Monte Carlo code] on the [http://kea.princeton.edu/ Panagiotopoulos Group Homepage]
[[category: Monte Carlo]]
[[category: Monte Carlo]]
[[category: Computer simulation techniques]]
[[category: Computer simulation techniques]]
Line 74: Line 133:
== Mixtures ==
== Mixtures ==
=== Symmetric mixtures ===
=== Symmetric mixtures ===
Examples of symmetric [[mixtures]] can be found both in lattice of continuous model. The [[Ising Models | Ising model]] can be
viewed as  mixture of two different chemical species which de-mix at low
temperature. The symmetry in the interactions can be exploited to simplify the calculation of phase diagrams.
== See also==
*[[Constrained cell method]]
*[[Gibbs-Duhem integration]]
*[[Phase switch Monte Carlo]]
==References==
==References==
<references/>
[[category: computer simulation techniques]]
[[category: computer simulation techniques]]

Latest revision as of 12:12, 6 May 2011

The computation of phase equilibria using computer simulation can follow a number of different strategies. Here we will focus mainly on first-order transitions in fluid phases, usually liquid-vapour equilibria. Thermodynamic equilibrium implies, for two phases and :

  • equal temperatures:
  • equal pressures:
  • equal chemical potentials:

Independent simulations for each phase at fixed temperature in the canonical ensemble[edit]

Simulations can be carried out using either the Monte Carlo or the molecular dynamics technique. Assuming that one has some knowledge on the phase diagram of the system, one can try the following recipe:

  1. Fix a temperature and a number of particles
  2. Perform a limited number of simulations in the low density region (where the gas phase density is expected to be)
  3. Perform a limited number of simulations in the moderate to high density region (where the liquid phase should appear)
  4. In these simulations we can compute for each density (at fixed temperature) the values of the pressure and the chemical potentials (for instance using the Widom test-particle method)
A quick 'first guess' method[edit]

Using the previously obtained results the following, somewhat unsophisticated, procedure can be used to obtain a first inspection of the possible phase equilibrium:

  1. Fit the simulation results for each branch by using appropriate functional forms:
  2. Use the fits to build, for each phase, a table with three entries: , then plot for both tables as a function of and check to see if the two lines intersect.
  3. The crossing point provides (to within statistical uncertainty, the errors due to finite size effects, etc.) the coexistence conditions.
Improving the 'first guess' method[edit]

It can be useful to take into account classical thermodynamics to improve the previous analysis. This is because is is not unusual have large uncertainties in the results for the properties. The basic idea is to use thermodynamic consistency requirements to improve the analysis.

Methodology in the NpT ensemble[edit]

Low temperature: [edit]

For temperatures well below the critical point, provided that the calculation of the chemical potential of the liquid phase using Widom test-particle method gives precise results, the following strategy can be used to obtain a 'quick' result:

  1. Perform an simulation of the liquid phase at zero pressure, i.e.
  2. Arrive at an initial estimate, for the coexistence value of the chemical potential by computing, in the liquid phase:
  3. Make a first estimate of the coexistence pressure, , by computing, either via simulation or via the virial coefficients of the gas phase, the pressure at which the gas phase fulfils:
  4. Refine the results, if required, by performing a simulation of the liquid phase at , or use estimates of (from the initial simulation) and the gas equation of state data to correct the initial estimates of pressure and chemical potential at coexistence.

Note that this method works only if the liquid phase remains metastable at zero pressure.

Weak first order transitions[edit]

There are situations where other strategies based on NpT ensemble simulations can be used. Similar approaches have also been applied in the Grand Canonical ensemble. In practice, the free energy barrier between the two phases has to be low enough to allow the simulated system to cross from one phase to the other when it is being simulated. Somehow, the situation is now the opposite to that described in Section 2.1. Taking into the account the classical partition function in the NpT ensemble it can be written:

,

where stands for the probability of the volume at given conditions . Let the pressure at which the phase transition occurs. In such a case the following scenario is expected for :

  • has two maxima, corresponding to the liquid and vapor pure phases, with
  • The probability of a given intermediate volume at can be estimated (from macroscopic arguments) as:
,

where is the surface tension of the vapor-liquid interface, and is the surface area, which depends on the thermodynamic variables and the geometry of the simulation box. For small values of the surface tension, small system sizes and good simulation algorithms it could be possible for pressures close to to sample in a simulation the whole region of densities between vapour and liquid densities. If such is the case the phase equilibria conditions can be computed by reweighing techniques applied on the volume histograms of the simulation.

Simple reweighing of the volume probability distribution[edit]

Suppose that a precise simulation has been carried out at pressure . From that simulation a volume probability distribution, has been computed. It is possible to use this function to estimate the distributions of volume for pressure values close to ;

Using this reweighing procedure we can estimate the value of ; that is: the value of pressure for which the volume distribution presents two peaks of equal height. The analysis of the form of the distributions at the equilibrium conditions for different system sizes (i.e. in the current case for different values of ) can be useful to distinguish between continuous and first order phase transitions.

See also[edit]

Surface tension

Van der Waals loops in the canonical ensemble[edit]

It is possible to compute the liquid-vapour equilibrium without explicit calculations of the chemical potential (or the pressure) by performing a number of simulations sampling appropriately the vapour, liquid, and intermediate regions. As an example, consider a simple fluid at a given subcritical temperature (). We can perform a number of simulations for a given number of particles, and different densities:

In these simulations, we can compute the pressure (or the chemical potential) and fit the result to an appropriate equation. With such an equation of state the phase equilibria can be estimated. If two phase equilibria exists, a loop in the representation of (or ) should appear.

  • Computing from the equation of state given as :

For fixed temperature and number of particles:

where is the Helmholtz energy function and , integrating:

On the other hand

therefore:

A similar procedure can be built up to compute from . Once and are known it is straightforward to compute the coexistence point.

Practical details[edit]

Some precautions should be taken if this procedure is used:

  • The precision of the simulation results in the two phase region will be poor (so, large simulations are required to have a good estimation of the equation of state)
  • The simulation results in the two phase region will depend dramatically on the system size (calculations with different number of particles become convenient to check the quality of the phase equilibria results)

Direct simulation of the two phase system[edit]

Direct simulation of the two phase system was first implemented by Abraham [1]. It has since been applied to the Lennard-Jones model [2] and water [3].

Gibbs ensemble Monte Carlo for one component systems[edit]

The Gibbs ensemble Monte Carlo method is often considered as a smart variation of the standard canonical ensemble procedure (See [4]). The simulation is, therefore, carried out at constant volume, temperature and number of particles. The whole system is divided into two non-interacting parts, each one has its own simulation box with its own periodic boundary conditions. This separation of the two phases into different boxes is in order to suppress any influence due to interfacial effects. The two subsystems can interchange volume and particles. The rules for these interchanges are built up so as to guarantee conditions of both chemical and mechanical equilibrium between the two phases. If the overall conditions are of phase separation, it is expected that two phases will appear in different simulation boxes.

External links[edit]

Mixtures[edit]

Symmetric mixtures[edit]

Examples of symmetric mixtures can be found both in lattice of continuous model. The Ising model can be viewed as mixture of two different chemical species which de-mix at low temperature. The symmetry in the interactions can be exploited to simplify the calculation of phase diagrams.

See also[edit]

References[edit]