Warning Message Regarding MuellerPlatheFlow with WCA Particles in 2D System

58 views
Skip to first unread message

岩瀬晃司

unread,
Sep 28, 2023, 8:18:03 AM9/28/23
to hoomd-users

Dear Hoomd-UsersGroup members,

I hope this message finds you well. I am currently working with a two-dimensional system using WCA particles and attempting to measure the viscosity using the ReversePerturbationFlow method. When running my simulation with the following code setup, I encountered the warnings mentioned below:

Warning: After 100 MuellerPlatheFlow could not achieve the target: 10 only 0.00304209 could be achieved.
Warning: After 100 MuellerPlatheFlow could not achieve the target: 20 only 0.00304209 could be achieved.


Could anyone provide insights on what these warnings imply?

I suspect the issue might be related to the following setting:

ramp = hoomd.variant.Ramp(0.0, shear*nsteps, 0, int(nsteps))

I've gone through the documentation, but I am still not completely clear on what the Ramp setting represents in this context. I would greatly appreciate any detailed explanation or guidance on this matter.

Thank you in advance for your assistance and time.

Warm regards,

Koji


def initialize_ra(Nx,Ny,dx,dy,lx,ly):
rx=[]
ry=[]
# rx.append(lx/4.0-lx/2)
# ry.append(ly/2.0-ly/2)
for i in range(Nx):
for j in range(Ny):
rx.append(i*dx-lx/2+dx/2)
ry.append(j*dy-ly/2+dy/2)
return rx,ry





shear=float(sys.argv[1])
rho=float(sys.argv[2])
dx=np.sqrt(1.0/rho)
dy=dx
lx=100
ly=300
Nx=int(lx/dx)
Ny=int(ly/dy)
N=Nx*Ny
sigma=1.0

kbT=1.0
m=1.0
epsilon=1.0

ver=str(shear)+"_"+str(rho)
main_dir="./"+ver
if not os.path.exists(main_dir): os.makedirs(main_dir)


real_time=100
dt = 1e-4
nsteps=int(real_time/dt)
pos_hout=int(nsteps/500)


rx,ry=initialize_ra(Nx,Ny,dx,dy,lx,ly)

position=[]
for i in range(len(rx)):
position.append((rx[i],ry[i],0.0))


snapshot = gsd.hoomd.Frame()
snapshot.particles.N = N
snapshot.particles.position = position[0:N]

snapshot.particles.typeid = (N)*[0]
snapshot.particles.types = ['Move']
snapshot.particles.diameter=(N)*[1.0]
snapshot.particles.mass = np.ones((N))
snapshot.configuration.box = [lx, ly, 0, 0, 0, 0]

sim = hoomd.Simulation(device=hoomd.device.GPU(), seed=12)


sim.create_state_from_snapshot(snapshot)


cell = hoomd.md.nlist.Cell(buffer=0.4)
lj = hoomd.md.pair.LJ(nlist=cell, mode="shift")
lj.params[("Move", "Move")] = dict(epsilon=epsilon, sigma=sigma)
lj.r_cut[("Move", "Move")] = 2**(1/6)*sigma



nve = hoomd.md.methods.ConstantVolume(filter=hoomd.filter.All())
integrator = hoomd.md.Integrator(
dt=dt,
methods=[nve],
forces=[lj],
)

# const integrated flow with 0.1 slope for max 1e8 timesteps
ramp = hoomd.variant.Ramp(0.0, shear*nsteps, 0, int(nsteps))
# velocity gradient in z direction and shear flow in x direction.
mpf = hoomd.md.update.ReversePerturbationFlow(filter=hoomd.filter.All(),
flow_target=ramp,
slab_direction="Y",
flow_direction="X",
n_slabs=200)

sim.operations+=mpf
sim.operations.integrator = integrator



# logger定義
pos_logger = hoomd.logging.Logger()
pos_logger.add(mpf, quantities=[ 'summed_exchanged_momentum'])
# pos_logger.add(thermodynamic_properties,quantities=["kinetic_temperature","kinetic_energy","potential_energy","volume"])
gsd_writer_pos = hoomd.write.GSD(filename=main_dir+"/log_pos.gsd",
trigger=hoomd.trigger.Periodic(pos_hout),
mode='xb',
filter=hoomd.filter.All())
gsd_writer_pos.log = pos_logger

sim.operations.writers.append(gsd_writer_pos)



sim.state.thermalize_particle_momenta(filter=hoomd.filter.All(), kT=kbT)

sim.run(0)

sim.run(nsteps)

Joshua Anderson

unread,
Sep 28, 2023, 8:29:40 AM9/28/23
to hoomd...@googlegroups.com
Koji,

I see no "shear*nsteps" in the HOOMD documentation. To learn about variant.Ramp, see the tutorial: https://hoomd-blue.readthedocs.io/en/v4.2.0/tutorial/01-Introducing-Molecular-Dynamics/03-Compressing-the-System.html#Variants and the documentation: https://hoomd-blue.readthedocs.io/en/v4.2.0/module-hoomd-variant.html#hoomd.variant.Ramp.
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan

--
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/8a0c4048-d42d-4c75-8655-a24d2f1b76f0n%40googlegroups.com.

岩瀬晃司

unread,
Sep 28, 2023, 10:25:06 AM9/28/23
to hoomd-users

Sorry, I understand the concept of a 'Ramp', but I'm not clear on what it signifies in the context of ReversePerturbationFlow. When using ReversePerturbationFlow, how does the 'ramp' argument influence the results?"

2023年9月28日木曜日 21:29:40 UTC+9 Joshua Anderson:

岩瀬晃司

unread,
Sep 28, 2023, 10:29:20 AM9/28/23
to hoomd-users
This example is ony my mistake.


ramp = hoomd.variant.Ramp(0.0, shear*nsteps, 0, int(nsteps))
correct example in Doc is
ramp = hoomd.variant.Ramp(0.0, 0.1e8, 0, int(1e8))

I know.
But I don't. know what 1e8 and 0.1e8 mean.

2023年9月28日木曜日 23:25:06 UTC+9 岩瀬晃司:

Joshua Anderson

unread,
Sep 28, 2023, 10:43:44 AM9/28/23
to hoomd...@googlegroups.com
I don't understand what you are asking. In one message, you clearly state that you "understand the concept of Ramp" and in the next you state that you don't know what two of the arguments to it mean. The arguments of Ramp are clearly labeled in the documentation and I see no need to explain them further.

The example you partially quote passes ramp to the `flow_target` argument. I know nothing more about this argument than is stated in the documentation. You could look at the original paper to see if is described in more detail there, or contact the original author of ReversePerturbationFlow.
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan

岩瀬晃司

unread,
Sep 28, 2023, 11:09:48 PM9/28/23
to hoomd-users

I had asked a question because I couldn't quite understand the paper after reading it, but I've decided to look into this matter a bit more on my own. However, I would like an explanation for these Warnings.


Warning: After 100 MuellerPlatheFlow could not achieve the target: 10 only 0.00304209 could be achieved.
Warning: After 100 MuellerPlatheFlow could not achieve the target: 20 only 0.00304209 could be achieved.

2023年9月28日木曜日 23:43:44 UTC+9 Joshua Anderson:

Joshua Anderson

unread,
Sep 29, 2023, 9:33:16 AM9/29/23
to hoomd...@googlegroups.com
That warning means exactly what it says: you asked for a target, and the method was unable to achieve the target. It is generated by this code if you wish to know more: https://github.com/glotzerlab/hoomd-blue/blob/d6b9707435274d84dcfc1413e1e7043e55481a55/hoomd/md/MuellerPlatheFlow.cc#L145-L151.

------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan

岩瀬晃司

unread,
Oct 3, 2023, 2:56:03 AM10/3/23
to hoomd-users
Thanks

To eliminate this warning, which parameter do you think I should change?

2023年9月29日金曜日 22:33:16 UTC+9 Joshua Anderson:

Joshua Anderson

unread,
Oct 3, 2023, 7:54:39 AM10/3/23
to hoomd...@googlegroups.com
I think you should set a lower flow target.

------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan

岩瀬晃司

unread,
Oct 17, 2023, 9:00:07 AM10/17/23
to hoomd-users
Joshua

Thanks, warnings disappeared.


2023年10月3日火曜日 20:54:39 UTC+9 Joshua Anderson:
Reply all
Reply to author
Forward
0 new messages