Unverified Commit 7f9400ea authored by Steve Plimpton's avatar Steve Plimpton Committed by GitHub
Browse files

Merge pull request #865 from athomps/fix_gcmc_temperature

Made ndof dynamic for temperature fixes and computes
parents 1b965d4d 4fa95de9
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -59,7 +59,9 @@ timestep 1.0
# rigid constraints with thermostat 

fix             myrigidnvt co2 rigid/nvt/small molecule temp ${temp} ${temp} 100 mol co2mol
fix_modify	myrigidnvt dynamic/dof no

# dynamically update  fix rigid/nvt/small temperature ndof
fix_modify	myrigidnvt dynamic/dof yes

# gcmc

@@ -82,7 +84,10 @@ variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+0.1)
variable	iacc equal f_mygcmc[4]/(f_mygcmc[3]+0.1)
variable	dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1)
variable	racc equal f_mygcmc[8]/(f_mygcmc[7]+0.1)

# dynamically update default temperature ndof
compute_modify  thermo_temp dynamic/dof yes

thermo_style    custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc v_nC v_nO
thermo          1000

+10 −7
Original line number Diff line number Diff line
@@ -30,8 +30,6 @@ create_box 2 box &
                extra/angle/per/atom 1      &
                extra/special/per/atom 2

# we can load multiple molecule templates, but don't have to use them all
molecule        co2mol CO2.txt
molecule        h2omol H2O.txt
create_atoms   	0 box mol h2omol 464563 units box
                        
@@ -58,18 +56,24 @@ timestep 1.0

minimize 0.0 0.0 100 1000
reset_timestep 0

# rigid constraints with thermostat 

fix             mynvt all nvt temp ${temp} ${temp} 100
fix             wshake  all shake 0.0001 50 0 b 1 a 1 mol h2omol
# gcmc
fix             mynvt h2o nvt temp ${temp} ${temp} 100
fix             wshake h2o shake 0.0001 50 0 b 1 a 1 mol h2omol

# important to make temperature dofs dynamic

compute_modify  thermo_temp dynamic/dof yes
compute_modify  mynvt_temp dynamic/dof yes

run 1000
reset_timestep 0

# gcmc

variable        tfac equal 5.0/3.0 # (3 trans + 2 rot)/(3 trans)
fix             mygcmc all gcmc 100 100 0 0 54341 ${temp} ${mu} ${disp} mol &
fix             mygcmc h2o gcmc 100 100 0 0 54341 ${temp} ${mu} ${disp} mol &
                h2omol tfac_insert ${tfac} group h2o shake wshake

# atom counts
@@ -87,7 +91,6 @@ variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+0.1)
variable	iacc equal f_mygcmc[4]/(f_mygcmc[3]+0.1)
variable	dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1)
variable	racc equal f_mygcmc[8]/(f_mygcmc[7]+0.1)
compute_modify  thermo_temp dynamic/dof yes
thermo_style    custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc v_nO v_nH
thermo          1000

+63 −59
Original line number Diff line number Diff line
LAMMPS (23 Oct 2017)
LAMMPS (30 Mar 2018)
  using 1 OpenMP thread(s) per MPI task
# GCMC for CO2 molecular fluid, rigid/small/nvt dynamics
# Rigid CO2 TraPPE model
@@ -39,14 +39,14 @@ Created orthogonal box = (0 0 0) to (10 10 10)
  1 by 1 by 1 MPI processor grid
molecule        co2mol CO2.txt
Read molecule co2mol:
  3 atoms with 2 types
  2 bonds with 1 types
  1 angles with 1 types
  0 dihedrals with 0 types
  0 impropers with 0 types
  3 atoms with max type 2
  2 bonds with max type 1
  1 angles with max type 1
  0 dihedrals with max type 0
  0 impropers with max type 0
create_atoms   	0 box mol co2mol 464563 units box
Created 24 atoms
  Time spent = 0.00196958 secs
  Time spent = 0.00241756 secs

# rigid CO2 TraPPE model

@@ -72,29 +72,31 @@ timestep 1.0

# rigid constraints with thermostat

fix             myrigidnvt all rigid/nvt/small molecule temp ${temp} ${temp} 100 mol co2mol
fix             myrigidnvt all rigid/nvt/small molecule temp 338.0 ${temp} 100 mol co2mol
fix             myrigidnvt all rigid/nvt/small molecule temp 338.0 338.0 100 mol co2mol
fix             myrigidnvt co2 rigid/nvt/small molecule temp ${temp} ${temp} 100 mol co2mol
fix             myrigidnvt co2 rigid/nvt/small molecule temp 338.0 ${temp} 100 mol co2mol
fix             myrigidnvt co2 rigid/nvt/small molecule temp 338.0 338.0 100 mol co2mol
8 rigid bodies with 24 atoms
  1.16 = max distance from body owner to body atom
fix_modify	myrigidnvt dynamic/dof no

# dynamically update  fix rigid/nvt/small temperature ndof
fix_modify	myrigidnvt dynamic/dof yes

# gcmc

variable        tfac equal 5.0/3.0 # (3 trans + 2 rot)/(3 trans)
fix             mygcmc all gcmc 100 100 0 0 54341 ${temp} ${mu} ${disp} mol                 co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt
fix             mygcmc all gcmc 100 100 0 0 54341 338.0 ${mu} ${disp} mol                 co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt
fix             mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 ${disp} mol                 co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt
fix             mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol                 co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt
fix             mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol                 co2mol tfac_insert 1.66666666666667 group co2 rigid myrigidnvt
fix             mygcmc co2 gcmc 100 100 0 0 54341 ${temp} ${mu} ${disp} mol                 co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt
fix             mygcmc co2 gcmc 100 100 0 0 54341 338.0 ${mu} ${disp} mol                 co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt
fix             mygcmc co2 gcmc 100 100 0 0 54341 338.0 -8.1 ${disp} mol                 co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt
fix             mygcmc co2 gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol                 co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt
fix             mygcmc co2 gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol                 co2mol tfac_insert 1.66666666666667 group co2 rigid myrigidnvt

# atom counts

variable 	carbon atom "type==1"
variable        oxygen atom "type==2"
group 		carbon dynamic all var carbon
group 		carbon dynamic co2 var carbon
dynamic group carbon defined
group 	        oxygen dynamic all var oxygen
group 	        oxygen dynamic co2 var oxygen
dynamic group oxygen defined
variable        nC equal count(carbon)
variable        nO equal count(oxygen)
@@ -105,7 +107,10 @@ variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+0.1)
variable	iacc equal f_mygcmc[4]/(f_mygcmc[3]+0.1)
variable	dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1)
variable	racc equal f_mygcmc[8]/(f_mygcmc[7]+0.1)

# dynamically update default temperature ndof
compute_modify  thermo_temp dynamic/dof yes

thermo_style    custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc v_nC v_nO
thermo          1000

@@ -113,13 +118,13 @@ thermo 1000

run             20000
Ewald initialization ...
WARNING: Using 12-bit tables for long-range coulomb (../kspace.cpp:321)
  using 12-bit tables for long-range coulomb (../kspace.cpp:321)
  G vector (1/distance) = 0.164636
  estimated absolute RMS force accuracy = 0.0332064
  estimated relative force accuracy = 0.0001
  KSpace vectors: actual max1d max3d = 16 2 62
                  kxmax kymax kzmax  = 2 2 2
WARNING: Fix gcmc using full_energy option (../fix_gcmc.cpp:445)
WARNING: Fix gcmc using full_energy option (../fix_gcmc.cpp:485)
0 atoms in group FixGCMC:gcmc_exclusion_group:mygcmc
0 atoms in group FixGCMC:rotation_gas_atoms:mygcmc
WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (../neighbor.cpp:472)
@@ -138,55 +143,54 @@ Neighbor list info ...
Per MPI rank memory allocation (min/avg/max) = 15.62 | 15.62 | 15.62 Mbytes
Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_racc v_nC v_nO 
       0    364.27579    4238.8631   -9.6809388    13.391989    0.5846359       24            0            0            0            0            8           16 
WARNING: Using kspace solver on system with no charge (../kspace.cpp:289)
    1000    420.43475    1722.4052   -9.6956123    15.456579    0.5846359       24   0.20879341   0.20713005            0            0            8           16 
    2000    302.29516   -547.83641   -22.017674     14.11699   0.73079488       30    0.1742478    0.1678018            0            0           10           20 
    3000     316.6934   -1080.2672   -8.2218891    10.069364   0.51155641       21   0.13544917   0.13720634            0            0            7           14 
    4000    246.81618   -679.83642   -14.577244     10.29997   0.65771539       27    0.1568939   0.15860229            0            0            9           18 
    5000    260.22849   -896.29914   -16.097593    10.859684   0.65771539       27   0.13138744   0.13547049            0            0            9           18 
    6000    291.70796     -1521.99   -22.303136    13.622574   0.73079488       30   0.12615476   0.12717694            0            0           10           20 
    7000    236.02638   -599.92186   -27.580831    13.367447   0.87695385       36     0.119703   0.12145398            0            0           12           24 
    8000    321.45341    688.10577    -10.09204    11.817696    0.5846359       24   0.10917411   0.11032646            0            0            8           16 
    9000    502.85382   -302.31056  -0.22330142   0.99927447  0.073079488        3    0.1254105   0.12905828            0            0            1            2 
   10000    249.98239    -510.0091   -32.815145    15.399767   0.95003334       39    0.1274504   0.12875623            0            0           13           26 
   11000    247.59424   -1129.0274   -25.320205    12.792544   0.80387436       33   0.11739076   0.11916784            0            0           11           22 
   12000            0    -20.39554  -0.14872889           -0            0        0    0.1254933   0.12920375            0            0            0            0 
   13000    1272.2738   -474.79484  -0.29450485    8.8489483   0.14615898        6   0.13767133   0.14112496            0            0            2            4 
   14000    516.54246   -36.296516   -5.0012009    11.291243   0.36539744       15   0.15632744   0.15955377            0            0            5           10 
   15000    307.09233    1951.9301   -14.820362    12.815375   0.65771539       27   0.15393544   0.15716192            0            0            9           18 
   16000    198.31989   -559.48443   -30.459487    11.231925   0.87695385       36    0.1482565   0.15025652            0            0           12           24 
   17000    246.99311    657.85683   -18.579206     11.53442   0.73079488       30   0.14143958   0.14375423            0            0           10           20 
   18000    467.13468    167.03738   -1.0945268     5.569759   0.21923846        9   0.13847359   0.14098533            0            0            3            6 
   19000    359.54027   -1413.5407   -12.156233    13.217895    0.5846359       24   0.15169146   0.15294205            0            0            8           16 
   20000    227.79597   -1204.5652    -23.24144    10.637925   0.73079488       30   0.14917199   0.15022946            0            0           10           20 
Loop time of 20.6928 on 1 procs for 20000 steps with 30 atoms

Performance: 83.507 ns/day, 0.287 hours/ns, 966.519 timesteps/s
99.2% CPU use with 1 MPI tasks x 1 OpenMP threads
    1000    330.05964    -376.0111   -13.936335    13.773831   0.65771539       27   0.21142067   0.21453147            0            0            9           18 
    2000    293.79769    -321.3209   -19.049256    13.720163   0.73079488       30   0.25170944   0.25426294            0            0           10           20 
    3000     348.9085    259.04079  -0.23347965    2.4267366   0.14615898        6   0.22016906   0.23200597            0            0            2            4 
    4000    360.54577   -329.12072   -16.584234    15.046059   0.65771539       27   0.19173099   0.19785362            0            0            9           18 
    5000    275.58628   -58.283006   -12.520856    11.500585   0.65771539       27   0.16490585   0.17329884            0            0            9           18 
    6000    338.59574    364.93514   -19.866569    17.494353   0.80387436       33   0.17971759   0.18331589            0            0           11           22 
    7000    286.11586   -1252.5069   -19.588667    13.361427   0.73079488       30   0.15729895   0.16220459            0            0           10           20 
    8000    454.86786   -642.89382   -20.818357    21.242037   0.73079488       30   0.15500235   0.15802382            0            0           10           20 
    9000    326.36695   -364.71382   -31.376162     18.48392   0.87695385       36   0.14203985   0.14510714            0            0           12           24 
   10000    348.46961   -387.75245   -21.068466     18.00451   0.80387436       33   0.14000907   0.14343389            0            0           11           22 
   11000    409.74257   -15.843895   -20.648252    21.170323   0.80387436       33   0.14689306   0.15117074            0            0           11           22 
   12000    523.93502    1003.0729   -6.0563102    14.055757   0.43847693       18   0.15337575    0.1580166            0            0            6           12 
   13000    278.14441    -717.1097   -2.3488496    4.6982087   0.29231795       12   0.15952356   0.16422306            0            0            4            8 
   14000    367.89375    1239.0841   -11.203323    13.524997    0.5846359       24   0.17002439   0.17460294            0            0            8           16 
   15000    197.05319   -471.14343   -9.3890758    6.2653668   0.51155641       21   0.17702612   0.18155802            0            0            7           14 
   16000    138.17147   -935.93437   -2.3846783    2.3338898   0.29231795       12   0.17884346   0.18268758            0            0            4            8 
   17000    245.61833    -166.1694   -5.0970057    5.3690384   0.36539744       15   0.18909252   0.19317817            0            0            5           10 
   18000     232.0142     -175.732   -14.320198    9.6822635   0.65771539       27   0.18977089   0.19280537            0            0            9           18 
   19000    362.01189    864.87258   -6.4515321    9.7117982   0.43847693       18   0.19207244   0.19488984            0            0            6           12 
   20000    441.19548    186.19779   -18.147268    20.603546   0.73079488       30   0.19713351     0.199073            0            0           10           20 
Loop time of 16.4949 on 1 procs for 20000 steps with 30 atoms

Performance: 104.760 ns/day, 0.229 hours/ns, 1212.498 timesteps/s
99.4% CPU use with 1 MPI tasks x 1 OpenMP threads

MPI task timing breakdown:
Section |  min time  |  avg time  |  max time  |%varavg| %total
---------------------------------------------------------------
Pair    | 2.5462     | 2.5462     | 2.5462     |   0.0 | 12.30
Bond    | 0.029783   | 0.029783   | 0.029783   |   0.0 |  0.14
Kspace  | 0.26167    | 0.26167    | 0.26167    |   0.0 |  1.26
Neigh   | 0.10705    | 0.10705    | 0.10705    |   0.0 |  0.52
Comm    | 0.23409    | 0.23409    | 0.23409    |   0.0 |  1.13
Output  | 0.0013416  | 0.0013416  | 0.0013416  |   0.0 |  0.01
Modify  | 17.458     | 17.458     | 17.458     |   0.0 | 84.37
Other   |            | 0.05433    |            |       |  0.26
Pair    | 1.8955     | 1.8955     | 1.8955     |   0.0 | 11.49
Bond    | 0.026564   | 0.026564   | 0.026564   |   0.0 |  0.16
Kspace  | 0.21215    | 0.21215    | 0.21215    |   0.0 |  1.29
Neigh   | 0.088336   | 0.088336   | 0.088336   |   0.0 |  0.54
Comm    | 0.19828    | 0.19828    | 0.19828    |   0.0 |  1.20
Output  | 0.001025   | 0.001025   | 0.001025   |   0.0 |  0.01
Modify  | 14.024     | 14.024     | 14.024     |   0.0 | 85.02
Other   |            | 0.0491     |            |       |  0.30

Nlocal:    30 ave 30 max 30 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost:    2310 ave 2310 max 2310 min
Nghost:    2094 ave 2094 max 2094 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs:    7736 ave 7736 max 7736 min
Neighs:    7664 ave 7664 max 7664 min
Histogram: 1 0 0 0 0 0 0 0 0 0

Total # of neighbors = 7736
Ave neighs/atom = 257.867
Total # of neighbors = 7664
Ave neighs/atom = 255.467
Ave special neighs/atom = 2
Neighbor list builds = 20349
Neighbor list builds = 20076
Dangerous builds = 0

Total wall time: 0:00:20
Total wall time: 0:00:16
+131 −0

File changed and moved.

Preview size limit exceeded, changes collapsed.

+88 −91

File changed and moved.

Preview size limit exceeded, changes collapsed.

Loading