Workflow User Data
Saving user data
Workflows enable you to tag your models in PRIMER with user data which can be utilised in D3PLOT, T/HIS, and REPORTER to provide relevant post-processing analysis tools.
The user data can either be saved in a JSON file or as post *END data in the model keyword file.
In PRIMER, each Workflow Tool will have buttons in the main window for saving either to a file or to a model, e.g. for the Automotive Assessments workflow:
User data saved to JSON files
If the data is saved to a JSON file, the file either needs to be saved in the same directory as the model or in a parent directory for it to be found when loading model results in D3PLOT, T/HIS and REPORTER.
The name of the file can be anything you want, although it must have the .json extension.
Saving JSON files in parent directories means that you only have to setup the user data once and it can be used by multiple models.
For example, in the folder structure below, the parent_user_data.json file in dir_1 will be used for the results in dir_3 and dir_4 and the user_data.json file in dir_2 will be used for the model in dir_2:
- dir_1
|- parent_user_data.json
|
|- dir_2
| |- model1.key
| |- d3thdt
| |- d3plot
| |- user_data.json
|
|- dir_3
| |- model2.key
| |- d3thdt
| |- d3plot
|
|- dir_4
| |- model3.key
| |- d3thdt
| |- d3plot
Maximum number of directories to search up
The maximum number of directories up from a model/results directory that will be searched is set to 4 by default, but it can be changed by setting the preference oasys*workflow_max_upward_folder_search_depth.
For example, in the following folder structure, the grandparent_user_data.json file is 2 directories up from the model in dir_3 and will be found when reading the results into D3PLOT, T/HIS and REPORTER.
- dir_1
|- grandparent_user_data.json
|
|- dir_2
| |- dir_3
| |- model1.key
| |- d3thdt
| |- d3plot
Search in workflow_user_data directory
The search for user data JSON files will also look in a folder named workflow_user_data in the model folder and its parent folders.
For example in the below folder structure, the parent_user_data.json file in dir_1/workflow_user_data will be used for the models in dir_3 and dir_4, and the user_data.json file in dir_2 will be used for the model in dir_2:
- dir_1
|- workflow_user_data
| |- parent_user_data.json
|
|- dir_2
| |- model1.key
| |- user_data.json
|
|- dir_3
| |- model2.key
|
|- dir_4
| |- model3.key
The name of the directory to search can be changed by setting the preference oasys*workflow_user_data_directory_name. This allows you to store your user data files in a helpfully named directory in your Ansys LS-DYNA analysis area.
Writing user data for multiple Workflows
When writing user data for multiple Workflows, you have two options:
-
Write the user data for each Workflow to a separate JSON file:
- dir_1
|- model1.key
|- d3thdt
|- d3plot
|- user_data_workflow_1.json
|- user_data_workflow_2.json
|- user_data_workflow_3.json -
Write the user data for each Workflow to a single JSON file:
- dir_1
|- model1.key
|- d3thdt
|- d3plot
|- user_data.json ← Contains user data for Workflows 1, 2 and 3
The option you chose will depend on how you want to organise your files, but in terms of how the data is read in D3PLOT, T/HIS and REPORTER, there is no difference.
To write multiple Workflows, you need to select an existing user data JSON file when saving the file.
- If user data for the workflow already exists in the file it will overwrite that data, but preserve the user data for any other workflows that already exist in the file.
- If user data for the workflow doesn't exist in the file it will append it to the existing user data for any other workflows in the file.
User data saved in keyword files
If the data is saved to a model it is stored as post *END data in the master keyword file, e.g.:
When you click Save To Model in the Workflow window, it is important to note that this adds the data to the model, but it doesn't automatically write the model to disk. You need to manually use Model → Write to save the data to the keyword file.