Open srpeiter opened 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
Thanx, I will give it a try though and report.
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!
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
The scheme of the code is as follows
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