Using Java Script To Create Animations Within Star CCM+

Adding motion to your simulation results can produce better understanding for all interested parties. Through exploiting the Java macro functionality offered in Star-CCM+ the camera’s position can be incrementally adjusted through multiple steps, while an image is saved at each step.  Using this functionality the model and results can be rotated, panned and zoomed automatically.  The saved images can then be stitched together using a wide variety of animation programs (Windows Movie Maker, ImageMagick, etc…).

PMI has developed a Java script that links to a local coordinate system within the Star-CCM+ model.  Using this coordinate system a wide variety of scene transformations can be implemented to create animations.  PMI has provided a copy of this script with this week’s update[1].  This script include a graphical user interface (GUI) to allow for most of the model transformations to be coded without the user needing to modify the underlying Java code.

The basics for using the script are as follows:

  • Copy the script into a text file and save it. Rename the file as ‘rotate_zoom_translate_GUI’ and change the extension from ‘.txt’ to ‘.java’.
  • Open your simulation file in Star CCM+. Run the ‘rotate_zoom_translate_GUI.java’ macro from ‘Play Macro…’ option.
  • Interactive dialogue boxes will pop-up to communicate information and will allow you to input variables for view transformations.

[1] NOTE:  This script was developed for PMI’s internal use and is provided without warranty.  PMI will not offer technical support for script modifications.

Java Code — Rotate_Zoom_Translate_GUI

 

By Lilunnahar Deju