# Floating objects: observed failure of conservation of linear momentum

This post is companion to https://forums.dual.sphysics.org/discussion/comment/3228/#Comment_3228, which regards conservation of angular momentum for rigid objects.

Here, a cube of 1m edge length, with centre of mass placed at the origin of the reference frame, has an initial velocity (20,0,0) m/s. I have run a simulation for the motion of this object without fluid and gravity. For the time marching I have given a conventional sound speed of 10 m/s and let DualSPHysics go. So the expectation is that the object maintains this velocity indefinitely because of conservation of linear momentum in the absence of external forcing.

The simulation covers 0.06 seconds with data output each 0.01 s. The average time step is in the order 0.0001 s. With the velocity assigned this means that the cubes should cover a stretch of 20 cm in 0.01 s and of 1 m in 0.05 s. I have used "DualSPHysics4 [Symmetry] v4.4.010 (21-06-2019)", "FloatingInfo4 v4.0.030 (21-06-2019)" and "GenCase4 v4.0.109 (21-06-2019)".

The table below is the output of FloatingInfo for the object in point. Some columns have been hidden.

Column I shows that at the time of the first output (0.01 s) the **centre of mass** has moved forward by ~20 cm. However, the displacement in the x-direction given by the **surge** in column L amounts to just ~6 cm, as though the object had travelled at 5.7 m/s (column R, my addition). This should be an inconsistency because of the object being rigid. This situation is highlighted in orange.

After that the object velocity and the surge speed are both 20 m/s. The row marked in yellow shows that after 0.05 seconds the centre of mass is at position ~1 m, while the surge displacement is 0.86 m. However, this mismatch is not just a presentational issue since the snapshot of the particle position shows that the whole object (including the centre of mass) has moved forward by the surge displacement 0.86 m rather than the expected 1 m.

I am glad to provide the input and output files, but please note that the files and procedure are pretty much the same as those attached in the companion post https://forums.dual.sphysics.org/discussion/comment/3228/#Comment_3228

I am afraid to have made trivial mistakes or that there could be something wrong with time marching of rigid bodies dynamics. Suggestions and/or patches, whichever applies, welcome. Thanks in advance for any feedback.

## Comments

Some suggestions;

What happens if you set the sound speed, c = 200 m/s?

What value of the variable b did you put? Did you use something arbitrary?

Kind regards

Thanks. Is there a reason why this behaviour is justified for c=10 m/s? The xml file can be found in https://forums.dual.sphysics.org/discussion/comment/3228/#Comment_3228 except for the swap between initial values of angular/linear velocity. b is computed from the artificial equation of state.

From your comment I understood that setting c = 200 m/s, ended up working? The reason for this change to be necessary is because DualSPHysics employs a weakly compressible approach - to ensure "99% incompressibility" it has been found that the speed of sound should be atleast 10 times larger than the speed of something in the domain. This can also be read in Chapter 3.4 on DualSPHysics Github wiki. I assume that the conservation of momentum might have had something to do with that. The reason you would never set c = 1000 or something like that, is because of the time step calculation, the larger c, the smaller time steps ie. slower solution - this is shown in Chapter 3.7.3.

And great, then you have computed b correctly (and for anyone interested see chapter 3.4 https://github.com/DualSPHysics/DualSPHysics/wiki/3.-SPH-formulation#34-equation-of-state).

Kind regards

@Asalih3d

The simulated material that can and should be weakly compressible is the fluid. Conversely, the weak compressibility approach holds for the fluid flow equations. There is no fluid here.

A rigid body, which is certainly incompressible, should follow its own set of the governing equations, also regardless of whether there is fluid or not.

Sound propagation is not physically relevant here. The time marching procedure might well inherit some parameters like time-step restrictions from the sound of speed. Nonetheless, at least on first looks, I would not expect instabilities and stability criteria from the motion of an isolated rigid object. Actually, one ends up having time steps quite small compared to those relating with the translation velocity of the body: order 10E-4 versus 10E-2 in this case, so the object motion is well resolved anyhow.

Rather than setting c=200 m/s, which leads to small time steps and long runs, I have given a velocity of 0.1 m/s and c=20 m/s (hence Ma=0.05 should it matter), while leaving all other parameters unchanged. The average time step is ~0.0008. The corresponding table from FloatingInfo shows that the problem persists:

So thanks again for your remark. It helped isolate the nature of this inconsistency further: it looks unrelated to the object's speed. This thread remains open.