JuliaMolSim / Molly.jl

Molecular simulation in Julia
Other
371 stars 51 forks source link

[feature request] velocity-dependent forces #148

Open algorithmx opened 9 months ago

algorithmx commented 9 months ago

Dear Molly developers,

I have been working on ion implantation simulation for a while and want to develop some new algorithms to deal with the microscopic collisions. Then I came across Molly.jl, in particular its gravity examples. I have two questions now, regarding the velocity-dependent forces.

Question 1. How difficult it is?

If I want to modify the function interface of force() in allow for arguments representing (lab frame or relative) velocities, how much effort will I make to get the code running with simulations using the Verlet algorithm?

Question 2. Is it necessary?

Since there isn't a block-diagram sketch of the overall design of Molly.jl, I only grasped a portion of it by digging into the call sequence. I realised that the force() function is designed not to accepting velocity as input argument. It is a deliberate choice? I mean, was it decided at the very beginning of the project that the package don't allow for velocity-dependent forces?

Consider the simulation of galaxy dynamics, the particles are moving in effective dust clouds, experiencing drag forces. I guess, in this case, velocity dependent force are absolutely necessary to make realistic simulations.

In my case of ion implantation simulation, the projectile and the targets are ions. They interact via screened Coulomb potential and a dissipation force depending the relative velocity. The dissipation force has significant impact on the scattering behaviour. In the regime when the projectile's velocity is comparable to the velocity of thermal motions of the targets, one must use molecular dynamics. The velocity-dependent dissipation force is necessary to reproduce the trajectories of the projectile and targets. That is basically why I open this issue to discuss the possibility.

I am an experienced Julia programmer and want to invest on this beautiful project of Molly.jl. Hope to have your opinions :-)

algorithmx commented 9 months ago

Simulating a particle system with velocity-dependent interaction forces cannot even be called an idea ...

jgreener64 commented 9 months ago

It's hard at the minute to do this with anything other than a general interaction. The initial aim of the package was molecular mechanics where this is not used, hence why it is not implemented. It would be a useful feature though and it has been requested before. I'll have a think about how to implement it.