Macro API Changes 2021.3

In Simcenter STAR-CCM+ 2021.3, the macro API changed for 3D-CAD, meshing, heat transfer, aeroacoustics, reacting flow, Eulerian multiphase, dispersed multiphase, VOF, electromagnetism, battery modeling, visualization, Design Manager, CAE integration, and co-simulation.

3D-CAD

Changes to Handling of Feature Failures

In Simcenter STAR-CCM+ 2021.3, when a Unite Bodies or Subtract Bodies feature fails, the bodies, faces, edges, and vertices that are responsible for the failure are highlighted whenever you select the corresponding node of the failed feature. This new feature has resulted in changes to the macro code. Deprecated components have been replaced as follows:

  • UniteBodiesFeature createUniteBodies(List<Body> bodies); has been replaced by UniteBodiesFeature createUniteBodies_2(List<Body> bodies);.
  • UniteBodiesFeature createUniteBodies(); has been replaced by UniteBodiesFeature createUniteBodies_2();.

Changes to Imprint Option

The two imprinting features of 3D-CAD, for imprinting bodies onto bodies and faces onto faces, have been enhanced. They now allow you to specify whether the target bodies/faces should be imprinted onto the tool bodies/faces, rather than this imprint happening automatically. These specifications are available only for body-imprinting features for which the Imprint Option is set to Between two Groups of Bodies, and for face-imprinting features for which the Imprint Option is set to Between Faces of two Bodies.

The new public member functions Imprint::setImprintOntoToolBodies and ImprintFaces::setImprintOntoToolFaces are used for controlling this imprint, as shown in the following examples:

Imprint imprintBodies = cadModel.getFeatureManager().createImprint();
imprintBodies.setImprintOntoToolBodies(false);
ImprintFaces imprintFaces = cadModel.getFeatureManager().createImprintFaces();
imprintFaces.setImprintOntoToolFaces(false);

These settings can be queried with the new public member functions Imprint::isImprintOntoToolBodies and ImprintFaces::isImprintOntoToolFaces.

Meshing: Changes Due to New Surface Mesh Numbering

The process of splitting part surfaces and part curves has changed, so that the numbering of the new parts is consistent and independent of factors such as CAD tessellation. While this change does not affect simulation files saved in previous versions, it does produce numbering that is different from that of the previous release.

Therefore if you have macros that depend on this numbering, update those macros as shown in the following table. For example, the part surface that in the previous release was named Block Surface 4 is now named Block Surface, that is, the name of the surface before splitting. Hence the variable partSurface_1 is no longer needed.

Previous Release Simcenter STAR-CCM+ 2021.3
Simulation simulation_0 = 
  getActiveSimulation();
SimpleBlockPart simpleBlockPart_0 = 
  ((SimpleBlockPart) simulation_0.get(SimulationPartManager.class).getPart("Block"));
PartSurface partSurface_0 = 
  ((PartSurface) simpleBlockPart_0.getPartSurfaceManager().getPartSurface("Block Surface"));
simpleBlockPart_0.getPartSurfaceManager().splitPartSurfacesByAngle(new NeoObjectVector(new Object[] {partSurface_0}), 89.0);
AutoMeshOperation autoMeshOperation_0 = 
  ((AutoMeshOperation) simulation_0.get(MeshOperationManager.class).getObject("Automated Mesh"));
SurfaceCustomMeshControl surfaceCustomMeshControl_0 = 
  ((SurfaceCustomMeshControl) autoMeshOperation_0.getCustomMeshControls().getObject("Surface Control"));
surfaceCustomMeshControl_0.getGeometryObjects().setQuery(null);
PartSurface partSurface_1 = 
  ((PartSurface) simpleBlockPart_0.getPartSurfaceManager().getPartSurface("Block Surface 4"));
surfaceCustomMeshControl_0.getGeometryObjects().setObjects(partSurface_1);
Simulation simulation_0 = 
  getActiveSimulation();
SimpleBlockPart simpleBlockPart_0 = 
  ((SimpleBlockPart) simulation_0.get(SimulationPartManager.class).getPart("Block"));
PartSurface partSurface_0 = 
  ((PartSurface) simpleBlockPart_0.getPartSurfaceManager().getPartSurface("Block Surface"));
simpleBlockPart_0.getPartSurfaceManager().splitPartSurfacesByAngle(new NeoObjectVector(new Object[] {partSurface_0}), 89.0);
AutoMeshOperation autoMeshOperation_0 = 
  ((AutoMeshOperation) simulation_0.get(MeshOperationManager.class).getObject("Automated Mesh"));
SurfaceCustomMeshControl surfaceCustomMeshControl_0 = 
  ((SurfaceCustomMeshControl) autoMeshOperation_0.getCustomMeshControls().getObject("Surface Control"));
surfaceCustomMeshControl_0.getGeometryObjects().setQuery(null);
surfaceCustomMeshControl_0.getGeometryObjects().setObjects(partSurface_0);

Heat Transfer: Changes to Radiation Workflow

Due to the simplified radiation workflow for external boundaries, macro code has changed.

The Surface Orientation Option, which was used to activate radiation from the external side of the boundaries, is no longer available in Simcenter STAR-CCM+ 2021.3. Instead, set the Radiation Transfer Option region condition to EXTERNAL, as shown in the examples:

Previous Release Simcenter STAR-CCM+ 2021.3
region_0.getConditions().get(SurfaceOrientationOption.class).setSelected(SurfaceOrientationOption.Type.OUTWARD);
region_0.getConditions().get(RadiationTransferOption.class).setSelected(RadiationTransferOption.Type.EXTERNAL);

The ENVIRONMENT thermal specification option is no longer available in Simcenter STAR-CCM+ 2021.3. To get the same thermal behavior, choose the CONVECTION thermal option:

Previous Release Simcenter STAR-CCM+ 2021.3
boundary_0.getConditions().get(WallThermalOption.class).setSelected(WallThermalOption.Type.ENVIRONMENT);
boundary_0.getConditions().get(WallThermalOption.class).setSelected(WallThermalOption.Type.CONVECTION );

When thermal radiation was used in the previous release, the ENVIRONMENT thermal specification also automatically activated external radiation from a boundary. In Simcenter STAR-CCM+ 2021.3, you must set the Radiation Transfer Option to External or Internal and External as appropriate, via the following macros:

region_0.getConditions().get(RadiationTransferOption.class).setSelected(RadiationTransferOption.Type.EXTERNAL);

region_0.getConditions().get(RadiationTransferOption.class).setSelected(RadiationTransferOption.Type.DUAL_SIDED);

Aeroacoustics: Data from On-the-Fly FW-H Receiver and Post FW-H Receiver No Longer Requires .csv Export

For On-the-Fly FW-H and Post FW-H solvers, the computed acoustic data now remains stored in the FW-H Receiver node. Table objects that contain this data now exist under each receiver node, and are ready for post-processing just like any other internal tables. As a result, the following right-click actions for the point receiver have been removed:

  • Export Surface Total
  • Export Surface Thickness
  • Export Surface Loading
  • Export Volume Quadrupole

This redesign has resulted in changes to the macro code. For the Post FW-H Receiver, remove the following line that represented the Export action:

pointFwhPostProcessingReceiver_0.exportTotalTrn(f1.getAbsolutePath());

and add the following lines:

ReceiverTable receiverTable_0 = pointFwhPostProcessingReceiver_0.getReceiverTable();
receiverTable_0.export(f1.getAbsolutePath());

For the On-the-Fly FW-H Receiver, to update macro code for the removal of the various export actions, replace the lines from the previous release with the lines from Simcenter STAR-CCM+ 2021.3 as shown in the following table:

Previous Release Simcenter STAR-CCM+ 2021.3
pointReceiver_0.export(f.getAbsolutePath());
ReceiverTable receiverTable_0 = pointReceiver_0.getReceiverTable();
receiverTable_0.export(f.getAbsolutePath());
pointReceiver_0.exportLoading(fLoading.getAbsolutePath());
XYPlot xYPlot_1 = simulation_0.getPlotManager().createPlot(XYPlot.class);
xYPlot_1.getDataSetManager().addDataProviders(new NeoObjectVector(new Object[] {receiverTable_0}));
ExternalDataSet externalDataSet_1 =  ((ExternalDataSet) +xYPlot_1.getDataSetManager().getDataSet("PointReceiver1"));
externalDataSet_1.setXValuesName("Acoustic Time");
externalDataSet_1.setYValuesName("Sound Pressure Loading Noise");
xYPlot_1.getDataSetManager().writeCSVDataSet(externalDataSet_1, fLoading, ",");
pointReceiver_0.exportThickness(fThickness.getAbsolutePath());
XYPlot xYPlot_2 = simulation_0.getPlotManager().createPlot(XYPlot.class);
xYPlot_2.getDataSetManager().addDataProviders(new NeoObjectVector(new Object[] {receiverTable_0}));
ExternalDataSet externalDataSet_2 =  ((ExternalDataSet) +xYPlot_2.getDataSetManager().getDataSet("PointReceiver1"));
externalDataSet_2.setXValuesName("Acoustic Time");
externalDataSet_2.setYValuesName("Sound Pressure Thickness Noise");
xYPlot_2.getDataSetManager().writeCSVDataSet(externalDataSet_2, fThickness, ",");
pointReceiver_0.exportQuadrupole(fQuadrupoleSoundPressure.getAbsolutePath());
XYPlot xYPlot_2 = getSimulation().getPlotManager().createPlot(XYPlot.class);
xYPlot_2.getDataSetManager().addDataProviders(new NeoObjectVector(new Object[] {receiverTable_0}));
ExternalDataSet externalDataSet_0 = ((ExternalDataSet) +xYPlot_2.getDataSetManager().getDataSet("PointReceiver1"));
externalDataSet_0.setXValuesName("Quadrupole Acoustic Time");
externalDataSet_0.setYValuesName("Quadrupole Sound Pressure");
xYPlot_2.getDataSetManager().writeCSVDataSet(externalDataSet_0, fQuadrupoleSoundPressure, ",");

Reacting Flow: Changes to Flamelet Models

Interpolation of variables from the flamelet table has been optimized for faster performance, resulting in changes to the macro code. Components have been replaced as follows:

  • physicsContinuum_0.enable(PpdfIdealGasModel.class); has been replaced by physicsContinuum_0.enable(PpdfEquilibriumIdealGasModel.class);
  • continuum.enable(IdealGasWithFlameletModel.class); has been replaced by continuum.enable(PpdfFlameletIdealGasModel.class);
  • gasMixture_0.getMaterialProperties().getMaterialProperty(SpecificHeatProperty.class).setMethod(PpdfFlameletSpecificHeatMethod.class); has been replaced by gasMixture_0.getMaterialProperties().getMaterialProperty(SpecificHeatProperty.class).setMethod(PpdfOneHlrSpecificHeatMethod.class);
  • gasMixture_0.getMaterialProperties().getMaterialProperty(SpecificHeatProperty.class).setMethod(PvmSpecificHeatMethod.class); has been replaced by gasMixture_0.getMaterialProperties().getMaterialProperty(SpecificHeatProperty.class).setMethod(FgmOneHlrSpecificHeatMethod.class);

Eulerian Multiphase (EMP)

Extension of EMP CFL-Based Time-Step Control

The Convective CFL Condition, a time-step provider in EMP, is now substituted and enhanced by the Smoothed Convective CFL Condition, resulting in changes to the macro code.

Previous Release Simcenter STAR-CCM+ 2021.3
Simulation simulation_0 = getActiveSimulation();
PhysicsContinuum physicsContinuum_0 = ((PhysicsContinuum) simulation_0.getContinuumManager(). getContinuum("Physics 1"));
AdaptiveTimeStepModel adaptiveTimeStepModel_0 = physicsContinuum_0.getModelManager().getModel(AdaptiveTimeStepModel.class);
ConvectiveCflTimeStepProvider convectiveCflTimeStepProvider_0 = adaptiveTimeStepModel_0.getTimeStepProviderManager(). createObject(ConvectiveCflTimeStepProvider.class);

          convectiveCflTimeStepProvider_0.getTargetMaxCfl().setValue(10.0);
Units units_0 = ((Units) simulation_0.getUnitsManager().getObject(""));
convectiveCflTimeStepProvider_0.getTargetMaxCfl().setUnits(units_0);

//"Target Mean CFL Number" does not exist in future releases
Units units_0 = ((Units) simulation_0.getUnitsManager().getObject(""));
convectiveCflTimeStepProvider_0.getTargetMeanCfl().setUnits(units_0);
Simulation simulation_0 = getActiveSimulation();
PhysicsContinuum physicsContinuum_0 = ((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1"));
AdaptiveTimeStepModel adaptiveTimeStepModel_0 = physicsContinuum_0.getModelManager().getModel(AdaptiveTimeStepModel.class);
EmpSmoothedConvectiveCflTimeStepProvider empSmoothedConvectiveCflTimeStepProvider_0 = adaptiveTimeStepModel_0.getTimeStepProviderManager().createObject(EmpSmoothedConvectiveCflTimeStepProvider.class);

empSmoothedConvectiveCflTimeStepProvider_0.getMaxConditionLimit().setValue(10.0);
Units units_0 = ((Units) simulation_0.getUnitsManager().getObject(""));
empSmoothedConvectiveCflTimeStepProvider_0.getMaxConditionLimit().setUnits(units_0);

Change to Liquid Film Stripping

Improvement of liquid film stripping has resulted in changes to the macro code. To update your macros, remove instances of code shown in the following example:

filmStrippingEMPModel_0.getStrippingVolumeFractionLimit().setValue(0.8);

Dispersed Multiphase: Changes to Particle Size Specification

Beginning with Simcenter STAR-CCM+ 2021.3, the particle size information for DMP phases is no longer specified as a material property, but as an interaction length scale in each phase interaction. Update your macros as shown in the following example.

Previous Release Simcenter STAR-CCM+ 2021.3
import star.dmp.ParticleDiameterInteractionLengthScaleModel;
import star.multiphase.ParticleDiameterProperty;
...
PhaseInteraction phaseInteraction_1 = multiPhaseInteractionModel_0.createPhaseInteraction(PhaseInteractionTopology.DMP_PC, eulerianPhase_0, physicsContinuum_0);
phaseInteraction_1.enable(ParticleDiameterInteractionLengthScaleModel.class);
...
PhysicsContinuum physicsContinuum = (PhysicsContinuum) getActiveSimulation().getContinuumManager().getContinuum("Physics 1");
dispersedMultiphaseModel = physicsContinuum.getModelManager().getModel(DispersedMultiphaseModel.class);
EulerianPhase eulerianPhase = dispersedMultiphaseModel.createPhase();
DMPSingleComponentDropletModel dmpSingleComponentDropletModel = eulerianPhase.getModelManager().getModel(DMPSingleComponentDropletModel.class);
Liquid liquid = ((Liquid) dmpSingleComponentDropletModel.getMaterial());
ConstantMaterialPropertyMethod constantMaterialPropertyMethod = 
  ((ConstantMaterialPropertyMethod) liquid.getMaterialProperties().getMaterialProperty(ParticleDiameterProperty.class).getMethod());
constantMaterialPropertyMethod.getQuantity().setValue(1e-5);
import star.dmp.DmpInteractionLengthScaleModel;
import star.multiphase.ConstantInteractionCoefficientMethod;
...
PhaseInteraction phaseInteraction_1 = multiPhaseInteractionModel_0.createPhaseInteraction(PhaseInteractionTopology.DMP_PC, eulerianPhase_0, physicsContinuum_0);
phaseInteraction_1.enable(DmpInteractionLengthScaleModel.class);
...
DmpInteractionLengthScaleModel dmpInteractionLengthScaleModel = phaseInteraction.getModelManager().getModel(DmpInteractionLengthScaleModel.class);
ConstantInteractionCoefficientMethod constantInteractionCoefficientMethod = ((InteractionLengthScaleMethodManager) dmpInteractionLengthScaleModel.getInteractionLengthScaleMethodManager()).getMethod(ConstantInteractionCoefficientMethod.class);
constantInteractionCoefficientMethod.getQuantity().setValue(1e-5);

VOF: Change to Resolved VOF-Lagrangian Transition Model

In Simcenter STAR-CCM+ 2021.3, the Resolved VOF-Lagrangian Transition Model can now convert the VOF blobs to Lagrangian parcels not only with maximum blob diameter but also with minimum blob diameter and/or blob shape metrics. This redesign has resulted in changes to the macro code.

Previous Release Simcenter STAR-CCM+ 2021.3
Simulation simulation_0 = 
  getActiveSimulation();
PhysicsContinuum physicsContinuum_0 = 
  ((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1"));
MultiPhaseInteractionModel multiPhaseInteractionModel_0 = 
  physicsContinuum_0.getModelManager().getModel(MultiPhaseInteractionModel.class);
PhaseInteraction phaseInteraction_0 = 
  ((PhaseInteraction) multiPhaseInteractionModel_0.getPhaseInteractionManager().getPhaseInteraction("Phase Interaction 1"));
phaseInteraction_0.enable(ResolvedVofLagrangianTransitionModel.class);
ResolvedVofLagrangianTransitionModel resolvedVofLagrangianTransitionModel_0 = 
  phaseInteraction_0.getModelManager().getModel(ResolvedVofLagrangianTransitionModel.class);
VofLagrangianTransitionLengthScaleProfile vofLagrangianTransitionLengthScaleProfile_0 = 
  resolvedVofLagrangianTransitionModel_0.getTransitionLengthScaleProfile();
vofLagrangianTransitionLengthScaleProfile_0.getMethod(ConstantScalarProfileMethod.class).getQuantity().setValue(1.0E-4);
Units units_0 = 
  ((Units) simulation_0.getUnitsManager().getObject("m"));
vofLagrangianTransitionLengthScaleProfile_0.getMethod(ConstantScalarProfileMethod.class).getQuantity().setUnits(units_0);
Simulation simulation_0 = 
  getActiveSimulation();
PhysicsContinuum physicsContinuum_0 = 
  ((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1"));
MultiPhaseInteractionModel multiPhaseInteractionModel_0 = 
  physicsContinuum_0.getModelManager().getModel(MultiPhaseInteractionModel.class);
PhaseInteraction phaseInteraction_0 = 
  ((PhaseInteraction) multiPhaseInteractionModel_0.getPhaseInteractionManager().getPhaseInteraction("Phase Interaction 1"));
phaseInteraction_0.enable(ResolvedVofLagrangianTransitionModel.class);
ResolvedVofLagrangianTransitionModel resolvedVofLagrangianTransitionModel_0 = 
  phaseInteraction_0.getModelManager().getModel(ResolvedVofLagrangianTransitionModel.class);
BlobDiameterVofLagrangianTransitionCriterion blobDiameterVofLagrangianTransitionCriterion_0 = 
  ((BlobDiameterVofLagrangianTransitionCriterion) resolvedVofLagrangianTransitionModel_0.getCriterionManager().getObject("Blob Diameter Criterion"));
Units units_0 = 
  ((Units) simulation_0.getUnitsManager().getObject("m"));
blobDiameterVofLagrangianTransitionCriterion_0.getMaxDiameter().setValue(1.0E-4);
blobDiameterVofLagrangianTransitionCriterion_0.getMaxDiameter().setUnits(units_0);
blobDiameterVofLagrangianTransitionCriterion_0.getMinDiameter().setValue(0.0);
blobDiameterVofLagrangianTransitionCriterion_0.getMinDiameter().setUnits(units_0);
BlobShapeVofLagrangianTransitionCriterion blobShapeVofLagrangianTransitionCriterion_0 = 
  ((BlobShapeVofLagrangianTransitionCriterion) resolvedVofLagrangianTransitionModel_0.getCriterionManager().getObject("Blob Shape Criterion"));
resolvedVofLagrangianTransitionModel_0.getCriterionManager().removeObjects(blobShapeVofLagrangianTransitionCriterion_0);

Electromagnetism

Change to Setup of Coils

The setup of excitation coils has been restructured, resulting in changes to the macro code.

Previous Release Simcenter STAR-CCM+ 2021.3
ExcitationCoilElectricCurrentDensityMagnitudeProfile excitationCoilElectricCurrentDensityMagnitudeProfile_0
                                    = region_4.getValues().get(ExcitationCoilElectricCurrentDensityMagnitudeProfile.class);
                                    excitationCoilElectricCurrentDensityMagnitudeProfile_0.getMethod(ExcitationCoilAmpereTurnMethod.class).setNSections(2);
                                    
                                    ExcitationCoilConductorRelativeOrAbsoluteArea excitationCoilConductorRelativeOrAbsoluteArea_0 = 
                                    excitationCoilElectricCurrentDensityMagnitudeProfile_0.getMethod(ExcitationCoilAmpereTurnMethod.class).getCoilArea();
                                    excitationCoilConductorRelativeOrAbsoluteArea_0.getRelativeOrAbsoluteOption().setSelected(ExcitationCoilConductorRelativeOrAbsoluteAreaOption.Type.ABSOLUTE);
                                    ((ExcitationCoilConductorAbsoluteArea) excitationCoilConductorRelativeOrAbsoluteArea_0.getAbsoluteArea());
import star.electromagnetism.common.ExcitationCoilNSections;
                                    ExcitationCoilNSections excitationCoilNSections = region_4.getValues().get(ExcitationCoilNSections.class);
                                    excitationCoilNSections.getModelPartValue().setValue(2);
                                    
                                    import star.electromagnetism.common.ExcitationCoilConductorArea;
                                    import star.electromagnetism.common.ExcitationCoilConductorAreaLeaf;
                                    ExcitationCoilConductorArea excitationCoilConductorArea_0 = region_5.getValues().get(ExcitationCoilConductorArea.class);
                                    ExcitationCoilConductorAreaLeaf excitationCoilConductorAreaLeaf_0 = excitationCoilConductorArea_0.getModelPartValue();excitationCoilConductorAreaLeaf_0.getRelativeOrAbsoluteOption().setSelected(ExcitationCoilConductorRelativeOrAbsoluteAreaOption.Type.ABSOLUTE);
                                    ((ExcitationCoilConductorAbsoluteArea) excitationCoilConductorAreaLeaf_0.getAbsoluteArea());

Changes to Permanent Magnet Modeling

Whenever a physics continuum activates the Permanent Magnet Model, you are advised to make sure that it is the default model by activating the Linear Permanent Magnet General Model, as in the following example:

    PhysicsContinuum pc = sim.getContinuumManager().createContinuum(PhysicsContinuum.class);
// ...
    pc.enable(PermanentMagnetModel.class);
    pc.enable(LinearPermanentMagnetGeneralModel.class);

To make this default model available it is necessary to import it from magneticpotential, as in the following line:

import star.electromagnetism.magneticpotential.LinearPermanentMagnetGeneralModel;

Battery Modeling: Changes to Workflow

A new workflow has been introduced for battery modeling in Simcenter STAR-CCM+, resulting in changes to the macro code.

The following classes have been replaced as follows:

  • BatteryCell has been replaced by BatteryCellBase.
  • BatteryModule has been replaced by TBMBatteryModule.
  • BatteryModuleCell has been replaced by TBMBatteryModuleCell.
  • BlockCellModelDescription has been replaced by BlockModelGeometry.
  • CylindricalCellModelDescription has been replaced by CylindricalModelGeometry.
  • PrismaticCellModelDescription has been replaced by PrismaticModelGeometry.

In some cases casting to the appropriate class may be required.

Update your macro codes for these parameters as follows:

Creating a new TBMBatteryModule:

Previous Release Simcenter STAR-CCM+ 2021.3
BatteryModule batteryModule_0 = batteryTool_0.getModules().createEmptyBatteryModule();
TBMBatteryModule batteryModule_0 = (TBMBatteryModule) (batteryTool_0.getModules()).createTBMBatteryModule();

Using a <Shape>ModelGeometry:

Previous Release Simcenter STAR-CCM+ 2021.3
<Shape>CellModelDescription cellModelDescription_0 = ((<Shape>CellModelDescription) <shape>BatteryCell_0.getCellModelDescription());
<Shape>ModelGeometry modelGeometry_0 = (<Shape>ModelGeometry) <shape>BatteryCell_0.getModelGeometry());

Looping through Battery Cells:

Previous Release Simcenter STAR-CCM+ 2021.3
Collection<BatteryCell> bcs = batteryTool_0.getCells().getObjects();
    for (BatteryCell bc : bcs) {
Collection<BatteryCellBase> bcs = batteryTool_0.getCells().getObjects();
   for (BatteryCellBase bcb : bcs) {
     BatteryCell bc = (BatteryCell) bcb;

Visualization

Changes to Hardcopy Export User Interface

With the introduction of anti-aliasing and transparency controls to plots and layouts, which resemble those for scenes, existing macros now export graphics files (hardcopies) of plots using anti-aliasing.

Changes to Compression for Scene Files

Due to the introduction of multiple levels of compression for the export of scene (.sce) files in Simcenter STAR-CCM+ 2021.3, the macro code has changed.

Previous Release Simcenter STAR-CCM+ 2021.3
Simulation simulation_0 = getActiveSimulation();
Scene scene_0 = simulation_0.getSceneManager().getScene("Scene");
// export a scene file with lossless compression
scene_0.export3DSceneFileAndWait(resolvePath("Scene.sce"), "Scene", "Description", false, true);
ResidualPlot residualPlot_0 = ((ResidualPlot) simulation_0.getPlotManager().getPlot("Residuals"));
// export a plot with lossless compression
residualPlot_0.exportScene(resolvePath("Residuals.sce"), "Residuals", "", false, true);
Simulation simulation_0 = getActiveSimulation();
Scene scene_0 = simulation_0.getSceneManager().getScene("Scene");
// export a scene file with lossless compression
scene_0.export3DSceneFileAndWait(resolvePath("Scene.sce"), "Scene", "Description", false, SceneFileCompressionLevel.LOSSLESS);
// export a scene file with medium lossy compression
scene_0.export3DSceneFileAndWait(resolvePath("Scene_lossy.sce"), "Scene", "Description", false, SceneFileCompressionLevel.MEDIUM);
ResidualPlot residualPlot_0 = ((ResidualPlot) simulation_0.getPlotManager().getPlot("Residuals"));
// export a plot with lossless compression
residualPlot_0.exportScene(resolvePath("Residuals.sce"), "Residuals", "", false, SceneFileCompressionLevel.LOSSLESS);

Scene files can also be exported when a scene is updated during a solution run, or using an Export simulation operation. Because these now also support selecting a compression level, getCompress() and setCompress() have been deprecated and replaced with getCompressionLevel() and setCompressionLevel() in the following classes:

  • star.common.SceneFileProperties
  • star.common.SceneExportSceneFileSettings
  • star.common.PlotExportSceneFileSettings

In Simcenter STAR-CCM+ 2021.3, the plot Update sub-node now includes the ability to select scene files as an export file type. A new SCE entry has been added to star.common.PlotHardcopyFormat, and star.common.PlotUpdate now also has a getSceneFileProperties() method. Deprecated components have been replaced as follows:

  • public boolean getCompress() has been replaced by public SceneFileCompressionLevel getCompressionLevel().
  • public void setCompress(boolean value) has been replaced by public void setCompressionLevel(SceneFileCompressionLevel level).
Previous Release Simcenter STAR-CCM+ 2021.3
Simulation simulation_0 = getActiveSimulation();
Scene scene_0 = simulation_0.getSceneManager().getScene("Scene");
ResidualPlot residualPlot_0 = ((ResidualPlot) simulation_0.getPlotManager().getPlot("Residuals"));

SceneUpdate sceneUpdate_0 = scene_0.getSceneUpdate();
sceneUpdate_0.setAnimationFileFormat(ImageFileFormat.SCE);
SceneFileProperties sceneFileProperties_0 = sceneUpdate_0.getSceneFileProperties();
if (!sceneFileProperties_0.getCompress()) {
  sceneFileProperties_0.setCompress(true);
}

SimDriverWorkflow simDriverWorkflow_0 = 
  ((SimDriverWorkflow) simulation_0.get(SimDriverWorkflowManager.class).getObject("Simulation Operations 1"));

ExportAutomationBlock exportAutomationBlock_0 = 
  ((ExportAutomationBlock) simDriverWorkflow_0.getBlocks().getObject("Export"));

SceneExportSettings sceneExportSettings_0 = exportAutomationBlock_0.getSceneSettings();
sceneExportSettings_0.setExportType(SceneExportType.SCENE_FILE);
SceneExportSceneFileSettings sceneExportSceneFileSettings_0 = sceneExportSettings_0.getSceneFileSettings();
if (sceneExportSceneFileSettings_0.getCompress()) {
  sceneExportSceneFileSettings_0.setCompress(false);
}

PlotExportSettings plotExportSettings_0 = exportAutomationBlock_0.getPlotSettings();
plotExportSettings_0.setExportType(PlotExportType.SCENE_FILE);
PlotExportSceneFileSettings plotExportSceneFileSettings_0 = plotExportSettings_0.getSceneFileSettings();
if (plotExportSceneFileSettings_0.getCompress()) {
  plotExportSceneFileSettings_0.setCompress(false);
}
Simulation simulation_0 = getActiveSimulation();
Scene scene_0 = simulation_0.getSceneManager().getScene("Scene");
ResidualPlot residualPlot_0 = ((ResidualPlot) simulation_0.getPlotManager().getPlot("Residuals"));

SceneUpdate sceneUpdate_0 = scene_0.getSceneUpdate();
sceneUpdate_0.setAnimationFileFormat(ImageFileFormat.SCE);
SceneFileProperties sceneFileProperties_0 = sceneUpdate_0.getSceneFileProperties();
if (sceneFileProperties_0.getCompressionLevel() == SceneFileCompressionLevel.OFF) {
  sceneFileProperties_0.setCompressionLevel(SceneFileCompressionLevel.LOSSLESS);
}

PlotUpdate plotUpdate_0 = residualPlot_0.getPlotUpdate();
plotUpdate_0.setAnimationFileFormat(PlotHardcopyFormat.SCE);
SceneFileProperties sceneFileProperties_1 = plotUpdate_0.getSceneFileProperties();
if (sceneFileProperties_1.getCompressionLevel() == SceneFileCompressionLevel.OFF) {
  sceneFileProperties_1.setCompressionLevel(SceneFileCompressionLevel.LOSSLESS);
}

SimDriverWorkflow simDriverWorkflow_0 = 
  ((SimDriverWorkflow) simulation_0.get(SimDriverWorkflowManager.class).getObject("Simulation Operations 1"));

ExportAutomationBlock exportAutomationBlock_0 = 
  ((ExportAutomationBlock) simDriverWorkflow_0.getBlocks().getObject("Export"));

SceneExportSettings sceneExportSettings_0 = exportAutomationBlock_0.getSceneSettings();
sceneExportSettings_0.setExportType(SceneExportType.SCENE_FILE);
SceneExportSceneFileSettings sceneExportSceneFileSettings_0 = sceneExportSettings_0.getSceneFileSettings();
if (sceneExportSceneFileSettings_0.getCompressionLevel() == SceneFileCompressionLevel.LOSSLESS) {
  sceneExportSceneFileSettings_0.setCompressionLevel(SceneFileCompressionLevel.OFF);
}

PlotExportSettings plotExportSettings_0 = exportAutomationBlock_0.getPlotSettings();
plotExportSettings_0.setExportType(PlotExportType.SCENE_FILE);
PlotExportSceneFileSettings plotExportSceneFileSettings_0 = plotExportSettings_0.getSceneFileSettings();
if (plotExportSceneFileSettings_0.getCompressionLevel() == SceneFileCompressionLevel.LOSSLESS) {
  plotExportSceneFileSettings_0.setCompressionLevel(SceneFileCompressionLevel.OFF);
}

Changes to Handling of Annotations

Refactoring of annotations has resulted in changes to the macro code for adding and removing annotations.

Previous Release Simcenter STAR-CCM+ 2021.3
Simulation simulation_0 = 
  getActiveSimulation();
ResidualPlot residualPlot_0 = 
  ((ResidualPlot) simulation_0.getPlotManager().getPlot("Residuals"));
LogoAnnotation logoAnnotation_0 = 
  ((LogoAnnotation) simulation_0.getAnnotationManager().getObject("Logo"));
LogoAnnotationProp logoAnnotationProp_0 = 
  (LogoAnnotationProp) residualPlot_0.getAnnotationPropManager().createPropForAnnotation(logoAnnotation_0);
residualPlot_0.getAnnotationPropManager().removePropsForAnnotations(logoAnnotation_0);
Simulation simulation_0 = 
  getActiveSimulation();
ResidualPlot residualPlot_0 = 
  ((ResidualPlot) simulation_0.getPlotManager().getPlot("Residuals"));
residualPlot_0.getAnnotationPropManager().getAnnotationGroup().setQuery(null);
LogoAnnotation logoAnnotation_0 = 
  ((LogoAnnotation) simulation_0.getAnnotationManager().getObject("Logo"));
residualPlot_0.getAnnotationPropManager().getAnnotationGroup().setObjects(logoAnnotation_0);
residualPlot_0.getAnnotationPropManager().getAnnotationGroup().setQuery(null);
residualPlot_0.getAnnotationPropManager().getAnnotationGroup().setObjects();

createPropForAnnotation has been deprecated. Replace instances of it with createAnnotationProp as shown in the following example:

Simulation simulation_0 = 
  getActiveSimulation();
ResidualPlot residualPlot_0 = 
  ((ResidualPlot) simulation_0.getPlotManager().getPlot("Residuals"));
LogoAnnotation logoAnnotation_0 = 
  ((LogoAnnotation) simulation_0.getAnnotationManager().getObject("Logo"));
residualPlot_0.getAnnotationPropManager().createAnnotationProp(logoAnnotation_0);
residualPlot_0.getAnnotationPropManager().removePropsForAnnotations(logoAnnotation_0);

Design Manager: Changes to Compute Resources

In Simcenter STAR-CCM+ 2021.3 all compute resources were moved under Tools, resulting in changes to the macro code.

The Java classes MdxDirectSettings, MdxJobManagerSettings, MdxLinuxClusterSettings, and MdxWindowsHPCClusterSettings have been removed. Macros with these classes are not supported, and the macro compilation will fail.

The methods in the MdxComputeResource Java class to get settings have also been removed:

  • getDirectSettings()
  • getLinuxClusterSettings()
  • getWindowsHPCClusterSettings()
  • getJobManagerSettings()

You should update your macros to use the new resource classes MdxDirectResource, MdxJobManagerResource, MdxLinuxClusterResource, and MdxWindowsHPCClusterResource, as shown in the following examples.

Direct

Previous Release Simcenter STAR-CCM+ 2021.3
MdxProject mdxProject_0 = getActiveMdxProject();
MdxDesignStudy study = mdxProject_0.getDesignStudyManager().getDesignStudy("Sweep");
MdxStudySettings study = study.getStudySettings();
MdxComputeResource mdxComputeResource_0 = study.getComputeResource();
mdxComputeResource_0.setType(MdxComputeResource.ResourceType.DIRECT);
MdxDirectSettings mdxDirectSettings_0 = mdxComputeResource_0.getDirectSettings();
mdxDirectSettings_0.setCcmpCmd("powerpre");
MdxProject mdxProject_0 = getActiveMdxProject();
MdxDesignStudy study = mdxProject_0.getDesignStudyManager().getDesignStudy("Sweep");
MdxDirectResource mdxDirectResource_0 =
mdxProject_0.get(MdxResourceManager.class).createResource(MdxDirectResource.class);
MdxLaunchSettings mdxLaunchSettings_0 = mdxStudySettings_0.getLaunchSettings();
mdxLaunchSettigns_0.setResourceMode(MdxLaunchSettings.ResourceMode.SINGLE_RESOURCE);
MdxSingleResourceSettings mdxSingleResourceSettings_0 =
mdxLaunchSettings_0.getSingleResourceSettings();
mdxSingleResourceSettings_0.setResource(mdxDirectResource_0);
mdxDirectResource_0.setCcmpCmd("powerpre");

Linux Cluster

Previous Release Simcenter STAR-CCM+ 2021.3
mdxComputeResource_0.setType(MdxComputeResource.ResourceType.LINUX_CLUSTER);
MdxLinuxClusterSettings mdxLinuxClusterSettings_0 =
mdxComputeResource_0.getLinuxClusterSettings();
mdxLinuxClusterSettings_0.setCcmpCmd("power");
mdxLinuxClusterSettings_0.setJobSubmitCmd("qsub -l nodes=1:ppn=8");
mdxLinuxClusterSettings_0.setJobNameIdentifier("-n");
mdxLinuxClusterSettings_0.setJobNamePrefix("dm_design");
mdxLinuxClusterSettings_0.setScriptFile("script.sh");
MdxLinuxClusterResource mdxLinuxClusterResource_0 =
mdxProject_0.get(MdxResourceManager.class).createResource(MdxLinuxClusterResource.class);
mdxSingleResourceSettings_0.setResource(mdxLinuxClusterResource_0);
mdxLinuxClusterResource_0.setCcmpCmd("powerpre");
mdxLinuxClusterResource_0.setJobSubmitCmd("qsub -l nodes=1:ppn=8");
mdxLinuxClusterResource_0.setJobNameIdentifier("-n");
mdxLinuxClusterResource_0.setJobNamePrefix("dm_design");
mdxLinuxClusterResource_0.setScriptFile("script.sh");

Windows Cluster

Previous Release Simcenter STAR-CCM+ 2021.3
mdxComputeResource_0.setType(MdxComputeResource.ResourceType.WINDOWS_CLUSTER);
MdxWindowsHPCClusterSettings mdxWindowsHPCClusterSettings_0 =
mdxComputeResource_0.getWindowsHPCClusterSettings();
mdxWindowsHPCClusterSettings_0.setCcmpCmd("power");
mdxWindowsHPCClusterSettings_0.setJobSubmitCmd("job submit /numcores:16");
mdxWindowsHPCClusterSettings_0.setJobNameIdentifier("/jname");
mdxWindowsHPCClusterSettings_0.setJobNamePrefix("dm_design");
mdxWindowsHPCClusterSettings_0.setScriptFile("script.sh");
MdxWindowsHPCClusterResource mdxWindowsHPCClusterResource_0 =
mdxProject_0.get(MdxResourceManager.class).createResource(MdxWindowsHPCClusterResource.class);
mdxSingleResourceSettings_0.setResource(mdxWindowsHPCClusterResource_0);
mdxWindowsHPCClusterResource_0.setCcmpCmd("power");
mdxWindowsHPCClusterResource_0.setJobSubmitCmd("job submit /numcores:16");
mdxWindowsHPCClusterResource_0.setJobNameIdentifier("/jname");
mdxWindowsHPCClusterResource_0.setJobNamePrefix("dm_design");
mdxWindowsHPCClusterResource_0.setScriptFile("script.sh");

Job Manager

Previous Release Simcenter STAR-CCM+ 2021.3
mdxComputeResource_0.setType(MdxComputeResource.ResourceType.JOB_MANAGER);
MdxJobManagerSettings mdxJobManagerSettings_0 =
mdxComputeResource_0.getJobManagerSettings();
mdxJobManagerSettings_0.setCcmpCmd("power");
mdxJobManagerSettings_0.setJobManagerKey("url:8100");
mdxJobManagerSettings_0.setSubmissionTemplate("NIGHTLY");
MdxJobManagerResource mdxJobManagerResource_0 =
mdxProject_0.get(MdxResourceManager.class).createResource(MdxJobManagerResource.class);
mdxSingleResourceSettings_0.setResource(mdxJobManagerResource_0);
mdxJobManagerResource_0.setCcmpCmd("power");
mdxJobManagerResource_0.setJobManagerKey("url:8100");
mdxJobManagerResource_0.setSubmissionTemplate("NIGHTLY");

Local CAD Update

Previous Release Simcenter STAR-CCM+ 2021.3
mdxComputeResource_0.setType(MdxComputeResource.ResourceType.LOCAL_CAD_UPDATE);
MdxLocalCadUpateSettings lcUpdateSettings = mdxComputeResource_0.getLocalCadUpdateSettings();
mdxLaunchSettigns_0.setResourceMode(MdxLaunchSettings.ResourceMode.LOCAL_CAD_UPDATE);
MdxLocalCadUpateSettings lcUpdateSettings = mdxLaunchSettings_0.getLocalCadUpdateSettings();

CAE Integration: Changes to CGNS Import

Improvements in time interpolation have resulted in changes to macro codes for CGNS import.

Previous Release Simcenter STAR-CCM+ 2021.3
import star.cosimulation.oneway.common.*;
...
public void execute() {
    Simulation simulation_0 = 
      getActiveSimulation();
    CoSimulation coSimulation_0 = 
      ((CoSimulation) simulation_0.get(CoSimulationManager.class).getObject("Link 1"));
    TransferStartTime transferStartTime_0 = 
      coSimulation_0.getCoSimulationValues().get(TransferStartTime.class);
    ...
    TransferStopTime transferStopTime_0 = 
      coSimulation_0.getCoSimulationValues().get(TransferStopTime.class);
    ...
    TimeStepsPerTransfer timeStepsPerTransfer_0 = 
      coSimulation_0.getCoSimulationValues().get(TimeStepsPerTransfer.class);
    ...
}
// The directory star.cosimulation.oneway.common is no longer used
// Use star.cosimulation.link.common instead

import star.cosimulation.link.common.*;
...
public void execute() {
    Simulation simulation_0 = 
      getActiveSimulation();
    CoSimulation coSimulation_0 = 
      ((CoSimulation) simulation_0.get(CoSimulationManager.class).getObject("Link 1"));
    // TransferStartTime has moved:
    //    FROM star.cosimulation.oneway.common
    //    TO   star.cosimulation.link.common
    TransferStartTime transferStartTime_0 = 
      coSimulation_0.getCoSimulationValues().get(TransferStartTime.class);
    ...
    // TransferStopTime has moved:
    //    FROM star.cosimulation.oneway.common
    //    TO   star.cosimulation.link.common
    TransferStopTime transferStopTime_0 = 
      coSimulation_0.getCoSimulationValues().get(TransferStopTime.class);
    ...
    // TimeStepsPerTransfer has been renamed to TimeStepFrequency and moved:
    //    FROM star.cosimulation.oneway.common
    //    TO   star.cosimulation.link.common
    TimeStepFrequency timeStepFrequency_0 = 
      coSimulation_0.getCoSimulationValues().get(TimeStepFrequency.class);
    timeStepFrequency_0.setFrequency(5);
    ...
}

Co-Simulation: Change to Abaqus Mapping Options

The user interface for Abaqus co-simulation has been improved, resulting in changes to the macro code.

Previous Release Simcenter STAR-CCM+ 2021.3
CoSimulation coSimulation_0 =  ((CoSimulation) simulation_0.get(CoSimulationManager.class).getObject("Link 1"));
CoSimulationZone coSimulationZone_0 = coSimulation_0.getCoSimulationZoneManager().getCoSimulationZone("Zone 1");
MapperSettings mapperSettings_0 = coSimulationZone_0.getCoSimulationZoneValues().get(MapperSettings.class);
mapperSettings_0.getMapperRefConfig().setSelected(MapperRefConfigOptions.Type.CURRENT);
CoSimulation coSimulation_0 = ((CoSimulation) simulation_0.get(CoSimulationManager.class).getObject("Link 1"));
coSimulation_0.getCoSimulationConditions().get(DisplacementReferenceConfigurationOption.class).setSelected(DisplacementReferenceConfigurationOption.Type.CURRENT);