宏 API 更改 2021.1

Simcenter STAR-CCM+ 2021.1 中,零部件和区域、反应流、多相、拉格朗日多相流、欧拉多相流、电磁、可视化和设计管理器的宏 API 已更改。

零部件和区域:零部件表面到边界分配的更改

用于定义零部件和区域,以及将其相互关联的的技法已改进。这些改进已导致宏代码发生更改。

Boundary.getPartSurfaceGroup() 方法的返回类型已更改。在以前的版本中,返回类型为 PartSurfaceGroup。新类型为 BoundaryPartSurfaceGroup,如下例所示:

以前版本 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
}

或者,可以使用直接包含更多通用 GeometryPartEntity 对象的新容器:

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

反应流体

对反应器网络模型的更改

烟气区模型选项已添加到反应器网络模型,从而导致宏代码更改。具体而言,以下实例

RNSootMomentOption rNSootMomentOption_0 = reactorNetworkEmissions_0.getSootMomentOption();

应改为

RNSootOption rNSootOption_0 = reactorNetworkEmissions_0.getSootMomentOption();

层流火焰速度已重构

由于重构,层流火焰速度的宏代码已更改。

以前版本 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);

多相:存在多相模型时不再允许激活薄膜模型

如果以前版本中的宏激活了薄膜模型与欧拉多相模型(VOF、欧拉多相和混合多相)的组合,建议重新录制它们。

使用这种模型组合导致了问题,薄膜不是为该状况设计的,因此不起作用。为此,Simcenter STAR-CCM+ 不允许使用多相模型激活薄膜。

包含此组合的宏在 Simcenter STAR-CCM+ 2021.1 中不起作用。相反,它会触发类似于以下内容的警告:

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

拉格朗日多相:对颗粒处理的更改

Simcenter STAR-CCM+ 2021.1 中,为混合平面上的拉格朗日颗粒添加了新的处理模式:传输。此新处理现在是默认模式。

在以前的版本中,拉格朗日颗粒的唯一处理模式是退出模式,因此它会自动激活。要在 Simcenter STAR-CCM+ 2021.1 中将先前录制的宏与退出模式一同使用,更新宏代码,如下例所示。

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);

欧拉多相流 (EMP)

对质量传递模型的更改

欧拉多相质量传递模型的重构导致宏代码更改。要更新宏,可移除以下代码的实例:

  • MusigNucleationModel.class
  • SgammaNucleationModel.class

例如:

以前版本 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);

对湍流模型结构的更改

对于 Simcenter STAR-CCM+ 2021.1 中的欧拉多相混合物湍流,湍流模型结构已修改,导致宏代码更改。

如果之前版本中的宏使用多相湍流,则必须添加 PhasicTurbulenceSpecificationModel,如下所示:

  • 在 import 标题中:

    import star.eulerianmultiphaseturb.PhasicTurbulenceSpecificationModel;

  • 选择多相湍流后。例如:
以前版本 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

电磁:移除多孔介质电磁模型

多孔介质电磁模型已从 Simcenter STAR-CCM+ 2021.1 中移除。在先前版本的 Simcenter STAR-CCM+ 中保存此模型的任何模拟文件将继续起作用。

但是,为使旧宏起作用,必须移除 PorousMediaElectromagnetismModel 的实例。例如,删除几行内容,如:

physicsContinuum.enable(PorousMediaElectromagnetismModel.class);

可视化:对宏中显示器处理的更改

函数 DisplayerManager.getDisplayer() 已弃用,因为它未精确匹配指定的显示器名称,从而导致意外结果。此函数将继续像以前一样起作用。但是,有两种替代方法可用于改进宏代码:

  • DisplayerManager.getDisplayer() 替换为 DisplayerManager.getObject()。此函数返回显示器,其确切名称作为参数提供,该名称通常应用作已弃用函数的直接替换名称。
  • 如果要查找名称以所提供参数开头的显示器,则使用新函数 DisplayerManager.getDisplayerByName(),复制旧功能。

设计管理器:对项目节点自动保存的更改

设计管理器项目节点的自动保存属性已修改,导致宏代码更改。

以前版本 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();