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(r)\) of the system and not on the external potentials \(V_i^\mathrm{ext}(r)\).
For a given temperature \(T\), chemical potentials \(\mu_i\) and external potentials \(V_i^\mathrm{ext}(r)\) the grand potential reaches a minimum at equilibrium. Mathematically this condition can be written as
where \(F_{\rho_i}(r)=\left.\frac{\delta F}{\delta\rho_i(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.
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(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
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'}(r)\) that are calculated recursively from
The index \(\alpha\) is used for every segment on component \(i\), \(\alpha'\) refers to all segments bonded to segment \(\alpha\) and \(\alpha''\) to all segments bonded to \(\alpha'\). For bulk systems the expressions simplify to
which shows that, by construction, the density of every segment in a molecule is identical in a bulk system. The index \(\gamma\) refers to all segments on moecule \(i\). The expressions can be combined in a similar way as for the molecular DFT:
At this point it can be numerically useful to redistribute the bulk contributions back into the bond integrals
Combined expression¶
To avoid having multiple implementations of the central part of the DFT code, the different descriptions of molecules can be combined in a single version of the Euler-Lagrange equation:
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\).