Install
openclaw skills install @sanyangye/chatmosp-kmc-simulatorKMC (Kinetic Monte Carlo) simulation engine of the chatMOSP system. Invokes kmc_standalone.py via Wine to run the Windows main.exe engine, executes catalyst surface reaction kinetic simulations, and produces TOF / coverage results. Uses utils/plot_kmc_data.py to generate coverage.png, coverage_steps.png, tof.png, and tof_time.png (4 images total). Triggers: after parameter-builder has built KMC parameters and the user has confirmed via the 5-option prompt, this skill executes the KMC simulation.
openclaw skills install @sanyangye/chatmosp-kmc-simulatorLanguage routing / 语言路由 Detect the user's language from the latest message.
- If the user writes in English, continue with this English file and respond in English.
- If the user writes in Chinese, read
SKILL.mdin this same directory and respond in Chinese. Always match the response language to the user's input language.
ini.xyz copied to KMC task directory (if applicable)mosp-for-chatMOSP installed, with kmc_standalone.py, MOSP_database/, and engine/main.exeinput.json — KMC must independently prepare complete parametersThe KMC engine is the Windows main.exe, requiring Wine to run.
which wine64 || which wine
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install wine64 wine32
When KMC steps ≥ 20M, MUST warn user before execution:
⚠️ Calculation Time Warning:
Current KMC steps: {N}, estimated time: ~{estimated_hours} hours.
(Reference: 20M steps ≈ 12 hours, 40M steps ≈ 24+ hours)
Continue with KMC simulation?
| Steps | Estimated time |
|---|---|
| 20M | ~12 hours |
| 40M | ~24 hours or longer |
| More | Linear growth |
Note: Running multiple conditions (e.g., multiple temperatures) requires separate calculations; total time multiplies.
| Field | Type | Description |
|---|---|---|
| Element | string | Metal element (Pd, Pt, Au, etc.) |
| Lattice constant | string | Lattice constant (Å) |
| Crystal structure | string | Crystal structure (FCC, BCC, HCP) |
| Temperature | string | Temperature (K) |
| Pressure | string | Pressure (Pa) |
| flag_MSR | boolean | MUST be false |
| flag_KMC | boolean | MUST be true |
| KMC | object | KMC parameter object |
| Field | Type | Description |
|---|---|---|
| nLoop | string | Simulation steps |
| record_int | string | Recording interval |
| nspecies | number | Number of species |
| nproducts | number | Number of products |
| nevents | number | Number of reaction events |
| nevents_mob | number | Number of mobility events |
| s1 / s2 | string | Species 1/2 definitions (JSON string) |
| p1 | string | Product 1 definition (JSON string) |
| e1 ~ e7 | string | Reaction events 1~7 (JSON string) |
| li | array | Lattice interaction matrix |
⚠️ CRITICAL: Gas entropy
s1.S_gas/s2.S_gasMUST match MSR'sGas1_S/Gas2_S(use the same calculation formula).
KMC task directory must be under MSR directory:
mosp-for-chatMOSP/OUTPUT/{msr_task_name}/
└── KMC_{steps}steps/ ← KMC task directory
├── input.json ← outside INPUT/
├── ini.xyz ← copied from MSR
├── coverage.png ← generated after run
├── coverage_steps.png ← generated after run
├── tof.png ← generated after run
├── tof_time.png ← generated after run
├── INPUT/ ← should be empty before run
└── OUTPUT/ ← populated after run
├── rec_cov.data
├── rec_event.data
└── rec_site_spc.data
⚠️ IMPORTANT:
ini.xyzandinput.jsonMUST be outsideINPUT/(kmc_standalone.pyclearsINPUT/OUTPUT)- Ensure
INPUT/andOUTPUT/are empty before running
mkdir -p OUTPUT/Pd_CO9_O18_473K_101325Pa_R50/KMC_{steps}steps/INPUT
mkdir -p OUTPUT/Pd_CO9_O18_473K_101325Pa_R50/KMC_{steps}steps/OUTPUT
cp OUTPUT/{msr_task_name}/ini.xyz OUTPUT/{msr_task_name}/KMC_{steps}steps/ini.xyz
# Copy template from MOSP_database (do not create manually)
cp mosp-for-chatMOSP/MOSP_database/{metal}-{reaction}.json \
OUTPUT/{msr_task_name}/KMC_{steps}steps/input.json
# Adjust fields:
# - nLoop: user-specified steps
# - T: user-specified temperature
# - gas_pp: user-specified partial pressures
# - record_int: recording interval
# - s1.S_gas / s2.S_gas: recalculated using parameter-builder §7.1 formula
Use parameter-builder §KMC parameter display format (5 options).
python3 {mosp_root}/kmc_standalone.py \
--xyz OUTPUT/{task_dir}/ini.xyz \
--json OUTPUT/{task_dir}/input.json \
--out-dir {task_dir}
{mosp_root} is normally $HOME/.openclaw/workspace/mosp-for-chatMOSP or
$OPENCLAW_WORKSPACE/mosp-for-chatMOSP. Confirm that this directory exists
before running.
Note: pass just the task directory name to
--out-dir(e.g.{msr_task_name}/KMC_{steps}steps). The script automatically places it underOUTPUT/; even if anOUTPUT/prefix is accidentally included it is de-duplicated, so noOUTPUT/OUTPUT/nesting is produced.
| File | Location | Description |
|---|---|---|
| coverage.png | KMC task dir | Coverage vs Time |
| coverage_steps.png | KMC task dir | Coverage vs Steps |
| tof.png | KMC task dir | TOF vs Time |
| tof_time.png | KMC task dir | TOF vs Steps |
| coverage.csv | OUTPUT/ | Coverage data |
| tof.csv | OUTPUT/ | TOF data |
| site_tof.csv | OUTPUT/ | Site TOF data |
| rec_cov.data | OUTPUT/ | Coverage records (KMC engine raw output) |
| rec_event.data | OUTPUT/ | Event records |
| rec_site_spc.data | OUTPUT/ | Site-species records |
⚠️ One image per call: Feishu message tool only supports 1 image per attachment. Sending more than one will silently drop the extras. After KMC completes, you MUST send the 4 images one at a time with numbered labels.
Send order and labels:
coverage.pngcoverage_steps.pngtof.pngtof_time.pngExample per message:
message(action=send, message="Image 1/4: Coverage vs Time",
attachments=[{filePath:"...coverage.png", type:"image"}])
After KMC completes (especially when user asks "is the task done?"), MUST check and regenerate plots if needed:
KMC_TASK_DIR="KMC task directory"
KMC_OUTPUT="$KMC_TASK_DIR/OUTPUT"
# 1. Check data files
if [ ! -f "$KMC_OUTPUT/rec_cov.data" ] || \
[ ! -f "$KMC_OUTPUT/rec_event.data" ] || \
[ ! -f "$KMC_OUTPUT/rec_site_spc.data" ]; then
echo "❌ Data files missing, KMC may not have completed"
exit 1
fi
# 2. Check step-count consistency
EXPECTED=$(grep -E "^[0-9]+\s+! Num of steps" "$KMC_TASK_DIR/INPUT/input.txt" | awk '{print $1}')
ACTUAL=$(tail -n 1 "$KMC_OUTPUT/rec_event.data" | awk '{print $2}')
if [ "$EXPECTED" != "$ACTUAL" ]; then
echo "❌ Expected $EXPECTED steps, got $ACTUAL, KMC did not complete"
exit 1
fi
# 3. Check plots (4 images), regenerate if missing
if [ -f "$KMC_TASK_DIR/coverage.png" ] && \
[ -f "$KMC_TASK_DIR/coverage_steps.png" ] && \
[ -f "$KMC_TASK_DIR/tof.png" ] && \
[ -f "$KMC_TASK_DIR/tof_time.png" ]; then
echo "✅ Plots already exist"
else
python3 ../../utils/plot_kmc_data.py "$KMC_OUTPUT"
echo "✅ Plots regenerated"
fi
Plotting script:
mosp-for-chatMOSP/utils/plot_kmc_data.py
| Error | Action |
|---|---|
| Step-count mismatch | Check KMC log; may not have finished |
| Data files missing | KMC did not complete; check run.log |
| Lattice constant missing | Copy complete template from MOSP_database; do not create manually |
| INPUT/OUTPUT dir missing | Create them in Step 1 |
| ini.xyz missing | Copy from MSR task directory |
| Wine missing | Prompt install instructions |
| KMC segfault | Wine version incompatible; prompt upgrade |
ini.xyz is produced. This skill independently fetches complete KMC parameters from MOSP_database. Do NOT reuse MSR's input.json.chatmosp-kmc-simulator/
├── SKILL.md # Chinese reference
└── SKILL_cn.md # This file (English)
User: Run KMC simulation for Pt CO oxidation at 850K, 150Pa, 20M steps
System: [Recognize as KMC → parameter-builder searches params →
Show 5-option confirmation → User confirms → Check Wine installed →
⚠️ 20M steps ≈ 12 hours, warn user → User confirms again →
Prepare input.json → Invoke kmc_standalone.py → Monitor progress →
Check output → Generate 4 images → Send one-by-one → Display results]
This skill is part of the ChatMOSP skill set. For complete functionality, install the companion ChatMOSP skills from ClawHub when they are missing:
If a required companion skill is unavailable, ask the user to install the missing ChatMOSP skill from ClawHub before continuing. Use the GitHub repository only as a fallback.