Search

Blog posts Volupe

Optimizing simulation workflows FOR Simcenter STAR-CCM+

Imagine you’re working on a project that involves running simulations in Simcenter STAR-CCM+. Each simulation run generates a .sim file containing crucial data about the model, mesh, and solution. As your project progresses or when you perform a Design Space Exploration,  these files accumulate, consuming valuable disk space. The only way to free up disk space is to clear mesh and solution data to archive them for future. Manually performing these tasks can be time-consuming and error-prone. In this article, we’ll explore the creation of a Linux shell script that automates these processes, making data management a breeze.

 

Introducing Automation: The Shell Script Solution

To address these challenges, we’ll create a shell script that automatically detects .sim files, opens them in Simcenter STAR-CCM+, clears mesh and solution data, and saves the modified files. Here’s how it works:

  1. Detecting .sim Files: The script starts by scanning the specified directory (and its subdirectories) for files with the .sim extension. We can recursively search a directory and its sub-directories, by writing a recursive function that takes as initial argument the path of the target directory (argument). It iterates through each entry of the current directory and invokes itself whenever that entry is a directory
    step1
    Then we check each file in the directory for its ending:step1b
  2. Store Path temporarily: Once a sim file was detected, we need to store the path temporarily since we are continuously changing the directory.
  3. Automating Simcenter STAR-CCM+ Operations: Once the .sim files are identified, the script utilizes Simcenter STAR-CCM+’s command-line to open each file to run the ClearClose.java script. With each .sim file open, the script executes commands within Simcenter STAR-CCM+ to clear the mesh and solution data. This step is crucial for conserving disk space while retaining the essential aspects of the simulation setup.
    step3ClearClose.java:
    step4 1
  4. Saving Modified Files: After clearing the data, the script instructs Simcenter STAR-CCM+ to save the modified .sim file, ensuring that the changes are preserved for future use.
    step5 1
  5. Clean up: Simcenter STAR-CCM+ creates temporary files every time you save the simulation. Thus we need to clean up and remove all *.sim~ files.
    step5
  6. Run: Last step is the application on your simulation directory. Add the path to your Simcenter STAR-CCM+ installation as well as the ClearClose.java macro.
    step6
    Say that you have an archive of completed project where you dump all finished project folders. Navigate to the script we are building and execute: step6b

Conclusion

By automating the management of simulation files, we can streamline workflows, save time, and ensure consistency in data handling. Whether you’re dealing with a handful of simulations or a vast dataset, a well-designed shell script can be a valuable tool in your arsenal. With the approach outlined in this article, you’ll be better equipped to tackle the challenges of data management in the world of CFD and simulation.

Have you ever automated file operations in your simulation workflows? Share your experiences and insights with us support@volupe.com! Let’s continue the conversation on efficient data management in Simcenter STAR-CCM+.

 

 

 

 

 

The Author

Florian Vesting, PhD
Contact: support@volupe.com
+46 768 51 23 46

florian volupe

 

More blog posts