Skip to main content

Table of contents

About ThermalConductivity-Workflow

ThermalConductivity-Workflow is designed to compute thermal conductivity of different materials based on Non-Equilibrium & Equilibrium Molecular Dynamics Simulations.It is supported by dflow, a Python framework for constructing scientific computing workflows.

Environment Installation

  • dflow, the necessary package in the host machine
  • computational environment, needed in both host and computing machine

Installation of dflow

With the power of dflow, users can easily minitor the whole workflow of ThermalConductivity tasks and dispatch their tasks to various computational resources. Before you use it, you should have dflow installed on your host computer (your PC or a remote server).

It it necessary to emphasize that, the computational nodes and monitor nodes are seperated. With dflow, you can deploy dflow and ThermalConductivity on your PC and achieve expensive computation on other resources (like Slurm and Cloud Platform) without any further effort.

Instructions of dflow installation are provided in detail on its Github page. Prerequisites of dflow usage are Docker and Kubenetes, where their main pages (Docker & Kubenetes include how you can install them. Besides, dflow repo also provides with easy-install shell scripts on dflow/scripts to install Docker & Kubenetes & dflow and make port-forwarding.

Installation of computational environment

The computational environment is supported by several third-party python packages.The following packages should be installed both on host & computing machines:

  • deepmd-kit & plumed lammps
  • dpdata
  • matplotlib
  • sportran

One may create a GPU environment containing the GPU version of DeePMD-kit and LAMMPS as following commands.Or look for more detailed installation options in deepmd-kit easy-install

conda create -n deepmd deepmd-kit=*=*gpu libdeepmd=*=*gpu lammps cudatoolkit=11.6 horovod -c https://conda.deepmodeling.com -c defaults

One can install other packages with following commands:

conda install -c conda-forge dpdata
pip install sportran
conda install -c conda-forge matplotlib-base

Workflow Framework

EMD(Equilibrium Molecular Dynamics Simulations)

The process of computing thermal conductivities with EMD is as follows:

graph TD
A[Initial Structure and Force Field] -->|LAMMPS| B{NVT}
B --> C[Structure 1]
B --> D[Structure 2]
B --> E[...]
B --> F[Structure N]
C -->|randon velocity| C1{NVE}
D -->|randon velocity| D1{NVE}
E -->|randon velocity| E1{NVE}
F -->|randon velocity| F1{NVE}
C1 --> G[Heat Fluxes and Mass Fluxes]
D1 --> G[Heat Fluxes and Mass Fluxes]
E1 --> G[Heat Fluxes and Mass Fluxes]
F1 --> G[Heat Fluxes and Mass Fluxes]
G -->|Sportran| H{Cesptral Analysis}
H --> I[Theraml Conductivity]

NEMD(Non-Equilibrium Molecular Dynamics Simulations)

The process of computing thermal conductivities with NEMD is as follows:

graph TD
A[Initial Cell] -->B{Cell Expansion along One Axis}
B -->|e.g. 6x3x2| C[Cell 1]
B -->|e.g. 15x3x2| D[Cell 2]
B -->|...| E[...]
B -->|e.g. 50x3x2| F[Cell N]
C -->|Langevin| C1{NEMD}
D -->|Langevin| D1{NEMD}
E -->|Langevin| E1{NEMD}
F -->|Langevin| F1{NEMD}
C1 --> C2[Temperature Gradient and Kappa 1]
D1 --> D2[Temperature Gradient and Kappa 2]
E1 --> E2[Temperature Gradient and Kappa ...]
F1 --> F2[Temperature Gradient and Kappa N]
C2 -->G{Linear extrapolation}
D2 -->G{Linear extrapolation}
E2 -->G{Linear extrapolation}
F2 -->G{Linear extrapolation}
G -->H[Thermal Conductivity]

Prepare Input Files

Firstly, we introduce the input files required for the ThermalConductivity.Input files in example/ have been prepared. The following files is needed:

  • data.lammps, the input structure file of lammps format
  • run.py, the main code to run the whole workflow, run_emd.py and run_nemd.py have been prepared
  • parameters.json, the settings for simulations and tasks
  • input_gen.py, the code to generate corresponding lammps input file
  • force field(if needed), the force field file used in lammps MD

Prepare run.py

The Function slurm_remote_executor should be setted for using remote computing resources. The varible 'your-jobname','your-env' and 'your-workdir' should be replaced in actual use

slurm_remote_executor = SlurmRemoteExecutor(
       host="",
       port=22,
       username="",
       password="",
       header="""#!/bin/bash
#SBATCH --job-name="your-jobname"
#SBATCH --error=./err.txt
#SBATCH --output=./stdout.inf
#SBATCH --gpus=1
#SBATCH --time=1000:00:00
source activate your-env-name
       """,
       workdir="/your-workdir"+"/{{workflow.name}}/{{pod.name}}",
   )

The relevant settings of dflow should also be setted in run.py

Prepare parameters.json

parameters.json of EMD

parameters.json for emd in /example/emd/H2O

{
    "type_map": ["C","H"],
    "mass_map": [12.0107,1.00794],
    "temperature":300,
    "time_step": 0.0005,
    "thermo_print_interval": 10,
    "traj_print_interval": 1000,
    "structure":"./data.pentacene3x3x3",
    "is_two-body-potential":false,
    "force_field":["frozen_model_compressed.pb"],
    "load_force_field":"pair_style deepmd frozen_model_compressed.pb\npair_coeff * *\n",
    "num_configurations":50,
    "NVT_steps":1000000,
    "NVE_steps":2000000
}

Description of parameters

Parameters Type Description
type_map List of str

parameters.json of NEMD

{
    "type_map": ["H","O"],
    "mass_map": [1,16],
    "time_step": 0.0005,
    "supercell": [[4,1,1],[5,1,1],[6,1,1],[8,1,1],[10,1,1],[15,1,1]],
    "temperature":408,
    "temperature_difference":30,
    "linear_scale":[0.10,0.90],
    "thermo_print_interval": 1000,
    "traj_print_interval": 1000,
    "structure":"./data.water",
    "force_field":["frozen_model_compressed.pb"],
    "load_force_field":"pair_style deepmd frozen_model_compressed.pb\npair_coeff * *\n",
    "langevin_damp":0.5,
    "NVT_steps":20000,
    "NEMD_equilibrium_steps":200000,
    "NEMD_production_steps":2000000,
    "num_configurations":10
}

Metadata

Release files for dflow-thermal-conductivity 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dflow-thermal-conductivity 0.0.2
File Size Uploaded Provenance Actions
dflow_thermal-conductivity-0.0.2.tar.gz 15.0 kB Without provenance Details for dflow_thermal-conductivity-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dflow-thermal-conductivity 0.0.2
File Interpreter ABI Platform Actions
dflow_thermal_conductivity-0.0.2-py3-none-any.whl Python 3 none any Details for dflow_thermal_conductivity-0.0.2-py3-none-any.whl

Total release size: 34.6 kB

Release files / dflow_thermal-conductivity-0.0.2.tar.gz

Download URL dflow_thermal-conductivity-0.0.2.tar.gz
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
54b11ea9be15af25aa2db8525960e66fc95582c1dbb9b090418e294a357359d6
BLAKE2b-256 checksum
How to use checksums
8d4a54135edcd98e730a840060464be0eb32f65caf61833558637119098b6fdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.13

Release files / dflow_thermal_conductivity-0.0.2-py3-none-any.whl

Download URL dflow_thermal_conductivity-0.0.2-py3-none-any.whl
Size 19.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5e936c5f5fb5240d248e8c579e58927d23ed03ee519462ff66a3a30390604343
BLAKE2b-256 checksum
How to use checksums
08d0edd9a8bb3e0f304145bcd8085c9b68875a4913a97b020cffc923efbd1df9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.13

Security for dflow-thermal-conductivity 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page