A comprehensive C++ program for calculating molecular thermochemistry properties from quantum chemistry output files (Gaussian, Orca, GAMESS, NWCHEM, CP2K, VASP, Q-Chem). OpenThermo implements state-of-the-art methods for computing thermodynamic quantities including Gibbs free energy, enthalpy, entropy, and heat capacities using statistical mechanics.
Online Document: https://lenhanpham.github.io/OpenThermo
The project is still in the early stage and not fully tested. Therefore, errors and inaccuracy may happen. Users are suggested to check calculated data against original data from outputs of corresponding quantum chemical programs (with default temperature, conentration, and pressure)
A graphical user interface (GUI) version is under development and can be found here: https://github.com/lenhanpham/OpenThermoGUI
- Project Overview
- Key Features
- System Requirements
- Installation
- Configuration
- Usage
- Input Formats
- Output Formats
- Calculation Methods
- Advanced Features
- Examples
- Troubleshooting
- Contributing
- License
OpenThermo is a high-performance C++17 program designed for molecular thermochemistry calculations. It processes quantum chemistry output files to compute thermodynamic properties using rigorous statistical mechanics methods. The program supports multiple quantum chemistry packages and implements both standard and advanced treatment methods for accurate thermochemical analysis.
OpenThermo addresses the need for accurate thermochemical data in computational chemistry without re-running quantum chemical programs by providing:
- Accurate thermodynamic calculations using statistical mechanics
- Multiple treatment methods for low-frequency vibrational modes
- Comprehensive analysis of molecular systems
- Batch processing capabilities for high-throughput workflows
- Extensible architecture for future enhancements
The codebase is organized into modular components located in the src/ directory:
src/
├── atommass.cpp
├── atommass.h
├── calc.cpp
├── calc.h
├── chemsys.h
├── help_utils.cpp
├── help_utils.h
├── loadfile.cpp
├── loadfile.h
├── main.cpp
├── omp_config.h
├── symmetry.cpp
├── symmetry.h
├── util.cpp
├── util.h
└── version.h
- Version: 0.001.6
- Language: C++17 with clang++ compiler
- Build System: GNU Make with CMake support
- Testing: Test regression suite with CI on Linux, macOS, and Windows (+ AddressSanitizer, ThreadSanitizer)
- Documentation: Doxygen-generated API documentation
- Multi-format Support: Gaussian, ORCA, GAMESS-US, NWChem, CP2K, VASP, Q-Chem (experimental)
- Advanced Thermochemistry: Standard RRHO and quasi-RRHO treatments for low-frequency modes
- Statistical Mechanics: Rigorous implementation of partition functions and thermodynamic properties
- Symmetry Analysis: Automatic point group detection and rotational symmetry number calculation
- Standard RRHO: Rigid-rotor harmonic oscillator approximation
- Quasi-RRHO Treatments:
- Truhlar's frequency raising method
- Grimme's entropy interpolation
- Minenkov's energy + entropy interpolation
- Head-Gordon's energy interpolation (with optional entropy) [Experimental]
- Electronic Contributions: Multi-level electronic structure support
- Concentration Corrections: Solution-phase Gibbs energy adjustments
- Temperature/Pressure Scanning: Automated parameter sweeps
- Batch Processing: Multi-file analysis with ensemble averaging
- Mass Modifications: Isotopic substitution and custom atomic masses
- Configurable Scaling: Frequency scaling factors for different properties
- Multiple Output Formats: Console, text files, and native OpenThermo format
- High Performance: Optimized C++17 implementation
- Memory Efficient: Minimal memory footprint for large systems
- Error Handling: Comprehensive validation and graceful error recovery
- Extensible Design: Modular architecture for easy enhancement
- Cross-Platform: Linux, macOS, and Windows support
- Operating System: Linux, macOS 10.14+, or Windows 10+
- Processor: x86_64 architecture
- Memory: 512 MB RAM (2 GB recommended)
- Storage: 50 MB free space
- Primary: Clang 6.0+ or GCC 7.0+
- Alternative: Intel C++ Compiler 18.0+
- Standard: C++17 compliant compiler
- GNU Make: 3.8.1+ (build system, tested)
- CMake: 3.26.5+ (alternative build system, tested)
- Standard Library: C++17 standard library
- Doxygen: 1.8+ (documentation generation)
- Graphviz: For documentation diagrams
- Python: 3.6+ (for test automation scripts)
- Linux: Ubuntu 18.04+, CentOS 7+, Fedora 28+
- macOS: 10.14+ with Xcode Command Line Tools
- Windows: 10+ with MSYS2/MinGW or Visual Studio 2017+
-
Clone or download the repository:
git clone https://github.com/lenhanpham/OpenThermo.git cd OpenThermo -
Build with Make (recommended):
make clean && make -
Alternative CMake build:
mkdir build && cd build cmake .. make
# Standard optimized build
make
# Build with OpenMP parallelization
make OPENMP=1
# Debug build with AddressSanitizer
make debug
# Release build with maximum optimization
make release
# Force specific compiler
make CXX=g++ # GCC
make CXX=clang++ # Clang
make CXX=icpc # Intel
# Clean build artifacts
make clean# Create build directory
mkdir build && cd build
# Configure and build
cmake ..
make
# Build with OpenMP parallelization
cmake .. -DENABLE_OPENMP=ON
make
# Build types
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake .. -DCMAKE_BUILD_TYPE=Debug
# Specify compiler
cmake .. -DCMAKE_CXX_COMPILER=clang++For Windows Users, there is a binary package in Release. Download this package and unzip it for further instruction of installation.
For those who would like to complie OpenThermo from source code on Windows:
- Install MSYS2 and open a MINGW64 terminal
- Install dependencies:
pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-clang mingw-w64-x86_64-cmake mingw-w64-x86_64-make
- Build:
The Makefile auto-detects Windows and adds
make
-staticlinking so the binary runs without MinGW DLLs.
-
Add OpenThermo to PATH (Linux/macOS):
Add the following line to your shell configuration file (
~/.bashrc,~/.zshrc, or equivalent), replacing/path/to/OpenThermowith the actual path to the directory containing theOpenThermobinary (e.g. the repo root orbuild/):export PATH=$PATH:/path/to/OpenThermo
Then reload your shell:
source ~/.bashrc # or source ~/.zshrc
Windows users: Add the directory containing
OpenThermo.exeto the System PATH via Settings → System → Advanced system settings → Environment Variables. -
Verify executable:
OpenThermo --help
-
Create settings file (optional):
OpenThermo --create-config
-
Compiler options:
make CXX=g++ # Force GCC compilation make CXX=icpc # Force Intel compiler
-
Clean build:
make clean
all(default): Standard optimized builddebug: Includes debug symbols and AddressSanitizerrelease: Maximum optimization for production usetsan: ThreadSanitizer build for detecting data races (use withOPENMP=1)clean: Remove all build artifactstest: Run the regression test suitetest-generate: Regenerate reference values from current build
Using compiler: g++
g++ -std=c++17 -Wall -Wextra -O2 -c main.cpp -o build/main.o
g++ -std=c++17 -Wall -Wextra -O2 -c atommass.cpp -o build/atommass.o
...
g++ build/main.o ... -o OpenThermo -lrt -lstdc++fs
OpenThermo supports configuration through:
- Command-line arguments (highest priority)
- Local settings file:
./settings.ini - Environment settings:
$OPENTHERMOPATH/settings.ini - Program defaults (lowest priority)
Generate a default settings file:
OpenThermo --create-configThis creates settings.ini with all available parameters and their default values.
# OpenThermo Settings File
# Lines starting with # are comments
# Electronic energy override
E = -76.384729
# Temperature settings (K)
T = 298.15
# For temperature scan: T = 200.0 400.0 25.0
# Pressure settings (atm)
P = 1.0
# For pressure scan: P = 0.5 2.0 0.2
# Frequency scaling factors
sclZPE = 1.0 # Zero-point energy scaling
sclheat = 1.0 # Thermal energy scaling
sclS = 1.0 # Entropy scaling
sclCV = 1.0 # Heat capacity scaling
# Low frequency treatment
lowvibmeth = Grimme # 0/Harmonic=RRHO, 1/Truhlar, 2/Grimme, 3/Minenkov, 4/HeadGordon
ravib = 100.0 # Raising threshold for Truhlar method
intpvib = 100.0 # Interpolation threshold for Grimme/Minenkov/HeadGordon
hg_entropy = true # Enable entropy interpolation for Head-Gordon method
# bav = qchem # Bav for HeadGordon only: grimme or qchem (default: qchem). Ignored for Grimme/Minenkov.
# Calculation options
ipmode = 0 # 0=gas phase, 1=condensed phase
imagreal = 0.0 # Imaginary frequency threshold
massmod = 3 # Mass assignment: 1=average, 2=abundant, 3=file
PGname = "?" # Point group (auto-detect if "?")
# Output options
prtlevel = 1 # Verbosity: 0=minimal, 1=default, 2=verbose, 3=full
prtvib = 0 # Vibration contributions: 0=no, 1=screen, -1=file
outotm = 0 # Output .otm file: 0=no, 1=yes
# Concentration (for solution phase)
conc = 1.0
# VASP energy selection
# false/no/0 = energy without entropy (default), true/yes/1 = energy(sigma->0)
extrape = false
# OpenMP threading (command-line or settings.ini)
# Default: half of physical CPU cores or scheduler-allocated CPUs
# On HPC: SLURM_CPUS_PER_TASK / PBS_NP / NSLOTS are auto-detected
# omp-threads = 4
# Override with CLI: -omp-threads N (takes precedence)
# Strategy (outer T/P vs inner vibrational) is auto-selected
# Mass modifications (optional section)
# modmass
# 1 H 1.007825 # Atom 1: Hydrogen with specific mass
# 2 C 12.0 # Atom 2: Carbon-12 isotope| Parameter | Meaning | Default Value |
|---|---|---|
conc |
Concentration string for solution phase Gibbs energy corrections | 0 |
prtlevel |
Output verbosity level (0=minimal, 1=default, 2=verbose, 3=full) | 1 |
prtvib |
Print vibration contributions (0=no, 1=screen, -1=file) | 0 |
lowvibmeth |
Low frequency treatment method | 2 |
massmod |
Mass assignment mode (1=average, 2=abundant, 3=file) | 3 |
outotm |
Output .otm file flag (0=no, 1=yes) | 0 |
ipmode |
Calculation mode (0=gas phase, 1=condensed phase) | 0 |
T |
Temperature in Kelvin | 298.15 |
P |
Pressure in atmospheres | 1.0 |
sclZPE |
ZPE scaling factor | 1.0 |
sclheat |
Thermal energy scaling factor | 1.0 |
sclS |
Entropy scaling factor | 1.0 |
sclCV |
Heat capacity scaling factor | 1.0 |
ravib |
Raising threshold for Truhlar method (cm⁻¹) | 100.0 |
intpvib |
Interpolation threshold for Grimme/Minenkov/HeadGordon (cm⁻¹) | 100.0 |
hg_entropy |
Entropy interpolation for Head-Gordon method | true |
bav |
Bav preset for HeadGordon free-rotor entropy (grimme/qchem) | qchem |
imagreal |
Imaginary frequency threshold (cm⁻¹) | 0.0 |
Eexter |
External electronic energy override (a.u.) | 0.0 |
extrape |
VASP electronic energy selection | false |
PGname |
Point group name ("?" for auto-detect) | "?" |
omp-threads |
OpenMP thread count (clamped to effective cores) | Half of effective cores |
Details for extrape:
false/no/0→ energy without entropytrue/yes/1→ energy (σ→0)
Details for lowvibmeth:
- 0/Harmonic = Rigid-Rotor Harmonic Oscillator approximation (RRHO)
- 1/Truhlar = Truhlar's QRRHO method
- 2/Grimme = Grimme's method
- 3/Minenkov = Minenkov's method
- 4/HeadGordon = Head-Gordon's energy interpolation (with optional entropy) [Experimental]
- Command-line arguments (highest priority)
- Current directory
settings.ini - Environment path
settings.ini - Program defaults (lowest priority)
OPENTHERMOPATH: Directory containingsettings.iniOPENTHERMO_OUTPUT: Default output directory
Settings are applied in this order:
- Command-line arguments override everything
- Current directory
settings.ini - Environment path
settings.ini - Built-in program defaults
- Description: Override electronic energy
- Units: Atomic units (a.u.)
- Default: Use value from input file
- Example:
-E -76.384729
- Description: Temperature specification
- Units: Kelvin (K)
- Default: 298.15 K
- Examples:
-T 300(single temperature)-T 200 400 25(scan from 200K to 400K in 25K steps)
- Description: Pressure specification
- Units: Atmospheres (atm)
- Default: 1.0 atm
- Examples:
-P 2.0(single pressure)-P 0.5 2.0 0.2(scan from 0.5 to 2.0 atm in 0.2 atm steps)
- Description: Scale factor for ZPE frequencies
- Default: 1.0
- Example:
-sclZPE 0.98
- Description: Scale factor for thermal energy frequencies
- Default: 1.0
- Example:
-sclheat 0.99
- Description: Scale factor for entropy frequencies
- Default: 1.0
- Example:
-sclS 0.99
- Description: Scale factor for heat capacity frequencies
- Default: 1.0
- Example:
-sclCV 0.99
- Description: Low frequency treatment method
- Values:
0orHarmonic: Standard RRHO (harmonic approximation)1orTruhlar: Truhlar's QRRHO (frequency raising)2orGrimme: Grimme's entropy interpolation3orMinenkov: Minenkov's entropy + energy interpolation4orHeadGordon: Head-Gordon's energy interpolation (+ optional entropy) [Experimental]
- Default: Grimme
- Example:
-lowvibmeth 1or-lowvibmeth Truhlar
- Description: Raising value for low frequencies (Truhlar's method)
- Units: cm⁻¹
- Default: 100.0
- Example:
-ravib 50.0
- Description: Interpolation frequency threshold for Grimme, Minenkov, and Head-Gordon methods
- Units: cm⁻¹
- Default: 100.0
- Example:
-intpvib 50.0
- Description: Enable or disable entropy interpolation for the Head-Gordon method
- Values:
true/falseor1/0 - Default: true
- Example:
-hg_entropy false
- Description: Average moment of inertia (Bav) used in the free-rotor entropy term. Only applicable to the HeadGordon method (
lowvibmeth=4). Grimme and Minenkov methods always usegrimme(1×10⁻⁴⁴ kg m²); this option is ignored for them. - Values:
grimme: I_av = 1×10⁻⁴⁴ kg m² (μ'_av from Grimme 2012, used by ORCA/xtb/GoodVibes/Shermo)qchem: I_av = 2.79928×10⁻⁴⁶ kg m² (B_av = 1 cm⁻¹, as specified in the Q-Chem manual)
- Default:
qchem(for HeadGordon) - Example:
-bav grimme
- Description: Calculation mode
- Values:
0: Gas phase (include translational/rotational)1: Condensed phase (remove translational/rotational)
- Default: 0
- Example:
-ipmode 1
- Description: Treat imaginary frequencies as real if |ν| < value
- Units: cm⁻¹
- Default: 0.0 (no treatment)
- Example:
-imagreal 50.0
- Description: Default atomic mass assignment
- Values:
1: Element average mass2: Most abundant isotope mass3: Masses from input file (default)
- Default: 3
- Example:
-massmod 2
- Description: Force specific point group
- Default: Auto-detect
- Example:
-PGname C2v
- Description: Concentration specification
- Default: None
- Example:
-conc "2.5"
- Description: Controls the amount of information printed to the console
- Values:
0: Minimal — banner + final thermodynamic data only1: Default — parameter summary, compact system info (atom count, point group, frequency range), and final data2: Verbose — full system data (per-atom masses, full frequency list, moments of inertia, rotational constants) and component breakdown (Translation/Rotation/Vibration/Electronic sections)3: Full — everything in level 2 plus per-mode vibrational detail tables (automatically enables-prtvib 1unless explicitly overridden)
- Default: 1
- Examples:
-prtlevel 0(minimal output for scripting)-prtlevel 2(full output matching pre-0.001.1 behavior)
- Settings file:
prtlevel = 1
- Description: Print vibration contributions
- Values:
0: No (default)1: Yes, to screen-1: Yes, tobasename.vibconfile
- Default: 0
- Example:
-prtvib 1
- Description: Output OpenThermo format file
- Values:
0: No (default)1: Yes
- Default: 0
- Example:
-outotm 1
- Description: Skip loading settings from
settings.ini - Example:
-noset
- Description: Set the number of OpenMP threads for parallel computation
- Default: Half of the detected physical CPU cores (minimum 1), or half of scheduler-allocated CPUs on HPC
- HPC scheduler support: Automatically detects allocated CPUs from
SLURM_CPUS_PER_TASK,PBS_NUM_PPN,PBS_NP,NSLOTS,LSB_DJOB_NUMPROC - Behavior:
- If not specified: uses half of effective cores (scheduler allocation or physical)
- If
N≤ effective cores: usesNthreads - If
N> effective cores: clamps to default (half) with a warning
- Strategy auto-selection: OpenThermo automatically selects the best parallelization strategy:
- Outer (T/P scan parallel): when many T/P scan points are available (≥ nthreads)
- Inner (vibrational parallel): when few T/P points but many frequencies (>50)
- Precedence: CLI
-omp-threads>settings.iniomp-threads> auto-detect - Examples:
-omp-threads 4(use 4 threads, if ≤ effective cores)-omp-threads 2(use 2 threads)
- Settings file:
omp-threads = 4(in settings.ini)
- Description: Show general help
- Example:
OpenThermo --help
- Description: Show help for specific option
- Examples:
--help-T(temperature help)--help-lowvibmeth(low frequency help)--help-input(input formats help)
Native format containing all molecular data:
<E> //Electronic energy (a.u.)
-76.384729
<frequency> //Wavenumbers (cm^-1)
1234.5
2345.6
...
<system> //Name, mass (amu), X, Y, Z (Angstrom)
C 12.000000 0.000000 0.000000 0.000000
H 1.007825 0.000000 0.000000 1.089000
...
<elevel> //Energy (eV) and degeneracy
0.0 1
1.5 3
- Requirements: Frequency analysis output
- Extracts: Geometry, frequencies, electronic energy
- Features: Automatic format detection
- Requirements: Frequency calculation results
- Features: Supports various ORCA output formats
- Requirements: Hessian/frequency analysis
- Features: Standard GAMESS output parsing
- Requirements: Frequency analysis output
- Features: Comprehensive NWChem support
- Requirements: Vibrational analysis output
- Features: Supports molecular and periodic systems
- Note: For condensed phase systems (ipmode=1): contributions of translation and rotation are ignored
- Requirements: Vibrational analysis output in OUTCAR, sysmtem information in CONTCAR
- Features: Supports molecular and periodic systems
- Note: For condensed phase systems (ipmode=1): contributions of translation and rotation are ignored
- Requirements: Frequency calculation output (standalone FREQ job or combined OPT+FREQ two-job file)
- Extracts: Geometry from last
Standard Nuclear Orientationblock (converged structure), SCF energy (SCF energy =), spin multiplicity from the$moleculeinput section, atomic masses from theSTANDARD THERMODYNAMIC QUANTITIESblock
Batch processing of multiple files:
molecule-a.log
molecule-b.out
/path/to/molecule-c.otm
- Automatic: Program detects format from file content
- No manual specification required
- Priority: OpenThermo → specific program signatures
OpenMP threads: 24 (default: half of 48 physical cores). Use -omp-threads N to override.
--- Summary of Current Parameters ---
Running parameters:
Print level: 1 (0=minimal, 1=default, 2=verbose, 3=full)
Printing individual contribution of vibration modes: No
Temperature: 298.150 K
Pressure: 1.000 atm
Scaling factor of vibrational frequencies for ZPE: 1.0000
Scaling factor of vibrational frequencies for U(T)-U(0): 1.0000
Scaling factor of vibrational frequencies for S(T): 1.0000
Scaling factor of vibrational frequencies for CV: 1.0000
Low frequencies treatment: Grimme's interpolation for entropy
Vibrational frequency threshold used in the interpolation is 100.00 cm^-1
-------- End of Summary --------
OpenThermo started to process BIH-conformers-1.log at Tue Feb 17 14:10:27 2026
-------- Chemical System Data -------
-------------------------------------
Electronic energy: -690.56452500 a.u.
Electronic energy level 1 E = 0.000000 eV Degeneracy = 1
Atoms: 33 (16 H, 15 C, 2 N) Total mass: 224.131420 amu
Point group: Cs Rotational symmetry number: 1
Frequencies: 93 (range: 25.1 -- 3233.0 cm^-1)
----------------------------
-------- Final data --------
----------------------------
Total q(V=0): 8.578987e+42
Total q(bot): 8.806492e-87
Total q(V=0)/NA: 1.424574e+19
Total q(bot)/NA: 1.462352e-110
Total CV: 237.069 J/mol/K 56.661 cal/mol/K
Total CP: 245.383 J/mol/K 58.648 cal/mol/K
Total S: 484.246 J/mol/K 115.738 cal/mol/K -TS: -34.507 kcal/mol
Zero point energy (ZPE): 736.269 kJ/mol 175.973 kcal/mol 0.280430 a.u.
Thermal correction to U: 773.673 kJ/mol 184.912 kcal/mol 0.294677 a.u.
Thermal correction to H: 776.152210 kJ/mol 185.504830 kcal/mol 0.295621 a.u.
Thermal correction to G: 631.774188 kJ/mol 150.997655 kcal/mol 0.240630 a.u.
Electronic energy: -690.5645250 a.u.
Sum of electronic energy and ZPE, namely U/H/G at 0 K: -690.2840949 a.u.
Sum of electronic energy and thermal correction to U: -690.2698485 a.u.
Sum of electronic energy and thermal correction to H: -690.2689043 a.u.
Sum of electronic energy and thermal correction to G: -690.3238950 a.u.
Calculation completed at: Tue Feb 17 14:10:27 2026
---------- Happy calculation ----------
---- OpenThermo normally terminated ---
Thermal corrections and total energies:
Ucorr, Hcorr and Gcorr are in kcal/mol; U, H and G are in a.u.
T(K) P(atm) Ucorr Hcorr Gcorr U H G
298.15 1.000 4.567 4.789 4.123 -76.380162 -76.379940 -76.384063
323.15 1.000 5.123 5.345 4.567 -76.379506 -76.379284 -76.383851
Entropy and partition functions:
S, CV and CP are in cal/mol/K; q(V=0)/NA and q(bot)/NA are unitless
T(K) P(atm) S CV CP q(V=0)/NA q(bot)/NA
298.15 1.000 45.67 12.34 13.56 1.234567e-05 2.345678e-03
323.15 1.000 48.90 13.45 14.67 1.456789e-05 2.567890e-03
Individual mode contributions (when prtvib = 1 or -1):
Vibrational mode contributions at 298.15 K:
Mode Freq(cm-1) ZPE(kJ/mol) U-T(kJ/mol) S(J/mol/K) CV(J/mol/K)
1 456.7 0.005 0.008 2.34 1.23
2 789.0 0.008 0.012 3.45 2.34
...
Native format file (when outotm = 1):
<E> //Electronic energy (a.u.)
-76.384729
<frequency> //Wavenumbers (cm^-1)
456.7
789.0
...
<system> //Name, mass (amu), X, Y, Z (Angstrom)
C 12.000000 0.000000 0.000000 0.000000
H 1.007825 0.000000 0.000000 1.089000
...
Rigid-Rotor Harmonic Oscillator approximation
- Translational:
q_trans = (2πmkT/h²)^(3/2) * V - Rotational:
q_rot = √(πI_a I_b I_c (kT/h²)^3) / σ(non-linear) - Vibrational:
q_vib = ∏(1 - exp(-hν_i/kT))⁻¹ - Electronic:
q_elec = ∑ g_i exp(-ε_i/kT)
- ZPE:
∑ (1/2) h ν_i - Thermal Energy:
U - U(0) = RT² ∂(ln Q)/∂T - Entropy:
S = R ln Q + RT ∂(ln Q)/∂T - Heat Capacity:
CV = T ∂S/∂T
Frequency raising approach:
- Frequencies below threshold (
ravib) are raised toravibvalue - Applied to: ZPE, thermal energy, entropy, heat capacity
- Mathematical: Replace ν < ν_threshold with ν_threshold
- Advantage: Simple and computationally efficient
Entropy interpolation between RRHO and free rotor:
- Weighting:
w = 1 / (1 + (ν_threshold/ν)^4) - Entropy:
S = w × S_RRHO + (1-w) × S_free - Free rotor entropy:
S_free = R [ 1/2 + ln(√(8π³I kT / h²)) ] - Moment of inertia I: Uses Bav = 1×10⁻⁴⁴ kg m² (Grimme's original μ'_av, fixed for this method)
- Threshold: Configurable via
intpvibparameter
Extended Grimme's method with energy interpolation:
- Same entropy treatment as Grimme's
- Additional energy interpolation:
U = (1/α) U_RRHO + (1-1/α) U_free - Where:
α = 1 + (ν_threshold/ν)^4 - Free rotor energy:
U_free = RT/2 - Note: ZPE = 0 for free rotor contribution
Energy interpolation with optional entropy interpolation (Li et al., 2015):
- Energy interpolation:
U = w × U_RRHO + (1-w) × U_free - Weighting:
w = 1 / (1 + (ν_threshold/ν)^4)(same damping function as Grimme/Minenkov) - Free rotor energy:
U_free = RT/2 - ZPE handling: ZPE is folded into the interpolated total vibrational energy (damped for low-frequency modes, as per eq. 4 of the paper). Separate ZPE is not displayed.
- Cv interpolation:
Cv = w × Cv_HO + (1-w) × R/2 - Optional entropy interpolation (
hg_entropy = true, default): uses the same Grimme free-rotor entropy formula - Entropy off (
hg_entropy = false): entropy uses the standard harmonic oscillator model (paper's original behavior) - Bav: Configurable via
-bavoption (only for this method):qchem(default): I_av = 2.79928×10⁻⁴⁶ kg m² (B_av = 1 cm⁻¹, Q-Chem manual)grimme: I_av = 1×10⁻⁴⁴ kg m² (Grimme 2012)
- Threshold: Configurable via
intpvibparameter - Reference: Li, Guo, Head-Gordon, Bell, J. Phys. Chem. C, 2015
- Automatic threshold: Based on
raviborintpvibparameters - Default threshold: 100.0 cm⁻¹
- Treatment scope: Applied to all vibrational modes below threshold
# Temperature range
OpenThermo molecule.log -T 200 400 25
# Pressure range
OpenThermo molecule.log -P 0.5 2.0 0.2
# Combined range
OpenThermo molecule.log -T 273 373 50 -P 0.5 2.0 0.5Custom atomic masses in settings.ini:
modmass
1 H 1.007825 # Atom 1: Hydrogen with specific mass
2 C 12.0 # Atom 2: Carbon-12
3 O 15.994915 # Atom 3: Oxygen-16- Automatic detection of point groups
- Manual override with
-PGnameoption - Rotational symmetry number calculation
- Linear molecule detection
- Automatic detection of imaginary frequencies
- Optional treatment as real frequencies
- Configurable threshold with
-imagrealoption
-
Energy line format: In VASP OUTCAR files, the energy line contains two values:
energy without entropy= -27.39346935 energy(sigma->0) = -27.39346935 -
Selection options:
extrape = false(default): Use first energy value (4th token)extrape = true: Use last energy value (final token)
-
Configuration: Set in
settings.inior use default behavior
Process multiple files:
# Create file list
echo "molecule-1.log" > batch.txt
echo "molecule-2.out" >> batch.txt
echo "molecule-3.otm" >> batch.txt
# Process batch
OpenThermo batch.txt# Standard calculation at 298.15 K, 1 atm
OpenThermo water.log
# Custom conditions
OpenThermo methane.out -T 300 -P 2.0
# High precision calculation
OpenThermo benzene.otm -T 298.15 -lowvibmeth 2 -sclZPE 0.98# Temperature scan with Grimme's method
OpenThermo molecule.log -T 200 400 25 -lowvibmeth 2
# Pressure scan with custom scaling
OpenThermo molecule.log -P 0.1 10 0.5 -sclS 0.99 -sclCV 0.99
# Transition state calculation
OpenThermo ts.out -imagreal 100 -lowvibmeth 1 -ravib 50
# Condensed phase calculation
OpenThermo crystal.out -ipmode 1 -conc "1.0 M"
# Minimal output (final data only)
OpenThermo molecule.log -prtlevel 0
# Verbose output with per-mode vibration detail
OpenThermo molecule.log -prtlevel 3# Process all .log files in directory
ls *.log > files.txt
OpenThermo files.txt
# Custom analysis for multiple molecules
OpenThermo molecules.txt -T 298 -lowvibmeth 3 -prtvib 1 -outotm 1# Standard thermochemistry
T = 298.15
P = 1.0
lowvibmeth = Grimme
sclZPE = 1.0
# High-precision calculation
T = 298.15
P = 1.0
lowvibmeth = Minenkov
sclZPE = 0.98
sclheat = 0.99
sclS = 0.99
sclCV = 0.99
# Head-Gordon quasi-RRHO (energy + entropy)
T = 298.15
P = 1.0
lowvibmeth = HeadGordon
intpvib = 100.0
hg_entropy = true
# Low temperature analysis
T = 100
P = 1.0
lowvibmeth = 1
ravib = 50.0Error: Error: Unable to find molecule.log
Solution:
- Check file path and spelling
- Ensure file is in current directory or provide full path
- For .txt batch files, verify all listed files exist
Error: Error: Unable to identify the program that generated this file
Solution:
- Verify the input file contains frequency analysis output
- Check if the quantum chemistry program is supported
- Ensure the calculation completed successfully
Error: Error: Invalid value for -T
Solution:
- Check argument syntax:
-T 298.15(single) or-T 200 400 25(range) - Ensure numeric values are valid
- Use
--help-Tfor detailed syntax
Error: Undefined references or compilation failures Solution:
- Ensure all source files are present
- Check compiler compatibility (GCC 7+, Intel, Clang)
- Run
make clean && maketo rebuild - Verify Makefile is in the correct directory
Warning: Warning: settings.ini cannot be found
Solution:
- Create
settings.iniin current directory - Set
OPENTHERMOPATHenvironment variable - Use
-nosetto skip settings loading
- Enable batch processing with smaller chunks
- Build with OpenMP (
make OPENMP=1) for temperature/pressure scans - Use
-omp-threads Nto control thread count (default: half of physical cores) - For dedicated compute nodes, use
-omp-threadswith the full core count for maximum performance - On shared HPC headnodes, the conservative default (half cores) prevents overloading
- Use different low frequency treatments (
lowvibmeth 0,1,2,3) - Compare with literature values
- Validate against experimental data
- Use
-prtlevel 2or-prtlevel 3for more detailed output - Use
-prtvib 1for detailed vibration analysis (auto-enabled at level 3) - Check
basename.vibconfor individual contributions - Review scan files for temperature/pressure dependence
const double R = 8.3144648; // Gas constant (J/mol/K)
const double kb = 1.3806503e-23; // Boltzmann constant (J/K)
const double NA = 6.02214179e23; // Avogadro number
const double h = 6.62606896e-34; // Planck constant (J·s)
const double au2kJ_mol = 2625.5; // Hartree to kJ/mol
const double au2cm_1 = 219474.6363; // Hartree to cm⁻¹- File format detection
- Molecular geometry extraction
- Frequency and energy parsing
- Symmetry analysis
- Mass assignment and moment of inertia calculation
- Partition function evaluation
- Thermodynamic property computation
- Low frequency treatment application
- Console results display
- File output creation
- Error handling and validation
- Dynamic arrays for molecular data
- Vector containers for flexible sizing
- Efficient parsing of large output files
- Minimal memory footprint for typical calculations
- Comprehensive validation of input parameters
- Graceful degradation for invalid data
- Detailed error messages with suggestions
- File existence checks before processing
- OpenMP parallelization (optional) for temperature/pressure scans, vibrational loops, and symmetry calculations
- Auto-strategy selection: OpenThermo chooses between parallelizing the T/P scan (outer) or the vibrational loop (inner) based on workload characteristics
- HPC-friendly defaults: Uses half of physical CPU cores to avoid headnode overload
- Efficient algorithms for partition function calculation
- Optimized mathematical operations
When built with OpenMP enabled (make OPENMP=1 or cmake -DENABLE_OPENMP=ON), OpenThermo automatically parallelizes computation with conservative, HPC-friendly defaults.
Thread management:
- Default: Half of detected physical CPU cores (minimum 1)
- HPC scheduler: Automatically detects allocated CPUs from
SLURM_CPUS_PER_TASK,PBS_NUM_PPN,PBS_NP,NSLOTS,LSB_DJOB_NUMPROC— when detected, uses half of the scheduler allocation instead of hardware cores - Override: Use
-omp-threads N(CLI) oromp-threads = N(settings.ini); CLI takes precedence - Safety clamp: If
Nexceeds effective cores (scheduler or hardware), the default is used with a warning - Rationale: Prevents overloading shared HPC headnodes while leaving resources for other users and system processes
Strategy auto-selection:
- Outer strategy: When many T/P scan points are available (≥ nthreads), the T/P loop is parallelized and vibrational calculations run serially inside each iteration
- Inner strategy: When few T/P points but many vibrational frequencies (>50), the vibrational loop is parallelized instead
- The strategy is selected automatically — users don't need to understand the internal parallelism patterns
Examples:
# Default: uses half of physical cores, auto-selects strategy
OpenThermo molecule.log -T 100 5000 1
# Explicit thread count for a dedicated compute node
OpenThermo molecule.log -T 100 5000 1 -omp-threads 8
# Verbose output shows thread count and strategy selection
OpenThermo molecule.log -T 100 500 10 -prtlevel 2Example output notifications:
# Default (4 physical cores detected, no scheduler)
OpenMP threads: 2 (default: half of 4 physical cores). Use -omp-threads N to override.
Strategy: outer (parallel T/P scan, 32 points, 30 frequencies)
# On HPC with SLURM_CPUS_PER_TASK=8
OpenMP threads: 4 (default: half of 8 scheduler-allocated CPUs). Use -omp-threads N to override.
Strategy: outer (parallel T/P scan, 32 points, 30 frequencies)
# Explicit valid request
OpenMP threads: 4 (user-specified)
Strategy: inner (serial T/P scan, parallel vibrational, 200 frequencies)
# Excessive request (clamped)
Warning: Requested 100 threads exceeds 4 physical cores. Using default (2).
Use -omp-threads <= 4 to use more threads.
The code compiles and runs correctly both with and without OpenMP.
OpenThermo includes a regression test suite that validates thermodynamic calculations against reference values across all supported formats.
# Run the full test suite
make test
# Run with verbose output (shows details on failure)
python3 tests/run_tests.py --verbose
# Run a single test by ID
python3 tests/run_tests.py --test gaussian_h2co_freqThe suite includes 25 tests organized by category:
Format coverage (10 tests) — one per supported QC program at default settings:
| ID | Format | Molecule |
|---|---|---|
gaussian_h2co_freq |
Gaussian | H2CO |
gaussian_large |
Gaussian | Large molecule |
gaussian_c2h5 |
Gaussian | C2H5 |
orca_optfreq |
ORCA | Opt+freq |
orca_ethanol |
ORCA | Ethanol |
gamess_ch4 |
GAMESS | CH4 |
gamess_h2co |
GAMESS | H2CO |
nwchem_nh2coh |
NWChem | NH2COH |
cp2k_co2_freq |
CP2K | CO2 |
vasp_co_freq |
VASP | CO |
Option coverage (9 tests) — different temperatures, pressures, low-frequency methods, scaling, concentration, imaginary frequency handling, and condensed phase mode.
Output file tests (3 tests) — verify .otm, .vibcon, and temperature scan (.UHG/.SCq) file generation.
Error handling (2 tests) — non-existent and invalid input files.
Batch/ensemble (1 test) — conformer ensemble with Boltzmann averaging.
Each regression test compares thermodynamic values against reference values with defined tolerances.
After modifying calculation logic, regenerate the reference file:
make test-generateThis runs OpenThermo on all test inputs and writes the results to tests/reference_values.json.
Tests run automatically on every push via GitHub Actions:
- Linux and macOS: Build + regression tests (serial and OpenMP at 1 and 4 threads)
- Windows: MSYS2/MinGW build + regression tests (serial and OpenMP)
- AddressSanitizer: Separate build with ASan on Linux to detect memory errors
- ThreadSanitizer: OpenMP build with TSan on Linux to detect data races
We welcome contributions to OpenThermo! Here's how you can help:
-
Fork the repository on GitHub
-
Clone your fork:
git clone https://github.com/your-username/openthermo.git cd openthermo -
Set up development environment:
make clean && make debug # Build with debug symbols OpenThermo --help # Verify installation
-
Create a feature branch:
git checkout -b feature/your-feature-name
- Language: C++17 with clang-format styling
- Documentation: Doxygen comments for all public APIs
- Testing: Add tests for new features
- Style: Follow LLVM coding standards
- Commits: Use descriptive commit messages
-
Code Quality:
- Ensure all code compiles without warnings
- Add comprehensive documentation
- Follow existing code patterns and conventions
- Test your changes thoroughly
-
Documentation:
- Update README.md for new features
- Add Doxygen comments to new functions
- Update examples if needed
-
Testing:
- Test with various quantum chemistry output files
- Verify results against known reference values
- Check edge cases and error conditions
-
Pull Requests:
- Provide clear description of changes
- Reference any related issues
- Ensure CI/CD checks pass
- Request review from maintainers
- Important Note: OpenThermo is not fully tested agaist several ouputs
- Bug Reports: Use the issue template with sample input files
- Feature Requests: Describe the use case and expected behavior
- Performance Issues: Include system specs and benchmark data
# Build and test
make clean && make
make test
# Generate documentation
doxygen Doxyfile
# Format code
clang-format -i src/*.cpp src/*.h
# Run static analysis
clang-tidy src/*.cpp -- -std=c++17Cite this project if you use OpenThermo for your research:
@article{pham_openthermo_2025,
title = {{OpenThermo} {A} {Comprehensive} {C}++ {Program} for {Calculation} of {Thermochemical} {Properties}},
url = {https://www.researchgate.net/doi/10.13140/RG.2.2.22380.63363},
doi = {10.13140/RG.2.2.22380.63363},
urldate = {2025},
author = {Pham, Le Nhan},
year = {2025},
note = {Publisher: Preprint},
}OpenThermo is licensed under the MIT License.
- Le Nhan Pham: Developer and maintainer
- Romain Despoullains: developer
- Open-source community: For contributions and feedback
- Quantum chemistry community: For validation and testing
OpenThermo v0.001.6 - High-performance molecular thermochemistry calculations Developed by Le Nhan Pham | GitHub
For more information, visit the project documentation or use OpenThermo --help