Macro API Changes 2021.1

In Simcenter STAR-CCM+ 2021.1, the macro API changed for parts and regions, reacting flows, multiphase, Lagrangian multiphase, Eulerian multiphase, electromagnetism, visualization, and Design Manager.

Parts and Regions: Change to Part Surface-to-Boundary Assignment

The techniques for defining parts and regions, and for associating them with each other, have been improved. These improvements have resulted in changes to the macro code.

The return type has changed for the method Boundary.getPartSurfaceGroup(). In previous releases, the return type was PartSurfaceGroup. The new type is BoundaryPartSurfaceGroup, as shown in the following example:

Previous Release Simcenter STAR-CCM+ 2021.1
PartSurfaceGroup psg = boundary.getPartSurfaceGroup();
for (PartSurface ps : psg.getObjects()) {
  // process objects
}
BoundaryPartSurfaceGroup psg = boundary.getPartSurfaceGroup();
for (PartSurface ps : psg.getObjects()) {
  // process objects
}

Alternatively, you can use the new container that holds more generic GeometryPartEntity objects directly:

GeometryPartEntityGroup gpeg = boundary.getGeometryPartEntityGroup();
for (GeometryPartEntity gpe : gpeg.getObjects()) {
  // process objects
}

Reacting Flows

Changes to Reactor Network Model

The Soot Sectional model option has been added to the Reactor Network model, resulting in changes to the macro code. Specifically, instances of

RNSootMomentOption rNSootMomentOption_0 = reactorNetworkEmissions_0.getSootMomentOption();

should be changed to

RNSootOption rNSootOption_0 = reactorNetworkEmissions_0.getSootMomentOption();

Laminar Flame Speed Restructured

Due to restructuring, macro codes for Laminar Flame Speed have changed.

Previous Release Simcenter STAR-CCM+ 2021.1
   AdiabaticPpdfCombustionModel adiabaticPpdfCombustionModel_0 =
      physicsContinuum_0.getModelManager().getModel(AdiabaticPpdfCombustionModel.class);

    adiabaticPpdfCombustionModel_0.setNumberOfStreams(3);
    EquilibriumTableGenerator equilibriumTableGenerator_0 =
      physicsContinuum_0.get(EquilibriumTableGenerator.class);

  TableFluidStreamCollection tableFluidStreams_0 =
      ((TableFluidStreamCollection) equilibriumTableGenerator_0.getTableFluidStreamCollection());
    tableFluidStreams_0.setNumberOfActiveStreams(3);
     NonAdiabaticPpdfCombustionModel nonAdiabaticPpdfCombustionModel_0 =
      physicsContinuum_0.getModelManager().getModel(NonAdiabaticPpdfCombustionModel.class);

    nonAdiabaticPpdfCombustionModel_0.setNumberOfStreams(3);
 TurbulentFlameClosure turbulentFlameClosure_0 =
     physicsContinuum_0.getModelManager().getModel(TurbulentFlameClosure.class);
 turbulentFlameClosure_0.getLaminarFlameSpeedOptions().setMethod(LaminarFlameSpeedGulderMethod.class);
 TurbulentFlameClosure turbulentFlameClosure_0 =
     physicsContinuum_0.getModelManager().getModel(TurbulentFlameClosure.class);
 turbulentFlameClosure_0.getLaminarFlameSpeedOptions().setMethod(LaminarFlameSpeedGulderOption.class);
   TurbulentFlameClosure turbulentFlameClosure_0 =
     physicsContinuum_0.getModelManager().getModel(TurbulentFlameClosure.class);
 turbulentFlameClosure_0.getLaminarFlameSpeedOptions().setMethod(LaminarFlameSpeedUserMethod.class);
  TurbulentFlameClosure turbulentFlameClosure_0 =
     physicsContinuum_0.getModelManager().getModel(TurbulentFlameClosure.class);
 turbulentFlameClosure_0.getLaminarFlameSpeedOptions().setMethod(LaminarFlameSpeedUserOption.class);
    TurbulentFlameClosure turbulentFlameClosure_0 =
     physicsContinuum_0.getModelManager().getModel(TurbulentFlameClosure.class);
 turbulentFlameClosure_0.getLaminarFlameSpeedOptions().setMethod(LaminarFlameSpeedMetghalchiMethod.class);
  TurbulentFlameClosure turbulentFlameClosure_0 =
     physicsContinuum_0.getModelManager().getModel(TurbulentFlameClosure.class);
 turbulentFlameClosure_0.getLaminarFlameSpeedOptions().setMethod(LaminarFlameSpeedMetghalchiOption.class);
TurbulentFlameClosure turbulentFlameClosure_0 =
     physicsContinuum_0.getModelManager().getModel(TurbulentFlameClosure.class);
LaminarFlameSpeedProfile laminarFlameSpeedProfile_0 =
      ((LaminarFlameSpeedUserMethod) turbulentFlameClosure_0.getLaminarFlameSpeedOptions().getMethod()).getLaminarFlameSpeedProfile();
TurbulentFlameClosure turbulentFlameClosure_0 =
     physicsContinuum_0.getModelManager().getModel(TurbulentFlameClosure.class);
 LaminarFlameSpeedProfile laminarFlameSpeedProfile_0 =  
      ((LaminarFlameSpeedUserOption) turbulentFlameClosure_0.getLaminarFlameSpeedOptions().getMethod()).getLaminarFlameSpeedProfile();
FlameSurfaceDensityRansModel flameSurfaceDensityRansModel_0 =
 physicsContinuum_0.getModelManager().getModel(FlameSurfaceDensityRansModel.class);
flameSurfaceDensityRansModel_0.getEcfmLaminarFlameSpeedControlOption().setSelect
ed(EcfmLaminarFlameSpeedControlOption.Type.TABULATED);
FlameSurfaceDensityRansModel flameSurfaceDensityRansModel_0 =
 physicsContinuum_0.getModelManager().getModel(FlameSurfaceDensityRansModel.class);
 flameSurfaceDensityRansModel_0.getLaminarFlameSpeedOptions().setMethod(LaminarFlameSpeedTabulatedOption.class);
FlameSurfaceDensityRansModel flameSurfaceDensityRansModel_0 =
 physicsContinuum_0.getModelManager().getModel(FlameSurfaceDensityRansModel.class);
flameSurfaceDensityRansModel_0.getEcfmLaminarFlameSpeedControlOption().setSelect
ed(EcfmLaminarFlameSpeedControlOption.Type.USERDEFINED);
FlameSurfaceDensityRansModel flameSurfaceDensityRansModel_0 =
 physicsContinuum_0.getModelManager().getModel(FlameSurfaceDensityRansModel.class);
 flameSurfaceDensityRansModel_0.getLaminarFlameSpeedOptions().setMethod(LaminarFlameSpeedUserOption.class);
FlameSurfaceDensityRansModel flameSurfaceDensityRansModel_0 =
 physicsContinuum_0.getModelManager().getModel(FlameSurfaceDensityRansModel.class);
flameSurfaceDensityRansModel_0.getEcfmLaminarFlameSpeedControlOption().setSelect
ed(EcfmLaminarFlameSpeedControlOption.Type.MK);
FlameSurfaceDensityRansModel flameSurfaceDensityRansModel_0 =
 physicsContinuum_0.getModelManager().getModel(FlameSurfaceDensityRansModel.class);
 flameSurfaceDensityRansModel_0.getLaminarFlameSpeedOptions().setMethod(LaminarFlameSpeedMetghalchiKeckOption.class);
  FlameSurfaceDensityRansModel flameSurfaceDensityRansModel_0 =
 physicsContinuum_0.getModelManager().getModel(FlameSurfaceDensityRansModel.class);  
     LfsTable lfsTable_0 =
-      ((LfsTable) ((LaminarFlameSpeedTabulatedOption) flameSurfaceDensityRansModel_0.getLaminarFlameSpeedOption()).getLfsTable());
  FlameSurfaceDensityRansModel flameSurfaceDensityRansModel_0 =
 physicsContinuum_0.getModelManager().getModel(FlameSurfaceDensityRansModel.class);  
      ((LfsTable) ((LaminarFlameSpeedTabulatedOption) flameSurfaceDensityRansModel_0.getLaminarFlameSpeedOptions().getMethod()).getLfsTable());
  CfmCombustionPartiallyPremixedModel cfmCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( CfmCombustionPartiallyPremixedModel .class);  
 cfmCombustionPartiallyPremixedModel_0.getLaminarFlameSpeedControlOption().setSelected(LaminarFlameSpeedControlOption.Type.GULDER);
CfmCombustionPartiallyPremixedModel cfmCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( CfmCombustionPartiallyPremixedModel .class);   
 cfmCombustionPartiallyPremixedModel_0.getLaminarFlameSpeedOptions().setMethod(LaminarFlameSpeedGulderOption.class);
  CfmCombustionPartiallyPremixedModel cfmCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( CfmCombustionPartiallyPremixedModel .class);  
 cfmCombustionPartiallyPremixedModel_0.getLaminarFlameSpeedControlOption().setSelected(LaminarFlameSpeedControlOption.Type.METHGALCHI);
CfmCombustionPartiallyPremixedModel cfmCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( CfmCombustionPartiallyPremixedModel .class);   
 cfmCombustionPartiallyPremixedModel_0.getLaminarFlameSpeedOptions().setMethod(LaminarFlameSpeedMethgalchiOption.class);
  CfmCombustionPartiallyPremixedModel cfmCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( CfmCombustionPartiallyPremixedModel .class);  
 cfmCombustionPartiallyPremixedModel_0.getLaminarFlameSpeedControlOption().setSelected(LaminarFlameSpeedControlOption.Type.USERDEFINED);
CfmCombustionPartiallyPremixedModel cfmCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( CfmCombustionPartiallyPremixedModel .class);   
 cfmCombustionPartiallyPremixedModel_0.getLaminarFlameSpeedOptions().setMethod(LaminarFlameSpeedUserOption.class);
  CfmCombustionPartiallyPremixedModel cfmCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( CfmCombustionPartiallyPremixedModel .class);  
 cfmCombustionPartiallyPremixedModel_0.getLaminarFlameSpeedControlOption().setSelected(LaminarFlameSpeedControlOption.Type.FGMTABLE);
CfmCombustionPartiallyPremixedModel cfmCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( CfmCombustionPartiallyPremixedModel .class);   
 cfmCombustionPartiallyPremixedModel_0.getLaminarFlameSpeedOptions().setMethod(LaminarFlameSpeedFgmTableOption.class);
  CfmCombustionPartiallyPremixedModel cfmCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( CfmCombustionPartiallyPremixedModel .class);  
 ((LaminarFlameSpeedGulderOption) cfmCombustionPartiallyPremixedModel_0 .getLaminarFlameSpeedOption()).getFuelNameControlOption().setSelected(FuelNameControlOption.PROPANE);
CfmCombustionPartiallyPremixedModel cfmCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( CfmCombustionPartiallyPremixedModel .class);   
    ((LaminarFlameSpeedGulderOption) cfmCombustionPartiallyPremixedModel_0 .getLaminarFlameSpeedOptions().getMethod()).getFuelNameControlOption().setSelected(FuelNameControlOption.PROPANE);
  CfmCombustionPartiallyPremixedModel cfmCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( CfmCombustionPartiallyPremixedModel .class);  
     LaminarFlameSpeedProfile laminarFlameSpeedProfile_0 =
-       ((LaminarFlameSpeedUserOption) cfmCombustionPartiallyPremixedModel_0.getLaminarFlameSpeedOption()).getLaminarFlameSpeedProfile();
CfmCombustionPartiallyPremixedModel cfmCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( CfmCombustionPartiallyPremixedModel .class);   
       ((LaminarFlameSpeedUserOption) cfmCombustionPartiallyPremixedModel_0.getLaminarFlameSpeedOptions().getMethod()).getLaminarFlameSpeedProfile();
  TfcCombustionPartiallyPremixedModel tfcCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( TfcCombustionPartiallyPremixedModel .class); 
 tfcCombustionPartiallyPremixedModel_0.getTurbulentFlameSpeedControlOption().setSelected(TurbulentFlameSpeedControlOption.Type.USERDEFINED_TFS);
 TfcCombustionPartiallyPremixedModel tfcCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( TfcCombustionPartiallyPremixedModel .class); 
 tfcCombustionPartiallyPremixedModel_0.getTurbulentFlameSpeedOptionManager().setMethod(TurbulentFlameSpeedUserOption.class);
  TfcCombustionPartiallyPremixedModel tfcCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( TfcCombustionPartiallyPremixedModel .class); 
 tfcCombustionPartiallyPremixedModel_0.getTurbulentFlameSpeedControlOption().setSelected(TurbulentFlameSpeedControlOption.Type.USERSOURCE);
 TfcCombustionPartiallyPremixedModel tfcCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( TfcCombustionPartiallyPremixedModel .class); 
 tfcCombustionPartiallyPremixedModel_0.getTurbulentFlameSpeedOptionManager().setMethod(TurbulentFlameSpeedUserSourceOption.class);
  TfcCombustionPartiallyPremixedModel tfcCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( TfcCombustionPartiallyPremixedModel .class); 
 tfcCombustionPartiallyPremixedModel_0.getTurbulentFlameSpeedControlOption().setSelected(TurbulentFlameSpeedControlOption.Type.PETERS_TFS;
 TfcCombustionPartiallyPremixedModel tfcCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( TfcCombustionPartiallyPremixedModel .class); 
 tfcCombustionPartiallyPremixedModel_0.getTurbulentFlameSpeedOptionManager().setMethod(TurbulentFlameSpeedPetersOption.class);
  TfcCombustionPartiallyPremixedModel tfcCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( TfcCombustionPartiallyPremixedModel .class); 
 tfcCombustionPartiallyPremixedModel_0.getTurbulentFlameSpeedControlOption().setSelected(TurbulentFlameSpeedControlOption.Type.ZIMONT_TFS);
 TfcCombustionPartiallyPremixedModel tfcCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( TfcCombustionPartiallyPremixedModel .class); 
 tfcCombustionPartiallyPremixedModel_0.getTurbulentFlameSpeedOptionManager().setMethod(TurbulentFlameSpeedZimontOption.class);
  TfcCombustionPartiallyPremixedModel tfcCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( TfcCombustionPartiallyPremixedModel .class); 
     TurbulentFlameSpeedProfile turbulentFlameSpeedProfile_0 =
     ((TurbulentFlameSpeedUserOption) tfcCombustionPartiallyPremixedModel_0.getTurbulentFlameSpeedOption()).getTurbulentFlameSpeedProfile();
 TfcCombustionPartiallyPremixedModel tfcCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( TfcCombustionPartiallyPremixedModel .class); 
      ((TurbulentFlameSpeedUserOption) tfcCombustionPartiallyPremixedModel_0.getTurbulentFlameSpeedOptionManager().getMethod()).getTurbulentFlameSpeedProfile();
  TfcCombustionPartiallyPremixedModel tfcCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( TfcCombustionPartiallyPremixedModel .class); 
           TfcUserSourceProfile tfcUserSourceProfile_0 =
         ((TfcUserSourceOption) tfcCombustionPartiallyPremixedModel_0.getTurbulentFlameSpeedOption()).getTfcUserSourceProfile();
 TfcCombustionPartiallyPremixedModel tfcCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( TfcCombustionPartiallyPremixedModel .class); 
   TfcUserSourceProfile tfcUserSourceProfile_0 =
 ((TfcUserSourceOption) tfcCombustionPartiallyPremixedModel_0.getTurbulentFlameSpeedOptionManager().getMethod()).getTfcUserSourceProfile();
 TfcCombustionPartiallyPremixedModel tfcCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( TfcCombustionPartiallyPremixedModel .class);       tfcCombustionPartiallyPremixedModel_0.getLaminarFlameSpeedOptions().setMethod(LaminarFlameSpeedMetghalchiMethod.class);
 TfcCombustionPartiallyPremixedModel tfcCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( TfcCombustionPartiallyPremixedModel .class);       tfcCombustionPartiallyPremixedModel_0.getLaminarFlameSpeedOptions().setMethod(LaminarFlameSpeedMetghalchiOption.class);
 TfcCombustionPartiallyPremixedModel tfcCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( TfcCombustionPartiallyPremixedModel .class);       tfcCombustionPartiallyPremixedModel_0.getLaminarFlameSpeedOptions().setMethod(LaminarFlameSpeedGulderMethod.class);
 TfcCombustionPartiallyPremixedModel tfcCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( TfcCombustionPartiallyPremixedModel .class);       tfcCombustionPartiallyPremixedModel_0.getLaminarFlameSpeedOptions().setMethod(LaminarFlameSpeedGulderOption.class);
 TfcCombustionPartiallyPremixedModel tfcCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( TfcCombustionPartiallyPremixedModel .class);       tfcCombustionPartiallyPremixedModel_0.getLaminarFlameSpeedOptions().setMethod(LaminarFlameSpeedUserMethod.class);
 TfcCombustionPartiallyPremixedModel tfcCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( TfcCombustionPartiallyPremixedModel .class);       tfcCombustionPartiallyPremixedModel_0.getLaminarFlameSpeedOptions().setMethod(LaminarFlameSpeedUserOption.class);
 TfcCombustionPartiallyPremixedModel tfcCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( TfcCombustionPartiallyPremixedModel .class);
   ((TurbulentFlameSpeedZimontOption) tfcCombustionPartiallyPremixedModel_0.getTurbulentFlameSpeedOption()).setFlameStretchEffectOption(true);
 TfcCombustionPartiallyPremixedModel tfcCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( TfcCombustionPartiallyPremixedModel .class);    
   ((TurbulentFlameSpeedZimontOption) tfcCombustionPartiallyPremixedModel_0.getTurbulentFlameSpeedOptionManager().getMethod()).setFlameStretchEffectOption(true);
 TfcCombustionPartiallyPremixedModel tfcCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( TfcCombustionPartiallyPremixedModel .class);
    LaminarFlameSpeedOptions laminarFlameSpeedOptions_0 =
      tfcCombustionPartiallyPremixedModel_0.getLaminarFlameSpeedOptions();
    ((LaminarFlameSpeedGulderMethod) laminarFlameSpeedOptions_0.getMethod()).getFuelNameControlOption().setSelected(FuelNameControlOption.Type.PROPANE);
 TfcCombustionPartiallyPremixedModel tfcCombustionPartiallyPremixedModel_0  =
 physicsContinuum_0.getModelManager().getModel( TfcCombustionPartiallyPremixedModel .class);      
    LaminarFlameSpeedOptions laminarFlameSpeedOptions_0 =
      tfcCombustionPartiallyPremixedModel_0.getLaminarFlameSpeedOptions();
    ((LaminarFlameSpeedGulderOption) laminarFlameSpeedOptions_0.getMethod()).getFuelNameControlOption().setSelected(FuelNameControlOption.Type.PROPANE);

Multiphase: Thin Film Model Activation No Longer Allowed with Multiphase Models

If you have macros from previous releases that activate the Thin Film model in combination with Eulerian Multiphase models (VOF, Eulerian Multiphase, and Mixture Multiphase), you are advised to re-record them.

Issues resulted from using this combination of models, for which Thin Film was not designed and therefore does not work. In response, Simcenter STAR-CCM+ 2021.1 does not allow activation of Thin Film with the Multiphase models.

A macro that includes this combination does not work in Simcenter STAR-CCM+ 2021.1. Instead, it triggers a warning similar to the following:

Warning: The model star.windshield.WindShieldModel is incompatible with the currently enabled models in ...: star.material.EulerianMultiphaseModel

Lagrangian Multiphase: Change to Treatment of Particles

In Simcenter STAR-CCM+ 2021.1, a new treatment mode has been added for Lagrangian particles on mixing planes: Transmit. This new treatment is now the default mode.

In previous releases, the only treatment mode for Lagrangian particles was Escape mode, so it was activated automatically. To use a previously recorded macro with Escape mode in Simcenter STAR-CCM+ 2021.1, update your macro code as shown in the following example.

Simulation simulation_0 = 
  getActiveSimulation();
PhysicsContinuum physicsContinuum_0 = 
  ((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1"));
LagrangianMultiphaseModel lagrangianMultiphaseModel_0 = 
  physicsContinuum_0.getModelManager().getModel(LagrangianMultiphaseModel.class);
LagrangianPhase lagrangianPhase_0 = 
  ((LagrangianPhase) lagrangianMultiphaseModel_0.getPhaseManager().getPhase("Phase 1"));
DefaultBoundaryConditions defaultBoundaryConditions_0 = 
  ((DefaultBoundaryConditions) lagrangianPhase_0.getDefaultBoundaryConditionsManager().getBoundaryConditions(MixingPlaneInflowBoundary.class));
BoundaryInteractionModeManager boundaryInteractionModeManager_0 = 
  defaultBoundaryConditions_0.getConditions().get(BoundaryInteractionModeManager.class);
boundaryInteractionModeManager_0.setActiveMode(EscapeMode.class);
DefaultBoundaryConditions defaultBoundaryConditions_1 = 
  ((DefaultBoundaryConditions) lagrangianPhase_0.getDefaultBoundaryConditionsManager().getBoundaryConditions(MixingPlaneOutflowBoundary.class));
BoundaryInteractionModeManager boundaryInteractionModeManager_1 = 
  defaultBoundaryConditions_1.getConditions().get(BoundaryInteractionModeManager.class);
boundaryInteractionModeManager_1.setActiveMode(EscapeMode.class);

Eulerian Multiphase (EMP)

Changes to Mass Transfer Models

Refactoring of Eulerian Multiphase mass transfer models has resulted in changes to the macro code. To update your macros, remove instances of the following code:

  • MusigNucleationModel.class
  • SgammaNucleationModel.class

For example:

Previous Release Simcenter STAR-CCM+ 2021.1
phaseInteraction_0.enable(SgammaNucleationModel.class);
phaseInteraction_0.enable(UserDefinedNucleationModel.class);
phaseInteraction_0.enable(UserDefinedNucleationModel.class);
phaseInteraction_0.enable(MusigNucleationModel.class);
phaseInteraction_0.enable(UserDefinedNucleationModel.class);
phaseInteraction_0.enable(UserDefinedNucleationModel.class);
phaseInteraction_0.enable(SgammaNucleationModel.class);
phaseInteraction_0.enable(CrystalNucleationModel.class);
phaseInteraction_0.enable(CrystalNucleationModel.class);
phaseInteraction_0.enable(MusigNucleationModel.class);
phaseInteraction_0.enable(CrystalNucleationModel.class);
phaseInteraction_0.enable(CrystalNucleationModel.class);

Changes to Turbulence Model Structure

For Eulerian multiphase mixture turbulence in Simcenter STAR-CCM+ 2021.1, the turbulence model structure has been modified, resulting in changes to the macro code.

If your macros from previous releases use multiphase turbulence, you must add PhasicTurbulenceSpecificationModel as follows:

  • In the import header:

    import star.eulerianmultiphaseturb.PhasicTurbulenceSpecificationModel;

  • After multiphase turbulence is selected. For example:
Previous Release Simcenter STAR-CCM+ 2021.1
PhysicsContinuum physicsContinuum_0 = ((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1"));
physicsContinuum_0.enable(MultiPhaseTurbulentModel.class);
PhysicsContinuum physicsContinuum_0 = ((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1"));
physicsContinuum_0.enable(MultiPhaseTurbulentModel.class);
physicsContinuum_0.enable(PhasicTurbulenceSpecificationModel.class);   // new line

Electromagnetism: Removal of Porous Media Electromagnetism Model

The Porous Media Electromagnetism model has been removed from Simcenter STAR-CCM+ 2021.1. Any simulation files that were saved with this model in previous versions of Simcenter STAR-CCM+ will continue to work.

However, for your old macros to work, you must remove instances of PorousMediaElectromagnetismModel. For example, delete lines such as:

physicsContinuum.enable(PorousMediaElectromagnetismModel.class);

Visualization: Change to Displayer Handling in Macros

The function DisplayerManager.getDisplayer() has been deprecated since it did not do an exact match on the displayer name specified, leading to unexpected results. This function continues to work as before. However, two alternatives are available with which you can improve your macro code:

  • Replace DisplayerManager.getDisplayer() with DisplayerManager.getObject(). This function returns the displayer with the exact name supplied as an argument, and this is what you should typically use as a direct replacement for the deprecated function.
  • Use the new function DisplayerManager.getDisplayerByName() if you want to find a displayer whose name starts with the supplied argument, replicating the old functionality.

Design Manager: Change to Auto Save for Project Node

The Auto Save property of the Design Manager project node has been modified, resulting in changes to the macro code.

Previous Release Simcenter STAR-CCM+ 2021.1
boolean getAutoSaveOnDesignCompletion(); => deprecated
void setAutoSaveOnDesignCompletion(boolean newValue); => deprecated
// begin macro: autosave
    MdxProject mdxProject_0 =  getActiveMdxProject();
    mdxProject_0. setAutoSaveOnDesignCompletion (false);
    boolean autoSave = mdxProject_0. getAutoSaveOnDesignCompletion ();
boolean getIsAutoSaveEnabled()
void setIsAutoSaveEnabled(boolean newValue);
  // begin macro: autosave
    MdxProject mdxProject_0 =  getActiveMdxProject();
    mdxProject_0.setIsAutoSaveEnabled(false);
    boolean autoSave = mdxProject_0.getIsAutoSaveEnabled();