Polymer Molecular Dynamics toolkit, easy to learn, fast to code, ready for polymer property production
Documentation: https://polymer-molecular-dynamics.netlify.app
Source Code: https://github.com/Ramprasad-Group/Polymer-Molecular-Dynamics
PMD is a modern, fast, python framework for building LAMMPS input and data files for predicting polymer properties
The key properties are:
- Glass transition temperature (Tg) - [Guide] [Scripts]
- Gas diffusivity - [Guide] [Scripts]
- Solvent diffusivity - [Guide] [Scripts]
- Viscosity - [Guide] [Scripts]
- Young's modulus and tensile strengths - [Guide] [Scripts]
- Thermal conductivity - In-progress
- Solubility - Planned
- Melting temperature (Tm) - Planned
pip install pmd
Below is an example where we use PMD to generate LAMMPS data and input files for Tg measurement with a list of SMILES strings.
import pmd
# A list of polymer SMILES strings to create simulations for
smiles_list = ['*CC*', '*CC(*)CC', '*CC(*)CCCC', '*CC(*)c1ccccc1']
for smiles in smiles_list:
# Define polymer and system specs
syst = pmd.System(smiles=smiles,
density=0.8,
natoms_total=5000,
natoms_per_chain=150,
builder=pmd.EMC(force_field='pcff'))
# Customize LAMMPS simulation
lmp = pmd.Lammps(read_data_from=syst,
procedures=[
pmd.Minimization(min_style='cg'),
pmd.Equilibration(Teq=600, Tmax=800),
pmd.TgMeasurement(Tinit=600, Tfinal=200)
])
# Create job scheduler settings
job = pmd.Torque(run_lammps=lmp,
jobname=smiles,
project='Your-project-id',
nodes=2,
ppn=24,
walltime='48:00:00')
# Generate all necessary files at each SMILES folder
run = pmd.Pmd(system=syst, lammps=lmp, job=job)
run.create(output_dir=smiles, save_config=True)
PMD can generate config file in YAML format out of the box, which helps you keep track of all the parameters used for each simulation. At the same time, you can build PMD systems directly via the config file from the command line. For example, run the pmd-load
command with the following config.yaml
to get exact same setup as the above example python script (but only for '*CC*').
$ pmd-load config.yaml [-o output_dir]
pmd.System:
smiles: "*CC*"
density: 0.8
builder:
pmd.EMC:
force_field: pcff
natoms_total: 5000
natoms_per_chain: 150
data_fname: data.lmps
pmd.Lammps:
read_data: data.lmps # This file name has to match data_fname if build from a yaml file
get_functional_form_from: # A PMD Builder has to be provided if build from a yaml file
pmd.EMC:
force_field: pcff
procedures:
- pmd.Minimization:
min_style: cg
- pmd.Equilibration:
Teq: 600
Tmax: 800
- pmd.TgMeasurement:
Tinit: 600
Tfinal: 200
lmp_input_fname: lmp.in
pmd.Torque:
run_lammps: lmp.in # This file name has to match the above lmp_input_fname if build from a yaml file
jobname: "*CC*"
project: Your-project-id
nodes: 2
ppn: 24
walltime: "48:00:00"
job_fname: job.pbs