This is an old revision of the document!
This page contains a feature refence for DSPH for FreeCAD. Here you can found an extensive feature description and usage for the software.
Each section is documented as a tutorial. This document is updated to the version 0.10a, so if you are using a higher version expect changes.
For installing FreeCAD is recommended to check out the Installation page. It contains information on the way to install DualSPHysics for FreeCAD in Microsoft Windows and GNU/Linux.
To execute DSPH for FreeCAD you need to have it installed and your FreeCAD version shoud be 0.16 or higher.
First of all, open FreeCAD. You should see an start page with no projects opened. Click on the 'Execute Macro' button to open a dialog.
In the dialog that appears, select DSPH.py and press 'Execute'.
DualSPHysics will load and when a side panel appears, you're ready to go.
The first time you execute DSPH for FreeCAD you'll see a warning informing you that some of the executables are not correct. This happens because DSPH for FreeCAD needs to use GenCase, DualSPHysics and PartVTK, and you need to provide this binaries for your own.
Click the 'Setup Plugin' button at the right toolbar (by default) to open a Setup dialog, in which you can set the path to the needed binaries.
Click the '…' button in each section to select the right binary file. If a file is not correct, DSPH for FreeCAD should spawn a warning dialog.
Once you set the 3 binaries, push Ok and the information will be saved on disk, so the next time you execute DSPH for FreeCAD you'll not need to do this again.
Creating a case opens a FreeCAD Document specifically modified to work with this software. Note that creating a new FreeCAD document with the 'File' menu will not create a correct DSPH-compatible file.
To create a case just press 'New Case' in the right side of the screen (by default). An default setting will be opened in FreeCAD. You will see a 'DSPH_Case' in the object tree, with only one element inside: 'Case_Limits'. This object will represent the boundaries of the case simulation, and everything outside that volume will be ignored.
That's it! You have a new case created.
A DSPH case has 2 main variable definition: A Case constants and execution parameters. This section covers the constant definition.
To define de constants of the open case, click the 'Define Constants' button in the right side of the screen (by default). A window will pop with data.
Each field of the constants definition can be edited but, by default, all data will be filled with optimal values.
Some of the most relevant things to change is the fluid reference density or the gravity.
Similar to constant definition, execution parameters covers the case variables that define execution.
To define the execution parameters, click the 'Execution Parameters' button in the right side of the screen (by default). A window will pop with data.
Each field of the execution parameters can be edited but, by default, all the data will be filled with optimal values.
Some of the most relevant things to change is the time of simulation, viscosity or max parts out allowed.
Loading a case opens a previously DSPH for FreeCAD compatible case. DSPH for FreeCAD opens *.dsphdata files
A bare bones case must be inside a folder and contain a casedata.dsphdata
file and a DSPH_Case.FCStd
file.
The name of the folder containing this elements will be the name of the case.
To load a case, press the 'Load Case' button at the right side of the screen (by default). In the file selector that pops in, select the *.dsphdata file that you want to open.
The case will be opened as a FreeCAD document with all of the previously modified data set.
Saving a case does multiple things:
As you can see, the saving feature does a really big chunk of the total work in a simulation.
To save, press the 'Save Case' button. If everything went well, a dialog will pop up indicating how many particles GenCase exported and a button to check the complete output of GenCase.
If GenCase can't be found, it will only save the case data and FreeCAD document.
If you want to generate a case to simulate, you just need to check how to save, as it does it automatically.
Check out how to save a case.
Simulating a Case will take the case generated previously to DualSPHysics. Simulating is usually a time consuming step, so make sure your case is correctly defined first.
To simulate a case make sure you saved your case, so the info in disk is accurate. Then, select the preferred processing for simulating:
Once selected, you have 2 options: To set additional parameters, with the 'Additional parameters' button, or simulate pressing 'Simulate Case'
During simulation, a window will pop with useful simulation data, such as the case name, the processor selected, the total number of particles, the particles that went out of case, and the estimated date of completion.