Dynamic wall with varied radius

Dear all,

Previously, I tried to create one virtual sphere located at the center of the box, and then the sphere expanded as a function of simulation time. Namely, the sphere’s radius increases as simulation time.

Now I know that the fix indent can do something similar.

But I wonder when I shrink the sphere, i.e., decrease the radius of the virtual sphere, how to let the atoms move back? I think I can add some interactions between the sphere surface and surrounding atoms. But I am not sure which command can achieve that.

The fix wall/harmonic can exert harmonic interactions between the wall and the surrounding atoms, but the walls are x, y, or z planes. not sphere.

So how to implement a sphere with varied radius and the sphere’s surface has a harmonic interaction with outside surrounding atoms?

Any suggestions will be appreciated.

Is that a physical model?
Won’t the atoms move into the free space automatically, provided they are mobile?
Adding a force between the sphere and the surrounding atoms would be equivalent of “gluing” those atoms to the sphere. Is this the model you want to build?

But those are repulsive only.

You can have “shaped” walls with fix wall/region

You can also use a single, immobile particle with either LJ or Morse potential and then use fix adapt to change the effective radius over time. Or use pair style lepton in combination with an equal style variable that is tied to the timestep.

Thank you for your quick response.

Yes, like gluing atoms to the sphere. But in my case, the gluing atoms have bonded with other atoms that are far from (not gluing to) the surface. For example, the expansion and contraction of cellular during respiration in the network matrix.

I tried to use the fix wall/region with a predefined sphere region, but the radius of the sphere can not be changed with simulation time. And I tried this, it doesn’t work:

region      dynamiccell sphere 200 200 200 30 side out move v_ux v_uy v_uz
fix         2 all wall/region dynamiccell harmonic 1.0 0.0 2.5

Now I know, the dynamiccell region will entirely move, but not expand at the fixed center.

I will try the other options you mentioned, thanks.

That is not correct. The documentation for the region command states:

sphere args = x y z radius
x,y,z = center of sphere (distance units)
radius = radius of sphere (distance units)
x,y,z, and radius can be a variable (see below)

Sorry for the late response. I changed the previous wrong command, and now it works.
Thanks.