Package: dflowTC
Table of contentsAbout ThermalConductivity-WorkflowWorkflow FrameworkPrepare Input FileAbout ThermalConductivity-WorkflowThermalConductivity-Workflow is designed to compute thermal conductivity of different materials based on Non-Equilibrium & Equilibrium Molecular Dynamics Simulations.It is supported bydflow, a Python framework for constructing scientific computing workflows.Environment Installationdflow, the necessary package in the host machinecomputational environment, needed in both host and computing machineInstallation of dflowWith 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 itsGithub page. Prerequisites of dflow usage are Docker and Kubenetes, where their main pages (Docker&Kubenetesinclude how you can install them. Besides, dflow repo also provides with easy-install shell scripts ondflow/scriptsto install Docker & Kubenetes & dflow and make port-forwarding.Installation of computational environmentThe computational environment is supported by several third-party python packages.The following packages should be installed  both on host & computing machines:deepmd-kit & plumed lammpsdpdatamatplotlibsportranOne 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-kiteasy-installcondacreate-ndeepmddeepmd-kit=*=*gpulibdeepmd=*=*gpulammpscudatoolkit=11.6horovod-chttps://conda.deepmodeling.com-cdefaultsOne can install other packages with following commands:condainstall-cconda-forgedpdata
pipinstallsportran
condainstall-cconda-forgematplotlib-baseWorkflow FrameworkEMD(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 FilesFirstly, 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 formatrun.py, the main code to run the whole workflow, run_emd.py and run_nemd.py have been preparedparameters.json, the settings for simulations and tasksinput_gen.py, the code to generate corresponding lammps input fileforce field(if needed), the force field file used in lammps MDPrepare run.pyThe Functionslurm_remote_executorshould be setted for using remote computing resources. The varible'your-jobname','your-env'and'your-workdir'should be replaced in actual useslurm_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:00source activate your-env-name""",workdir="/your-workdir"+"/{{workflow.name}}/{{pod.name}}",)The relevant settings of dflow should also be setted in run.pyPrepare parameters.jsonparameters.json of EMDparameters.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 parametersParametersTypeDescriptiontype_mapList of strparameters.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}