宏 API 更改 8.06

Simcenter STAR-CCM+ 8.06 中,针对数据集函数、湍流耗散模型、零部件接触、平面运动、颗粒温度模型、固体应力模型和网格操作进行了宏 API 的更改。

表面时间历史数据集函数

TimeHistoryImportedModelDerivedData 类已重命名为 ProbeTimeHistoryImportedModelDerivedData

以前发行版本 Simcenter STAR-CCM+ v8.06

public void testhL(){

double[] verificationValue = {17762, 1156700};

TimeHistoryImportedModelDerivedData  h_l1 = (TimeHistoryImportedModelDerivedData)        getSimulation().get(DerivedDataManager.class).hasObject("h_l1");

DerivedDataView3D derivedDataView3D = h_l1.getDerivedDataView3D();

SingleSliderValue singleSliderValue = derivedDataView3D.getSliderVal();

singleSliderValue.setValue(0.5);

double[] range = createScalarScene(h_l1);

setMessage(FourierTransformsUtils.verifyFieldFunctionValue(range, verificationValue));

}

public void testhL(){

double[] verificationValue = {17762, 1156700};

ProbeTimeHistoryImportedModelDerivedData  h_l1 = (ProbeTimeHistoryImportedModelDerivedData) 

getSimulation().get(DerivedDataManager.class).hasObject("h_l1");

DerivedDataView3D derivedDataView3D = h_l1.getDerivedDataView3D();

SingleSliderValue singleSliderValue = derivedDataView3D.getSliderVal();

singleSliderValue.setValue(0.5);

double[] range = createScalarScene(h_l1);

setMessage(FourierTransformsUtils.verifyFieldFunctionValue(range, verificationValue));

}

湍流耗散模型更改

湍流普朗特数已从作为湍流耗散模型的属性改为具有其自己的管理器,现在支持将常数、场函数和特定模型作为备选方法。 因此,显式(而不是默认)设置此属性的任何旧宏将无法编译。

以前发行版本 Simcenter STAR-CCM+ v8.06

PhaseInteraction phaseInteraction_0 =

((PhaseInteraction) multiPhaseInteractionModel_0.getPhaseInteractionManager().getPhaseInteraction("Phase Interaction 1"));

TurbulentDispersionForceModel turbulentDispersionForceModel_0 =

phaseInteraction_0.getModelManager().getModel(TurbulentDispersionForceModel.class);

turbulentDispersionForceModel_0.setPrandtlNo_t(0.9);

PhaseInteraction phaseInteraction_0 =

((PhaseInteraction) multiPhaseInteractionModel_0.getPhaseInteractionManager().getPhaseInteraction("Phase Interaction 1"));

TurbulentDispersionForceModel turbulentDispersionForceModel_0 =

phaseInteraction_0.getModelManager().getModel(TurbulentDispersionForceModel.class);

ConstantInteractionCoefficientMethod constantInteractionCoefficientMethod_0 =

turbulentDispersionForceModel_0.getTurbulentPrandtlNumber().getMethod(ConstantInteractionCoefficientMethod.class);

constantInteractionCoefficientMethod_0.getQuantity().setValue(0.9);

零部件接触

在以前版本的 Simcenter STAR-CCM+ 中,未记录足够的接触信息来标识正确的接触。 例如,当涉及复合零部件时,两个接触可能具有相同的名称。 在 Simcenter STAR-CCM+ v8.06 中,零部件接触的宏 API 已更改以改善日志记录,现在可正确标识接触。 按以下说明更新这些宏:

以前发行版本 Simcenter STAR-CCM+ v8.06

Body body_0 = 

((Body) cadModel_0.getBodyManager().getObject("Body 1"));

Body body_1 = 

((Body) cadModel_0.getBodyManager().getObject("Body 2"));

cadModel_0.createParts(new NeoObjectVector(new Object[] {body_0, body_1}), "SharpEdges", 30.0, 2, true, 1.0E-5);

PartContact partContact_0 = 

((PartContact) simulation_0.get(PartContactManager.class).getObject("Part Contact"));

Body body_0 = 

((Body) cadModel_0.getBodyManager().getObject("Body 1"));

Body body_1 = 

((Body) cadModel_0.getBodyManager().getObject("Body 2"));

cadModel_0.createParts(new NeoObjectVector(new Object[] {body_0, body_1}), "SharpEdges", 30.0, 2, true, 1.0E-5);

SolidModelPart solidModelPart_0 = 

((SolidModelPart) simulation_0.get(SimulationPartManager.class).getPart("Body 1"));

SolidModelPart solidModelPart_1 = 

((SolidModelPart) simulation_0.get(SimulationPartManager.class).getPart("Body 2"));

PartContact partContact_0 = 

simulation_0.get(PartContactManager.class).getPartContact(solidModelPart_0,solidModelPart_1);

平面运动

为了清晰起见,已重命名 DFBI 中平面运动机构的某些属性。 Simcenter STAR-CCM+ v8.04 中录制的 Java 宏在 v8.06 中仍有效,但是将来可能放弃对这些宏的支持。

以前发行版本 Simcenter STAR-CCM+ v8.06

Simulation simulation_0 = 

getActiveSimulation();

Body body_0 = 

((Body) simulation_0.get(BodyManager.class).getObject("Boat"));

((PlanarMotionCarriage) body_0.getMotionType()).getPlanarMotionOption().setSelected(PlanarMotionOption.PLANAR_MOTION_MECHANISM);

((PlanarMotionMechanism) ((PlanarMotionCarriage) body_0.getMotionType()).getPlanarMotionType()).getForwardVelocity().setValue(1.0);

((PlanarMotionMechanism) ((PlanarMotionCarriage) body_0.getMotionType()).getPlanarMotionType()).getSwayAmplitude().setValue(2.0);

((PlanarMotionMechanism) ((PlanarMotionCarriage) body_0.getMotionType()).getPlanarMotionType()).getSwayFrequency().setValue(0.1);

Simulation simulation_0 = 

getActiveSimulation();

Body body_0 = 

((Body) simulation_0.get(BodyManager.class).getObject("Boat"));

((PlanarMotionCarriage) body_0.getMotionType()).getPlanarMotionOption().setSelected(PlanarMotionOption.PLANAR_MOTION_MECHANISM);

((PlanarMotionMechanism) ((PlanarMotionCarriage) body_0.getMotionType()).getPlanarMotionType()).getVelocityX().setValue(1.0);

((PlanarMotionMechanism) ((PlanarMotionCarriage) body_0.getMotionType()).getPlanarMotionType()).getAmplitudeY().setValue(2.0);

((PlanarMotionMechanism) ((PlanarMotionCarriage) body_0.getMotionType()).getPlanarMotionType()).getOscillationFrequency().setValue(0.1);

EMP 中的颗粒温度模型更改

Simcenter STAR-CCM+ v8.04 中,选择颗粒压力模型后会自动选择颗粒温度模型。 在 Simcenter STAR-CCM+ v8.06 中,GranularTemperatureModel 类被替换为 GranularTemperatureProviderGroup 类。 此组提供选项来选择 3 种颗粒温度模型的任意一种:代数 (AlgebraicGranularTemperatureModelProvider)、传输 (GranularTemperatureTransportModelProvider) 和用户自定义 (UserDefinedGranularTemperatureModelProvider)。

GranularPressureModel 类的运动流态已被移除。 还移除了 KineticTheoryProvider 类,即 Simcenter STAR-CCM+ v8.06 中已移除 GranularPressureModel 类的 getKineticTheory()getKineticRegimeOption() 方法。

以前发行版本 Simcenter STAR-CCM+ v8.06

Simulation simulation_0 = getActiveSimulation();

PhysicsContinuum physicsContinuum_0 = ((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1"));

physicsContinuum_0.enable(GranularTemperatureModel.class);

Simulation simulation_0 = getActiveSimulation();

PhysicsContinuum physicsContinuum_0 = ((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1"));

physicsContinuum_0.enable(GranularTemperatureProviderGroup.class);

physicsContinuum_0.enable(AlgebraicGranularTemperatureModelProvider.class);

Simulation simulation_0 = getActiveSimulation();

PhysicsContinuum physicsContinuum_0 = ((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1"));

physicsContinuum_0.enable(GranularTemperatureModel.class);

GranularPressureModel granularPressureModel_0 = physicsContinuum_0.getModelManager().getModel(GranularPressureModel.class);

granularPressureModel_0.getKineticRegimeOption().setSelected(KineticRegimeOption.NONE);

Simulation simulation_0 = getActiveSimulation();

PhysicsContinuum physicsContinuum_0 = ((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1"));

固体应力模型名称更改

Simcenter STAR-CCM+ v8.06 中,SolidStress 类已重命名为 FvSolidStressModel

以前发行版本 Simcenter STAR-CCM+ v8.06

private void execute0() {

    Simulation simulation_0 = 

      getActiveSimulation();

    PhysicsContinuum physicsContinuum_0 = 

      simulation_0.getContinuumManager().createContinuum(PhysicsContinuum.class);

    physicsContinuum_0.enable(ThreeDimensionalModel.class);

    physicsContinuum_0.enable(SteadyModel.class);

    physicsContinuum_0.enable(SolidModel.class);

    physicsContinuum_0.enable(SolidStressModel.class);

    physicsContinuum_0.enable(LinearIsotropicElasticModel.class);

    physicsContinuum_0.enable(ConstantDensityModel.class);

    physicsContinuum_0.enable(SegregatedSolidEnergyModel.class);

    physicsContinuum_0.enable(CellQualityRemediationModel.class);

  }

private void execute0() {

    Simulation simulation_0 = 

      getActiveSimulation();

    PhysicsContinuum physicsContinuum_0 = 

      simulation_0.getContinuumManager().createContinuum(PhysicsContinuum.class);

    physicsContinuum_0.enable(ThreeDimensionalModel.class);

    physicsContinuum_0.enable(SteadyModel.class);

    physicsContinuum_0.enable(SolidModel.class);

    physicsContinuum_0.enable(FvSolidStressModel.class);

    physicsContinuum_0.enable(LinearIsotropicElasticModel.class);

    physicsContinuum_0.enable(ConstantDensityModel.class);

    physicsContinuum_0.enable(SegregatedSolidEnergyModel.class);

    physicsContinuum_0.enable(CellQualityRemediationModel.class);

  }

从网格操作中移除输出零部件选项属性的简单列表以及简单列表和合并选项

Simcenter STAR-CCM+ v8.06 中,简单列表以及 Flat List & Merge by Name(简单列表和按名称合并) 选项已从输出零部件选项属性中移除。 此属性以前位于抽取体积合并相交布尔减网格操作对话框中。 对这些选项的任何引用都必须从旧宏中移除。

以前发行版本 Simcenter STAR-CCM+ v8.06

ExtractVolumeOperation extractVolumeOperation_2 = 

      (ExtractVolumeOperation) simulation_0.get(MeshOperationManager.class).createExtractVolumeOperation();

    Units units_0 = 

      simulation_0.getUnitsManager().getPreferredUnits(new IntVector(new int[] {0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}));

    SolidModelPart solidModelPart_0 = 

      ((SolidModelPart) simulation_0.get(SimulationPartManager.class).getPart("Body 1"));

    SolidModelPart solidModelPart_1 = 

      ((SolidModelPart) simulation_0.get(SimulationPartManager.class).getPart("Body 2"));

    SolidModelPart solidModelPart_2 = 

      ((SolidModelPart) simulation_0.get(SimulationPartManager.class).getPart("Body 3"));

    extractVolumeOperation_1.getInputGeometryObjects().setObjects(solidModelPart_0, solidModelPart_1, solidModelPart_2);

    extractVolumeOperation_1.getVolumeModeOption().setSelected(ExtractVolumeOption.AUTOMATIC);

    extractVolumeOperation_1.execute();

    extractVolumeOperation_1.getDisplayMode().setSelected(MeshOperationDisplayModeOption.FLAT_UNMERGED);

ExtractVolumeOperation extractVolumeOperation_1 = 

      (ExtractVolumeOperation) simulation_0.get(MeshOperationManager.class).createExtractVolumeOperation();

    Units units_0 = 

      simulation_0.getUnitsManager().getPreferredUnits(new IntVector(new int[] {0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}));

    SolidModelPart solidModelPart_0 = 

      ((SolidModelPart) simulation_0.get(SimulationPartManager.class).getPart("Body 1"));

    SolidModelPart solidModelPart_1 = 

      ((SolidModelPart) simulation_0.get(SimulationPartManager.class).getPart("Body 2"));

    SolidModelPart solidModelPart_2 = 

      ((SolidModelPart) simulation_0.get(SimulationPartManager.class).getPart("Body 3"));

    extractVolumeOperation_1.getInputGeometryObjects().setObjects(solidModelPart_0, solidModelPart_1, solidModelPart_2);

    extractVolumeOperation_1.getVolumeModeOption().setSelected(ExtractVolumeOption.AUTOMATIC);

    extractVolumeOperation_1.execute();