How to deduct the stream velocity when calculate the local stress tensor

Hi lammps users

I have a system where the liquid is confined between two walls. The top wall is moving in x direction, while bottom wall is moving oppositely. The liquid region is divided into several number of bins.I calculate the stress tensor in each bin of water by those commands:

compute peratom_pres water stress/atom water_temp

compute Vxz water chunk/atom bin/1d z lower 1.9

fix profile_vxz water ave/chunk 10 100000 1000000 Vxz vx density/mass c_peratom_pres[1] c_peratom_pres[2] c_peratom_pres[3] c_peratom_pres[4] c_peratom_pres[5] c_peratom_pres[6] file CouetteVxz.profile

After I check the stress/atom command in the maual, I find the stream velocity of the water is also included when the stress tensor is calculated because the water will follow the moving of the wall.

So, I wonder if there is a way or command to subtract the stream velocity in lammps. For example, the average bin velocity is first obtained by some commands, and then subtracting it when the local stress tensor is calculated.

Any suggestions?

Fan Li

Hi lammps users
I read the manul again. It is said compute temp command calculates velocity biases directly (e.g. advection velocities) that are removed when computing the thermal temperature.Also, it is said the temp-ID in compute stress/atom command can be used to affect the per-atom velocities used in the kinetic energy contribution to the total stress. If desired, the specified temperature compute can be one that subtracts off a bias to leave each atom with only a thermal velocity to use in the formula above, e.g. by subtracting a background streaming velocity.

That means the stream velocity has already been subtracted in my calculation. Is it right?

Fan Li

It is said compute temp command calculates velocity biases directly (e.g. advection velocities) that are >removed when computing the thermal temperature.

Vanilla compute temp does not do this, but several other compute temp/* commands

remove a bias as you describe. You need to pick a compute temp/* variant

that applies the style of bias appropriate to your model.

Steve

I read the the manual and found the compute temp/profile can be used for my case. The walls are moving in x direction, so the flow direction is x as well. To subtract the flow velocity from the total velocity, I used the following command:

compute water_temp water temp/profile 1 0 0 z 20
compute Vxz water chunk/atom bin/1d z lower 1.9
fix profile_vxz water ave/chunk 10 100000 1000000 Vxz vx density/mass c_peratom_pres[1] c_peratom_pres[2] c_peratom_pres[3] c_peratom_pres[4] c_peratom_pres[5] c_peratom_pres[6] file CouetteVxz.profile

Are they right?

Fan Li

I suggest you try it and verify for yourself that it is doing

what you expect, i.e the right thing.

Just b/c someone on the mail list says some command look

right vs wrong doesn’t answer that Q.

Steve