# compressing system in cylindrical confinement

39 views

### azam cheraghi

Mar 13, 2023, 5:33:25 PM3/13/23
I was able to generate  a randomized system of 19 octahedrons confined in a cylindrical wall, using HPMC. Next step is to compress it and then equilibrium. In compression somehow it looks like that system doesn't know what the box size is and wall condition. I played with it in different ways but still couldn't figure out how to fix it. File named p1.gsd id my randomized system and it shows particles confined in a cylinder.

cpu = hoomd.device.CPU()

sim = hoomd.Simulation(device=cpu, seed=20)

mc = hoomd.hpmc.integrate.ConvexPolyhedron()

sim.operations.integrator = mc

mc.shape['octahedron'] = dict(vertices=[

(-0.5, 0, 0),

(0.5, 0, 0),

(0, -0.5, 0),

(0, 0.5, 0),

(0, 0, -0.5),

(0, 0, 0.5),

])

sim.create_state_from_gsd(filename='p1.gsd')

a = math.sqrt(2) / 2

V_particle = 1 / 3 * math.sqrt(2) * a**3

initial_volume_fraction = (sim.state.N_particles * V_particle / sim.state.box.volume)

initial_box = sim.state.box

final_box = hoomd.Box.from_box(initial_box)

final_volume_fraction = 0.57

final_box.volume = sim.state.N_particles * V_particle / final_volume_fraction

compress = hoomd.hpmc.update.QuickCompress(trigger=hoomd.trigger.Periodic(10),                                         target_box=final_box)

sim.operations.updaters.append(compress)

periodic = hoomd.trigger.Periodic(10)

tune = hoomd.hpmc.tune.MoveSize.scale_solver(moves=['a', 'd'],

target=0.2,

trigger=periodic,

max_translation_move=0.2,

max_rotation_move=0.2)

sim.operations.tuners.append(tune)

while not compress.complete and sim.timestep < 1e6:

sim.run(1000)

if not compress.complete:

raise RuntimeError("Compression failed to complete")

hoomd.write.GSD.write(state=sim.state, mode='xb', filename='pc.gsd')

### Brandon Butler

Mar 14, 2023, 1:05:17 PM3/14/23
Hey,

You don’t set the wall on the sent script so the simulation does not know about it. Also, walls are not meant to be used in compression simulations.

Best,
Brandon

--
You received this message because you are subscribed to the Google Groups "hoomd-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hoomd-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hoomd-users/CAKfCtRPO0B5QMaJv-S7fPUgW%2BAsm59XoUFgxo%3DRP-zw%3Dx90r3g%40mail.gmail.com.
--
Brandon Butler
PhD Candidate Glotzer Lab
Department of Chemical Engineering
University of Michigan, Ann Arbor

### azam cheraghi

Mar 14, 2023, 1:54:12 PM3/14/23