Inquiry about Method for Creating Particle Flow

22 views
Skip to first unread message

岩瀬晃司

unread,
Oct 14, 2023, 2:45:31 AM10/14/23
to hoomd-users
I am working on a simulation of a Karman vortex and need to generate a flow of WCA particles in the direction of the x-axis. To represent this flow, I've decided to create an Updater as follows:

class RelativeFlow(hoomd.custom.Action): def __init__(self, ave_flow, h): self.ave_flow = ave_flow self.h = h def act(self, timestep): snap = self._state.get_snapshot() if snap.communicator.rank == 0: snap.particles.position[:,0] += self.ave_flow * self.h self._state.set_snapshot(snap)
Here, "ave_flow" represents the velocity of the flow, and "h" signifies the time step.

I would like to know if there are any issues with this code. Furthermore, for analysis, to accurately represent the velocity, I presume a correction like "vx + ave_flow" is necessary, correct?
Reply all
Reply to author
Forward
0 new messages