# FrictionSim2D Publication Dataset

**DOI**: [10.82186/gs4dc-90a11](https://doi.org/10.82186/gs4dc-90a11)

This dataset contains LAMMPS friction simulation results for 2D materials, produced using [FrictionSim2D](https://github.com/mjvalder/FrictionSim2D.git). It accompanies the publication and is provided as:

- **`friction2d_archive.aiida`** — a ZIP-format AiiDA archive with full simulation provenance and all result data.

---

## Contents

The dataset contains **10 simulation sets**:

| Label | Type | Description |
|---|---|---|
| `251113-afm` | AFM | Multi-material AFM survey (~40 materials, 100×100 Å, layers 1–5) |
| `251125-sheetonsheet` | Sheet-on-sheet | Multi-material sheet-on-sheet survey using Jiang SW potentials |
| `260227-mos2_jing2` | Sheet-on-sheet | h-MoS₂, 5 layers, Jiang SW potential (SW2) |
| `260227-mos2_jing3` | Sheet-on-sheet | h-MoS₂, 5 layers, Jiang SW potential (SW3) |
| `260227-rebomos` | Sheet-on-sheet | h-MoS₂, 5 layers, REBOMoS potential |
| `260227-sevik_mos2` | Sheet-on-sheet | h-MoS₂, 5 layers, Sevik SW potential |
| `260227-sw_lammps` | Sheet-on-sheet | h-MoS₂, 5 layers, Jiang SW potential (SW1) |
| `260227-tmd` | Sheet-on-sheet | h-MoS₂, 5 layers, Jiang SW potential (SW4) |
| `260312-force_rebomos` | Sheet-on-sheet | h-MoS₂ force-displacement, 5 layers, REBOMoS potential |
| `260312-force_sevik` | Sheet-on-sheet | h-MoS₂ force-displacement, 5 layers, Sevik SW potential |

Each set contains full time-series lateral force, normal force, and displacement data at multiple loads and simulation cell sizes.

---

## Requirements

A full installation of FrictionSim2D (including all optional dependencies) is required to properly manipulate this dataset. Alternatively, a raw SQLite database file can be found in the .aiida zip folder.  See installation.md for help with installation. 

---

## Importing the AiiDA Archive

The file `friction2d.aiida` is a ZIP-format AiiDA archive. Download it from the DOI above, then:

### 1. Set up AiiDA (first time only)

```bash
FrictionSim2D aiida setup
```

### 2. Import the archive

```bash
FrictionSim2D aiida import-archive friction2d.aiida
```

### 3. Verify

```bash
FrictionSim2D aiida list-sets
```

You should see all 10 simulation sets listed.

---

## Export JSON results files from the AiiDA archive

After importing the archive (see above), export JSON result files for use with the plotting pipeline:

```bash
mkdir -p \[your directory\]

for label in 251113-afm 251125-sheetonsheet \
             260227-mos2_jing2 260227-mos2_jing3 \
             260227-rebomos 260227-sevik_mos2 \
             260227-sw_lammps 260227-tmd \
             260312-force_rebomos 260312-force_sevik; do
    FrictionSim2D aiida dump "$label" --output-dir \[your directory\]/\${label}
done
```

Then copy `plots_publication.json`, `trib_index.json`, `mos2_comparison_data.json`, and `mos2_reaxff_comparison.json` into \[your directory\] and run:

```bash
cd \[your directory\]/
FrictionSim2D postprocess plot plots_publication.json --output-dir plots/
```

---

## Rebuild simulation input files from provenance

If you want to re-run the simulations from scratch (e.g., with a different potential or cell size), FrictionSim2D can reconstruct the complete LAMMPS input directory tree from the stored provenance:

```bash
FrictionSim2D aiida rebuild 251125-sheetonsheet --output-dir ./rebuilt/ --hpc-scripts
```

The reconstructed tree is identical to what `FrictionSim2D run sheetonsheet` produced when they were first run. The simulations can be launched immediately. This ensures reproducibility of the results. 

---

## Generating the Publication Figures

All figures in the publication are generated by `plots_publication.json`. The config defines:

| Figure | Plot type | Description |
|---|---|---|
| `lf_vs_load_100x100_sheetonsheet.png` | `summary` | Lateral force vs normal load, sheet-on-sheet |
| `lf_vs_load_100x100_afm.png` | `summary` | Lateral force vs normal load, AFM (7 materials) |
| `lf_vs_time_h_MoS2_l2_afm.png` | `timeseries` | Time-series lateral force, AFM, h-MoS₂ |
| `tribindex_vs_cof_sheetonsheet.png` | `scatter_comparison` | COF vs tribological figure of merit |
| `lf_vs_nf_100x100_mos2_sx_sy.png` | `summary` | LF vs NF for all MoS₂ potentials |
| `lf_vs_time_h_MoS2_l2_v_com_top.png` | `timeseries` | Displacement + lateral force time-series |
| `stick_slip_h_MoS2_v_com_top_0.1GPa_rebomos.png` | `stick_slip_analysis` | Stick-slip analysis (REBOMoS) |
| `stick_slip_h_MoS2_v_com_top_0.1GPa_sevik.png` | `stick_slip_analysis` | Stick-slip analysis (SW-Sevik) |
| `cof_histogram_mos2.png` | `cof_histogram` | COF bar chart, all MoS₂ potentials |

Run all figures at once:

```bash
FrictionSim2D postprocess plot plots_publication.json --output-dir plots/
```

---

## File Index

| File | Description |
|---|---|
| `plots_publication.json` | Master plot configuration (reproduces all publication figures) |
| `trib_index.json` | Lubricating figure-of-merit values from DFT high-throughput screening \[1\] |
| `mos2_comparison_data.json` | Literature MoS₂ COF vs load data from MD simulations \[2\] |
| `mos2_reaxff_comparison.json` | Literature MoS₂ ReaxFF and experimental nanoscale friction data \[3\] |
| `Images/` | All plots and graphs present in "FrictionSim2D: A High-Throughput Molecular Simulation Framework to Screen the Friction of Two-Dimensional Materials" |

---

## References

\[1\] Tang, K., Qi, W., Ru, G., & Liu, W. (2024). Screening of Low-Friction Two-Dimensional Materials from High-Throughput Calculations Using Lubricating Figure of Merit. *Friction*, 12(8), 1897–1908. https://doi.org/10.1007/s40544-024-0901-8

\[2\] Hu, C., Yi, C., Bai, M., Lv, J., & Tang, D. (2020). Molecular dynamics study of the frictional properties of multilayer MoS₂. *RSC Advances*, 10(30), 17418–17426. https://doi.org/10.1039/D0RA00995D

\[3\] Serpini, E., Rota, A., Valeri, S., Ukraintsev, E., Rezek, B., Polcar, T., & Nicolini, P. (2019). Nanoscale frictional properties of ordered and disordered MoS₂. *Tribology International*, 136, 67–74. https://doi.org/10.1016/j.triboint.2019.03.004
