how to setup velocity inlet boundary condition in lammps

Hi Axel,

Thanks for your suggestion.

I’ve run the simulation according to your idea, using “fix langevin” command to the end part of the x region. The input is attached below.

The stream velocity in “fix langevin” region is not damped out. I don’t know what’s worng. When the density is small, the stream velocity in “fix langevin” region will be smaller, but also not totally damped out.

Is there anything wrong with my code?

Best Regards.

Fubing

in.flow (1.73 KB)

Hi Axel,

Thanks for your suggestion.

I've run the simulation according to your idea, using "fix langevin" command
to the end part of the x region. The input is attached below.

this cannot work. you define a group instead of a region bias. group
assignments are fixed and thus the thermostatted atoms will diffuse.

axel.

You should also explore the ATC package. It gives you a lot of extra
ways to control the boundary conditions.

Aidan

Hi Axel,

Yes, you are right. I checked the group atoms and found that the atoms in a group would not change. So the “fix langevin command” didn’t act on specific region. I used “variable” command to define a group, in order to put all atoms in a certain region to a group every time-step, but it seems doesn’t work.

We can calculate temperature based on specific region using “compute temp/region” command in lammps, But how “fix langevin” command act on a specific region? Does the following codes works when I only want the “fix langevin” command on a specific region?

region region_langevin block 100 INF INF INF INF INF
region region_other block INF 100 INF INF INF INF
compute T_langevin all temp/region region_langevin
compute T_other all temp/region region_other
fix 1 all nve
fix 2 all langevin 2.5 2.5 0.03 101325
fix_modify 2 temp T_langevin
fix 3 all temp/rescale 100 2.5 2.5 0.3 1.0
fix_modify 3 temp T_other

will fix 2 only apply to region_langevin and fix 3 only apply to region_other?

Maybe there is some method do define a dynamic group on a specific region, but I haven’t found it yet.

Regards.

Fubing

Hi Aidan,

Thanks for your suggestion. But maybe it can be solved in a simple way. I don’t want to couple with continuum method.

Fubing

See this section of the manual: Howto 6.16 on thermostatting
and applying biases to thermostats. You want to use fix langevin all
and the fix modify command with a compute temp/region command.

You do not want to try and dynamically assign atoms to a group.

Steve

Hi Steve,

Thanks. I’ve read section 6.16 about thermostat carefully for several times. But I’m still not sure about the usage of thermostat. There is a sentence in section 6.16: “For example, you can apply a thermostat to only the x and z components of velocity by using it in conjunction with compute temp/partial.” Does it means that y component of velocity will not affected?

So like my former mail,

region region_langevin block 100 INF INF INF INF INF
compute T_langevin all temp/region region_langevin
fix 1 all nve
fix 2 all langevin 2.5 2.5 0.03 101325
fix_modify 2 temp T_langevin

Does the above code only control the temp in region region_langevin? Through group all is used in fix 2, the atoms not in this region will not affect by fix 2. I’m not sure about it.

Fubing

Hi Steve,
    Thanks. I've read section 6.16 about thermostat carefully for several
times. But I'm still not sure about the usage of thermostat. There is a
sentence in section 6.16: "For example, you can apply a thermostat to only
the x and z components of velocity by using it in conjunction with compute
temp/partial." Does it means that y component of velocity will not affected?
    So like my former mail,
region region_langevin block 100 INF INF INF INF INF
compute T_langevin all temp/region region_langevin
fix 1 all nve
fix 2 all langevin 2.5 2.5 0.03 101325
fix_modify 2 temp T_langevin

Does the above code only control the temp in region region_langevin? Through
group all is used in fix 2, the atoms not in this region will not affect by
fix 2. I'm not sure about it.

there is only "one true way(tm)" to be certain that a feature does
what you want: make a test

this is the fundamental scientific procedure and no "yes" or "no"
answer from some random person can replace that.
remember that the name of the mailing list is "lammps-users" not
"lammps-approval" :wink:

axel.

Hi Axel,

Thank you.
In fact, I’m keeping on testing what different commands will result in these days, but not sure about the results. Thank you for pointing out and I will keep on. Thanks.

Fubing

Comments below.

Steve