srpeiter / ICCP

0 stars 0 forks source link

Argon simulation with link-method #1

Open srpeiter opened 9 years ago

srpeiter commented 9 years ago

Now I implemented a code that simulates the behaviour of a noble gas. The important part of the code, is the place where I calculate the interactions between particles : force_calculate function. I do this with the Link cell method. What I do is

  1. Divide the volume up in grids 2.Locate each particles in te grid.
  2. calculate the forces on the particle wiht other particles within the same cell and also the neighbouring cells. for more information see http://reaktiveplasmen.rub.de/files/lehre/md/02-2.pdf (this is where i got the information from)

The scheme of the code is as follows

  1. Allocate memory for the arrays : Make_array
  2. Initialize position and velocity of the particles : Initialization 3.Calculate the interactions (forces) : force_calculate 4.update position: pos_update
  3. calculate update force : force_calcute
  4. update velocity : vel_update

Note that this scheme is put into loop.

The problem now is that in the first iteration at point 5, when updating the force, the forces between the particles explodes to 10^50 and so on. This is obviously not possible. This is because for example: Say at point 2 of the code a particle 1 is at (0,0,0) and particle 2 is (0,0,2). At point 4 of the code both particles are at (0,0,9). I spent nights searching for solutions , but I couldn't find it.

So my question is : How can I resolve this problem? Is there a workaround?

Many Thanks

josthijssen commented 9 years ago

Did you try calculating the force using a stupis straightforward method first? You should always do that before venturing into the complicated methods. I will have a look at the code. JMT

srpeiter commented 9 years ago

Thanx, I will give it a try though and report.

josthijssen commented 9 years ago

I guess you should remove the -1 from cell_number and box_length in lines 224-226 and 260-262. By the way, box_length suggests that it is a length - it isn't. Choose clear and correct names!