deposit-kill approach for gas flow simulation

Dear LAMMPS users,
I am trying to simulate ideal gas flow through a microchannel. I am using the SPH module for solving the problem.

Regarding the implementation, i am using the deposit-Kill approach: where i deposit particles before the inlet region and delete them after the outlet region, with fixed boundary in the flow direction. This would ensure a continuous time simulation. The added particles should have initial velocity before it begin integrated and interact with each other.

I do not know how to deposit the particles with initial velocity, so that they propagate only according to the specified pair interactions, and not that velocity anymore.

When i use fix-deposit command, it seems the velocity have the same magnitude and direction at all time integration. Thus i am not sure whether such command is not useful or i just can not use it properly.

Also, using fix-move command with variable equals the velocity seems good, in the sense that it can drives the particles at the following regions, but this approach will not ensure a long-time simulation, and thus it is not useful to my case.

I would be highly appreciated if you encountered similar simulations, to let me know how to handle.

INPUT file:

dimension 2
units si
atom_style meso

boundary f p p

region geometry block -3500.0e-6 3500.0e-6 -750.0e-6 750.0e-6 -10.0e-6 10.0e-6 side in

create_box 2 geometry

region delete_in block EDGE -3001.0e-6 EDGE EDGE EDGE EDGE units box

delete_atoms region delete_in

region generate_in block -3000.0e-6 -2500.0e-6 EDGE EDGE EDGE EDGE units box

lattice hex 50.0e-6
region fluid_in block -2000.0e-6 -500.0e-6 EDGE EDGE EDGE EDGE units box
create_atoms 1 region fluid_in

lattice hex 50.0e-6
region fluid_channel block 0.0e-6 1000.0e-6 -150.0e-6 150.0e-6 EDGE EDGE units box
create_atoms 1 region fluid_channel

lattice sq2 20.0e-6
region upper_wall block 0.0e-6 1000.0e-6 150.0e-6 EDGE EDGE EDGE units box
create_atoms 2 region upper_wall

lattice sq2 20.0e-6
region lower_wall block 0.0e-6 1000.0e-6 EDGE -150.0e-6 EDGE EDGE units box
create_atoms 2 region lower_wall

lattice hex 50.0e-6
region fluid_out block 1500.0e-6 3000.0e-6 EDGE EDGE EDGE EDGE units box
create_atoms 1 region fluid_out

region delete_out block 3001.0e-6 EDGE EDGE EDGE EDGE EDGE units box
delete_atoms region delete_out

region walls union 2 upper_wall lower_wall units box

group fluid type 1

group walls type 2

mass 1 4.112e-9

mass 2 2.29787234e-10
set type 1 meso/rho 1.17
set type 2 meso/rho 1.17
set type 1 meso/e 0.8650571e-3
set type 2 meso/e 0.048341259e-3

pair_style hybrid/overlay sph/rhosum 1 sph/idealgas

pair_coeff 1 1 sph/rhosum 150.0e-6
pair_coeff 1 1 sph/idealgas 0.5 150.0e-6
pair_coeff 1 2 sph/idealgas 0.5 20.0e-6
pair_coeff 2 2 sph/idealgas 0.5 20.0e-6

compute rho_peratom all meso/rho/atom

compute e_peratom all meso/e/atom
compute ke_peratom all ke/atom
compute esph all reduce sum c_e_peratom
compute ke all ke
variable etot equal c_ke+c_esph

neighbor 25.0e-6 nsq
neigh_modify every 1 delay 0 check yes

fix fix_deposit fluid deposit 999999999 1 100 13572468 region fluid_in vx 1.9 2.1 near 25.0e-6 attempt 10000 units box

fix fix_integrate fluid meso
fix fix_walls walls meso/stationary

dump dump_id all custom 10 dump_gas.out id type x y z vx vy c_rho_peratom c_e_peratom

dump_modify dump_id first yes
thermo 10
thermo_style custom step c_esph v_etot
thermo_modify norm no lost ignore

timestep 0.5e-8
run 400000

Thanks in advance
Ali Gad
MSc Mathematical engineering,
BSc Mechanical engineering

You seem to be complaining that the velocity of the inserted particles do not change. This is most likely because they are mostly not interacting with any other particles. If you want to see a lot of interactions, try increasing the density.

Dear Mr. Aidan,
Many thanks for your reply. I have tried to increase the insertion density by decreasing M from 100 into 2 but still seems that the driving force is due to the specified velocity in the deposit command only. Moreover, there always occurs that the simulation crashes with non-numeric coordinates when the generated particles approaches the walls (ie, the velocity vector of particles can not alter from specified value in deposit command).
I have some doubts that the specified groups might not correct, may be not updated or so.
I would be appreciated for you to check the input file and let me know.

Ali

This might be an issue with the parameters you have chosen for the pair interactions. Instead of worrying about fix deposit and walls, I would focus your attention on a bulk fluid first. Make sure you can do that. Then add walls, then add fix deposit.

Thanks again for your advice. In the following file i have tried with fix-move to make the fluid region “generate_in” before inlet to act as the driving fluid. Here i can notice the interaction of the gas particles with each other as well as its collision with walls (i have manipulated parameters to behave like elastic collision). Thus the bulk fluid is interacting with itself and with the walls. However the simulation time can not be continuous as there is no particles added but only removed.

My apologies for bothering, but i still can not find a way to ensure a continuous inlet flow for a long-time simulation but only fix-deposit command which i am still stuck at.

dimension 2

units si
atom_style meso
boundary f p p

region geometry block -3500.0e-6 3500.0e-6 -750.0e-6 750.0e-6 -10.0e-6 10.0e-6 side in

create_box 2 geometry

region delete_in block EDGE -3001.0e-6 EDGE EDGE EDGE EDGE units box

delete_atoms region delete_in

lattice hex 50.0e-6
region generate_in block -3000.0e-6 -2500.0e-6 EDGE EDGE EDGE EDGE units box
create_atoms 1 region generate_in

lattice hex 50.0e-6
region fluid_in block -2400.0e-6 -100.0e-6 EDGE EDGE EDGE EDGE units box
create_atoms 1 region fluid_in

lattice hex 50.0e-6
region channel block 0.0e-6 1000.0e-6 -120.0e-6 120.0e-6 EDGE EDGE units box
create_atoms 1 region channel

lattice sq2 20.0e-6
region upper_wall block 0.0e-6 1000.0e-6 150.0e-6 EDGE EDGE EDGE units box
create_atoms 2 region upper_wall

lattice sq2 20.0e-6
region lower_wall block 0.0e-6 1000.0e-6 EDGE -150.0e-6 EDGE EDGE units box
create_atoms 2 region lower_wall

lattice hex 50.0e-6
region fluid_out block 1100.0e-6 3400.0e-6 EDGE EDGE EDGE EDGE units box
create_atoms 1 region fluid_out

region delete_out block 3401.0e-6 EDGE EDGE EDGE EDGE EDGE units box
delete_atoms region delete_out

region walls union 2 upper_wall lower_wall units box

group fluid type 1

group walls type 2
group fluid_in region fluid_in
group generate_in region generate_in

mass 1 4.112e-9

mass 2 2.29787234e-10
set type 1 meso/rho 1.17
set type 2 meso/rho 1.17
set type 1 meso/e 0.8650571e-3
set type 2 meso/e 0.048341259e-3

pair_style hybrid/overlay sph/rhosum 1 sph/idealgas

pair_coeff 1 1 sph/rhosum 150.0e-6
pair_coeff 1 1 sph/idealgas 0.5 150.0e-6
pair_coeff 1 2 sph/idealgas 0.5 20.0e-6
pair_coeff 2 2 sph/idealgas 0.5 20.0e-6

compute rho_peratom all meso/rho/atom

compute e_peratom all meso/e/atom
compute ke_peratom all ke/atom
compute esph all reduce sum c_e_peratom
compute ke all ke
variable etot equal c_ke+c_esph

variable vx equal 2.065645898

fix fix_move generate_in move variable NULL NULL NULL v_vx NULL NULL
fix fix_integrate fluid meso
fix fix_walls walls meso/stationary

dump dump_id all custom 10 dump_trial.out id type x y z vx vy c_rho_peratom c_e_peratom

dump_modify dump_id first yes
thermo 10
thermo_style custom step c_esph v_etot
thermo_modify norm no lost ignore

neighbor 25.0e-6 nsq
neigh_modify every 1 delay 0 check yes
timestep 0.5e-8
run 4000000

Any advice would really help,
Thanks in advance,
Ali

Please take my advice.