Temperature profile

Dear lammps users,

I am modeling a simple 2D model without any body force and temperature gradient. ‘p’ and ‘f’ style boundary condition are applied in x and y direction respectively. 270 fluid atoms are confined by two solid atoms wall that are perpendicular to y direction. Each wall has 3 layers and per layer includes 20 solid atoms. Every wall atoms is fixed to it’s initial position by using ‘fix spring/self’ command. In the whole simulation process, temperature for fluid atoms or solid atoms is kept constant value at 200K. However, I find that, by dividing fluid atoms region into many chunks, temperature for each chunk is far more less or higher than the specified temperature (200K). I will appreciate for any comments. My input file and temperature sample value are shown below.

Input file:

units nano

variable T_wall equal 200

variable T_fluid equal 200

variable spring_constant equal 70.0e3

dimension 2

boundary p f p

atom_style atomic

neighbor 1.0 bin

neigh_modify delay 1 check yes

#-------------------------model----------------------------

lattice sq 0.4

region box block 0 20 0 20 -0.25 0.25

create_box 2 box

#-------------------------region----------------------------

region r_bot_wall block INF INF INF 2 INF INF

region r_top_wall block INF INF 17.0 INF INF INF

region r_flow block INF INF 2.6 16.6 INF INF

#--------------------------create atoms----------------------

create_atoms 1 region box

delete_atoms region r_flow

group g_bot_wall region r_bot_wall

group g_top_wall region r_top_wall

group g_boundary union g_bot_wall g_top_wall

create_atoms 2 random 270 987654 r_flow

group g_flow region r_flow

mass 1 323.98306/1.0e6

mass 2 66.424/1.0e6

#-----------------------------LJ potential------------------

pair_style lj/cut 0.85125

pair_coeff 1 1 83.5 0.2475 0.85125

pair_coeff 2 2 1.657 0.3405 0.85125

pair_coeff 1 2 11.763 0.2940 0.85125

#------------------------initialization velocity------------

velocity g_boundary create ${T_wall} 987654 dist gaussian

velocity g_flow create ${T_wall} 987654 dist gaussian

#-------------------------spring model for wall atoms----------------------------------------------

fix spring_boundary_wall g_boundary spring/self ${spring_constant}

#-------------------------energy minimization-------------------------------------

minimize 1.0e-4 1.0e-6 10000 20000

min_style cg

#-------------------------thermostat for boundary---------------------------------

compute th_com_wall g_bot_wall temp

fix th_fix_wall g_bot_wall temp/rescale 1 {T_wall} {T_wall} 0.1 1

fix_modify th_fix_wall temp th_com_wall

compute th_com_wall_0 g_top_wall temp

fix th_fix_wall_0 g_top_wall temp/rescale 1 {T_wall} {T_wall} 0.1 1

fix_modify th_fix_wall_0 temp th_com_wall

#-------------------------thermostat for liquid------------------------------------

compute th_com_flow g_flow temp

fix th_scale_flow g_flow temp/rescale 1 {T_wall} {T_wall} 0.1 1

fix_modify th_scale_flow temp th_com_flow

fix 1 g_flow nve

fix spring_recenter_0 g_bot_wall recenter INIT INIT INIT

fix spring_recenter_1 g_top_wall recenter INIT INIT INIT

fix 2D all enforce2d

#------------------------------------sampling---------------------------------------

compute ps_com_20 g_flow chunk/atom bin/2d x lower 0.4 y lower 0.4 units box

fix ps_rusult_20 g_flow ave/chunk 2 450000 1000000 ps_com_20 vx vy density/number temp file flow_result_20.out format %20.16g

fix 2D all enforce2d

#------------------------------------equilibrium------------------------------------

thermo 50000

timestep 1e-5

run 1200000

Result file:

Chunk-averaged data for fix ps_rusult_20 and group vy

Timestep Number-of-chunks Total-count

Chunk Coord1 Coord2 Ncount vx vy density/number temp

1000000 400 270

1 0.2 0.2 0 0 0 0 0

2 0.2 0.6 0 0 0 0 0

3 0.2 1 0.849518 0.02352804448664468 -0.01301563323264512 5.30948611111111 472.0724828598343

4 0.2 1.4 0.835733 0.02778265445903207 0.002484448054801916 5.223333333333333 231.8115759493574

5 0.2 1.8 0.765669 -0.08681604323864593 -0.08960753577980518 4.785430555555554 255.7800832261954

6 0.2 2.2 0.651207 0.05774551308321196 -0.1011650063128498 4.070041666666666 295.817685251791

7 0.2 2.6 0.95758 -0.01612331854840349 -0.05656651574723375 5.984874999999999 232.1320425641624

8 0.2 3 0.678713 -0.1106450264499378 -0.05156627925166036 4.241958333333332 211.9923597647906

9 0.2 3.4 0.976262 0.02317112972051899 -0.03692316737165308 6.101638888888888 164.1864107184842

10 0.2 3.8 1.04875 0.005903985893984654 -0.02502700824055246 6.554708333333332 147.4709464387095

11 0.2 4.2 1.02764 -0.08828839589997028 -0.05857859491781743 6.42273611111111 146.1221720173032

12 0.2 4.6 1.01364 -0.02081578341295853 -0.05502178697296155 6.33523611111111 202.1554337989851

13 0.2 5 0.922111 -0.01015158915211346 0.005847000316195504 5.763194444444443 143.8013536391488

14 0.2 5.4 1.03162 0.01090064654920931 0.01906690753196229 6.44761111111111 143.5376657735961

15 0.2 5.8 0.958351 0.02335967671758488 -0.008381007332411464 5.989694444444443 119.3280655059463

16 0.2 6.2 0.605938 0.0157236117560291 0.001028595226501184 3.78711111111111 267.1929246342699

17 0.2 6.6 0.983867 0.0158147489503501 0.001105043228880838 6.149166666666666 281.1074527327147

18 0.2 7 0 0 0 0 0

19 0.2 7.4 0 0 0 0 0

20 0.2 7.8 0 0 0 0 0

21 0.6 0.2 0 0 0 0 0

22 0.6 0.6 0 0 0 0 0

23 0.6 1 0.951907 0.05172156724970964 0.001537519539081735 5.949416666666665 271.7508361325796

24 0.6 1.4 0.539631 0.01883793283066265 -0.05909856665974594 3.372694444444444 285.5369986608534

25 0.6 1.8 0.75654 -0.05936042233465616 -0.0864925773257037 4.728374999999999 167.6098919036001

26 0.6 2.2 0.838131 0.005788201658283289 -0.0691722535753259 5.238319444444444 190.3178900976716

27 0.6 2.6 0.66644 -0.09478387610074612 -0.04597171037207621 4.165249999999999 187.7235525702241

28 0.6 3 1.08922 0.006225641030681069 -0.03965648323285471 6.807624999999999 186.0507455276578

29 0.6 3.4 0.946067 0.0003923845041151799 -0.09130854932594615 5.912916666666666 170.8021623627343

30 0.6 3.8 0.880638 -0.009052697095403652 -0.05022956476833229 5.50398611111111 280.7950327296847

31 0.6 4.2 0.948231 -0.08923973798846932 0.003395978920757619 5.926444444444443 119.0612160886134

32 0.6 4.6 0.88118 -0.05547087357098041 -0.004540757339456147 5.507374999999999 207.7102084607978

33 0.6 5 1.28102 -0.07054393141508182 -0.01642128027470105 8.006374999999998 143.6596514674557

34 0.6 5.4 0.999156 0.03619045639749988 -0.003712629483356373 6.244722222222221 115.5324706098614

35 0.6 5.8 0.31664 0.04024401974051375 0.06954972690469866 1.979 188.2840310493752

36 0.6 6.2 0.936398 0.001023289130979687 0.03276297151422664 5.85248611111111 197.5639529151157

37 0.6 6.6 0.97152 -0.0001972680684431195 0.01505331050389747 6.071999999999999 377.7859140320545

38 0.6 7 0 0 0 0 0

39 0.6 7.4 0 0 0 0 0

40 0.6 7.8 0 0 0 0 0

Best wishes,

Qiangqiang Sun

Are your chunks composed of very few atoms? If so, does time-averaging the chunks lead to smaller fluctuations? It seems to me that you have very few atoms in your fluid and hence you should expect large fluctuations, especially if your chunks consist of on average 1 atom.