A high-performance, GPU-accelerated molecular dynamics simulator for studying the Lennard-Jones system with real-time 3D visualization and comprehensive thermodynamic analysis.
LJ Fusion is a sophisticated computational chemistry application that simulates the behavior of particles interacting via the Lennard-Jones potential. The simulator leverages NVIDIA CUDA for GPU acceleration, enabling real-time simulation of systems with thousands of particles at ~60 fps.
The project demonstrates:
- CUDA GPU Computing: High-performance force calculations on NVIDIA GPUs
- Molecular Dynamics: Velocity Verlet integration with multiple ensemble supports
- Real-time Visualization: OpenGL 3D rendering with interactive controls
- Thermodynamic Analysis: Computation of thermodynamic properties and statistical distributions
- Multi-platform Support: Cross-platform deployment via CMake
| Feature | Description |
|---|---|
| Ensembles | Microcanonical (NVE), Canonical (TVN) with thermostat |
| Boundary Conditions | Periodic, Hard-wall, and Open expansion modes |
| GPU Acceleration | CUDA-optimized force calculations for 10-100x speedup |
| Visualization | Real-time 3D particle rendering with OpenGL |
| Analysis Tools | RDF, velocity distributions, thermodynamic properties |
| CLI Tasks | Batch simulations for phase diagrams and fluctuation analysis |
The main Qt5-based GUI provides interactive control and real-time visualization:
The simulator can explore all major phases of the Lennard-Jones system:
Low density, high temperature regime showing diffuse particle distribution.
Coexistence of gas and liquid phases.
High density, low temperature showing dense particle packing.
The Lennard-Jones potential describes the interaction between two particles:
Where:
- Ξ΅ (epsilon): Depth of the potential well (energy scale)
- Ο (sigma): Finite distance at which inter-particle potential is zero
- r: Distance between particles
The simulator uses reduced units:
- T* = k_B T / Ξ΅ (Reduced temperature)
- Ο* = Ο ΟΒ³ (Reduced density)
- t* = t β(mΞ΅/ΟΒ²) (Reduced time)
This allows study across different materials without unit conversion.
- CMake 3.18+
- C++11 compatible compiler
- Qt5 (for GUI) - optional for CLI tools
- NVIDIA CUDA Toolkit (optional, for GPU acceleration)
- OpenGL development libraries
git clone https://github.com/ellay21/LJFusion.git
cd LJFusion
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)./src/gui/QtLennardJonesIsotherm Simulation - Generate phase diagram data:
./src/tasks/run-isotherm <temperature> <density> <steps>Fluctuations Analysis - Study system fluctuations:
./src/tasks/run-fluctuations <temperature> <density> <duration>Semi-GCE Analysis - Grand canonical ensemble analysis:
./src/tasks/semiGCEfluctuations <parameters>LJFusion/
βββ CMakeLists.txt # Root CMake configuration
βββ src/
β βββ library/ # Core MD library (CPU/GPU)
β β βββ MDSystem.h/cpp # Main molecular dynamics engine
β β βββ MDSystem.cu # CUDA GPU kernels
β β βββ splinefunction.* # Utility functions
β βββ gui/ # Qt5 GUI application
β β βββ main.cpp # Application entry point
β β βββ mainwindow.* # Main window UI
β β βββ glwidget.* # OpenGL 3D viewport
β β βββ constants.* # UI constants
β βββ tasks/ # Command-line analysis tools
β β βββ run-isotherm/ # Isotherm simulation task
β β βββ run-fluctuations/ # Fluctuations analysis
β β βββ semiGCEfluctuations/ # Semi-GCE analysis
β βββ extra/ # Utility modules
βββ thirdparty/ # External dependencies
β βββ QCustomPlot/ # Plot visualization
β βββ MersenneTwister/ # RNG implementation
βββ input/ # Sample input data files
βββ .github/workflows/ # GitHub Actions CI/CD
βββ LICENSE # GPLv3 License
Custom CMake options:
cmake .. \
-DCMAKE_BUILD_TYPE=Release # Release or Debug
-DCMAKE_CUDA_COMPILER=OFF # Disable GPU acceleration
-DCMAKE_PREFIX_PATH=/path/to/Qt5 # Custom Qt5 locationTypical performance (NVIDIA RTX 2080 Ti):
- Single precision (float): ~15 GFLOPS sustained
- Particle count: Up to 100,000 particles at 60 FPS
- Integration accuracy: Velocity Verlet, O(dtΒ²)
- Speedup over CPU: 10-100x depending on system size
The simulator uses the Velocity Verlet algorithm for stable, reversible dynamics:
- Periodic: Particles wrap around domain boundaries
- Hard-wall: Elastic collisions with fixed walls
- Open: Particles can leave the domain
- NVE (Microcanonical): Constant volume & energy
- NVT (Canonical): Constant volume & temperature with Berendsen thermostat
Sample data files in /input/ directory test various scenarios:
N400.Tst1.4.isotherm- Low temperature isothermN400.Tst1.708.rho0.05- Gas phase dataN400.Tst1.4.rho0.05- Transition region
This project is licensed under the GNU General Public License v3.0. See LICENSE for details.
Contributions are welcome! Areas for enhancement:
- Additional ensemble implementations (NPT, ΞΌVT)
- GPU optimization techniques
- Web-based visualization
- Performance profiling and optimization
For issues, feature requests, or questions:
- Open an issue on GitHub Issues
- Check existing documentation in the project
Last Updated: November 18, 2025
