Inflow Region

Dear LAMMPS users,

I’m trying to set up an inflow region that all particles entering this region will have a designated velocity until they leave. The reason for doing this is to simulate a inflow boundary with constant inlet velocity/flow rate. And I can use a period boundary in the inflow and outflow direction, such that all particles leaving will reenter the domain with desired inflow velocity. Compared to other methods that generates particles at inflow end and kill them at outflow, this method is easier to understand and achieve.

They way I have tried is to apply dynamic group to a region and then use velocity and fix setforce command to fix the velocity in such region. For example a constant velocity in x direction as vx:

region inflowarea
group inflow dynamic all region inflowarea
group inflow type 3
velocity inflow set vx 0 0
fix inflow setforce 0 0 0

I get no error message but the output file contains no particles in type 3 and no particle has constant speed as vx. However, it looks like the velocity command works and particles seem to have an initial speed as vx. It looks like the fix setforce is not working somehow. I understand from the manual that dynamic group is not applied to all of the fix command, but I’m wondering if I have made any mistake in my command or there is a way to setup a region with constant velocity?

Thanks for your patience and help!