宏 API 更改 2402

在 Simcenter STAR-CCM+ 2402 中,针对 3D-CAD、运动、材料属性、热传递、辐射、欧拉多相流、电池建模、后处理和设计管理器更改了宏 API。

3D-CAD:用于保留原始面的新布尔合并选项

Simcenter STAR-CCM+ 2402 中添加了一个用于在布尔合并操作中保留原始面的选项。通过此新选项,可指定是否保留由合并体功能压印到任何输入体上的任何冗余边。在以前的发行版中,这些冗余压印边是通过合并体功能自动删除的。此项改进导致宏代码更改。

以下成员函数已添加到 UniteBodiesFeature 类,该类位于包 star.cadmodeler: void setKeepImprintedEdges(boolean mode); 中。

在 2402 版本中用创建默认合并体功能录制宏时,会向宏录制一个附加语句:uniteBodiesFeature_0.setKeepImprintedEdges(false);。

以前版本 Simcenter STAR-CCM+ 2402
UniteBodiesFeature uniteBodiesFeature_0 = cadModel_0.getFeatureManager().createUniteBodies2();
uniteBodiesFeature_0.setImprintOption(0);
uniteBodiesFeature_0.setUseAutoMatch(true);
uniteBodiesFeature_0.setTransferFaceNames(true);
uniteBodiesFeature_0.setTransferBodyNames(false);
UniteBodiesFeature uniteBodiesFeature_0 = cadModel_0.getFeatureManager().createUniteBodies2();
uniteBodiesFeature_0.setKeepImprintedEdges(false);
uniteBodiesFeature_0.setImprintOption(0);
uniteBodiesFeature_0.setUseAutoMatch(true);
uniteBodiesFeature_0.setTransferFaceNames(true);
uniteBodiesFeature_0.setTransferBodyNames(false);

运动:旋转运动的更改

由于 Simcenter STAR-CCM+ 引入了新的旋转运动功能,因此旋转运动和叠加旋转运动的宏代码已更改。

设置旋转运动中的旋转速率

以前版本 Simcenter STAR-CCM+ 2402
  RotatingMotion rotatingMotion_0 = 
    ((RotatingMotion) simulation_0.get(MotionManager.class).getObject("Rotation"));

  Units units_0 = 
    ((Units) simulation_0.getUnitsManager().getObject("radian/s"));

  rotatingMotion_0.getRotationRate().setValueAndUnits(1.0, units_0);
  RotatingMotion rotatingMotion_0 = 
    ((RotatingMotion) simulation_0.get(MotionManager.class).getObject("Rotation"));

  RotationRate rotationRate_0 = 
    ((RotationRate) rotatingMotion_0.getRotationSpecification());

  Units units_0 = 
    ((Units) simulation_0.getUnitsManager().getObject("radian/s"));

  rotationRate_0.getRotationRate().setValueAndUnits(1.0, units_0);

设置旋转运动中的旋转轴方向和原点

以前版本 Simcenter STAR-CCM+ 2402
  RotatingMotion rotatingMotion_0 = 
    ((RotatingMotion) simulation_0.get(MotionManager.class).getObject("Rotation"));

  Units units_0 = 
    ((Units) simulation_0.getUnitsManager().getObject(""));

  rotatingMotion_0.getAxisDirection().setComponentsAndUnits(0.0, 1.0, 1.0, units_0);
  // Alternatively it can also be:
  // rotatingMotion_0.getAxisVector().setComponentsAndUnits(0.0, 1.0, 1.0, units_0);

  Units units_1 = 
    ((Units) simulation_0.getUnitsManager().getObject("m"));

  rotatingMotion_0.getAxisOrigin().setComponentsAndUnits(0.0, 0.0, 1.0, units_1);
  // Alternatively it can also be:
  // rotatingMotion_0.getOriginVector().setComponentsAndUnits(0.0, 0.0, 1.0, units_1);
  RotatingMotion rotatingMotion_0 = 
    ((RotatingMotion) simulation_0.get(MotionManager.class).getObject("Rotation"));

  MotionRotationAxis motionRotationAxis_0 = 
    rotatingMotion_0.getRotationAxis();

  Units units_0 = 
    ((Units) simulation_0.getUnitsManager().getObject(""));

  motionRotationAxis_0.getDirection().setComponentsAndUnits(0.0, 1.0, 1.0, units_0);

  Units units_1 = 
    ((Units) simulation_0.getUnitsManager().getObject("m"));

  motionRotationAxis_0.getOrigin().setComponentsAndUnits(0.0, 0.0, 1.0, units_1);

设置叠加旋转运动中的旋转轴方向和原点

以前版本 Simcenter STAR-CCM+ 2402
  SuperposingRotatingMotion superposingRotatingMotion_0 = 
    ((SuperposingRotatingMotion) rotatingMotion_0.getSuperposingMotionManager().getObject("Superposing Rotation"));

  Units units_0 = 
    ((Units) simulation_0.getUnitsManager().getObject(""));

  superposingRotatingMotion_0.getAxisDirection().setComponentsAndUnits(0.0, 1.0, 1.0, units_0);
  // Alternatively it can also be:
  // superposingRotatingMotion_0.getAxisVector().setComponentsAndUnits(0.0, 1.0, 1.0, units_0);

  Units units_1 = 
    ((Units) simulation_0.getUnitsManager().getObject("m"));

  superposingRotatingMotion_0.getAxisOrigin().setComponentsAndUnits(0.0, 0.0, 1.0, units_1);
  // Alternatively it can also be:
  // superposingRotatingMotion_0.getOriginVector().setComponentsAndUnits(0.0, 0.0, 1.0, units_1);
  SuperposingRotatingMotion superposingRotatingMotion_0 = 
    ((SuperposingRotatingMotion) rotatingMotion_0.getSuperposingMotionManager().getObject("Superposing Rotation"));

  MotionRotationAxis motionRotationAxis_0 = 
    superposingRotatingMotion_0.getRotationAxis();

  Units units_0 = 
    ((Units) simulation_0.getUnitsManager().getObject(""));

  motionRotationAxis_0.getDirection().setComponentsAndUnits(0.0, 1.0, 1.0, units_0);

  Units units_1 = 
    ((Units) simulation_0.getUnitsManager().getObject("m"));

  motionRotationAxis_0.getOrigin().setComponentsAndUnits(0.0, 0.0, 1.0, units_1);

设置旋转运动中的旋转角度

以前版本 Simcenter STAR-CCM+ 2402
  RotatingMotion rotatingMotion_0 = 
    ((RotatingMotion) simulation_0.get(MotionManager.class).getObject("Rotation"));

  RotationAngle rotationAngle_0 = 
    ((RotationAngle) rotatingMotion_0.getRotationSpecification());

  UserFieldFunction userFieldFunction_0 = 
    ((UserFieldFunction) simulation_0.getFieldFunctionManager().getFunction("AngleFieldFunction"));

  rotationAngle_0.setRotationAngleFunction(userFieldFunction_0);
  RotatingMotion rotatingMotion_0 = 
    ((RotatingMotion) simulation_0.get(MotionManager.class).getObject("Rotation"));

  RotationAngle rotationAngle_0 = 
    ((RotationAngle) rotatingMotion_0.getRotationSpecification());

  rotationAngle_0.getRotationAngle().setDefinition("${AngleFieldFunction}");

设置叠加旋转运动中的旋转角度

以前版本 Simcenter STAR-CCM+ 2402
  SuperposingRotatingMotion superposingRotatingMotion_0 = 
    ((SuperposingRotatingMotion) rotatingMotion_0.getSuperposingMotionManager().getObject("Superposing Rotation"));

  RotationAngle rotationAngle_0 = 
    ((RotationAngle) superposingRotatingMotion_0.getRotationSpecification());

  UserFieldFunction userFieldFunction_0 = 
    ((UserFieldFunction) simulation_0.getFieldFunctionManager().getFunction("AngleFieldFunction"));

  rotationAngle_0.setRotationAngleFunction(userFieldFunction_0);
  SuperposingRotatingMotion superposingRotatingMotion_0 = 
    ((SuperposingRotatingMotion) rotatingMotion_0.getSuperposingMotionManager().getObject("Superposing Rotation"));

  RotationAngle rotationAngle_0 = 
    ((RotationAngle) superposingRotatingMotion_0.getRotationSpecification());

  rotationAngle_0.getRotationAngle().setDefinition("${AngleFieldFunction}");

材料属性:弃用各向异性材料属性指定方法

材料属性指定方法各向异性和各向异性(原有)从 2210 版本开始已弃用,并计划从以后的版本中移除。有关这些方法和计划替换的详细信息,请参见 2402 发行说明“重要说明”章节中的“材料属性”。

如果任何现有宏使用已弃用的材料属性法(导热率、导电率、渗透率、介电常数的 9 个各向异性分量,或是导热率的各向异性(原有)),则搜索以下字符串的实例并更新它们,如下表中所示。

以前版本 Simcenter STAR-CCM+ 2402
AnisotropicElectricalConductivityMethodWithValues FullTensorElectricalConductivityMethodWithValues
AnisotropicPermeabilityMethodWithValues FullTensorPermeabilityMethodWithValues
AnisotropicPermittivityMethodWithValues FullTensorPermittivityMethodWithValues
AnisotropicThermalConductivityMethodWithValues FullTensorThermalConductivityMethodWithValues
AnisotropicThermalConductivityMethod FullTensorLegacyThermalConductivityMethod

辐射:光子蒙特卡洛建模的更改

由于引入了体积光子蒙特卡洛建模,光子蒙特卡洛求解器的宏代码已更改。

以前版本 Simcenter STAR-CCM+ 2402
PMCSolver pMCSolver_0 = ((PMCSolver) simulation.getSolverManager().getSolver(PMCSolver.class));
S2sPMCRtPhysicsSolver s2sPMCRtPhysicsSolver_0 =
    ((S2sPMCRtPhysicsSolver) pMCSolver_0.getSolvers().getSolver(S2sPMCRtPhysicsSolver.class));
s2sPMCRtPhysicsSolver_0.setNumRaysPerPatch(400);
PMCSolver pMCSolver_0 = ((PMCSolver) simulation.getSolverManager().getSolver(PMCSolver.class));
PMCRtPhysicsSolver pMCRtPhysicsSolver_0 =
    ((PMCRtPhysicsSolver) pMCSolver_0.getSolvers().getSolver(PMCRtPhysicsSolver.class));
pMCRtPhysicsSolver_0.setNumRaysPerPatch(400);

欧拉多相流 (EMP):颗粒引发湍流的更改

在 2402 版本中,欧拉多相混合物湍流现在与颗粒引发湍流兼容,导致宏代码发生更改。

以前版本 Simcenter STAR-CCM+ 2402
phaseInteraction_0.enable(ParticleInducedTurbulenceGroup.class);

phaseInteraction_0.enable(TchenPitModel.class);

phaseInteraction_0.enable(VirtualMassCoefficientModel.class);

TchenPitModel tchenPitModel_0 = 
  phaseInteraction_0.getModelManager().getModel(TchenPitModel.class);

Units units_0 = 
  ((Units) simulation_0.getUnitsManager().getObject(""));

tchenPitModel_0.getTchenCDamp().setValueAndUnits(1.0, units_0);

tchenPitModel_0.getTchenC3().setValueAndUnits(1.44, units_0);

tchenPitModel_0.getTchenPrandtlNumber().setValueAndUnits(1.0, units_0);

tchenPitModel_0.getC_beta().setValueAndUnits(1.8, units_0);
phaseInteraction_0.enable(ParticleInducedTurbulenceSourceModel.class);

ParticleInducedTurbulenceSourceModel particleInducedTurbulenceSourceModel_0 = 
  phaseInteraction_0.getModelManager().getModel(ParticleInducedTurbulenceSourceModel.class);

particleInducedTurbulenceSourceModel_0.getPitSourceOption().setSelected(PitSourceOption.Type.TCHEN);

Units units_0 = 
  ((Units) simulation_0.getUnitsManager().getObject(""));

particleInducedTurbulenceSourceModel_0.getTchenC3().setValueAndUnits(1.44, units_0);

particleInducedTurbulenceSourceModel_0.getTchenCDamp().setValueAndUnits(1.0, units_0);

particleInducedTurbulenceSourceModel_0.getC_beta().setValueAndUnits(1.8, units_0);

particleInducedTurbulenceSourceModel_0.getTchenPrandtl().setValueAndUnits(1.0, units_0);
phaseInteraction_0.enable(ParticleInducedTurbulenceGroup.class);

phaseInteraction_0.enable(TroshkoHassanPITModel.class);
	
	phaseInteraction_0.enable(VirtualMassCoefficientModel.class);
	
Units units_0 = 
  ((Units) simulation_0.getUnitsManager().getObject(""));

TroshkoHassanPITModel troshkoHassanPITModel_0 = 
  phaseInteraction_0.getModelManager().getModel(TroshkoHassanPITModel.class);

troshkoHassanPITModel_0.getTroshkoHassanC3().setValueAndUnits(0.45, units_0);

troshkoHassanPITModel_0.getTroshkoHassanCDamp().setValueAndUnits(1.0, units_0);
phaseInteraction_0.enable(ParticleInducedTurbulenceSourceModel.class);

ParticleInducedTurbulenceSourceModel particleInducedTurbulenceSourceModel_0 = 
  phaseInteraction_0.getModelManager().getModel(ParticleInducedTurbulenceSourceModel.class);

particleInducedTurbulenceSourceModel_0.getPitSourceOption().setSelected(PitSourceOption.Type.TROSHKO_HASSAN);

Units units_0 = 
  ((Units) simulation_0.getUnitsManager().getObject(""));
   
particleInducedTurbulenceSourceModel_0.getTroshkoHassanC3().setValueAndUnits(0.45, units_0);

particleInducedTurbulenceSourceModel_0.getTroshkoHassanCDamp().setValueAndUnits(1.0, units_0);
phaseInteraction_0.enable(ParticleInducedMixingModel.class);

ParticleInducedMixingModel particleInducedMixingModel_0 = 
  phaseInteraction_0.getModelManager().getModel(ParticleInducedMixingModel.class);

SatoBubbleInducedViscosityMethod satoBubbleInducedViscosityMethod_0 = 
  particleInducedMixingModel_0.getParticleInducedViscosity().getMethod(SatoBubbleInducedViscosityMethod.class);

satoBubbleInducedViscosityMethod_0.setAPlusConstant(26.0);

satoBubbleInducedViscosityMethod_0.setCalibrationConstant(1.2);
   phaseInteraction_0.enable(ParticleInducedTurbulenceViscosityModel.class);

ParticleInducedTurbulenceViscosityModel particleInducedTurbulenceViscosityModel_0 = 
  phaseInteraction_0.getModelManager().getModel(ParticleInducedTurbulenceViscosityModel.class);

SatoBubbleInducedViscosityMethod satoBubbleInducedViscosityMethod_0 = 
  particleInducedTurbulenceViscosityModel_0.getParticleInducedViscosity().getMethod(SatoBubbleInducedViscosityMethod.class);

satoBubbleInducedViscosityMethod_0.setAPlusConstant(26.0);

satoBubbleInducedViscosityMethod_0.setCalibrationConstant(1.2);
phaseInteraction_0.enable(ParticleInducedTurbulenceGroup.class);

phaseInteraction_0.enable(VirtualMassCoefficientModel.class);
	
phaseInteraction_0.enable(TurbulentDispersionForceModel.class);

phaseInteraction_0.enable(GosmanPITModel.class);
phaseInteraction_0.enable(ParticleInducedTurbulenceSourceModel.class);

ParticleInducedTurbulenceSourceModel particleInducedTurbulenceSourceModel_0 = 
  phaseInteraction_0.getModelManager().getModel(ParticleInducedTurbulenceSourceModel.class);
 
 particleInducedTurbulenceSourceModel_0.getPitSourceOption().setSelected(PitSourceOption.Type.GOSMAN);

电池建模:热失控的更改

由于在热失控建模中引入了 Q 表,相关宏代码已更改。

以前版本 Simcenter STAR-CCM+ 2402
ThermalRunawayHeatReleaseModelDescription thermalRunawayHeatReleaseModelDescription_0 = 
      ((ThermalRunawayHeatReleaseModelDescription) userDefinedBatteryCell_0.getModelDescription(ModelType.TRHEAT));

thermalRunawayHeatReleaseModelDescription_0.setTable(fileTable_0);
thermalRunawayHeatReleaseModelDescription_0.setTemperature("Temperature");
thermalRunawayHeatReleaseModelDescription_0.setHeatRate("Heatrate");
thermalRunawayHeatReleaseModelDescription_0.setExtrapolateTable(true);
thermalRunawayHeatReleaseModelDescription_0.getInterpolationTypeOption().setSelected(InterpolationTypeOption.Type.BEZIER);

thermalRunawayHeatReleaseModelDescription_0.plotHeatRateTable();
ThermalRunawayHeatReleaseModelDescription thermalRunawayHeatReleaseModelDescription_0 = 
      ((ThermalRunawayHeatReleaseModelDescription) userDefinedBatteryCell_0.getModelDescription(ModelType.TRHEAT));

HeatRateByTemperatureTableMethod heatRateByTemperatureTableMethod_0 = 
      ((HeatRateByTemperatureTableMethod) thermalRunawayHeatReleaseModelDescription_0.getHeatRateMethods().getActiveMethod());

heatRateByTemperatureTableMethod_0.setTable(fileTable_0);
heatRateByTemperatureTableMethod_0.setTemperature("Temperature");
heatRateByTemperatureTableMethod_0.setHeatRate("Heatrate");
heatRateByTemperatureTableMethod_0.setExtrapolateTable(true);
heatRateByTemperatureTableMethod_0.getInterpolationTypeOption().setSelected(InterpolationTypeOption.Type.BEZIER);

thermalRunawayHeatReleaseModelDescription_0.getHeatRateMethods().plotHeatRateTable();

后处理:计划从 Java Framework 中移除 ChartStyle 类 (2406)

ChartStyle 类当前计划在版本 2406 中从绘图框架中移除,以进一步更改为准。

以下类结构不再受支持,它们可能存在于导入 .plt 文件的较旧 Java 宏中:

  • star.common.graph.ChartStyle
  • star.common.graph.ChartStyleManager

该类的早期使用示例在 exampleXYPlot 上显示数据集,其 ChartStyle 正在更新:

DataSet dataSet = exampleXYPlot.getYAxes().getAxisType("Y Type 1").getDataSets().getDataSet("Temperature");
dataSet.getChartStyle().setSymbolShape(JCSymbolStyle.NONE);
dataSet.getChartStyle().setLinePattern(JCLineStyle.SOLID);
dataSet.getChartStyle().setLineColor(Color.red);
dataSet.getChartStyle().setLineWidth(4);

近年来,Style 已在其自己的子对象中进行管理,ChartStyle 已变得不必要。

对于版本 2402,需要进行两项更改:

  • 如果适用,直接更新 Style,而不是通过 ChartStyle 路由请求。
  • 如果无法直接更改,则完全移除调用。

特定 Style-to-Type 替换:

  • 将 JCSymbolStyle 替换为 SymbolShapeOption.Type。
  • 将 JCLineStyle 替换为 LinePatternOption.Type。
  • 将 JCFillStyle 替换为 FillPatternOption.Type。

更新代码的详细说明,含示例

应根据需要更新以下与线样式相关的调用:

  • ChartStyle.setLinePattern
  • ChartStyle.setLineColor
  • ChartStyle.setLineWidth

对线样式 API 调用的更新的示例:

// At the top of the macro
import star.common.LinePatternOption;
import star.common.LineStyle;
 
DataSet dataSet = exampleXYPlot.getYAxes().getAxisType("Y Type 1").getDataSets().getDataSet("Temperature");
 
// Step 1: Replace getChartStyle() calls with their direct 'set' calls.
// dataSet.getChartStyle().setLinePattern(JCLineStyle.SOLID);
dataSet.getLineStyle().setLinePatternOptionInput(LinePatternOption.Type.SOLID);          // (Step 2) replacement for JCLineStyle.SOLID
 
// dataSet.getChartStyle().setLineColor(Color.red);
dataSet.getLineStyle().setColor(Color.red);
 
// dataSet.getChartStyle().setLineWidth(4);
dataSet.getLineStyle().setLineWidth(4);

应根据需要更新以下与标记样式相关的调用:

  • ChartStyle.setSymbolShape
  • ChartStyle.setSymbolSize
  • ChartStyle.setSymbolStrokeWidth
  • ChartStyle.setSymbolColor

对标记样式 API 调用的更新的示例:

// At the top of the macro
import star.common.SymbolShapeOption;
import star.common.SymbolStyle;
 
DataSet dataSet = exampleXYPlot.getYAxes().getAxisType("Y Type 1").getDataSets().getDataSet("Temperature");
 
// Step 1: Replace getChartStyle() calls with their direct 'set' calls. Calls
// dataSet.getChartStyle().setSymbolShape(JCSymbolStyle.NONE);
dataSet.getSymbolStyle().setSymbolShapeOptionInput(SymbolShapeOption.Type.NONE);            // (Step 2) replacement for JCSymbolStyle.NONE
 
// dataSet.getChartStyle().setSymbolSize(10);
dataSet.getSymbolStyle().setSize(10);
 
// dataSet.getChartStyle().setSymbolStrokeWidth(0.2);
dataSet.getSymbolStyle().setStrokeWidth(0.2);
 
// dataSet.getChartStyle().setSymbolColor(Color.red);
dataSet.getSymbolStyle().setColor(Color.red);

应根据需要更新以下与填充风格相关的调用:

  • ChartStyle.setFillPattern
  • ChartStyle.setFillColor
  • ChartStyle.setFillBackground

对填充风格 API 调用的更新的示例:

// At the top of the macro
import star.common.FillPatternOption;
import star.common.FillStyle;
 
DataSet dataSet = exampleXYPlot.getYAxes().getAxisType("Y Type 1").getDataSets().getDataSet("Temperature");
 
// Step 1: Replace getChartStyle() calls with their direct 'set' calls.
// dataSet.getChartStyle().setFillPattern(JCFillStyle.SOLID);
dataSet.getFillStyle().setLinePatternOptionInput(FillPatternOption.Type.SOLID);             // (Step 2) replacement for JCFillStyle.SOLID
 
// dataSet.getChartStyle().setFillColor(Color.red);
dataSet.getFillStyle().setColor(Color.red);
 
// dataSet.getChartStyle().setFillBackground(Color.blue);
dataSet.getFillStyle().setBackgroundColor(Color.blue);

应完全移除以下 API 调用。他们的处理已中止/内部化。

  • ChartStyle.setLineCap
  • ChartStyle.setLineJoin

对线样式 API 调用的移除的示例:

DataSet dataSet = exampleXYPlot.getYAxes().getAxisType("Y Type 1").getDataSets().getDataSet("Temperature");
dataSet.getChartStyle().setLineCap(0);
dataSet.getChartStyle().setLineJoin(0);

旧标记、线样式和填充风格已替换为当前支持的类型

标记样式:import star.common.SymbolShapeOption;

以前版本 Simcenter STAR-CCM+ 2402
JCSymbolStyle.NONE
SymbolShapeOption.Type.NONE
JCSymbolStyle.DOT
SymbolShapeOption.Type.FILLED_CIRCLE
JCSymbolStyle.BOX
SymbolShapeOption.Type.FILLED_SQUARE
JCSymbolStyle.TRIANGLE
SymbolShapeOption.Type.FILLED_TRIANGLE
JCSymbolStyle.DIAMOND
SymbolShapeOption.Type.FILLED_DIAMOND
JCSymbolStyle.STAR
SymbolShapeOption.Type.STAR 
JCSymbolStyle.VERT_LINE
SymbolShapeOption.Type.VERTICAL_LINE
JCSymbolStyle.HORIZ_LINE
SymbolShapeOption.Type.HORIZONTAL_LINE
JCSymbolStyle.CROSS
SymbolShapeOption.Type.CROSS
JCSymbolStyle.CIRCLE
SymbolShapeOption.Type.EMPTY_CIRCLE
JCSymbolStyle.SQUARE
SymbolShapeOption.Type.EMPTY_SQUARE

线样式:import star.common.LinePatternOption;

以前版本 Simcenter STAR-CCM+ 2402
JCLineStyle.NONE
LinePatternOption.Type.NONE
JCLineStyle.SOLID
LinePatternOption.Type.SOLID
JCLineStyle.LONG_DASH
LinePatternOption.Type.DASH
JCLineStyle.SHORT_DASH
LinePatternOption.Type.DOT
JCLineStyle.LSL_DASH
LinePatternOption.Type.DASH_DOT
JCLineStyle.DASH_DOT
LinePatternOption.Type.DASH_DOT

填充风格:import star.common.FillPatternOption;

以前版本 Simcenter STAR-CCM+ 2402
JCFillStyle.NONE
FillPatternOption.Type.NONE
JCFillStyle.SOLID
FillPatternOption.Type.SOLID
JCFillStyle.PER_25
FillPatternOption.Type.DOT_25_PERCENT
JCFillStyle.PER_50
FillPatternOption.Type.DOT_50_PERCENT
JCFillStyle.PER_75
FillPatternOption.Type.DOT_75_PERCENT
JCFillStyle.HORIZ_STRIPE
FillPatternOption.Type.HORIZONTAL_STRIPE
JCFillStyle.VERT_STRIPE
FillPatternOption.Type.VERTICAL_STRIPE
JCFillStyle.STRIPE_45
FillPatternOption.Type.DEGREE_45_STRIPE
JCFillStyle.STRIPE_135
FillPatternOption.Type.DEGREE_135_STRIPE
JCFillStyle.DIAG_HATCHED
FillPatternOption.Type.DIAGONAL_HATCH
JCFillStyle.CROSS_HATCHED
FillPatternOption.Type.CROSS_HATCH
JCFillStyle.CUSTOM_FILL
FillPatternOption.Type.SOLID
JCFillStyle.CUSTOM_STACK
FillPatternOption.Type.SOLID

样式 API 移除和替换

线样式

移除以下内容:

  • LineStyle.setVisible(boolean)
  • LineStyle.getJoin()
  • LineStyle.setJoin(int)
  • LineStyle.getCap()
  • LineStyle.setCap(int)

如下替换代码:

以前版本 Simcenter STAR-CCM+ 2402
LineStyle.getStyle()
LinePatternOption.Type LineStyle.getLinePatternOption().getSelectedElement()
LineStyle.setStyle(int)
LineStyle.getLinePatternOption().setSelected(LinePatternOption.Type)

标记样式

Remove SymbolStyle.setVisible(boolean)。

如下替换代码:

以前版本 Simcenter STAR-CCM+ 2402
SymbolStyle.getStyle()
SymbolShapeOption.Type SymbolStyle.getSymbolShapeOption().getSelectedElement()
SymbolStyle.setStyle(int)
SymbolStyle.getSymbolShapeOption().setSelected(SymbolShapeOption.Type)

填充风格

Remove FillStyle.setVisible(boolean)。

以前版本 Simcenter STAR-CCM+ 2402
FillStyle.getPattern()
FillPatternOption.Type FillStyle.getFillPatternOption().getSelectedElement()
FillStyle.setPattern(int)
FillStyle.getFillPatternOption().setSelected(FillPatternOption.Type)

设计管理器:输出表和默认视图的更改

在设计管理器中,输出表已重构,现在运行研究时仪表板是默认视图。这些修改导致宏代码发生更改。

输出表有一个新类,并且 openTableView 类现已弃用。

以前版本 Simcenter STAR-CCM+ 2402
MdxAllDesignSet mdxAllDesignSet_0 = 
  ((MdxAllDesignSet) mdxDesignStudy_0.getDesignSets().getDesignSet("All"));

mdxAllDesignSet_0.openTableView();
MdxAllDesignSet mdxAllDesignSet_0 = 
  ((MdxAllDesignSet) mdxDesignStudy_0.getDesignSets().getDesignSet("All"));

MdxDesignSetTable mdxDesignSetTable_0 = 
  mdxAllDesignSet_0.getDesignSetTable();

mdxDesignSetTable_0.openInteractive();

2402 版本中引入了设计管理器仪表板。运行研究时,将显示仪表板而不是输出表。仪表板也可以手动打开。

您可能想要打开仪表板而不是输出表。以下代码将打开仪表板:

MdxDesignStudy mdxDesignStudy_0 = 
  mdxProject_0.getDesignStudyManager().getDesignStudy("Test");

LayoutView layoutView_0 = 
  mdxDesignStudy_0.openStudyDashboard();

下表显示在先前发行版和 2402 版本中运行设计研究过程中录制的宏代码。

以前版本 Simcenter STAR-CCM+ 2402
MdxProject mdxProject_0 = 
  getActiveMdxProject();

MdxDesignStudy mdxDesignStudy_0 = 
  mdxProject_0.getDesignStudyManager().getDesignStudy("Design Study");

MdxAllDesignSet mdxAllDesignSet_0 = 
  ((MdxAllDesignSet) mdxDesignStudy_0.getDesignSets().getDesignSet("All"));

mdxAllDesignSet_0.openTableView();

mdxAllDesignSet_0.openTableView();

mdxDesignStudy_0.runDesignStudy();

MdxDesign mdxDesign_0 = 
  mdxDesignStudy_0.getDesigns().getDesign("Design 1");

mdxDesignStudy_0.getDesigns().setCurrentDesign(mdxDesign_0);
MdxProject mdxProject_0 = 
  getActiveMdxProject();

MdxDesignStudy mdxDesignStudy_0 = 
  mdxProject_0.getDesignStudyManager().getDesignStudy("Test");

mdxDesignStudy_0.runDesignStudy();

LayoutView layoutView_0 = 
  mdxDesignStudy_0.openStudyDashboard();

layoutView_0.openInteractive();

MdxDesignSceneView mdxDesignSceneView_0 = 
  ((MdxDesignSceneView) mdxProject_0.get(MdxDesignViewManager.class).getDesignView("Test - Snapshot"));

mdxDesignSceneView_0.initializeAndWait();