Macro API Changes 12.02

In Simcenter STAR-CCM+ 12.02, the macro API changed for morphing motion, Eulerian multiphase, meshing, and reacting flows.

Morphing Motion: External STL File Replaced with Part Surface

For boundaries, the Morpher Constraint Specification constraint option STL Surface has been replaced with a more general Part Surface option.

In the macro code, the java class option ConstraintSpecification.Type.SLIDE_ON_STL_SURFACE has been replaced with ConstraintSpecification.Type.SLIDE_ON_PART_SURFACE).

An example of the changes to the macro code follows:

Previous Release Simcenter STAR-CCM+ v12.02

boundary_0.getConditions()
.get(MorpherSpecification.class)
.setSelected(MorpherSpecification.Type.CONSTRAINT);

boundary_0
.getConditions()
.get(ConstraintSpecification.class)
.setSelected(ConstraintSpecification.Type.SLIDE_ON_STL_SURFACE);

GuideSurfaceFileSettings guideSurfaceFileSettings_0 =
boundary_0
.getValues()
.get(GuideSurfaceFileSettings.class);

guideSurfaceFileSettings_0
.setFilePath("/users/iridium2/dmitry/guide_surface.stl");

// Step 1. Import STL file as a Part
Units units_0 =       
simulation_0
.getUnitsManager()
.getPreferredUnits(new IntVector(new int[] {0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}));

PartImportManager partImportManager_0 =
simulation_0
.get(PartImportManager.class);

partImportManager_0
.importStlPart(resolvePath("/users/iridium2/dmitry/guide_surface.stl"), "OneSurfacePerPatch", units_0, true, 1.0E-5);
    
Boundary boundary_0 = 
region_0
.getBoundaryManager()
.getBoundary("car-bdy");

// Step 2. Use Part surface

boundary_0.getConditions()
.get(MorpherSpecification.class)
.setSelected(MorpherSpecification.Type.CONSTRAINT);

boundary_0
.getConditions()
.get(ConstraintSpecification.class)
.setSelected(ConstraintSpecification.Type.SLIDE_ON_PART_SURFACE);

PartGuideSurfaceSettings partGuideSurfaceSettings_0 = 
boundary_0.getValues()
.get(PartGuideSurfaceSettings.class);

MeshPart meshPart_0 = 
((MeshPart) simulation_0
.get(SimulationPartManager.class)
.getPart("guide_surface"));

PartSurface partSurface_0 = 
((PartSurface) meshPart_0
.getPartSurfaceManager()
.getPartSurface("Surface"));

partGuideSurfaceSettings_0
.getGeometryObjectGroup()
.setObjects(partSurface_0);

Eulerian Multiphase: Changes to Suspension and Emulsion Rheology Models

For the Suspension and Emulsion Rheology models, phase interaction material properties have been restructured, resulting in changes to the macro code. The objects that were named based on their method are now named for the type of phase model.

The following example is the Krieger and Dougherty Relative Viscosity method used with the Emulsion Rheology model.

Previous Release Simcenter STAR-CCM+ v12.02

KriegerRelativeViscosityMethod kViscosityMethod_0 =
((KriegerRelativeViscosityMethod) phaseInteractionMaterial_0
.getMaterialProperties()
.getMaterialProperty(RelativeViscosityProperty.class)
.getMethod());

kViscosityMethod_0
.getMaximumPacking()
.setValue(maxPacking);

EmulsionRheologyModel emulsionRheologyModel_0 = 
phaseInteraction_0
.getModelManager()
.getModel(EmulsionRheologyModel.class);

emulsionRheologyModel_0
.getMaxPackingRheology()
.setValue(maxPacking);

The following example is the Morris and Boulay Relative Viscosity method used with the Suspension Rheology model.

Previous Release Simcenter STAR-CCM+ v12.02

MorrisAndBoulayRelativeViscosityMethod morrisAndBoulayRelativeViscosityMethod_0 =
((MorrisAndBoulayRelativeViscosityMethod) phaseInteractionMaterial_0
.getMaterialProperties()
.getMaterialProperty(RelativeViscosityProperty.class)
.getMethod());

morrisAndBoulayRelativeViscosityMethod_0
.getMaximumPacking()
.setValue(maxPacking);

SuspensionRheologyModel suspensionRheologyModel_0 = 
phaseInteraction_0
.getModelManager()
.getModel(SuspensionRheologyModel.class);

suspensionRheologyModel_0
.getMaxPackingRheology()
.setValue(phimax);

Meshing: Changes to Boolean Operation Macros

Macro commands for Boolean operations in surface repair have been enhanced to allow retention of tool faces for subtract operations.

NoteBoolean operation macros that worked in the previous version of Simcenter STAR-CCM+ are still supported. For long-term reliability, it is recommended that you upgrade your macros with the methods of the current version.

Examples of the changes to the macro code follow:

Boolean Unite

Previous Release Simcenter STAR-CCM+ v12.02
surfaceMeshWidgetIntersectOptions_0.setIntersectMode(1);
surfaceMeshWidgetIntersectOptions_0.setBooleanType(0); // Unite
surfaceMeshWidgetIntersectController_0.intersectFaces();
surfaceMeshWidgetIntersectOptions_0.setIntersectMode(1);
surfaceMeshWidgetIntersectOptions_0.setBooleanType(0);
surfaceMeshWidgetIntersectOptions_0.setKeepToolFaces(false);
surfaceMeshWidgetIntersectOptions_0.setRetainedFacesMode(0);
surfaceMeshWidgetIntersectController_0.booleanFaces(null);

Boolean Intersect

Previous Release Simcenter STAR-CCM+ v12.02
surfaceMeshWidgetIntersectOptions_0.setIntersectMode(1);
surfaceMeshWidgetIntersectOptions_0.setBooleanType(1); // Intersect
surfaceMeshWidgetIntersectController_0.intersectFaces();
surfaceMeshWidgetIntersectOptions_0.setIntersectMode(1);
surfaceMeshWidgetIntersectOptions_0.setBooleanType(1);
surfaceMeshWidgetIntersectOptions_0.setKeepToolFaces(false);
surfaceMeshWidgetIntersectOptions_0.setRetainedFacesMode(0);
surfaceMeshWidgetIntersectController_0.booleanFaces(null);

Boolean Subtract

Previous Release Simcenter STAR-CCM+ v12.02
surfaceMeshWidgetIntersectOptions_0.setIntersectMode(1);
surfaceMeshWidgetIntersectOptions_0.setBooleanType(2); // Subtract
surfaceMeshWidgetIntersectController_0.intersectFaces();
surfaceMeshWidgetIntersectOptions_0.setIntersectMode(1);
surfaceMeshWidgetIntersectOptions_0.setBooleanType(2);
surfaceMeshWidgetIntersectOptions_0.setKeepToolFaces(false);
surfaceMeshWidgetIntersectOptions_0.setRetainedFacesMode(0);
surfaceMeshWidgetIntersectController_0.booleanFaces(null);

Reacting Flows

Changes Due to Restructuring

The objects of certain reacting flow models have been restructured, resulting in changes to the macro code.

Previous Release Simcenter STAR-CCM+ v12.02
import star.segregatedflow.*;
import star.segregatedenergy.*;
import star.combustion.*;
import star.segregatedflow.*;
import star.segregatedenergy.*;
import star.combustion.*;
import star.reactions.*;

Changes to Table Generation

The process of generating tables for soot models has been merged into the process of generating tables for combustion. Therefore remove options with ppdfSootFlameletTable from your macros. An example follows:

Previous Release Simcenter STAR-CCM+ v12.02
SootMomentTableModel sootMomentModel_0 = 
   physicsContinuum_0.getModelManager().getModel(SootMomentTableModel.class);
sootMomentModel_0.setThreshold(100);
PpdfSootFlameletTable ppdfSootFlameletTable_0 =
   ((PpdfSootFlameletTable) sootMomentModel_0.getPpdfSootFlameletTable());
PpdfTableAxis ppdfTableAxis_2 =
  ((PpdfTableAxis) ((PpdfTableAxisManager) ppdfSootFlameletTable_0.getPpdfTableAxisManager()).getComponent("Mixture Fraction Variance"));
ppdfTableAxis_2.setDimensionSize(1);
ppdfSootFlameletTable_0.importTable(resolveDataPath("case/sootFlameletLibrary.tbl"));
SootMomentTableModel sootMomentModel_0 = 
   physicsContinuum_0.getModelManager().getModel(SootMomentTableModel.class);
sootMomentModel_0.setThreshold(100);

There were additional changes to the Soot Moment model in 12.02, in particular some model options were deprecated, that may affect existing macros. Please consult the "Restoring the 11.06 Soot Moments Model" section in the 12.02 User Guide for more information.

Changes to Setting of Number of Flamelet Grid Points

The method has changed for setting the number of points for a flamelet grid (such as for Mixture Fraction, Mixture Fraction Variance, Heat loss, and Progress Variable), resulting in changes to the macro code. You can now set the number of points for grids as fixed (similar to v11.06) or adaptive. Adaptive is now the default option.

The following example is for the Chemical Equilibrium Combustion model:

Previous Release Simcenter STAR-CCM+ v12.02
EquilibriumTableGenerator equilibriumTableGenerator_0 =
physicsContinuum_0.get(EquilibriumTableGenerator.class);
PpdfEquilibriumTable ppdfEquilibriumTable_0 =
((PpdfEquilibriumTable) equilibriumTableGenerator_0.getPpdfEquilibriumTable());
PpdfTableAxis ppdfTableAxis_0 = ((PpdfTableAxis) ((PpdfTableAxisManager)
ppdfEquilibriumTable_0.getPpdfTableAxisManager()).getComponent("Mixture Fraction"));
ppdfTableAxis_0.setDimensionSize(61);
PpdfTableAxis ppdfTableAxis_1 =
((PpdfTableAxis) ((PpdfTableAxisManager)
ppdfEquilibriumTable_0.getPpdfTableAxisManager()).getComponent("Mixture Fraction Variance"));
ppdfTableAxis_1.setDimensionSize(31);
EquilibriumTableGenerator equilibriumTableGenerator_0 =
physicsContinuum_0.get(EquilibriumTableGenerator.class)
EquilibriumTableParameters equilibriumTableParameters_0 =
((EquilibriumTableParameters) equilibriumTableGenerator_0.getTableParameters());
EquilibriumNumericalSettings equilibriumNumericalSettings_0 =
((EquilibriumNumericalSettings)equilibriumTableParameters_0.getEquilibriumNumericalSettings());
TableAxisParameters tableAxisParameters_1 = ((TableAxisParameters)
equilibriumNumericalSettings_0.getTableAxisParametersManager().getComponent
("MixtureFraction"));
// Set number of points to adaptive based on tolerance
tableAxisParameters_0.setAdapt(true);
AdaptiveGridParameters adaptiveGridParameters_0 =
tableAxisParameters_0.getAdaptiveGridParameters();
adaptiveGridParameters_0.setMaxDimensionSize(61);
adaptiveGridParameters_0.setRangeTol(0.001);
// Set number of points to non-adaptive (fixed)
tableAxisParameters_0.setAdapt(false);
FixedGridParameters fixedGridParameters_0 =
tableAxisParameters_1.getFixedGridParameters();
fixedGridParameters_0.setDimensionSize(61);