Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not fix NH during NVT melting #134

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions calphy/liquid.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,23 @@ def melt_structure(self, lmp):
"""
"""
melted = False

#this is the multiplier for thigh to try melting routines
for thmult in np.arange(1.0, 2.0, 0.1):

trajfile = os.path.join(self.simfolder, "traj.melt")
if os.path.exists(trajfile):
os.remove(trajfile)

self.logger.info("Starting melting cycle with thigh temp %f, factor %f"%(self.calc._temperature_high, thmult))
factor = (self.calc._temperature_high/self.calc._temperature)*thmult
lmp.velocity("all create", self.calc._temperature*factor, np.random.randint(1, 10000))
self.fix_nose_hoover(lmp, temp_start_factor=factor, temp_end_factor=factor)
if self.calc._pressure is not None:
self.fix_nose_hoover(lmp, temp_start_factor=factor, temp_end_factor=factor)
lmp.run(int(self.calc.md.n_small_steps))
self.unfix_nose_hoover(lmp)

if self.calc._pressure is not None:
self.unfix_nose_hoover(lmp)

self.dump_current_snapshot(lmp, "traj.melt")

#we have to check if the structure melted
Expand All @@ -81,7 +83,7 @@ def melt_structure(self, lmp):
if (solids/self.natoms < self.calc.tolerance.liquid_fraction):
melted = True
break

#if melting cycle is over and still not melted, raise error
if not melted:
lmp.close()
Expand Down
Loading