For cases that have been post-processed to include a User Process Cube or Cylinder that has been divided into Eulerian Statistics, this script will, for the desired time range, export the selected variables of a selected Eulerian Statistics process. It will also allow you to choose whether to have Rocky save the exported data to a single file that contains all outputs, or to save one individual file per output.
Script Details
When running this script in a case that contains results and at least one Eulerian Statistics process, a new Export details window appears.
One file per output?: When checked, single .csv files will be created for each output.
Initial time: Selects the initial time to be exported.
Final time: Selects the final time to be exported.
Tip: If you want to export single time information, select the Initial time equal to the Final time.
Eulerian Process: Enables you to select the Eulerian Statistics process for which you want to export properties.
Properties to be exported: This option lists all the particle properties available for exporting. The user must check the properties which will be written in the .csv file.
Script Outputs
The files created after running this script will be saved in the same location as your project folder, inside a folder named eulerian-data.
If the user enables the One file per output? option, there will be a single file per output. The quantity of outputs to be exported is defined by the selected Initial time and Final time. If the One file per output? is disabled (unchecked), a single .csv file will be generated, containing all outputs within the desired time range.
For a case named case_name and the One file per output? option enabled, the export file of the output 0.14s will be named:
case_name_eulerian_data-0.14s.csv
The figure below shows an example of a file generated with the One file per output? option checked.
The figure below shows an example of a file generated with the One file per output? option disabled.
Some properties are available only if Collect Contacts Data are enabled. This script will list only the properties that are available for exporting.
If the selected property is not a scalar (for example, a tensor), the number of columns will correspond to the number of property components, and the variable name in the file header will contain the corresponding component number. For example, for the Stress Tensor variable, 9 columns will be written, one for each tensor’s components, with the names starting as Stress Tensor[0] up to Stress Tensor[8], as can be seen below.
Script Prerequisites
This script must run only on current release.
After downloading and extracting the attached .zip file, the included .py file must be saved to your Scripts folder, which is inside your Rocky folder.
On Windows, this folder is located at C:\Users\YOURUSERNAME\Documents\Rocky\Scripts.
On Linux, this folder is located at /home/YOURUSERNAME/.Rocky/scripts.
This script requires that at least one Eulerian Statistics process exists in your project.
Tip: To modify this script to better match your own project needs, open the .py file in a Python Editor, such as Visual Studio Code, and then use the information in the PrePost Scripting Manual to adjust the parameters and settings to your needs.