siladitya
unread,Nov 7, 2012, 1:06:28 PM11/7/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to hoomd...@googlegroups.com
Hi,
I am running a NVT simulation with langevin thermostat. The problem I am facing is the temperature of the system during the course of the simulation is fluctuating a lot compare to the set temperature which should not be the case, as I am doing a NVT simulation. Earlier in my code I had a bead spring model without any harmonic angle potential with NVT ensemble and langevin thermostat and with that I never faced any problem regarding the temperature fluctuation. But recently I introduced a harmonic angle potential in my script with BD NVT ensemble and facing the problem of temperature fluctuation. I can't understand the problem and any help regarding this matter will be very helpful. I have also pasted my hoomd script.
from hoomd_script import *
import random
#from math import exp
#input data file
system = init.read_xml(filename="data.xml")
#define the bead-bead interactions
def LJ_tab(r, rmin, rmax, epsilon, sigma):
V = 4 * epsilon * ( (sigma / r)**12 - (sigma / r)**6);
F = 4 * epsilon / r * ( 12 * (sigma / r)**12 - 6 * (sigma / r)**6);
return (V, F)
table = pair.table(width=1000)
table.pair_coeff.set('0', '0', func=LJ_tab, rmin=1.4288, rmax=5.358, coeff=dict(epsilon=46.9953, sigma=1.786))
table.pair_coeff.set('1', '1', func=LJ_tab, rmin=0.95, rmax=3.41, coeff=dict(epsilon=1.383656, sigma=1.1386458))
table.pair_coeff.set('2', '2', func=LJ_tab, rmin=0.95, rmax=3.24, coeff=dict(epsilon=2.947790, sigma=1.0809928))
table.pair_coeff.set('1', '2', func=LJ_tab, rmin=0.95, rmax=3.33, coeff=dict(epsilon=2.019586, sigma=1.1098193))
table.pair_coeff.set('0', '1', func=LJ_tab, rmin=1.16984, rmax=4.3869, coeff=dict(epsilon=8.06383, sigma=1.4623))
table.pair_coeff.set('0', '2', func=LJ_tab, rmin=1.14672, rmax=4.3002, coeff=dict(epsilon=11.77, sigma=1.4334))
#define the bond type and parameters
spring_constant_1 = 500
spring_constant_2 = 10000
ro_1 = 1.462
ro_2 = 0.444
bon = bond.harmonic()
bon.set_coeff('bond0', k=spring_constant_1, r0=ro_1)
bon.set_coeff('bond1', k=spring_constant_2, r0=ro_2)
ang = angle.harmonic()
ang.set_coeff('1-0-1', k=7000, t0=1.047197)
all = group.all()
# thermostat
#resize_time = 1e6
cool_time = 5e5
integrate.mode_standard(dt=0.001)
T_start = 75.0
T_end = 70.0
T_seed = 12345
bd1 = integrate.bdnvt(group=all, T=variant.linear_interp([(0, T_start), (cool_time, T_end)]), gamma_diam=False, seed=T_seed, limit=0.01)
bd1.set_gamma('0', gamma=1.786)
bd1.set_gamma('1', gamma=1.1386458)
bd1.set_gamma('2', gamma=1.0809928)
run(cool_time)
#box rescale
Lx2=31.201
Ly2=31.201
Lz2=31.201
resize_time = 5e5
box_resize = update.box_resize(Lx = variant.linear_interp([(0, 208.0), (resize_time, Lx2)]), Ly = variant.linear_interp([(0, 208.0), (resize_time, Ly2)]), Lz = variant.linear_interp([(0, 208.0), (resize_time, Lz2)]) )
box_resize.set_params(scale_particles = True)
# initialize particle velocities
random.seed(12345);
T = 70.0
for p in system.particles:
mass = p.mass;
vx = random.gauss(0, (T / mass)**(0.5))
vy = random.gauss(0, (T / mass)**(0.5))
vz = random.gauss(0, (T / mass)**(0.5))
p.velocity = (vx, vy, vz)
update.zero_momentum(period=1e6)
# number of timesteps to run
run(resize_time)
#remove all the fixes so we don't accidentally redefine fixes
box_resize.disable()
bd1.disable()
#system equilibration
T_end = 70.0
T_seed = 12345
run_time = 5e5
#bd1 = integrate.bdnvt(group=all, T=variant.linear_interp([(0, T_start), (run_time, T_end)]), gamma_diam=False, seed=T_seed)
bd1 = integrate.bdnvt(group=all, T=T_end, gamma_diam=False, seed=T_seed)
bd1.set_gamma('0', gamma=1.786)
bd1.set_gamma('1', gamma=1.1386458)
bd1.set_gamma('2', gamma=1.0809928)
run(run_time)
#defining log file
analyze.log(filename='mylogsilicaT70_1.log', quantities=['potential_energy', 'temperature', 'kinetic_energy', 'pressure'], period=1000, overwrite=True)
# dump a .mol2 file for the structure information
mol2 = dump.mol2()
mol2.write(filename='tetheredsilica_particleT70_60deg_1.mol2')
dump.dcd(filename='tetheredsilica_particleT70_60deg_1.dcd', period=10000)
run(1e6)
#dump a xml file
xml = dump.xml()
xml.set_params(position=True, type=True, mass=True, velocity=True, bond=True, angle=True)
xml.write(filename="silicaparticle_temp70_60deg_1cooling.xml")
Thanks,
Siladitya