宏 API 更改 10.06

Simcenter STAR-CCM+ 10.06 中,针对单位、壳厚度、简单形状零部件、燃烧、材料属性、湍流和热传递进行了宏 API 的更改。

单位:替换特殊字符

Angstroms 的特殊字符 ÅAng 替换(在 Simcenter STAR-CCM+ 界面内),因此对宏代码做出了更改。

以前发行版本 Simcenter STAR-CCM+ v10.06
Simulation simulation_0 = getActiveSimulation();
MaxReport maxReport_0 = ((MaxReport) simulation_0.getReportManager().getReport("Maximum 1"));
Units units_0 = ((Units) simulation_0.getUnitsManager().getObject("\u212B"));
maxReport_0.setUnits(units_0);
Simulation simulation_0 = getActiveSimulation();
MaxReport maxReport_0 = ((MaxReport) simulation_0.getReportManager().getReport("Maximum 1"));
Units units_0 = ((Units) simulation_0.getUnitsManager().getObject("Ang"));
maxReport_0.setUnits(units_0);

壳厚度更改

Simcenter STAR-CCM+ 处理壳厚度的方法已更改。 对现有的宏做出相应修改。

以前发行版本 Simcenter STAR-CCM+ v10.06
PrimitiveFieldFunction primitiveFieldFunction_0 =
((PrimitiveFieldFunction) simulation_0.getFieldFunctionManager().getFunction("ShellThickness"));
PrimitiveFieldFunction primitiveFieldFunction_0 =
((PrimitiveFieldFunction) simulation_0.getFieldFunctionManager().getFunction("SolidShellThickness"));

简单形状零部件更改

简单形状零部件的宏代码已更改。

以下是针对方块零部件、圆锥体、圆柱体和球体的宏步骤示例。

方块零部件
以前发行版本 Simcenter STAR-CCM+ v10.06
SimpleBlockPart simpleBlockPart_0 = 
  meshPartFactory_0.createNewBlockPart(simulation_0.get(SimulationPartManager.class));
simpleBlockPart_0.setDoNotRetessellate(true);
LabCoordinateSystem labCoordinateSystem_0 = 
  simulation_0.getCoordinateSystemManager().getLabCoordinateSystem();
simpleBlockPart_0.setCoordinateSystem(labCoordinateSystem_0);
Coordinate coordinate_0 = 
  simpleBlockPart_0.getCorner1();
coordinate_0.setCoordinateSystem(labCoordinateSystem_0);
coordinate_0.setCoordinate(units_0, units_0, units_0, new DoubleVector(new double[] {-1.0, -1.0, -1.0}));
coordinate_0.setValue(new DoubleVector(new double[] {0.0, 0.0, 4.0}));
Coordinate coordinate_1 = 
  simpleBlockPart_0.getCorner2();
coordinate_1.setCoordinateSystem(labCoordinateSystem_0);
coordinate_1.setCoordinate(units_0, units_0, units_0, new DoubleVector(new double[] {1.0, 1.0, 1.0}));
coordinate_1.setValue(new DoubleVector(new double[] {1.0, 1.0, 5.0}));
simpleBlockPart_0.rebuildSimpleShapePart();
simpleBlockPart_0.setDoNotRetessellate(false);
SimpleBlockPart simpleBlockPart_0 = 
  meshPartFactory_0.createNewBlockPart(simulation_0.get(SimulationPartManager.class));
simpleBlockPart_0.setDoNotRetessellate(true);
LabCoordinateSystem labCoordinateSystem_0 = 
  simulation_0.getCoordinateSystemManager().getLabCoordinateSystem();
simpleBlockPart_0.setCoordinateSystem(labCoordinateSystem_0);
Coordinate coordinate_0 = 
  simpleBlockPart_0.getCorner1();
coordinate_0.setCoordinateSystem(labCoordinateSystem_0);
coordinate_0.setCoordinate(units_0, units_0, units_0, new DoubleVector(new double[] {0.0, 0.0, 4.0}));
Coordinate coordinate_1 = 
  simpleBlockPart_0.getCorner2();
coordinate_1.setCoordinateSystem(labCoordinateSystem_0);
coordinate_1.setCoordinate(units_0, units_0, units_0, new DoubleVector(new double[] {1.0, 1.0, 5.0}));
simpleBlockPart_0.rebuildSimpleShapePart();
simpleBlockPart_0.setDoNotRetessellate(false);
圆锥体
以前发行版本 Simcenter STAR-CCM+ v10.06
SimpleConePart simpleConePart_0 = 
  meshPartFactory_0.createNewConePart(simulation_0.get(SimulationPartManager.class));
simpleConePart_0.setDoNotRetessellate(true);
simpleConePart_0.setCoordinateSystem(labCoordinateSystem_0);
Coordinate coordinate_2 = 
  simpleConePart_0.getStartCoordinate();
coordinate_2.setCoordinateSystem(labCoordinateSystem_0);
coordinate_2.setCoordinate(units_0, units_0, units_0, new DoubleVector(new double[] {0.0, 0.0, 1.0}));
coordinate_2.setValue(new DoubleVector(new double[] {0.0, 0.0, 3.0}));
simpleConePart_0.getStartRadius().setUnits(units_0);
simpleConePart_0.getStartRadius().setValue(1.0);
Coordinate coordinate_3 = 
  simpleConePart_0.getEndCoordinate();
coordinate_3.setCoordinateSystem(labCoordinateSystem_0);
coordinate_3.setCoordinate(units_0, units_0, units_0, new DoubleVector(new double[] {0.0, 0.0, 0.0}));
coordinate_3.setValue(new DoubleVector(new double[] {0.0, 0.0, 4.0}));
simpleConePart_0.getEndRadius().setUnits(units_0);
simpleConePart_0.getEndRadius().setValue(1.0);
simpleConePart_0.getTessellationDensityOption().setSelected(TessellationDensityOption.MEDIUM);
simpleConePart_0.rebuildSimpleShapePart();
simpleConePart_0.setDoNotRetessellate(false);
SimpleConePart simpleConePart_0 = 
  meshPartFactory_0.createNewConePart(simulation_0.get(SimulationPartManager.class));
simpleConePart_0.setDoNotRetessellate(true);
simpleConePart_0.setCoordinateSystem(labCoordinateSystem_0);
Coordinate coordinate_0 = 
  simpleConePart_0.getStartCoordinate();
coordinate_0.setCoordinateSystem(labCoordinateSystem_0);
coordinate_0.setCoordinate(units_0, units_0, units_0, new DoubleVector(new double[] {0.0, 0.0, 3.0}));
simpleConePart_0.getStartRadius().setUnits(units_0);
simpleConePart_0.getStartRadius().setValue(1.0);
Coordinate coordinate_1 = 
  simpleConePart_0.getEndCoordinate();
coordinate_1.setCoordinateSystem(labCoordinateSystem_0);
coordinate_1.setCoordinate(units_0, units_0, units_0, new DoubleVector(new double[] {0.0, 0.0, 4.0}));
simpleConePart_0.getEndRadius().setUnits(units_0);
simpleConePart_0.getEndRadius().setValue(1.0);
simpleConePart_0.getTessellationDensityOption().setSelected(TessellationDensityOption.Type.MEDIUM);
simpleConePart_0.rebuildSimpleShapePart();
simpleConePart_0.setDoNotRetessellate(false);
圆柱体
以前发行版本 Simcenter STAR-CCM+ v10.06
SimpleCylinderPart simpleCylinderPart_0 = 
  meshPartFactory_0.createNewCylinderPart(simulation_0.get(SimulationPartManager.class));
simpleCylinderPart_0.setDoNotRetessellate(true);
simpleCylinderPart_0.setCoordinateSystem(labCoordinateSystem_0);
Coordinate coordinate_4 = 
  simpleCylinderPart_0.getStartCoordinate();
coordinate_4.setCoordinateSystem(labCoordinateSystem_0);
coordinate_4.setCoordinate(units_0, units_0, units_0, new DoubleVector(new double[] {0.0, 0.0, 1.0}));
coordinate_4.setValue(new DoubleVector(new double[] {0.0, 0.0, 6.0}));
Coordinate coordinate_5 = 
  simpleCylinderPart_0.getEndCoordinate();
coordinate_5.setCoordinateSystem(labCoordinateSystem_0);
coordinate_5.setCoordinate(units_0, units_0, units_0, new DoubleVector(new double[] {0.0, 0.0, 0.0}));
coordinate_5.setValue(new DoubleVector(new double[] {0.0, 0.0, 7.0}));
simpleCylinderPart_0.getRadius().setUnits(units_0);
simpleCylinderPart_0.getRadius().setValue(1.0);
simpleCylinderPart_0.getTessellationDensityOption().setSelected(TessellationDensityOption.MEDIUM);
simpleCylinderPart_0.rebuildSimpleShapePart();
simpleCylinderPart_0.setDoNotRetessellate(false);
SimpleCylinderPart simpleCylinderPart_0 = 
  meshPartFactory_0.createNewCylinderPart(simulation_0.get(SimulationPartManager.class));
simpleCylinderPart_0.setDoNotRetessellate(true);
simpleCylinderPart_0.setCoordinateSystem(labCoordinateSystem_0);
Coordinate coordinate_2 = 
  simpleCylinderPart_0.getStartCoordinate();
coordinate_2.setCoordinateSystem(labCoordinateSystem_0);
coordinate_2.setCoordinate(units_0, units_0, units_0, new DoubleVector(new double[] {0.0, 0.0, 6.0}));
Coordinate coordinate_3 = 
  simpleCylinderPart_0.getEndCoordinate();
coordinate_3.setCoordinateSystem(labCoordinateSystem_0);
coordinate_3.setCoordinate(units_0, units_0, units_0, new DoubleVector(new double[] {0.0, 0.0, 7.0}));
simpleCylinderPart_0.getRadius().setUnits(units_0);
simpleCylinderPart_0.getRadius().setValue(1.0);
simpleCylinderPart_0.getTessellationDensityOption().setSelected(TessellationDensityOption.Type.MEDIUM);
simpleCylinderPart_0.rebuildSimpleShapePart();
simpleCylinderPart_0.setDoNotRetessellate(false);
球体
以前发行版本 Simcenter STAR-CCM+ v10.06
SimpleSpherePart simpleSpherePart_0 = 
  meshPartFactory_0.createNewSpherePart(simulation_0.get(SimulationPartManager.class));
simpleSpherePart_0.setDoNotRetessellate(true);
LabCoordinateSystem labCoordinateSystem_0 = 
  simulation_0.getCoordinateSystemManager().getLabCoordinateSystem();
simpleSpherePart_0.setCoordinateSystem(labCoordinateSystem_0);
Coordinate coordinate_0 = 
  simpleSpherePart_0.getOrigin();
coordinate_0.setCoordinateSystem(labCoordinateSystem_0);
coordinate_0.setCoordinate(units_0, units_0, units_0, new DoubleVector(new double[] {0.0, 0.0, 0.0}));
coordinate_0.setValue(new DoubleVector(new double[] {0.0, 0.0, 9.0}));
simpleSpherePart_0.getRadius().setUnits(units_0);
simpleSpherePart_0.getRadius().setValue(1.0);
simpleSpherePart_0.getTessellationDensityOption().setSelected(TessellationDensityOption.MEDIUM);
simpleSpherePart_0.rebuildSimpleShapePart();
simpleSpherePart_0.setDoNotRetessellate(false);
SimpleSpherePart simpleSpherePart_0 = 
  meshPartFactory_0.createNewSpherePart(simulation_0.get(SimulationPartManager.class));
simpleSpherePart_0.setDoNotRetessellate(true);
LabCoordinateSystem labCoordinateSystem_0 = 
  simulation_0.getCoordinateSystemManager().getLabCoordinateSystem();
simpleSpherePart_0.setCoordinateSystem(labCoordinateSystem_0);
Coordinate coordinate_0 = 
  simpleSpherePart_0.getOrigin();
coordinate_0.setCoordinateSystem(labCoordinateSystem_0);
coordinate_0.setCoordinate(units_0, units_0, units_0, new DoubleVector(new double[] {0.0, 0.0, 9.0}));
simpleSpherePart_0.getRadius().setUnits(units_0);
simpleSpherePart_0.getRadius().setValue(1.0);
simpleSpherePart_0.getTessellationDensityOption().setSelected(TessellationDensityOption.Type.MEDIUM);
simpleSpherePart_0.rebuildSimpleShapePart();
simpleSpherePart_0.setDoNotRetessellate(false);

燃烧:PPDF 和氮氧化物模型更改

已经对 PPDF 和快速型氮氧化物模型做出下述更改,由此导致宏代码变化:

  • 移除 PPDF 更新选项
  • 更改灰气体加权求和 (WSGG) 法的使用
  • 以下选项的 PPDF_TABLE 替换为组分列表:OxygenAtomModelOption、OHGroupModelOption 和 AcetyleneModelOption
  • 移除多余的快速型氮氧化物组分模型选项

以下是针对这些更改的宏步骤示例。

PPDF 更新
以前发行版本 Simcenter STAR-CCM+ v10.06
PpdfNonAdiabaticFlameletPartiallyPremixedModel ppdfFlameletPartiallyPremixedModel_0 =
continuum.getModelManager().getModel(PpdfNonAdiabaticFlameletPartiallyPremixedModel.class);
PpdfSpeciesUpdate ppdfSpeciesUpdate_0 =
ppdfFlameletPartiallyPremixedModel_0.getPpdfSpeciesUpdate();
PpdfSpeciesUpdateFrequency ppdfSpeciesUpdateFrequency_0 =
ppdfSpeciesUpdate_0.getPpdfSpeciesUpdateFrequency();
ppdfSpeciesUpdateFrequency_0.setThreshold(100);
PpdfFlameletTable ppdfFlameletTable_0 =
((PpdfFlameletTable) ppdfFlameletPartiallyPremixedModel_0.getPpdfFlameletTable());
ppdfFlameletTable_0.importTable(resolveDataPath("case/PpdfFlameletDropComb.tbl"));
PpdfNonAdiabaticFlameletPartiallyPremixedModel ppdfFlameletPartiallyPremixedModel_0 =
continuum.getModelManager().getModel(PpdfNonAdiabaticFlameletPartiallyPremixedModel.class);
PpdfFlameletTable ppdfFlameletTable_0 =
((PpdfFlameletTable) ppdfFlameletPartiallyPremixedModel_0.getPpdfFlameletTable());
ppdfFlameletTable_0.importTable(resolveDataPath("case/PpdfFlameletDropComb.tbl"));
WSGG
以前发行版本 Simcenter STAR-CCM+ v10.06
gasMixture_0.getMaterialProperties().getMaterialProperty(AbsorptionCoefficientProperty.class).setMethod(PpdfWsggMethod.class);
gasMixture_0.getMaterialProperties().getMaterialProperty(AbsorptionCoefficientProperty.class).setMethod(WsggMethod.class);
组分列表
以前发行版本 Simcenter STAR-CCM+ v10.06
noxGeneralZeldovichModel_0.getOHGroupModelOption().setSelected(OHGroupModelOption.PPDF_TABLE);
noxGeneralZeldovichModel_0.getOxygenAtomModelOption().setSelected(OxygenAtomModelOption.PPDF_TABLE);
noxGeneralZeldovichModel_0.getOHGroupModelOption().setSelected(OHGroupModelOption.SPECIES_LIST);
noxGeneralZeldovichModel_0.getOxygenAtomModelOption().setSelected(OxygenAtomModelOption.SPECIES_LIST);
speciesConcentrationForSoot_0.getAcetyleneModelOption().setSelected(AcetyleneModelOption.PPDF_TABLE);
speciesConcentrationForSoot_0.getOxygenAtomModelOption().setSelected(OxygenAtomModelOption.SPECIES_LIST);
组分模型
以前发行版本 Simcenter STAR-CCM+ v10.06
PhysicsContinuum physicsContinuum_0 =
((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1"));
PromptNoxModel promptNoxModel_0 =
physicsContinuum_0.getModelManager().getModel(PromptNoxModel.class);
promptNoxModel_0.getPromptNoxSpeciesModelOption().setSelected(PromptNoxSpeciesModelOption.PPDF_TABLE);
promptNoxModel_0.setCorrectionFactor(2.43);
PhysicsContinuum physicsContinuum_0 =
((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1"));
PromptNoxModel promptNoxModel_0 =
physicsContinuum_0.getModelManager().getModel(PromptNoxModel.class);
promptNoxModel_0.setCorrectionFactor(2.43);

燃烧:比热法注册更改

更改宏代码,将比热材料属性的方法设为 PPDF 小火焰表

在构建或导入 PPDF 表前无法选择此方法。
以前发行版本 Simcenter STAR-CCM+ v10.06
PpdfAdiabaticFlameletPartiallyPremixedModel PpdfAdiabaticFlameletPartiallyPremixedModel_0 =
physicsContinuum_0.getModelManager().getModel(PpdfAdiabaticFlameletPartiallyPremixedModel.class);
PpdfFlameletTable ppdfFlameletTable_0 =
((PpdfFlameletTable) PpdfAdiabaticFlameletPartiallyPremixedModel_0.getPpdfFlameletTable());
MultiComponentGasModel multiComponentGasModel_0 =
((MultiComponentGasModel) physicsContinuum_0.getModelManager().getModel(MultiComponentGasModel.class));
((SpecificHeatProperty) gasComponent_0.getMaterialProperties().getMaterialProperty(SpecificHeatProperty.class)).setMethod
(PpdfFlameletSpecificHeatMethod.class);
ppdfFlameletTable_0.importTable(resolveDataPath("case/CH4_Flamelet_29_16.tbl"));
PpdfAdiabaticFlameletPartiallyPremixedModel PpdfAdiabaticFlameletPartiallyPremixedModel_0 =
physicsContinuum_0.getModelManager().getModel(PpdfAdiabaticFlameletPartiallyPremixedModel.class);
PpdfFlameletTable ppdfFlameletTable_0 =
((PpdfFlameletTable) PpdfAdiabaticFlameletPartiallyPremixedModel_0.getPpdfFlameletTable());
ppdfFlameletTable_0.importTable(resolveDataPath("case/CH4_Flamelet_29_16.tbl"));
MultiComponentGasModel multiComponentGasModel_0 =
((MultiComponentGasModel) physicsContinuum_0.getModelManager().getModel(MultiComponentGasModel.class));
((SpecificHeatProperty) gasComponent_0.getMaterialProperties().getMaterialProperty(SpecificHeatProperty.class)).setMethod
(PpdfFlameletSpecificHeatMethod.class);

材料属性:兰纳-琼斯材料属性更改

兰纳-琼斯势材料属性已经分为兰纳-琼斯能兰纳-琼斯特征长度材料属性,因此对宏代码做出了更改。

以前发行版本 Simcenter STAR-CCM+ v10.06
ConstantLennardJonesPotentialMethod constantLennardJonesPotentialMethod_0 =
   ((ConstantLennardJonesPotentialMethod) gas_0.getMaterialProperties().getMaterialProperty(LennardJonesPotentialProperty.class).getMethod());
 constantLennardJonesPotentialMethod_0.getSigmaQuantity().setValue(5.0);
 constantLennardJonesPotentialMethod_0.getEpsilonQuantity().setValue(100.0);
 ConstantMaterialPropertyMethod constantMaterialPropertyMethod_0 =
   ((ConstantMaterialPropertyMethod) gas_0.getMaterialProperties().getMaterialProperty(LennardJonesCharacteristicLengthProperty.class).getMethod());
 constantMaterialPropertyMethod_0.getQuantity().setValue(5.0);
 ConstantMaterialPropertyMethod constantMaterialPropertyMethod_1 =
   ((ConstantMaterialPropertyMethod) gas_0.getMaterialProperties().getMaterialProperty(LennardJonesCharacteristicEnergyProperty.class).getMethod());
 constantMaterialPropertyMethod_1.getQuantity().setValue(100.0);

湍流响应模型:相间相互作用更改

湍流响应模型在属性中选择参考相间相互作用,而不是参考连续相。

下述示例使用陈氏湍流响应模型。 但是,类似的宏更改也适用于伊萨和用户自定义的湍流响应模型。

以前发行版本 Simcenter STAR-CCM+ v10.06
tchenTurbulenceResponseModel_1.setReferencePhase(eulerianPhase_0);
MultiPhaseInteractionModel multiPhaseInteractionModel_0 = physicsContinuum_0.getModelManager().getModel(MultiPhaseInteractionModel.class);
PhaseInteraction phaseInteraction_0 = ((PhaseInteraction) multiPhaseInteractionModel_0.getPhaseInteractionManager().getPhaseInteraction("solid-water"));
tchenTurbulenceResponseModel_1.setReferencePhaseInteraction(phaseInteraction_0);

材料属性:分子量材料属性方法更改

分子量材料属性的只读常数值方法已重命名,因此对宏代码做出了更改。

以前发行版本 Simcenter STAR-CCM+ v10.06
GasComponent gasComponent_0 = 
  ((GasComponent) gasMixture_0.getComponents().getComponent("CH4"));
gasComponent_0.getMaterialProperties().getMaterialProperty(MolecularWeightProperty.class).setMethod(ElementalCompositionMolecularWeightMethod.class);
gasComponent_0.getMaterialProperties().getMaterialProperty(MolecularWeightProperty.class).setMethod(ReadOnlyConstantMolecularWeightMethod.class);
GasComponent gasComponent_0 = 
  ((GasComponent) gasMixture_0.getComponents().getComponent("CH4"));
gasComponent_0.getMaterialProperties().getMaterialProperty(MolecularWeightProperty.class).setMethod(ElementalCompositionMolecularWeightMethod.class);
gasComponent_0.getMaterialProperties().getMaterialProperty(MolecularWeightProperty.class).setMethod(ReadOnlyConstantMaterialPropertyMethod.class);

热传递:热传递系数场函数更改

热传递系数场函数已更改,以更可靠地处理谐波平衡和协同仿真。 此更改会影响宏代码。

以前发行版本 Simcenter STAR-CCM+ v10.06
HeatTransferCoefficientFunction heatTransferCoefficientFunction_0 = 
  ((HeatTransferCoefficientFunction) simulation_0.getFieldFunctionManager().getFunction("HeatTransferCoefficient"));
HeatTransferCoefficientUserYPlusFunction heatTransferCoefficientUserYPlusFunction_0 =  ((HeatTransferCoefficientUserYPlusFunction) sim.getFieldFunctionManager().getFunction("HeatTransferCoefficientUserYPlus"));
HtcFunction htcFunction_0 = 
  ((HtcFunction) simulation_0.getFieldFunctionManager().getFunction("HeatTransferCoefficient"));
HtcUserYPlusFunction htcUserYPlusFunction_0 = 
  ((HtcUserYPlusFunction) simulation_0.getFieldFunctionManager().getFunction("HeatTransferCoefficientUserYPlus"));