Euler-Lagrange equation¶
The fundamental expression in classical density functional theory is the relation between the grand potential functional \(\Omega\) and the intrinsic Helmholtz energy functional \(F\).
What makes this expression so appealing is that the intrinsic Helmholtz energy functional only depends on the temperature \(T\) and the density profiles \(\rho_i(\mathbf{r})\) of the system and not on the external potentials \(V_i^\mathrm{ext}(\mathbf{r})\).
For a given temperature \(T\), chemical potentials \(\mu_i\) and external potentials \(V_i^\mathrm{ext}(\mathbf{r})\) the grand potential reaches a minimum at equilibrium. Mathematically this condition can be written as
where \(F_{\rho_i}(\mathbf{r})=\left.\frac{\delta F}{\delta\rho_i(\mathbf{r})}\right|_T\) is short for the functional derivative of the intrinsic Helmholtz energy. In this context, eq. (1) is commonly referred to as the Euler-Lagrange equation, an implicit nonlinear integral equation which needs to be solved for the equilibrium density profiles of the system.
For a homogeneous (bulk) system, \(V_i^\mathrm{ext}=0\) and we get
The functional derivative of the Helmholtz energy of a bulk system \(F_{\rho_i}^\mathrm{b}\) is a function of the temperature \(T\) and bulk densities \(\rho^\mathrm{b}\). At this point, it can be advantageous to relate the grand potential of an inhomogeneous system to the densities of a bulk system that is in equilibrium with the inhomogeneous system. This approach has several advantages:
The thermal de Broglie wavelength \(\Lambda\) cancels out.
If the chemical potential of the system is not known, all variables are the same quantity (densities).
The bulk system is described by a Helmholtz energy which is explicit in the density, so there are no internal iterations required.
Using eq. (2) in eq. (1) leads to the Euler-Lagrange equation
Spherical molecules¶
In the simplest case, the molecules under consideration can be described as spherical. Then the Helmholtz energy can be split into an ideal and a residual part:
with the thermal de Broglie wavelength \(\Lambda_i\). The functional derivatives for an inhomogeneous and a bulk system follow as
Using these expressions in eq. (3) results in
The Euler-Lagrange equation can be recast as
which is convenient because it leads directly to a recurrence relation known as Picard iteration. The expression can be further simplified by defining the fugacity \(f_i=\rho_i^\mathrm{b}e^{\beta F_{\rho_i}^\mathrm{b,res}}\) which leads to
Homosegmented chains¶
For chain molecules that do not resolve individual segments (essentially the PC-SAFT Helmholtz energy functional) a chain contribution is introduced as
where \(m_i\) is the number of segments (i.e., the PC-SAFT chain length parameter), \(y_{ii}\) is the cavity correlation function at contact in the reference fluid, and \(\lambda_i\) is a weighted density. The presence of \(\rho_i(\mathbf{r})\) in the logarithm poses numerical problems. Therefore, it is convenient to rearrange the expression as
Then the total Helmholtz energy
can be rearranged to
The functional derivatives are then similar to the spherical case
and lead to a slightly modified Euler-Lagrange equation
or with the modified fugacity \(\hat f_i=\rho_i^\mathrm{b}e^{\frac{\beta}{m_i}\hat F_{\rho_i}^\mathrm{b,res}}\)
Heterosegmented chains¶
The expressions are more complex for models in which density profiles of individual segments are considered. A derivation is given in the appendix of Rehner et al. (2022). The resulting Euler-Lagrange equation is given as
with the bond integrals \(I_{\alpha\alpha'}(\mathbf{r})\) that are calculated recursively from
Here, \(\alpha'\) refers to all segments bonded to segment \(\alpha\) and \(\alpha''\) to all other segments bonded to \(\alpha'\) (excluding \(\alpha\)). For bulk systems the expressions simplify to
with \(\gamma\) referring to all segments on the same molecule as \(\alpha\). Solving for the fugacity leads to
which is by construction equal for every segment \(\alpha\) on the same molecule.
Associating molecules¶
Association is described with Wertheim’s theory, which introduces the fractions of non-bonded association sites \(X_A\). In the bulk, they are determined from the mass action equations, which are usually solved for given densities before the Helmholtz energy is evaluated. In inhomogeneous systems, we treat the fractions of non-bonded sites \(X_A(\mathbf{r})\) as additional variables of the density profile. Following Michelsen and Hendriks (2001), we define the functional
of the density profiles and the fractions of non-bonded sites. Here, \(\tilde\rho_A\) is the density of site \(A\), i.e., the multiplicity of the site times the (possibly weighted) density of the segment that carries the site, and \(\Delta^{AB}(\mathbf{r},\mathbf{r}')\) is the association strength between sites \(A\) and \(B\) at positions \(\mathbf{r}\) and \(\mathbf{r}'\). For local approaches, \(\Delta^{AB}(\mathbf{r},\mathbf{r}')=\Delta^{AB}(\mathbf{r})\delta(\mathbf{r}-\mathbf{r}')\), whereas the non-local approach restricts \(\mathbf{r}'\) to a shell at contact around \(\mathbf{r}\). The specific expressions are given in the section on the association functionals.
The association contribution to the Helmholtz energy follows as the stationary point of \(Q\) with respect to the fractions of non-bonded sites
The stationarity condition \(\frac{\delta Q}{\delta X_A(\mathbf{r})}=0\) yields the mass action equations
with the association sums
Inserting the mass action equations into \(Q\) recovers the well-known form of the association contribution
The stationarity also simplifies the functional derivative with respect to the density profiles because the implicit dependence of \(X_A(\mathbf{r})\) on the density profiles does not contribute. The functional derivative is therefore evaluated at fixed \(X_A(\mathbf{r})\)
The association contribution is added to \(\hat F_{\rho_\alpha}^\mathrm{res}\), so the Euler-Lagrange equation keeps its form and is solved together with eq. (4) for \(\rho_\alpha(\mathbf{r})\) and \(X_A(\mathbf{r})\). In the bulk phase, the fractions of non-bonded sites \(X_A^\mathrm{b}\) follow from the mass action equations at the bulk densities, and the association contribution to \(\hat F_{\rho_\alpha}^\mathrm{b,res}\) is evaluated at \(X_A^\mathrm{b}\).
Full expression¶
To avoid having multiple implementations of the central part of the DFT code, the different descriptions of molecules are combined in a single set of equations:
Here, \(\hat F_{\rho_\alpha}^\mathrm{res}\) contains the association contribution at fixed \(X_A(\mathbf{r})\), and \(\hat F_{\rho_\gamma}^\mathrm{b,res}\) the association contribution at the fractions of non-bonded sites of the bulk phase. If molecules consist of single (possibly non-spherical) segments, the Euler-Lagrange equation simplifies to that of the homosegmented chains shown above. For heterosegmented chains, the correct expression is obtained by setting \(m_\alpha=1\). Without association, the mass action equations drop out.