Weird behavior reading acceleration files

Hi all,

I am writing to ask about a weird behavior that I found yesterday using the special accinputs. I am using DualSPHysics to simulate the fuel in a tank under a given profile of acceleration (automotive application). I am passing to the code a csv file for the accelerations.

Comparing the solution with a previous result obtained with a VOF method, I figured out that, for the first seconds the two codes give quite similar results, but after a while the two solutions become very different. In particular, the fluid simulated with DualSPHysics seems to feel a "wrong" acceleration (to give you an some point, the car has a long turn and I have almost only -60m/s**2 in y and the fluid is all located in -x).

Thinking about the possible source of this problem, I thought that one of the possible reason could be in a wrong reading of the csv file that contain the accelerations. So, to check that, yesterday I sorted the csv file in order to have the acceleration values every 0.05s and run a simulation again (the original csv file has values extracted every 0.005s from a true car lap). The results look slightly different from the one obtained using the original csv file.

Actually, I was expecting small changes because of the different interpolations that probably you get when you interpolate the csv values, but not so visible and not after few iterations.

Have you ever faced problem like this one?

Any suggestions is appreciated;)




  • Dear Lorenzo,

    This feature should work fine since it has already been tested. However, it is always possible that is some strange bug in the code. We can’t help you much if you don´t send us a specific example to test it. Reading your acceleration file may not be correct. You can display the values used during the simulation to check it.

    On the other hand, the frequency of the data may or may not have a great impact in the simulation depending on the variability of the data. It is normal since it uses a linear interpolation between consecutive values.

    Best regards,


  • Hi Jose!

    thanks for the comment and sorry for the delay.

    I did many tests at the end of last week and finally I think I got the point (hopefully...ahaha).


    When the acceleration file also contains rotational components, at each time step the local frame of reference of the body is consequently updated and it rotates. However, the acceleration components refers always to the reference of frame at t=0. This means that the acceleration file has to contain the values in the global reference and not the local one.

    In my case, I have values extracted from a car running on a track, and of course the values are always in a frame of reference fixed with the car. This was creating the problem mentioned above.

    I created for that a test case on a cube, passing an acceleration file that contains acceleration values of a 90 degrees right turn, but with and without angular acceleration. The idea is that the fluid has to move to -y, since that the car is moving to +y (the +x is pointing from the front to the rear of the car). And the result that I got:

    Here, we can see that, in the case with the angular acceleration, the system of reference has been also rotated of pi/2, and so the fluid that I was expecting in -y is now in -x. On the other hand, not considering the angular acceleration, everything looks as expected.

    I think that, in the future, it would be nice to have the possibility to switch from global and local values of the acceleration because, from experiments, you can have easily both the cases.


    As you correctly said, the issue was in the oscillations of the signal. The signal sampled at 20Hz has smoothed out high frequencies that are instead present in the signal at 200Hz...the differences are only in the time steps where there is a lot of noise.

    Many thanks!


Sign In or Register to comment.