Running the Simulation to Convergence

The following steps demonstrate how to alter the macro to run the set of simulations until convergence has been reached.

  1. Open trainFlowAngles.java file using an appropriate text editor.
  2. Locate the line in the macro where you call the runCase() method from the SimRunner object.
    public void execute() {
     
      try {
    
        for (/**/) {
    
          runner.runCase(sD, 5);
    
        }
        } catch (/**/) {
        }
    }
  3. Change the number of iterations to 400.
    runner.runCase(sD, 400);
  4. Save and close the file.
  5. Make sure that the simulation trainMacro.sim is open.
  6. Click the (Play Macro) button in the Macro toolbar and select the trainFlowAngles.java file.
  7. If, at any time, the macro must be interrupted click the (Abort) button next to the status bar.


When the macro has finished running you get a set of drag coefficient data, as well as a collection of scenes and plots. The following are examples of the residual plot, and streamlines scene for the train with a cross-wind angle of 90 degrees, after 400 iterations.
Residual Plot:

Velocity Magnitude Scene:

Streamlines Scene: