This is an old revision of the document!
In this tutorial we will create a body of water colliding with a wall. It uses the initial velocity properties to apply a force at simulation start. Additionally, it uses STL imported and exported meshes. The result should be something like this:
This simulation consists in a STL imported geometry that holds a cube of water.
These are the steps to get to that.
First of all, lets run FreeCAD and run this software. Make sure DesignSPHysics is installed. For that, you can check the installation page.
Once in DesignSPHysics, use the New Case button to create a new case. If you have opened FreeCAD files, DesignSPHysics will prompt you to close them automatically.
Once created you should see something like this:
This red lines represent the Case Limits, in which elements that are part of the simulation will be contained.
Make sure your plugin is configured correctly, pressing “Setup Plugin” and establishing the proper executables in the configuration window that appears.
Change the Inter-particle distance text input box to 0.06. It will look something like this:
This will set the case to generate a particle every 0.06 meters. For this case is an appropiate value for quick-simulation.
The next step is to adjust the case limits, so let's do that.
First of all select Case_Limits from FreeCAD's combo view. You will see the FreeCAD objects properties in the properties table. There, edit the Length, Width and Height to match 3 meters, 2 meters and 2 meters respectively. It should look like this:
Now, move the Case_Limits object to the position [0,3m 0,3m -50mm] (X, Y and Z), to make it look like this:
Once done that, we will import the boundary object. To import the object, just click in FreeCAD's File menu → Import. In the file selector, open casing.stl (downloadable from ——————>here).
You should see how it fits into the Case Limits. Now, add it to the simulation pressing the Add to DSPH Simulation button, and ensure its MKBound is 1
We're going to create a new cube and rename it to “Water”. For that, press in the cube icon on the top of the screen, select the generated cube, and press F2 (or right click → rename) to rename it.
We need to resize this body, so press in it and in FreeCAD's property table input, as before, this values:
Water:
We need to mark this object as part of the simulation. Press the Add to DSPH Simulation button in the DSPH Object Properties
Now we will set this body to be fluid. For that, select it and in the DualSPHysics property table set the Type of Object to: Fluid. Also, if is not set yet, put the MKFluid value to 0
You will see that the body turns blue, representing water. You should have something like this on your screen:
To do this, select the Water object. In the Initials property click Configure. A window will appear.
We need to set initials to True to enable the movement vector editing. Once enabled, input an (3.0, 0.0, 0.0) vector (X, Y, Z). Press apply and DesignSPHysics should warn you that this property will apply to all objects with mkfluid = 0. That's right, so continue.
And that's it! It's ready to simulate.
You can now save your project. This will generate a GenCase export and tell you how many particles you have to simulate.
Your case should be something like this:
From there you can just select your preferred processor in the simulation group (CPU or GPU[Nvidia only]) and press “Simulate Case”. Once finished you can export the data to VTK with the button “Export data to VTK”.
To see the resulting animation you can open all the data generated with a visualization software, like Paraview. Your simulation data is in the folder you saved the project, under [project name]_Out/