Macro API Changes 2302

In Simcenter STAR-CCM+ 2302, the macro API changed for meshing, simulation operations, morphing, material properties, electromagnetism, battery modeling, and Simcenter STAR-CCM+ In-cylinder.

Meshing: Removal of Region-Based Meshing

Region-based meshing has been removed. For details about specific changes in the Simcenter STAR-CCM+ UI, see "Meshing: Removal of Region-Based Meshing" in the Important Notes section of the 2302 Release Notes.

The recommended practice is to use parts-based meshing—see the section "Simcenter STAR-CCM+ > Pre-Processing > Meshing > Parts-Based Meshing" in the Simcenter STAR-CCM+ User Guide.

Macro codes related to this feature have also changed.

Previous Release Simcenter STAR-CCM+ 2302
public void newRegionsFromParts(Collection<GeometryPart> parts,
          String regionMode,
          Region region,
          String boundaryMode,
          Boundary boundary,
          String featureCurveMode,
          Object featureCurve,
          CreateInterfaceMode interfaceMode)
// Deprecated; use instead:

public void newRegionsFromParts(Collection<GeometryPart> parts,
          String regionMode,
          Region region,
          String boundaryMode,
          Boundary boundary,
          CreateInterfaceMode interfaceMode)
public void newRegionsFromParts(Collection<GeometryPart> parts,
        String regionMode,
        String boundaryMode,
        String featureCurveMode,
        boolean createInterfaces)
// Deprecated; use instead: 

public void newRegionsFromParts(Collection<GeometryPart> parts,
          String regionMode,
          String boundaryMode,
          boolean createInterfaces)
public void newRegionFromPart(GeometryPart part,
                String boundaryMode,
                String featureCurveMode,
                boolean createInterfaces)
// Removed.
public void newRegionsFromParts(
Collection<GeometryPart> parts,
String regionMode,
Region region,
String boundaryMode,
Boundary boundary,
String featureCurveMode,
FeatureCurve featureCurve,
boolean createInterfaces)
public void newRegionsFromParts(
Collection<GeometryPart> parts,
String regionMode,
Region region,
String boundaryMode,
Boundary boundary,
boolean createInterfaces)
FeatureCurve featureCurve_0 = 
    ((FeatureCurve) region_2.getFeatureCurveManager().getObject("Default"));

     region_2.getFeatureCurveManager().removeObjects(featureCurve_0);
// Deprecated. This code can still be called, but it has no effect.
PartCurve pc;
pc.hasFeatureCurve();
pc.getFeatureCurve();
pc.setFeatureCurve(fc);
// Removed.
Region r;
r.getMeshContinuum();
r.setMeshContinuum(MeshContinuum mc);
// Removed.

Classes that are related to FeatureCurves, MeshContinuum, and MeshValueManager have been removed. Many classes that end with Solver or Model have also been taken out. Below is a list of classes that you might find in your macros that have been removed or altered:

  • AbsoluteWakeRefinementDistance
  • AbsoluteWakeRefinementSize
  • AddEdgesToFeatureCurveAction
  • AssignPartCurveToExistingFeatureCurveAction
  • AssignPartCurveToFeatureCurveAction
  • AssignPartCurveToNewFeatureCurveAction
  • AutomaticSurfaceRepair
  • BatteryMeshContinuum
  • BatteryMesherModel
  • BatteryMesherSolver
  • BatteryResurfacerMeshingModel
  • BodyFittedMesherModel
  • BodyFittedMesherSolver
  • BodyfittedPrismStretchingOption
  • BodyfittedPrismThickness
  • BodyfittedPrismWallThickness
  • BodyfittedVolumeSourceDualMesherSizeOption
  • BodyfittedVolumeSourcePrismsOption
  • BooleanOperateRegionsAction
  • BoundaryOption
  • CombineFeatureCurvesAction
  • ContactPreventionSelectBoundariesAction
  • ContactPreventionSet
  • ContactPreventionSetManager
  • CreateFeatureEdgesAction
  • CustomSimpleSurfaceGrowthRate
  • CustomSurfaceGrowthRateOption
  • CustomTwoLevelTemplateSurfaceGrowthRate
  • DelaunayMesherModel
  • DelaunayMesherSolver
  • DualMesherModel
  • DualMesherSolver
  • EditFeatureCurveAction
  • ExtrudeBoundaryCoordinateValues
  • ExtrudeBoundaryNonNormalValues
  • ExtrudeBoundaryNormalValues
  • ExtrudeBoundaryOption
  • ExtrudeBoundaryValues
  • ExtruderModel
  • ExtruderSolver
  • FeatureCurveEditor
  • FeatureCurvePartCurveGroup
  • FeatureCurvePartCurvesDynamicQueryGroup
  • FeatureCurvesComboBox
  • FeatureCurveSelector
  • FeatureCurveTransferSelector
  • FillHolesInFeatureCurvesAction
  • GenCylConstantExtrusionValues
  • GenCylExtrusionValues
  • GenCylModel
  • GenCylNonConstantExtrusionValues
  • IntersectBoundariesAction
  • IntersectRegionsAction
  • MeshContinuum
  • MeshingModelsSelectAction
  • MeshValueManager
  • NumLayers
  • OneGroupContactPreventionSet
  • PartsMeshContinuum
  • PolyWakeRefinementSelectBoundariesAction
  • PolyWakeRefinementSelectFeatureCurvesAction
  • PolyWakeRefinementSet
  • PolyWakeRefinementSetManager
  • PrismMesherModel
  • PrismMesherSolver
  • PrismTypeValue
  • RegionOption
  • RelativeWakeRefinementSize
  • ResurfacerMeshingModel
  • ShellingExtrusionValues
  • ShellingMesherModel
  • SimpleTemplateGrowthRate
  • SolidMesherModel
  • SolidMesherModelBase
  • SolidMesherRegionOption
  • SolidMesherSolver
  • SolidMesherSubModel
  • SolutionInterpolationOption
  • SplitBoundariesByFeatureCurvesAction
  • SplitBoundaryByFacesAction
  • SplitBoundaryByPatchAction
  • SplitNonContiguousFeatureCurvesAction
  • SplitRegionsBySurfaceTopologyAction
  • StartSurfaceMeshRepairAction
  • SubtractRegionsAction
  • SurfaceCurvatureOption
  • SurfaceImporter
  • SurfaceProximityOption
  • SurfaceRepFeatureCurve
  • SurfaceRepFeatureCurveManager
  • SurfaceSizeRatio
  • SurfaceWrapperMeshingModel
  • SurfaceWrapperSolver
  • ThinSolidLayers
  • ThinSolidThickness
  • TrimmerAnisotropicSizeOption
  • TrimmerMeshingModel
  • TrimmerSizeOption
  • TrimmerSolver
  • TwoGroupContactPreventionSet
  • TwoLevelTemplateGrowthRate
  • UniteRegionsAction
  • VolumeMeshSourceBlending
  • VolumeSourcePrismsOption
  • VolumeSourceResurfacerSizeOption
  • VolumeSourceSurfaceWrapperSizeOption
  • WakeRefinementSelectBoundariesAction
  • WakeRefinementSelectFeatureCurvesAction
  • WakeRefinementSet
  • WakeRefinementSetManager
  • ZipEdgesInFeatureCurvesAction

Simulation Operations: Change to Solve Normal Modes Operation

Due to restructuring, macro codes for the Solve Normal Modes simulation operation have changed.

Previous Release Simcenter STAR-CCM+ 2302
import star.modalharmonic.SolveNormalModesAutomationBlock;

public class NormalModesSimOpSetup extends NormalModesSetup {

    public void ModalAnalysisSolve() {

        Simulation simulation_0 = getActiveSimulation();
        
        SimDriverWorkflow simDriverWorkflow_0 = 
                ((SimDriverWorkflow) simulation_0.get(SimDriverWorkflowManager.class).createSimDriverWorkflow("Simulation Operations 1"));
 simDriverWorkflow_0.getBlocks().createBlock("star.modalharmonic.SolveNormalModesAutomationBlock", "Solve Normal Modes");
  
        simulation_0.get(SimDriverWorkflowManager.class).setSelectedWorkflow(simDriverWorkflow_0);
  
        simDriverWorkflow_0.execute();
    }
}
import star.solidstress.SolveNormalModesAutomationBlock;

public class NormalModesSimOpSetup extends NormalModesSetup {

    public void ModalAnalysisSolve() {

        Simulation simulation_0 = getActiveSimulation();
        
        SimDriverWorkflow simDriverWorkflow_0 = 
                ((SimDriverWorkflow) simulation_0.get(SimDriverWorkflowManager.class).createSimDriverWorkflow("Simulation Operations 1"));
        
        simDriverWorkflow_0.getBlocks().createBlock("star.solidstress.SolveNormalModesAutomationBlock", "Solve Normal Modes");
  
        simulation_0.get(SimDriverWorkflowManager.class).setSelectedWorkflow(simDriverWorkflow_0);
  
        simDriverWorkflow_0.execute();
    }
}

Morphing: Change to Default Morphing Method

For a morpher, the default setting of the Morpher Method property has been changed from RBF to BSpline.

This affects the macro code, depending on which default you prefer.

  • If you want to retain RBF as the default method, update your macros as shown below.
    Previous Release Simcenter STAR-CCM+ 2302
    MorphingMotion morphingMotion_0 = _sim.get(MotionManager.class).createMotion(MorphingMotion.class, "Morphing");
    RbfMorpherParameters rbfMorpherParameters_0 = morphingMotion_0.getRbfMorpherParameters();
     rbfMorpherParameters_0.setAutomaticThinout(false);
    MorphingMotion morphingMotion_0 = _sim.get(MotionManager.class).createMotion(MorphingMotion.class, "Morphing");
    morphingMotion_0.getMorpherMethodOption().setSelected(MorpherMethodOption.Type.RBF);
    RbfMorpherParameters rbfMorpherParameters_0 = morphingMotion_0.getRbfMorpherParameters();
    rbfMorpherParameters_0.setAutomaticThinout(false);
    rbfMorpherParameters_0.setLinearFit(true);
  • Alternatively, to use the new default B-Spline morpher, update your macros as follows using the relevant settings object (instead of RbfMorpherParameters).
    Previous Release Simcenter STAR-CCM+ 2302
    MorphingMotion morphingMotion_0 = _sim.get(MotionManager.class).createMotion(MorphingMotion.class, "Morphing");
    RbfMorpherParameters rbfMorpherParameters_0 = morphingMotion_0.getRbfMorpherParameters();
     rbfMorpherParameters_0.setAutomaticThinout(false);
    MorphingMotion morphingMotion_0 = _sim.get(MotionManager.class).createMotion(MorphingMotion.class, "Morphing");
    // B-Spline is used by default here. But we need to grab the relevant settings object.
    BsplineMorpherParameters bsplineMorpherParameters_0 =  morphingMotion_0.getBsplineMorpherParameters();
    bsplineMorpherParameters_0.setLinearFit(true);

Material Properties: Deprecation of Anisotropic Material Property Specification Methods

The material property specification methods Anisotropic and Anisotropic (Legacy) have been deprecated in version 2210 and are planned for removal from a future version. For details about these methods and the planned replacements, see "Material Properties" in the Important Notes section of the 2302 Release Notes.

If any of your existing macros use the deprecated material property methods (9 Anisotropic components for Thermal Conductivity, Electrical Conductivity, Permeability, Permittivity, or Anisotropic (Legacy) for Thermal Conductivity), search for instances of following strings and update them as shown in the following table:

Previous Release Simcenter STAR-CCM+ 2302
AnisotropicElectricalConductivityMethodWithValues FullTensorElectricalConductivityMethodWithValues
AnisotropicPermeabilityMethodWithValues FullTensorPermeabilityMethodWithValues
AnisotropicPermittivityMethodWithValues FullTensorPermittivityMethodWithValues
AnisotropicThermalConductivityMethodWithValues FullTensorThermalConductivityMethodWithValues
AnisotropicThermalConductivityMethod FullTensorLegacyThermalConductivityMethod

Electromagnetism: Changes Due to Extension of Part Curve Selection

Due to the added capability of supporting multiple parts curves, related macro code has changed.

Previous Release Simcenter STAR-CCM+ 2302
import star.electromagnetism.common.LocalDirectionFieldFeatureCurveFlipOption;
import star.electromagnetism.common.LocalDirectionFieldFeatureCurveMethod;

LocalDirectionFieldFeatureCurveMethod method =
regionCoilB.getValues().get(LocalDirectionFieldProfile.class).getMethod(LocalDirectionFieldFeatureCurveMethod.class);
method.getFlipOption().setSelected(LocalDirectionFieldFeatureCurveFlipOption.FORWARD);

localDirectionFieldDirection_0.getDirectionOption().setSelected(LocalDirectionFieldFeatureCurveFlipOption.Type.RETURN);
import star.electromagnetism.common.LocalDirectionFieldFlipOption;
import star.electromagnetism.common.LocalDirectionFieldPartCurveMethod;_

LocalDirectionFieldPartCurveMethod method =
regionCoilB.getValues().get(LocalDirectionFieldProfile.class).getMethod(LocalDirectionFieldPartCurveMethod.class);
method.getFlipOption().setSelected(LocalDirectionFieldFlipOption.FORWARD);

localDirectionFieldDirection_0.getDirectionOption().setSelected(LocalDirectionFieldFlipOption.Type.RETURN);

Battery Modeling: Changes to Workflow

The introduction of Battery Thermal Runaway has changed the workflow of battery modeling in Simcenter STAR-CCM+, resulting in changes to the macro code.

  • star.battery.EquivalentCircuitBatteryCell has been renamed to star.battery.UserDefinedBatteryCell.
    Previous Release Simcenter STAR-CCM+ 2302
    EquivalentCircuitBatteryCell equivalentCircuitBatteryCell_0 = ((EquivalentCircuitBatteryCell) batteryTool_0.getCells().getBatteryCellBase("Equivalent Circuit Battery Cell"));
    UserDefinedBatteryCell equivalentCircuitBatteryCell_0 =  ((UserDefinedBatteryCell) batteryTool_0.getCells().getBatteryCellBase("User Defined Battery Cell"));
  • In the previous release, EquivalentCircuitBatteryCell contains an RCR model by default. In Simcenter STAR-CCM+ 2302, UserDefinedBatteryCell contains no models by default. The RCR model needs to be activated.
Previous Release Simcenter STAR-CCM+ 2302
batteryTool_0.getCells().createUserDefinedBatteryCell();
UserDefinedBatteryCell equivalentCircuitBatteryCell_0 = (UserDefinedBatteryCell) batteryTool_0.getCells().createUserDefinedBatteryCell();
    equivalentCircuitBatteryCell_0.enableModel(ModelType.RCR);

Simcenter STAR-CCM+ In-cylinder: Reorganization of Objects

A variety of changes were made to objects used in Simcenter STAR-CCM+ In-cylinder. Many of these changes involved removing "1" from the object name to prevent functional conflicts with other objects. For details about specific changes in the Simcenter STAR-CCM+ In-cylinder UI, see "Simcenter STAR-CCM+ In-Cylinder: Reorganization of Objects" in the Important Notes section of the 2302 Release Notes.

As a consequence of this reorganization, related macro codes have also changed:

  • The names of the QuickPart definitions have changed such that they match the initial QuickPart name. Update the names accordingly in your macros. For example, getQuickPartDefinition("CustomCylinderDef 1") must now be getQuickPartDefinition("Cylinder").
  • Any name that does not follow the object : quantity format must be manually updated.
  • Switch the names Min Cell Quality and Min Cell Quality 1 wherever they appear.
  • The following Java classes have been removed, so any imports of them in macros must also be removed:
    • CellCountMonitorPlot.java
    • CylinderMassMonitorPlot.java
    • CylinderPressureMonitorPlot.java
    • CylinderTemperatureMonitorPlot.java
    • CylinderTurbulenceKineticEnergyPlot.java
    • CylinderVolumeMonitorPlot.java
    • MinimumTimeStepMonitorPlot.java
    • PressureVolumeDiagramPlot.java
    • SwirlMonitorPlot.java
    • TumbleXMonitorPlot.java
    • TumbleYMonitorPlot.java