Creating a Simple Plan

With the aims of the macro clearly defined, you can start planning.

First, write down the steps required. For example, set the velocity to 5 m/s and run the simulation. These steps form the basis of a plan. Next, expand the plan to include other processes such as extracting data from an input file, looping through to repeat a set of actions, and opening a panel. Write the plan in simple terms.

To simplify the process of scripting the macro, you can record a simple Java macro in Simcenter STAR-CCM+ and extract sections of the code.

To meet the aims that were defined previously, the following steps are required (processes that can be obtained by recording a macro in Simcenter STAR-CCM+ are marked with a *):

  • Read cross-wind data from an external source
  • Clear any previous solution*
  • Set the inlet velocity value*
  • Set the initial velocity value*
  • Run the simulation for some iterations*
  • Calculate the drag coefficient on the train*
  • Save the drag coefficient value for each cross-wind angle of attack in an external data file
  • Save the simulation*
  • Repeat for each cross-wind angle of attack

You have marked a number of actions for which the Java code can be obtained by recording a macro.