Use Fix_evaporate command to delete particles in the Latest CFDEM version Errors!

Submitted by Donald Trump on Wed, 01/15/2020 - 03:38

I recently met this problem when I compiled a pack of source codes, does anyone have any clues what this syntax error is? The application file is called fix evaporate.C in the directory. I want to use this command to calculate the outflow mass rate and delete some particles at a certain rate in my simulation! I added this file into the original SRC directory and recompiled, then the system showed me the information below:

mpicxx -funroll-loops -fstrict-aliasing -Wall -Wno-unused-result -O2 -std=c++17 -DHAVE_TR1_CMATH -fPIC -DSUPERQUADRIC_ACTIVE_FLAG -DNONSPHERICAL_ACTIVE_FLAG -c ../fix_evaporate.cpp
../fix_evaporate.cpp: In constructor ‘LAMMPS_NS::FixEvaporate::FixEvaporate(LAMMPS_NS::LAMMPS*, int, char**)’:
../fix_evaporate.cpp:61:32: error: invalid conversion from ‘int’ to ‘const char*’ [-fpermissive]
random = new RanPark(lmp,seed);
^
In file included from ../math_extra_liggghts.h:53:0,
from ../domain.h:62,
from ../fix_evaporate.cpp:21:
../random_park.h:56:3: note: initializing argument 2 of ‘LAMMPS_NS::RanPark::RanPark(LAMMPS_NS::LAMMPS*, const char*, bool, int)’
RanPark(class LAMMPS * lmp, const char * seed_char, bool proc_shift = false, int multiplier = 1);
^
make[1]: *** [fix_evaporate.o] Error 1
make[1]: Leaving directory `/LIGGGHTS-PUBLIC-master/LIGGGHTS-PUBLIC-master/src/Obj_auto'
make: *** [auto] Error 2

Or any other solutions to solve that problem if I want to use fix_evaporate in the latest version?
Or Any suggestions that can be used to delete particles in a defined region at a certain rate will be welcomed!

Thank you!!!

mschramm | Wed, 01/15/2020 - 06:47

Hello,
From the provided file, it seems that evaporate only uses the seed variable 3 times
1) Init of fix
2) check that the seed > 0
3) used seed in random number generator.

You should be able to edit the fix file by changing
int seed = force->inumeric(FLERR,arg[6]); to const char * seed = arg[6];
if (seed <= 0) error->all(FLERR,"Illegal fix evaporate command"); -> if (force->inumeric(FLERR,seed) <= 0) error->all(FLERR,"Illegal fix evaporate command");
random = new RanPark(lmp,seed); -> bool proc_shift = 1; random = new RanMars(lmp,seed+comm->me,proc_shift,1);

I do not know if this will break anything else in the code.
There may have been a good reason why it was not in the latest release but I do not know.