DualSPHysics / DesignSPHysics

Module for FreeCAD intended to use with DualSPHysics fluid simulator.
Other
113 stars 40 forks source link

Issue on Linear Motion File in Sloshing tank example #98

Closed VictorV666 closed 2 years ago

VictorV666 commented 3 years ago

Hello,

I would like to give a heads-up of a potential bug when I am running a 2D case of a tank with water inside (sloshing case), under a linear motion file - horizontal translation (a text file which has 2 columns). When I define the X-column as 1, and time as 0, it runs, but when I vizualize actually it translatez on Z-direction, and the particles are out of the boundary. I tried to reverse them, and use Z as my X, but it just translates endlessly, without actually following the time steps created on the text file that I input as linear motion file (I attached the external file). If other files are required, please let me know. I would be interested if this is a general problem, or it is just by me, since I don't get errors on that.

The version used for FreeCad is 0.19 with DualSPHysics package: 0.6.1.2102-24-04.

motion_a5mm_f01-08Hz.txt

Thank you!

zlotny commented 2 years ago

Could you upload the case xml file? I wonder if this problem is related with DualSPHysics. Maybe DualSPHysics can read your txt file correctly. I'll try to test this to see where the problem is.

Thanks for noticing it!

VictorV666 commented 2 years ago

Sure, please find it attached! slosh_Def.zip

zlotny commented 2 years ago

Hi there, I've been trying different things with your file and there's something weird with it. Then I tested with a newly made file so I can give you a working recommendation. These are the problems I see with it:

  1. Don't use tabs. Theres multiple tabs at the end of each line that can confuse DualSPHyiscs. I would process that file so it only separates values by 1 space each (like: "0 0.2" and so on).
  2. Create another column with 0 values. This way you can set the coordinates you don't want to move to that column. That was one of the main issues. For example if you want the object only to move on the X axis you could have a file in which each line was something like "1 0.2 0", being 1 second of time, an space, 0.2 is the value for an axis, and 0 is just a null value. Then in DesignSPHysics you could use it like this:

image

Notice how Y and Z point to the last column (2, beginning in column 0) so they won't move, but X is pointing to the middle column (1, beginning in column 0) which has the actual values I want

  1. The movement in the file is reeeeeally tiny. Take in mind the values are measured in seconds and in meters. It may lead to confusion that the "standard" unit in FreeCAD by default is mm. For I can see you're moving your half a meter long tank by 0.004 meters (or 4 mm) when the time hits 3 second. Are you sure this is correct?

  2. Try to avoid exponentials. This is not specifically bad but sometimes different softwares use different notations for exponentials in text files, and I'm not really sure which format is the preferred one for DualSPHysics. Sure, the file will be bigger but in a text file nowadays... it's not a big deal at least you plan on moving it via diskette :)

I hope this helps, I'll keep the issue open for now, but the main problem seems solvable with a few lines of python or matlab.

Have a nice day!

VictorV666 commented 2 years ago

Hi, thank you for taking the time to answer! I am still in doubt as I checked a case, with defining the motion (ex: sinusoidal rectilinear motion) - I will snap the images to explain - basically I want to give a sinusoidal harmonic of 0.5Hz and 5cm amplitude on X-dir, but by looking at the paraview - the particles are just dispersed on Z dir. This did not happen in the previous, older DSPH versions. I attach also the input files - i used GUI for that. motion_sloshing

visual

DSPH_Case.zip 5/152856799-316175ab-d5af-4a50-acec-d583386c0787.PNG)

Thanks and best regards, Victor

VictorV666 commented 2 years ago

Dear Andres,

I figured out why the above was happening - namely, the decimal symbol on my windows was set to comma (","), not point (".") , the same for digit decimal (it should be a comma). After I fixed that, it works. A small detail, but it took some time to figure it out, and I decided to post it here for the users who might experience this issue in the future. With that, I would like to close the issue, as solved. Thank you!

Best regards, Victor