Made ndof dynamic for temperature fixes and computes
This commit is contained in:
@ -59,7 +59,9 @@ timestep 1.0
|
|||||||
# rigid constraints with thermostat
|
# rigid constraints with thermostat
|
||||||
|
|
||||||
fix myrigidnvt co2 rigid/nvt/small molecule temp ${temp} ${temp} 100 mol co2mol
|
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
|
# 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 iacc equal f_mygcmc[4]/(f_mygcmc[3]+0.1)
|
||||||
variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1)
|
variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1)
|
||||||
variable racc equal f_mygcmc[8]/(f_mygcmc[7]+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
|
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_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc v_nC v_nO
|
||||||
thermo 1000
|
thermo 1000
|
||||||
|
|
||||||
|
|||||||
@ -30,8 +30,6 @@ create_box 2 box &
|
|||||||
extra/angle/per/atom 1 &
|
extra/angle/per/atom 1 &
|
||||||
extra/special/per/atom 2
|
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
|
molecule h2omol H2O.txt
|
||||||
create_atoms 0 box mol h2omol 464563 units box
|
create_atoms 0 box mol h2omol 464563 units box
|
||||||
|
|
||||||
@ -58,15 +56,21 @@ timestep 1.0
|
|||||||
|
|
||||||
minimize 0.0 0.0 100 1000
|
minimize 0.0 0.0 100 1000
|
||||||
reset_timestep 0
|
reset_timestep 0
|
||||||
|
|
||||||
# rigid constraints with thermostat
|
# rigid constraints with thermostat
|
||||||
|
|
||||||
fix mynvt all nvt temp ${temp} ${temp} 100
|
fix mynvt h2o nvt temp ${temp} ${temp} 100
|
||||||
fix wshake all shake 0.0001 50 0 b 1 a 1 mol h2omol
|
fix wshake h2o shake 0.0001 50 0 b 1 a 1 mol h2omol
|
||||||
# gcmc
|
|
||||||
|
|
||||||
|
# important to make temperature dofs dynamic
|
||||||
|
|
||||||
|
compute_modify thermo_temp dynamic/dof yes
|
||||||
|
compute_modify mynvt_temp dynamic/dof yes
|
||||||
|
|
||||||
run 1000
|
run 1000
|
||||||
|
reset_timestep 0
|
||||||
|
|
||||||
|
# gcmc
|
||||||
|
|
||||||
variable tfac equal 5.0/3.0 # (3 trans + 2 rot)/(3 trans)
|
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 all gcmc 100 100 0 0 54341 ${temp} ${mu} ${disp} mol &
|
||||||
@ -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 iacc equal f_mygcmc[4]/(f_mygcmc[3]+0.1)
|
||||||
variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1)
|
variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1)
|
||||||
variable racc equal f_mygcmc[8]/(f_mygcmc[7]+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_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc v_nO v_nH
|
||||||
thermo 1000
|
thermo 1000
|
||||||
|
|
||||||
|
|||||||
@ -1253,6 +1253,10 @@ void FixGCMC::attempt_molecule_deletion()
|
|||||||
|
|
||||||
if (ngas == 0) return;
|
if (ngas == 0) return;
|
||||||
|
|
||||||
|
// work-around to avoid n=0 problem with fix rigid/nvt/small
|
||||||
|
|
||||||
|
if (ngas == natoms_per_molecule) return;
|
||||||
|
|
||||||
tagint deletion_molecule = pick_random_gas_molecule();
|
tagint deletion_molecule = pick_random_gas_molecule();
|
||||||
if (deletion_molecule == -1) return;
|
if (deletion_molecule == -1) return;
|
||||||
|
|
||||||
@ -1910,6 +1914,10 @@ void FixGCMC::attempt_molecule_deletion_full()
|
|||||||
|
|
||||||
if (ngas == 0) return;
|
if (ngas == 0) return;
|
||||||
|
|
||||||
|
// work-around to avoid n=0 problem with fix rigid/nvt/small
|
||||||
|
|
||||||
|
if (ngas == natoms_per_molecule) return;
|
||||||
|
|
||||||
tagint deletion_molecule = pick_random_gas_molecule();
|
tagint deletion_molecule = pick_random_gas_molecule();
|
||||||
if (deletion_molecule == -1) return;
|
if (deletion_molecule == -1) return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user