Keywords

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

1 Introduction

The computation of excess free energy due to interfaces (also called surface tension or interfacial tension) for condensed matter systems is still an outstanding challenge. First of all, on a molecular scale, interfaces are diffuse: thus for a vapor-liquid interface, it is not straightforward to distinguish a local excursion of the interface position from density fluctuations in the coexisting vapor and liquid phases near the interface. In addition, interfaces are mesoscopic objects, and may exhibit fluctuations from the molecular scale to the scale of the simulation box, which are hard to sample exhaustively. A system containing one or more interfaces is necessarily anisotropic, directions parallel and perpendicular to the interface(s) are not equivalent, and boundary conditions matter. Thus, the sampling of the physical effects of interfaces that are present in a system requires huge computational efforts on supercomputers, since the interfacial tension is not a straightforward output variable of a simulation (unlike quantities such as internal energy, pair correlation functions, etc.). One typically needs to compute the difference in free energy between two systems, one system with interfaces, and the other system without. Finding efficient algorithms for this task has been a longstanding challenge. The present paper describes work on a recently developed algorithm that has great potential for this task. As a first step, we focus on the finite size effects, which are anyway ubiquitous in simulations, but particularly harmful here, since interfaces exhibit long wavelength fluctuations of an anisotropic character. In the following section we will first introduce out new computational approach to solve this task, namely the ensemble switch method.

2 The Ensemble Switch Method

The determination of the interfacial tension between coexisting phases is a non-trivial task, especially if a crystalline phase occurs. To compute the interfacial tension using Monte Carlo simulations, we use a method which is based on the “ensemble switch method”, which has been used successfully to calculate wall tensions between a phase and various types of walls [4]. Our generalization of this method allows us to calculate interfacial tensions directly [12].

The idea of our approach is to calculate the free energy difference between two systems with Hamiltonians \(\mathcal{H}_{0}\) and \(\mathcal{H}_{1}\) respectively, differing only by the absence or presence of interfaces (cf. Fig. 1). The first system, characterized by \(\mathcal{H}_{0}\), consists of two separate boxes of length \(L_{z}/2\) and width L, each filled with one phase, which are called A and B (A, B = crystal, liquid, vapor, …). The two boxes have periodic boundary conditions individually and are therefore completely separated. The other system has the Hamiltonian \(\mathcal{H}_{1}\) and consists of one large box of length L z and width L, where the two phases are in direct coexistence and thereby form two interfaces. Apart from the boundary conditions, the two systems are identical. One can do a thermodynamic integration from one system to the other via a reaction coordinate κ ∈ [0, 1]. At κ = 0 or 1, the system is characterized by the Hamiltonian \(\mathcal{H}_{0}\) or \(\mathcal{H}_{1}\), respectively, while the intermediate systems are defined by the Hamiltonian

$$\displaystyle{ \mathcal{H}(\kappa ) =\kappa \mathcal{H}_{1} + (1-\kappa )\mathcal{H}_{0}\;. }$$
(1)

Except for the cases κ = 0, 1, which correspond to real physical systems, the intermediate systems are unphysical, but nevertheless well-defined in this context. If such an integration over κ is performed, the free energy difference between the two systems of interest is given by

$$\displaystyle{ \varDelta F = (F_{\text{A,bulk}} + F_{\text{B,bulk}} + 2\gamma _{\mathit{AB}}L^{2}) - (F_{ \text{A,bulk}} + F_{\text{B,bulk}}) = 2\gamma _{\mathit{AB}}L^{2}\;, }$$
(2)

where γ AB is the interfacial tension to be measured and L 2 the size of one interface. Because of periodic boundary conditions, one has two interfaces between the two phases. This approach can be combined with Wang-Landau Sampling [15], Successive Umbrella Sampling [13, 14] or similar advanced simulation techniques.

Fig. 1
figure 1

Visualization of the ensemble switch method. The interfacial tension is computed via a thermodynamic integration from a reference system with Hamiltonian \(\mathcal{H}_{0}\), which does not contain any interfaces, to a system with Hamiltonian \(\mathcal{H}_{1}\), where interfaces are present. The free energy difference between those systems is then given by the interfacial tension times the total area of all interfaces. Here, the initial state consists of two separate boxes, each with periodic boundary conditions in all directions, containing a homogeneous phase, e.g. a crystal, liquid or vapor. Then the two boxes are combined by changing the periodic boundary conditions continuously from one state to the other. The intermediate systems have the Hamiltonian \(\mathcal{H}_{\kappa } =\kappa \mathcal{H}_{1} + (1-\kappa )\mathcal{H}_{0}\)

For the Monte Carlo simulation, one only needs two kinds of moves. Apart from canonical moves, i.e. trial moves to translate a single particle, where the energy difference is calculated via the Hamiltonian H(κ), one needs to implement the ensemble switch move. Here, the value of κ is changed, changing the system’s internal energy according to \(U(\kappa ) =\kappa U_{1} + (1-\kappa )U_{0}\) where U 0 and U 1 are the internal energies of the systems with two separate boxes and with one combined box, respectively, and U(κ) is the internal energy of the system for the current value κ. This move is computationally very cheap if the energies U 0 and U 1 are kept up to date during the simulation.

In the simulation, the interval [0, 1] is subdivided into a discrete set of κ i , so that the free energy difference can be calculated from κ i to κ i+1. The simulation can be parallelized by using successive umbrella sampling and assigning one window [κ i , κ i+1] to one core. To obtain more accurate results, it is better not to let κ vary linearly from window to window. Since the intermediate steps are non-physical anyway, one can choose an arbitrary set of {κ i }. We choose functions which vary slowly near 0 and 1, e.g.

$$\displaystyle{ \kappa _{i} =\sin ^{2}\left ( \frac{\pi } {2}x\right )\;\text{, or} }$$
(3a)
$$\displaystyle{ \kappa _{i} = \left \{\begin{array}{ll} \frac{(2x)^{a}} {2} & x < 0.5 \\ 1 -\frac{(2(1-x))^{a}} {2} & x \geq 0.5 \end{array} \right.\;, }$$
(3b)

where \(x = i/M\) and M is the number of κ values, which in our case is usually 1,024. The second function has a parameter a to tune the exact shape of the function. Higher numbers result in a small slope at the beginning and a steep slope near κ = 0. 5. Figure 2 shows examples of the mapping iM → κ i .

Fig. 2
figure 2

Some choices for the mapping i → κ i . Instead of a linear mapping, one can make smaller windows where more accuracy is needed. The curve labeled sine shows Eq. (3a) while the curve labeled power shows Eq. (3b) with a = 6. Both functions have smaller steps near 0 and 1, while the step size is larger near x = 0. 5

Another means to optimize successive umbrella sampling is to introduce a bias [13]. To do this, one equilibrates the system and then does a short pre-production run to estimate the probability ratio within the two states κ i and κ i+1 of the window. Then one uses this ratio as a fixed bias for the production run. This bias makes the two states equally likely and therefore reduces the computational effort.

Figure 3 shows the resulting curves β F(κ) for various model systems, namely hard spheres (for solid-liquid coexistence) and spheres with a Lennard-Jones (LJ) potential (for vapor-liquid coexistence) in d = 3 dimensions. In order to reduce the computational effort, the Lennard-Jones potential is truncated at a distance \(r_{\text{cut}} = 2 \cdot 2^{1/6}\) and shifted [\(C = 127/16,384\)] so that the potential is continuous at r cut:

$$\displaystyle{ U(r) = \left \{\begin{array}{cl} 4\varepsilon \left [\left ( \frac{\sigma } {r}\right )^{12} -\left ( \frac{\sigma }{ r}\right )^{6} + C\right ]&\text{, }r \leq r_{\text{cut}} \\ 0 &\text{, }r > r_{\text{cut}}\\ \end{array} \right.\;. }$$
(4)

In this work, the temperature for the Lennard-Jones vapor-liquid coexistence is \(k_{\text{B}}T/\varepsilon = 0.78\) throughout. For a Lennard-Jones-like potential, the integration curve (Fig. 3a) is smooth and exhibits a hump, so that the free energy of some intermediate states it higher than the free energy of the final state. The reason behind this is that the interface, which forms during the integration, cannot move at first, but when κ is large enough, it can begin to explore the length L z of the box. This effect is explained in more detail in Sect. 4. Of course, the difference between κ = 0 and κ = 1 is proportional to the interfacial area and therefore scales like L 2. If L z is changed while L is constant, the free energy difference decreases slightly because of the translational entropy of the interfaces (cf. Sect. 4).

Fig. 3
figure 3

Free energy difference β F(κ) versus the integration coordinate κ for various box geometries for a LJ system (left) and a hard sphere system (right). The difference between the value at κ = 1 and κ = 0 is the free energy needed to create the interfaces in the systems and is therefore proportional to the interfacial tension

In the hard sphere case (Fig. 3b), the free energy difference β Δ F(κ) rises much more rapidly with κ already at small κ, and stays almost constant for a wide range of κ unlike in the case of vapor-liquid interfaces in the LJ-type model. But the variation with L and L z is qualitatively similar: the free energy difference scales roughly like L 2, and decreases with increasing L z , due to the interfaces’ translational degrees of freedom. The dependence on L and L z will be discussed in more detail in the next section.

3 Finite Size Scaling of the Interfacial Tension

The interfacial tension γ is defined as the amount of free energy per unit area to create an interface. In the thermodynamic limit, i.e. for infinite volume, the interfacial tension is well-defined by

$$\displaystyle{ \beta \gamma _{\infty } =\lim _{V \rightarrow \infty }\frac{\beta \varDelta F} {A}\;, }$$
(5)

where Δ F is the free energy to create an interface with area A. Since in computer simulations, the boxes one can consider with an acceptable amount of computational resources are always finite and far away from being large enough to ignore finite-size effects, it is crucial to analyze the limit in Eq. (5) systematically and extrapolate to the thermodynamic limit.

In a cuboid d-dimensional simulation box with linear dimension L except for one direction, in which the box is elongated and has a length L z  ≥ L, an interface always aligns itself to be perpendicular to the z-direction, in order to minimize its free energy, and hence has an area L d−1. The fact that a finite interface can explore the whole length L z of the simulation box, as indicated in Fig. 4a, corresponds to a degree of freedom, which gives rise to an entropy contribution

$$\displaystyle{ \varDelta S = k_{\text{B}}\ln \left (\frac{L_{z}} {l_{z}} \right )\;, }$$
(6)

where l z is a natural length scale so that L z l z corresponds to the number of possible positions of the interface in the simulation box. The free energy changes according to

$$\displaystyle{ \varDelta F =\varDelta U - T\varDelta S = -k_{\text{B}}T\ln \left (\frac{L_{z}} {l_{z}} \right )\;. }$$
(7)

Note that the free energy cost of an interface is decreased. This is a well-known effect in the literature [6, 9]. For example, one can observe that for extremely elongated boxes (L z  ≫ L), the gain of entropy outweighs the cost of energy so that the system creates new interfaces spontaneously [16]. It is remarkable that the effect of translational entropy on the free energy exhibits a logarithmic dependence on the box length L z with a prefactor − 1 which is independent of the details of the model under consideration.

The translational entropy is one of three effects which lead to logarithmic contributions. They can be described by a general finite-size scaling ansatz of the form

$$\displaystyle{ \beta \gamma (L,L_{z}) =\beta \gamma _{\infty }- x_{\perp } \frac{\ln L_{z}} {L^{d-1}} + x_{\parallel } \frac{\ln L} {L^{d-1}} + \frac{\mathop{\mathrm{const}}\nolimits } {L^{d-1}} \;. }$$
(8)

All length scales in the logarithmic terms (like l z in Eq. (7)) can be absorbed by the constant in the last term, which is the next-to-leading order contribution. The prefactors x  ⊥  and x  ∥  are determined by the degrees of freedom of the interface(s). In the following the other two effects and their influence on the prefactors will be motivated.

If considering rough interfaces, one has to deal with the phenomenon of capillary waves. A rough interface cannot be described by a flat plane, but it is a rather fuzzy object because of microscopic fluctuations. From a coarse-grained perspective, the shape of the interface can be decomposed into modes. The frequency (or wavelength) spectrum of an infinite interface is continuous. In a finite simulation box, however, the modes must be compatible with the periodic boundary conditions. This constraint leads to a discretization of the spectrum and hence to a loss of entropy [3] (l cw is a short wavelength cutoff to the capillary wave spectrum)

$$\displaystyle{ \varDelta S = \frac{3 - d} {2} \ln \left ( \frac{L} {l_{\text{cw}}}\right )\;, }$$
(9)

which depends on L only and therefore contributes to the prefactor x  ∥  in Eq. (8). Note that the prefactor depends on the dimensionality and vanishesFootnote 1 in d = 3.

The third and final effect has been discovered recently [12] and plays a very prominent role because it influences both x  ⊥  and x  ∥ . This effect is called domain breathing and occurs in canonical ensembles. If the particle number is fixed, the average volume fractions of the coexisting phases are fixed by their coexistence densities

$$\displaystyle{ \rho V =\langle \rho _{1}V _{1}\rangle +\langle \rho _{2}V _{2}\rangle \;. }$$
(10)

For simplicity, we consider the case \(\langle V _{1}\rangle =\langle V _{2}\rangle\), i.e. the particle number is \(N = (\langle \rho _{1}\rangle +\langle \rho _{2}\rangle )V/2\). It is important to note that although the average position of the interface between the phases is located in the center of the box, the actual interfacial position can fluctuate around its mean position by spontaneous fluctuations in the bulk of the two phases, as indicateed in Fig. 4b. A straightforward calculation [12] shows that the mean squared displacement is non-zero and corresponds to an entropy contribution

$$\displaystyle{ \varDelta S = -\frac{1} {2}\ln \left ( \frac{L_{z}} {l_{\text{db}}}\right ) + \frac{d - 1} {2} \ln \left ( \frac{L} {l_{\text{db}}}\right )\;. }$$
(11)

Apparently, this effect contributes to both prefactors x  ⊥  and x  ∥ . Again, the minimum length scale l db on which these fluctuations contribute to the free energy is not discussed further here.

Fig. 4
figure 4

Sketch of the origin of the logarithmic contributions. Left: translational entropy. If the interface position is not fixed, it can explore the whole simulation box. This corresponds to a translational degree of freedom which decreases the cost of free energy to form an interface. Right: domain breathing. If the interface position is fixed within the simulation box, the interface can still fluctuate around its average position. One can show that this has an influence on the cost of free energy, depending on the dimensions of the simulation box. In both cases, the interface exhibits capillary waves. The interface is not flat but its shape is the sum of capillary wave modes. The capillary wave spectrum is, however, restricted by the periodic boundary conditions, because only wavelengths compatible with the box dimensions are possible: the entropy connected to capillary waves is reduced and hence the free energy cost is increased

The exact values of the prefactors x  ⊥  and x  ∥  in Eq. (8) depend on the dimensionality d and the choice of boundary conditions and the ensemble (cf. Table 1). For a given choice, the prefactors are universal in the sense that they do not depend on details of the system like the pair potential between the particles or whether it is a Ising-like or an off-lattice model. In contrast, the length scales l z , l cw and l db, which contribute to the term \(\mathop{\mathrm{const}}\nolimits /L^{d-1}\) in Eq. (8) surely will depend on such details.

Table 1 The universal prefactors x  ⊥  and x  ∥  for various choices of boundary conditions (periodic or antiperiodic) and the ensemble (canonical or grandcanonical). Note that x  ⊥  is independent of the dimensionality of the interface while \(x_{\|}\) depends on d

4 Results

Here, we show results obtained from the ensemble switch method when applied to various model systems. The easiest model system to study phase coexistence is the Ising model, which can be used to study the coexistence of a liquid (spin up rich phase) and a vaporous phase (spin down rich phase). An advantage of the Ising model is that one can apply different combinations of boundary conditions (periodic BC or antiperiodic BC) and ensembles (canonical (c) or grandcanonical (gc)). The two-dimensional variant is also attractive because the interfacial tension is exactly known [10]. Hence, the Ising model is a very good choice to test the finite-size scaling ansatz Eq. (8).

We focus on the 3d Ising model first. To test Eq. (8), it is useful to test the dependence on L and L z independently. If L is fixed, and the data for various L z is plotted against L −2ln(L z ), the scaling ansatz suggests that the data can be represented by straight lines with slope − x  ⊥ . Figure 5a confirms that the above logarithmic corrections are indeed present. The slopes of the curves agree with the predicted values of x  ⊥  collected in Table 1 for all combinations of BC and ensembles. Note that the slopes do not depend on L at all.

Fig. 5
figure 5

Finite-size scaling of the interfacial tension γ(L, L z ) for various models. (a) and (b) show data for a 3d Ising model at \(k_{\text{B}}T/J = 3.0\) for three combinations of boundary conditions (periodic (PBC) and antiperiodic (APBC)) and ensembles (canonical (c) and grandcanonical (gc)). (c) shows data for a Lennard-Jones liquid-vapor coexistence and (d) shows results for hard spheres with fcc110 orientation in the crystal. (a), (c) and (d) show data at fixed L, so that according to Eq. (8), the data should be straight lines with slope − x  ⊥  if plotted against L −2ln(L z ). (b) shows data at fixed L z where the lines are one-parameter fits. (b) is taken from [12]

The L-dependence is more complicated, for the next-to-leading order amplitude in Eq. (8) is unknown and the L-dependence of β γ(L, L z ) is non-linear. Hence, one has to do a fit where the amplitude is an unknown parameter. Figure 5b shows data at constant L z for the 3d Ising model. The fit curves describe the data very well for x  ∥  from Table 1. Alternatively, one can take x  ∥  as a second unknown parameter, but this yields results compatible with the expected values.

The next step is to test the method with off-lattice systems. To study the interfacial tension for a vapor-liquid coexistence, we use a model with point particles, where the pair potential U(r) is the truncated and shifted Lennard-Jones model (Eq. (4)). The ensemble switch method is also applicable for hard sphere systems, where coexistence of crystalline and fluid phases can be studied. Here, the interfacial tension is especially hard to compute. For off-lattice models, like simulation of colloids with Lennard-Jones or hard sphere potentials, there is no straightforward method to implement antiperiodic boundary conditions. Hence, it is of great benefit to analyze the Ising model carefully in order to gain insight for the case where one simulates a box with periodic boundary conditions in a canonical ensemble.

As was claimed in Sect. 3, the prefactors x  ⊥  and x  ∥  do not depend on the model. Figure 5c, d show that the data is compatible with the slope − x  ⊥  if plotted against A −1ln(L z ), A being the box cross section, for the Lennard-Jones particles for hard spheres. The quality of the data in Fig. 5c, d is not as good as for the Ising model. Of course, the Ising model is a simpler model, where one can easily simulate comparatively large systems with feasible effort. Furthermore, for the Ising model one can use moves where arbitrarily chosen pairs of spins of opposite signs are exchanged instead of local canonical moves. Conducting the ensemble switch method for off-lattice models takes a significantly larger amount of computational resources until sufficient convergence is achieved. Nevertheless, the data suggests that the finite-size scaling ansatz Eq. (8) remains valid for off-lattice models. The next step is to test the L-dependence for fixed L z . If the full scaling ansatz is validated, this will enable us to make much better predictions of the interfacial tension γ , which is an important parameter for classical nucleation theory and other fields of research.

5 Future Applications

One potential application of the described method is to test classical nucleation theory (CNT) [7], since it is not fully understood on a quantitative level. In CNT, the barrier of homogeneous nucleation is given by two contributions, the free energy gain of creating a droplet and the free energy loss due to surface tension of the newly created interface. The underlying assumption is, that macroscopic properties of the system can be applied to describe microscopic droplets. We are going to study the coexistence of a crystalline nucleus in a liquid environment. Hence, we require a model, which shows phase separation into a liquid-like and a solid-like phase. Therefore, we use a soft extension of the well-known effective Asakura-Oosawa (AO) model [1], which has the great advantage that one can integrate the degrees of freedom of the polymers out and replace them by an effective attractive interaction between the colloids, if the diameter ratio \(q =\sigma _{p}/\sigma _{c}\) of polymers and colloids is smaller than 0. 154 [5]. It has the following form

$$\displaystyle{ U(r) = \left \{\begin{array}{ll} \infty &,r \leq \sigma _{c} \\ -\eta _{p}^{r}\left (\frac{1+q} {q} \right )^{3}\left [1 - \frac{3r} {2\sigma _{c}(1+q)} + \frac{r^{3}} {2\sigma _{c}^{3}(1+q)^{3}} \right ]&,\sigma _{c} < r <\sigma _{c} +\sigma _{p} \\ 0 &,r \geq \sigma _{c} +\sigma _{p} \end{array} \right. }$$
(12)

where η p r is the polymer reservoir packing fraction. To compute the pressure using a virial expression, the repulsive part of the potential needs to be continuous, which is why we use the following soft repulsive part instead of the hard sphere repulsion in Eq. (12)

$$\displaystyle{ U(r) = \begin{array}{ll} 4\left [\left ( \frac{b\sigma } {r-e\sigma }\right )^{12} + \left ( \frac{b\sigma } {r-e\sigma }\right )^{6} -\left ( \frac{b} {1+q-e}\right )^{12} -\left ( \frac{b} {1+q-e}\right )^{6}\right ]&,r \leq \sigma _{ c} \end{array} }$$
(13)

where b and e control the strength and the zero crossing point of the repulsive part,Footnote 2 respectively. This potential is a continuous fit to the effective Asakura-Oosawa model [5].

Our aim is to measure the pressure p f in the liquid surrounding a crystalline nucleus. A typical system configuration containing a nucleus is shown in Fig. 6. The value of the pressure is not the same as in pure liquid. It is enhanced due to the existence of a curved interface of the nucleus, the so-called Laplace pressure. The Laplace pressure can be calculated [2] if one assumes a spherical nucleus of radius R and an isotropic interfacial tension γ:

$$\displaystyle{ p_{c} - p_{f} = 2\gamma /R^{{\ast}}\;, }$$
(14)
$$\displaystyle{ p_{c} = p_{\text{coex}} + (p_{f} - p_{\text{coex}})v_{f}/v_{c}\;, }$$
(15)

where v f v c is the volume ratio of the surrounding fluid and the nucleus, p f is the pressure of the fluid and p coex is the coexistence pressure, which can be determined independently. If we combine the two Eqs. (14) and (15), we also obtain

$$\displaystyle{ p_{f} - p_{\mathrm{coex}} = \frac{2\gamma } {R^{{\ast}}} \frac{\eta _{f}} {\eta _{c} -\eta _{f}} }$$
(16)

with η f, c being the respective packing fraction of the fluid or the crystal. To identify the crystal and determine the critical radius R within the simulation box (see Fig. 6), we apply averaged Steinhardt order parameters [8].

Fig. 6
figure 6

Typical snapshot of a crystalline nucleus in liquid. The simulation volume is 21. 484318 × 21. 484318 × 21. 484318 with periodic boundary conditions and contains 10, 000 particles, resulting in a packing fraction of η c  = 0. 528. For distinguishing the different phases, we use averaged Steinhardt bond order parameters, as defined in Ref. [8]. Blue colored particles are liquid-like, red ones are solid-like and the interface is shown in green

In Fig. 7, we compare the pressure in the fluid phase with Eq. (16). For γ, we use an estimate for the interfacial stiffness \(\tilde{\gamma }\) [17]. If the result on the right-hand side is multiplied by c = 1. 26, the two curves match. This prefactor can either be attributed to the difference between γ and \(\tilde{\gamma }\) or deviations from the spherical shape of the nucleus [11] or both. Therefore, the determination of γ is crucial for the comparison between classical nucleation theory and simulation results. The “ensemble switch” method can be easily applied to the effective Asakura-Oosawa model and the next step will be to calculate the interfacial tension for this model.

Fig. 7
figure 7

Pressure in the fluid phase of a system which consists of a crystalline nucleus surrounded by liquid. The three sets of data points correspond to systems with (from top to bottom) N = 6, 000, 8, 000 and 10, 000 particles. The curves are theoretical estimates from Eq. (16) multiplied by a constant c = 1. 26

6 Conclusion

In this report, we have introduced an extension of the ensemble switch method which allows us to determine interfacial tensions in various combinations of ensembles and boundary conditions. This method was applied to Ising models as well as continuous models with Lennard-Jones or hard sphere interactions to study logarithmic finite-size corrections including a previously unknown correction due to “domain breathing”. As a first practical application, we have outlined a procedure to compute the Laplace pressure of a crystalline nucleus surrounded by liquid to compare results with classical nucleation theory.