LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
Re: [lammps-users] couette flow with walls at different temperatures

# Re: [lammps-users] couette flow with walls at different temperatures

 From: Axel Kohlmeyer Date: Fri, 14 Jul 2017 20:22:48 -0400

```On Fri, Jul 14, 2017 at 5:46 PM, m n via lammps-users
<lammps-users@lists.sourceforge.net> wrote:
> Dear all,
> I want to modify the couette flow input code. I need to specify a low
> temperature (T=1) for the lower wall and a high temperature (T=2) for the
> upper wall and find the temperature distribution in the middle flow area.
> The problem is the results are not reasonable since the temperature of the
> lower wall is "0" in the output file. Could any body help me figure out
> where the bugs are?

the problem is, that you are mixing things that contradict each other
and are not realizing, that what you want to do is much more complex
than just replacing fix nve with fix nvt.

most importantly, you are not defining cleanly, what you understand as
"temperature" here. what LAMMPS looks at by default, is the kinetic
energy times a conversion factor divided by the degrees of freedom in
*all* dimensions.

however, for the kind of flow simulation, that you run, you have to
differentiate between a "temperature" in the direction of the flow and
one orthogonal to it.
the "temperature" in the direction of the flow is determined by the
moving walls and *must* not be changed. this is where velocity set and
fix setforce come into play.
at that point is the first complication, since the example input
forces the wall movement of the upper wall with fixed velocity and has
the lower wall stationary, but completely removes all kinetic energy
orthogonal to it. this is needed to keep the walls in place. so if you
replace the 0 in the velocity and fix setforce commands for that
dimension with NULL, your system will fall apart. you need to add
something that keeps those wall atoms confined in the direction
orthogonal to the flow. you can do this e.g. with fix spring/self or
with fix wall.
then you need to set up your thermostat to *only* thermalize the
direction orthogonal to the flow. this can be done with compute
temp/partial. similarly, you need to define a 1d binning via chunks
and then compute temp/chunk to obtain the temperature distribution,
but again, you need to tweak this by removing the bias from the flow
with compute temp/partial.

so i suggest to go back to square one and first try to set up your
temperature distribution simulation *without* a flow and sort out the
related technical aspects. then you try to set up a simulation with
unthermalized walls, where you need to figure out how obtain the
bias-free temperature of the flow atoms. and only after you have
figured all this out, should you try to piece it all together and do
the full setup you are looking for.

axel.

>
> Thank you so much in advance.
> Best,
>
> Santiago
>
> My modified code is as follows:
>
> # 2-d LJ flow simulation
>
> units lj
> dimension 2
> boundary p p p
>
> atom_style atomic
> neighbor 0.3 bin
> neigh_modify delay 5
>
> # create geometry
>
> lattice hex 0.7
> region mybox block 0 20 0 10 -0.25 0.25
> create_box 3 mybox
> create_atoms 1 box
>
> mass 1 1.0
> mass 2 1.0
> mass 3 1.0
>
> # LJ potentials
>
> pair_style lj/cut 1.12246
> pair_coeff * * 1.0 1.0 1.12246
>
> ##########
> velocity        all create 1.0 23652 mom yes rot yes
> fix             npt all npt temp 1 1 0.01 iso 0 0 0.1
> ##########
>
> # define groups
>
> ##########
> unfix           npt
> ##########
>
> region        1 block INF INF INF 1.25 INF INF
> group        lower region 1
> region        2 block INF INF 8.75 INF INF INF
> group        upper region 2
> group        boundary union lower upper
> group        flow subtract all boundary
>
> set        group lower type 2
> set        group upper type 3
>
> # Couette flow
>
> velocity        lower set 0.0 0.0 0.0
> velocity        upper set 3.0 0.0 0.0
> fix        1 boundary setforce 0.0 0.0 0.0
> fix        2 all enforce2d
>
> ########## HOT & COLD
> fix 3 lower nvt temp 1 1 0.01
> fix 4 upper nvt temp 2 2 0.01
> fix 5 flow nve
> ##########
> compute         hot upper temp
> compute         middle flow temp
> compute         cold lower temp
> ##########
> fix             6 all ave/time 1 10000 10000  c_hot c_middle c_cold  file
> temp.txt
>
> # Run
>
> timestep 0.003
> thermo 500
> dump 1 all xyz 100 dump.xyz
> dump 2 all movie 100 movie.mpg type type &
> run 50000
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> lammps-users mailing list
> lammps-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lammps-users
>

--
Dr. Axel Kohlmeyer  akohlmey@...24...  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.

```