Project 02 · Case study
Particle-based modelling

Methane Molecular Dynamics Solver

A custom NVT simulation for studying pressure, phase behaviour and molecular structure across gas and liquid states.

  • Python
  • Lennard-Jones
  • Velocity Verlet
  • Nosé-Hoover
Compare molecular motion Liquid · 358.4 kg/m³ · 400 K
Force field TraPPE methane · σ = 3.73 Å · ε/kB = 148 K
Integration Velocity Verlet with periodic boundary conditions
Temperature control Nosé-Hoover thermostat · selected damping time 25 fs
Solver architecture

Built from the particle level

The workflow covers system initialization, intermolecular forces, integration, thermostat control and simulation output.

01

Initialize

Create a cubic particle configuration and a temperature-scaled velocity field.

02

Interact

Evaluate truncated Lennard-Jones forces using periodic minimum-image distances.

03

Integrate

Advance particle positions and velocities with the Velocity Verlet algorithm.

04

Control

Maintain the target temperature through a deterministic Nosé-Hoover thermostat.

Verification

Checked against reference MD data

Temperature, pressure and energy behaviour were compared with a LAMMPS reference simulation before using the solver for the phase study.

Kinetic, potential and total energy from the custom molecular dynamics solver compared with verification data
The custom solver follows the reference energy evolution after the initial transient.
Equilibrium Approximately 2,000 steps

At 150 K and 358.4 kg/m³, the total energy settles into stable fluctuations after the initial transient.

Thermostat tuning 25 fs damping time

The selected value produced the smallest mean absolute temperature error among the tested settings.

Application mode NVT methane simulations

The verified solver was then used across two densities and four temperatures.

Phase evolution

The same model, two molecular states

At 400 K, density changes the spatial organisation more strongly than the particle model itself.

Liquid state 358.4 kg/m³ · 400 K
Initial ordered liquid-density methane configuration
Initial configuration
Evolved dense methane configuration
Evolved configuration
Gas state 1.6 kg/m³ · 400 K
Initial low-density methane configuration
Initial configuration
Evolved dispersed methane gas configuration
Evolved configuration
Thermodynamic response

Pressure across temperature and density

Simulations were evaluated at 100, 200, 300 and 400 K for the liquid-density and gas-density states.

Pressure rises with temperature in both cases. Agreement with the real-fluid reference is strongest from 200 to 400 K, while the simplified Lennard-Jones model shows its largest deviation at 100 K.

Pressure-temperature comparison between molecular dynamics results and CoolProp for liquid and gas methane states
Pressure-temperature response for 358.4 and 1.6 kg/m³.
Radial structure

Molecular order through radial distribution

The radial distribution function separates the organised neighbour shells of the liquid from the weaker structure of the gas.

Liquid methane radial distribution functions from 100 to 400 K
Liquid A strong first shell appears near 4 Å. Lower temperature produces greater local ordering.
Gas methane radial distribution functions from 100 to 400 K
Gas The lower-density curves are flatter and noisier, with the strongest clustering at 100 K.
Engineering outcome

A reusable foundation for molecular transport studies

The project produced a verified methane MD workflow covering forces, integration, temperature control, thermodynamic response and molecular structure.

The same solver later became the basis for a separate self-diffusion study using unwrapped trajectories, mean-squared displacement and finite-size correction.

Explore the methane self-diffusion study
  • Custom MD solver
  • Reference validation
  • Phase comparison
  • RDF analysis