How to apply custom oscillatory force on a spherical particle?

122 views
Skip to first unread message

Dinesh SD

unread,
Apr 20, 2022, 1:13:49 PM4/20/22
to hoomd-users
Hello All,

I am relatively a new user of HOOMD and I am trying to apply external oscillatory force on a spherical particle embedded in a soft matter system. The idea is to oscillate the particle in one of the Cartesian directions while holding it in a harmonic trap to prevent it from diffusing through the system.  I previously used to achieve this in LAMMPS (in reduced units) as follows:

variable        NumProbeBeads equal 2988
variable        Amplitude equal 23
variable        Hxx equal 10
variable        Hyy equal 1000
variable        Hzz equal 1000
variable        TimestepPerOscillation equal 105000*v_Timestep
variable        Omega equal (2*3.1415)/${TimestepPerOscillation}

variable             ForceX equal (v_Amplitude*cos(v_Omega*v_Time)-v_Hxx*v_delX)/v_NumProbeBeads
variable             ForceY equal (-v_Hyy*v_delY)/v_NumProbeBeads
variable             ForceZ equal (-v_Hzz*v_delZ)/v_NumProbeBeads

 fix                     ExtForce Probe addforce v_ForceX v_ForceY v_ForceZ

v_delX, v_delY, and v_delZ are the displacement of the particle's center of mass from its initial position during the start of the simulation. As can be seen above, I am applying oscillatory force + a weak harmonic trap in the x-direction (variable ForceX ....) while a very strong harmonic trap in the y and z directions (variable ForceY .... and variable ForceZ ....) to hold the spherical particle in its place. Could someone please let me know how to achieve the same in HOOMD? Thanks for the help. 

Best,
Dinesh

Brandon Butler

unread,
Apr 21, 2022, 2:17:56 PM4/21/22
to hoomd...@googlegroups.com

Hello Dinesh,

You can use a hoomd.md.force.Custom subclass to implement this behavior.

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/b7f10d55-039c-4b4d-a447-da94d8a07bddn%40googlegroups.com.
--
Brandon Butler
MolSSI Fellow
PhD Candidate, Chemical Engineering and Scientific Computing | Glotzer Lab, University of Michigan
Email: butl...@umich.edu

Dinesh SD

unread,
Apr 26, 2022, 12:34:37 PM4/26/22
to hoomd-users
Thank you, Brandon.  I will try this option.

Best,
Dinesh

Reply all
Reply to author
Forward
0 new messages