lammpstutorials / lammpstutorials.github.io

LAMMPS tutorials for both beginners and advanced users
https://lammpstutorials.github.io/
GNU General Public License v3.0
97 stars 19 forks source link

lammps script for CH4 adsorption inside porous medium #94

Closed sogenyi closed 1 month ago

sogenyi commented 1 month ago

Hello friends,

I have been able to follow some of the tutorials given in this page. And i must say it has been very helpful. I now tried to create an input file for ch4 adsorption inside zeolite. The main aim is to generate structures for DFT calculation and eventual development of machine learning potential. The input file i used is

variable tfac equal 5.0/3.0 variable T equal 300 variable rdm equal 65452 variable attempt equal 10

dimension 3 units real boundary p p p # periodic boundary conditions atom_style full atom_modify map array

neighbor 2 bin neigh_modify every 10 delay 0 check no

read_data zeolite.data # Replace with your zeolite structure file

pair_style reaxff NULL pair_coeff maz.ff O Si Cu Al H C

fix 4 all qeq/reaxff 1 0.0 10.0 1e-6 param.qeq molecule methane_mol methane0.mol # Replace with the methane molecule file

create_atoms 0 random 10 456415 NULL mol methane_mol 654321 maxtry 50 overlap 3

Define atom types (replace with actual atom types)

variable O index 1 variable Si index 2 variable Cu index 3 variable Al index 4 variable H index 6 variable C index 5

group Zeolite type ${O} ${Si} ${Al} ${Cu} # Adjust atom types based on your zeolite structure group CH4 type ${C} ${H}

thermo 1000 variable methane atom "type==${C}" group methane dynamic all var methane variable nCH4 equal count(methane) fix at1 all ave/time 500 1 500 v_nCH4 file number_methane.dat

compute temp_zeolite Zeolite temp compute temp_CH4 CH4 temp compute_modify thermo_temp dynamic/dof yes compute_modify temp_CH4 dynamic/dof yes

fix mynvt_zeolite Zeolite nvt temp ${T} ${T} 100 fix_modify mynvt_zeolite temp temp_zeolite

fix mynvt_CH4 CH4 langevin ${T} ${T} 10 ${rdm} fix_modify mynvt_CH4 temp temp_CH4

fix fgcmc CH4 gcmc 500 ${attempt} 0 0 ${rdm} ${T} -5 0.1 mol methane_mol tfac_insert ${tfac} group CH4 full_energy pressure 5000

run 10000

write_data methane-filled.data write_dump all atom dump_methane.lammpstrj

The content of the file methane0.mol is :

LAMMPS Description

5 atoms 0 bonds 0 angles 0 dihedrals 0 impropers

Coords

1 0.0000 0.0000 0.0000 # Carbon (C) 2 0.6291 0.6291 0.6291 # Hydrogen (H) 3 0.6291 -0.6291 -0.6291 # Hydrogen (H) 4 -0.6291 0.6291 -0.6291 # Hydrogen (H) 5 -0.6291 -0.6291 0.6291 # Hydrogen (H)

Types

1 5 # Carbon (C) 2 6 # Hydrogen (H) 3 6 # Hydrogen (H) 4 6 # Hydrogen (H) 5 6 # Hydrogen (H)

Charges

1 0.0000 # Charge for C 2 0.0000 # Charge for H 3 0.0000 # Charge for H 4 0.0000 # Charge for H 5 0.0000 # Charge for H

When i run this script i kept getting the error:

ERROR: Incorrect args for pair coefficients (src/REAXFF/pair_reaxff.cpp:280)

Please how do i solve this problem?

simongravelle commented 1 month ago

This question is not related to one of the tutorial, therefore it should not be posted as an issue here. I am closing it.