Skip to content

shambhuphysics/PCFC-Automation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PCFC - Phase Coexistence Free Energy Calculator

License: MIT Bash VASP

Status: Active

Python

Automated workflow for solid-liquid coexistence determination and free energy calculations using VASP DFT and thermodynamic integration.

Overview

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.

Architecture

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

Quick Start

Prerequisites

  • VASP 5.4+ compiled with MPI
  • Bash 5.0+
  • Python 3.8+ with scikit-learn, numpy
  • BC calculator, ASE (optional)

Installation

git clone https://github.com/shambhuphysics/PCFC-Automation.git
cd pcfc
source source.sh  # Load environment

Basic Usage

cd example
./pipeline.sh  # Run full coexistence + TI workflow

Configuration: Edit config/coexistence.conf to set:

  • ELEMENT, ATOMIC_MASS
  • TEMP_MIN, TEMP_MAX, TEMP_TOLERANCE
  • VOLUME_COEX, COEX_ATOMS
  • TI parameters (TI_ATOMS, KPOINTS)

Workflow Stages

Stage 1: Coexistence Search

Binary search algorithm identifies solid-liquid coexistence temperature within specified tolerance.

Stage 2: Free Energy Correction

  1. VP Scan: Volume-pressure relation at coexistence
  2. EOS Fit: Birch-Murnaghan equation fitting
  3. MD Sampling: NPT trajectory generation
  4. TI Calculation: EAM and DFT thermodynamic integration

Output Files

  • coex_results.dat: Coexistence T, P, V
  • VP.dat, VP_plot.png: EOS data
  • XDATCAR.s: MD trajectories
  • s*EAM/, s*DFT/: TI calculation directories

Citation

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},

}

Contributing

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

License

MIT License - see LICENSE file [attached_file:1]

Author

Shambhu Bhandari Sharma

University College London

📧 ucfbsbh.22@ucl.ac.uk

Acknowledgments

Developed as part of PhD research in computational materials science at UCL.

About

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 .

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages