SkillAgentSearch skills...

DFT

A classical Density Functional Theory code to calculate the properties of hard spheres or Lennard-Jones particles in planar geometry i.e. near an infinite hard or soft wall.

Install / Use

/learn @nbwilding/DFT
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

This C code uses Classical Density Functional Theory to find the density profile of a fluid at a planar wall for a prescribed bulk density. The fluid potential is written as the sum of a hard part and a Lennard-Jones-like attractive part with truncated interactions. The hard part is treated by Rosenfeld's functional measure theory with a choice of either the original form, or the White Bear version (See R. Roth, J. Phys. Condensed Matter, 22, 063102 (2010) for more details). The attractive part is treated in a simple mean fashion. The code also allows calculation of the local compressibility profile, the adsorption and the surface tension. Checking capability includes comparison with the pressure sum rule and the Gibbs adsorption theorem. Nigel Wilding, March 2018.

More details of the implementation can be found in the notes file "planar.pdf".

Example usage.

  1. Lennard-Jones fluid at some temperature T, near an attractive wall.

To calculate the density profile for Lennard-Jones particles at temperature T=1.022566 and bulk density density 0.597846 (which corresponds to the liquid density at liquid-vapor coexistence), near an attractive wall having well depth \epsilon_w=1.0, run with

DFT 1.022566 0.15 1.0 0.597846 ew1.0

The last argument is the "runcode", ie. output appears in the file ew1.0.dat

  1. Hard spheres at a hard wall

To calculate the density profile of hard spheres at a hard wall at bulk density 0.304665, first comment out #define LJ and #define LR and recompile. Then run with

DFT 1. 0.1 0.304665 tesths

Output appears in the file tesths.dat

Related Skills

View on GitHub
GitHub Stars17
CategoryDevelopment
Updated8mo ago
Forks8

Languages

C

Security Score

87/100

Audited on Jul 15, 2025

No findings