ERROR: KSpace style is incompatible with Pair style (src/kspace.cpp:199)

Dear all,
when I made a model that CO2 is on the upper area and FeCr alloy is on the bottom area, I chose lj/cut/coul/long for CO2, for kspace_style chose ewald. I view the manual, didn’t find any mistake, but I got this error:
ERROR: KSpace style is incompatible with Pair style (src/kspace.cpp:199)
Last command: write_data data.CO2_FeCr

Follow is my in file.
image

Could anybody help me to solve this? Thank you so much!

Please quote the complete input file and not a screenshot (how rude).

You most likely have defined another pair_style after line 20, which overrides the previous command and does not include any long-range electrostatics.

Thank you for your reply! Yes, I defined another pair_style. I add the all data again.
All_model.lmp (922 Bytes)

What is the reason for having:

pair_style     lj/cut/coul/long 10.0
kspace_style   ewald 1.0e-4
kspace_modify  slab 3.0     

if you then use ReaxFF as the only pair potential for all atoms?
You have either to use pair_style hybrid and define suitable pair coefficients for every atom pair, or chose one pair style for all. Above all, I suggest to study the input files in the examples folder of LAMMPS.

1 Like

Using pair style hybrid in combination with ReaxFF is rarely a good idea. There are far too many problems, and particularly with long-range electrostatics there is a serious problem of double counting Coulomb interactions in k-space.

For ReaxFF you need a potential file that is specific to the kind of reaction you are studying. There may be many parameter set that support the same kinds of elements, but if they are parameterized for a different use case, they will likely produce bad results.

2 Likes

Hi Axel,

I totally agree with you. My remark was purely on the syntactic consequences of issuing two pair_style commands for only one pair_coeff.

1 Like

Thanks! I see what you mean, I’ll delete reaxff pair_style and try it. It might be better to introduce reaxff when calculating after building the model.

Yes, I agree with you. I faced many problems because of ReaxFF :sob:.