Automated workflow for solid-liquid coexistence determination and free energy calculations using VASP DFT and thermodynamic integration.
PCFC automates the computation of melting points and phase equilibria through binary search coexistence algorithms coupled with thermodynamic integration (TI). It combines molecular dynamics simulations, equation-of-state fitting, and machine learning-based phase classification to calculate Gibbs free energy corrections.
pcfc/
├── bin/ # Core workflow executables
│ ├── main_exe # Main coexistence search driver
│ ├── binary_search_coexistence
│ ├── check_coexistence # Phase state detector
│ └── run_coexistence # Single-point coexistence runner
├── calculators/ # Thermodynamic property calculators
│ ├── calc_temperature # Temperature from OSZICAR
│ ├── calc_pressure # Pressure from OUTCAR
│ ├── calc_energy # Internal energy
│ ├── calc_enthalpy # Enthalpy/entropy
│ └── calc_*_block # Block averaging for error analysis
├── sampling/ # MD trajectory sampling
│ ├── sample_md_coex # NPT equilibration at coexistence
│ ├── sample_ti_configs # Configuration extraction for TI
│ └── run_md # Generic MD runner
├── eos/ # Equation of state fitting
│ ├── calc_vp_scan # Volume-pressure scan
│ └── fit_eos_coex # Birch-Murnaghan EOS fitting
├── analysis/ # Post-processing tools
│ ├── extract_and_density # Density profile extraction
│ ├── plot_convergence # Convergence diagnostics
│ └── run_block_error # Statistical error analysis
├── ml/ # Machine learning classifiers
│ ├── classify_density.py # Phase identification
│ └── models/ # Pre-trained classifiers
├── utils/ # Pipeline utilities
│ ├── check_pipeline_status
│ ├── show_pipeline_help
│ └── write_incar # VASP input generator
└── example/ # Example workflows
├── pipeline.sh # Full pipeline script
├── POSCAR.coex # Coexistence supercell
└── POSCAR.s # Single-phase cell
- VASP 5.4+ compiled with MPI
- Bash 5.0+
- Python 3.8+ with scikit-learn, numpy
- BC calculator, ASE (optional)
git clone https://github.com/shambhuphysics/PCFC-Automation.git
cd pcfc
source source.sh # Load environmentcd example
./pipeline.sh # Run full coexistence + TI workflowConfiguration: Edit config/coexistence.conf to set:
ELEMENT,ATOMIC_MASSTEMP_MIN,TEMP_MAX,TEMP_TOLERANCEVOLUME_COEX,COEX_ATOMS- TI parameters (
TI_ATOMS,KPOINTS)
Binary search algorithm identifies solid-liquid coexistence temperature within specified tolerance.
- VP Scan: Volume-pressure relation at coexistence
- EOS Fit: Birch-Murnaghan equation fitting
- MD Sampling: NPT trajectory generation
- TI Calculation: EAM and DFT thermodynamic integration
coex_results.dat: Coexistence T, P, VVP.dat,VP_plot.png: EOS dataXDATCAR.s: MD trajectoriess*EAM/,s*DFT/: TI calculation directories
If you use PCFC in your research, please cite:
@software{pcfc2024,
author = {Sharma, Shambhu Bhandari},
title = {PCFC: Phase Coexistence Free Energy Calculator},
year = {2024},
url = {https://github.com/shamphuphysics/pcfc}
}
@article{10.1063/5.0264856,
author = {Sharma, Shambhu Bhandari and Mehta, Shailesh and Alfè, Dario},
title = {Ab initio phase diagrams of binary alloys in the low solute concentration limit},
journal = {The Journal of Chemical Physics},
volume = {162},
number = {18},
pages = {184502},
year = {2025},
month = {05},
issn = {0021-9606},
doi = {10.1063/5.0264856},
url = {https://doi.org/10.1063/5.0264856},
eprint = {https://pubs.aip.org/aip/jcp/article-pdf/doi/10.1063/5.0264856/20515367/184502_1_5.0264856.pdf},}
Contributions welcome! Please follow:
- Modular function design (single responsibility)
- Configuration-driven parameters (no hardcoding)
- Standard bash error handling (
set -euo pipefail) - Descriptive logging with severity levels
MIT License - see LICENSE file [attached_file:1]
Shambhu Bhandari Sharma
University College London
Developed as part of PhD research in computational materials science at UCL.