Macro API Changes 9.06

In Simcenter STAR-CCM+ 9.06, the macro API changed for the On-The-Fly FW-H model, the Circuit Solver, the Dars-CFD Reaction model, the Fan Interface model, and simple shape parts.

Changes to the On-The-Fly FW-H Model

The FW-H Field Functions: FwhLoadingSurfaceTerm, FwhThicknessSurfaceTerm, FwhTotalSurfaceTerm, and FwhQuadrupoleVolumeTerm now use a unique and persistent index for each Receiver. Consequently, any old macro that sets these On-the-Fly FW-H Model field functions will fail to compile.
Previous Release Simcenter STAR-CCM+ v9.06
((PrimitiveFieldFunction)
getSimulation().getFieldFunctionManager()
.getFunction("LoadingSurfaceTermstar.acoustics.PointReceiver_0"));

((PrimitiveFieldFunction)
getSimulation().getFieldFunctionManager()
.getFunction("ThicknessSurfaceTermstar.acoustics.PointReceiver_0"));

((PrimitiveFieldFunction)
getSimulation().getFieldFunctionManager()
.getFunction("TotalSurfaceTermstar.acoustics.PointReceiver_0"));

((PrimitiveFieldFunction)
getSimulation().getFieldFunctionManager()
.getFunction("QuadrupoleVolumeTermstar.acoustics.PointReceiver_0"));
((PrimitiveFieldFunction)
getSimulation().getFieldFunctionManager()
.getFunction("Receiver0::LoadingSurfaceTerm"));

((PrimitiveFieldFunction)
getSimulation().getFieldFunctionManager()
.getFunction("Receiver0::ThicknessSurfaceTerm"));

((PrimitiveFieldFunction)
getSimulation().getFieldFunctionManager()
.getFunction("Receiver0::TotalSurfaceTerm"));

((PrimitiveFieldFunction)
getSimulation().getFieldFunctionManager()
.getFunction("Receiver0::QuadrupoleVolumeTerm"));

Changes to the Circuit Solver

In Simcenter STAR-CCM+ v9.06, the circuit solver has been reorganized to have its own library. Macros that were recorded in previous versions of Simcenter STAR-CCM+ must be modified to import the circuit solver library: import star.circuit.
Previous Release Simcenter STAR-CCM+ v9.06
package base.battery;

import star.common.MonitorPlot;
import star.common.Simulation;
import star.common.StarMacro;

import java.io.File;

import star.material.*;
import star.common.*;
import star.base.neo.*;
import star.segregatedenergy.*;
import star.base.report.*;
import star.battery.*;
import star.solidmesher.*;
import star.flow.*;
import star.meshing.*;
import star.metrics.*;
import star.energy.*;
package base.battery;

import star.common.MonitorPlot;
import star.common.Simulation;
import star.common.StarMacro;

import java.io.File;

import star.material.*;
import star.common.*;
import star.base.neo.*;
import star.segregatedenergy.*;
import star.base.report.*;
import star.battery.*;
import star.circuit.*;
import star.solidmesher.*;
import star.flow.*;
import star.meshing.*;
import star.metrics.*;
import star.energy.*;

Changes to the Dars-CFD Reaction Model

In Simcenter STAR-CCM+ v9.06, the Allow Switch to ASCII property has been removed from the Dars-CFD Reaction model. Remove all references to this property from your existing macros.
Previous Release Simcenter STAR-CCM+ v9.06
DarsCfdGasReactionModel darsCfdGasReactionModel_0 =
physicsContinuum_0.getModelManager().getModel(DarsCfdGasReactionModel.class);

darsCfdGasReactionModel_0.setModeSwitch(true);
DarsCfdGasReactionModel darsCfdGasReactionModel_0 =
physicsContinuum_0.getModelManager().getModel(DarsCfdGasReactionModel.class);

Introduction of Fan Curve Scaling for the Fan Interface Model

In Simcenter STAR-CCM+ v9.06, the method that you use to set the rotation rate in the fan interface has changed due to the addition of fan curve scaling. In previous versions of Simcenter STAR-CCM+ there was no fan curve scaling for the fan interface. In v9.06, you define the fan curve scaling on the performance curve by setting two values: Operating Rotating Rate and Data Rotation Rate. Modify your existing macros to use the updated method for setting the rotation rate.
Previous Release Simcenter STAR-CCM+ v9.06
Simulation simulation_0 = getActiveSimulation();

BoundaryInterface boundaryInterface_0 =
((BoundaryInterface) simulation_0.getInterfaceManager()
.getInterface("Block/Block 2"));

FanInterfaceSwirlProperties fanInterfaceSwirlProperties_0 =
boundaryInterface_0.getValues().get(FanInterfaceSwirlProperties.class);

fanInterfaceSwirlProperties_0.getRotationRate().setValue(50.0); 
Simulation simulation_0 = getActiveSimulation();

DirectBoundaryInterface directBoundaryInterface_0 =
((DirectBoundaryInterface) simulation_0.getInterfaceManager()
.getInterface("Block/Block 2"));

FanCurveTable fanCurveTable_0 =
directBoundaryInterface_0.getValues().get(FanCurveTable.class);

fanCurveTable_0.getOperatingRotationRate().setValue(50.0);
fanCurveTable_0.getDataRotationRate().setValue(50.0);

New Method for Simple Shape Parts

Newly created simple shape parts are now associated with CAD objects. Rather than numbering faces sequentially from 1, use the ID numbers from the CAD surfaces.

Simple shape parts in earlier simulations are not associated with CAD objects. If you change any parameter related to the shape in an old simulation file (for example the radius of a sphere), Simcenter STAR-CCM+ generates a CAD body for the part and then re-tessellates the part.

To perform the split-by-patch action, use one of the following functions to get the patch ID of a specific face and pass it to the splitPartSurfaceByPatch function as an argument:

  • For a block part:
    • getMinXFace()
    • getMinYFace()
    • getMinZFace()
    • getMaxXFace()
    • getMaxYFace()
    • getMaxZFace()
  • For cylinder/cone parts:
    • getStartFace() – patch corresponding to the face that is close to the start point
    • getEndFace() – patch corresponding to the face that is close to the end point
    • getSideFace() – patch corresponding to the cylindrical face

Examples of macro steps for a block part and a cylinder follow.

Block Part

The value used in this example is minXFace.

Previous Release Simcenter STAR-CCM+ v9.06
SimpleBlockPart simpleBlockPart_0 = 
      ((SimpleBlockPart) simulation_0.get(SimulationPartManager.class).getPart("Block"));

    PartSurface partSurface_0 = 
      ((PartSurface) simpleBlockPart_0.getPartSurfaceManager().getPartSurface("Block Surface"));

    simpleBlockPart_0.splitPartSurfaceByPatch(partSurface_0, new IntVector(new int[] {1}), "Block Surface");
SimpleBlockPart simpleBlockPart_0 = 
      ((SimpleBlockPart) simulation_0.get(SimulationPartManager.class).getPart("Block"));

    PartSurface partSurface_0 = 
      ((PartSurface) simpleBlockPart_0.getPartSurfaceManager().getPartSurface("Block Surface"));

    int minXFace = simpleBlockPart_0.getMinXFace();
    simpleBlockPart_0.splitPartSurfaceByPatch(partSurface_0, new IntVector(new int[] {minXFace}), "Block Surface");
Cylinder Part

The value used in this example is startFace.

Previous Release Simcenter STAR-CCM+ v9.06
SimpleCylinderPart simpleCylinderPart_0 = 
      ((SimpleCylinderPart) simulation_0.get(SimulationPartManager.class).getPart("Cylinder"));

    PartSurface partSurface_0 = 
      ((PartSurface) simpleCylinderPart_0.getPartSurfaceManager().getPartSurface("Cylinder Surface"));

    simpleCylinderPart_0.splitPartSurfaceByPatch(partSurface_0, new IntVector(new int[] {1}), "Cylinder Surface");
SimpleCylinderPart simpleCylinderPart_0 = 
      ((SimpleCylinderPart) simulation_0.get(SimulationPartManager.class).getPart("Cylinder"));

    PartSurface partSurface_0 = 
      ((PartSurface) simpleCylinderPart_0.getPartSurfaceManager().getPartSurface("Cylinder Surface"));
    
    int startFace = simpleCylinderPart_0.getStartFace();
    
    simpleCylinderPart_0.splitPartSurfaceByPatch(partSurface_0, new IntVector(new int[] {startFace}), "Cylinder Surface");