宏 API 更改 2019.3

Simcenter STAR-CCM+ 2019.3 中,宏 API 针对网格化、有限元模型、重叠、多孔介质、伴随、DEM、欧拉多相流、VOF 和 N-相混合物、电磁学、电化学和等离子体、设计管理器、协同仿真和 STAR-ICE(现为 Simcenter STAR-CCM+ In-cylinder)进行了更改。

网格化:对解算方案插值的模型选择的更改

与解算方案插值相关的模型已重构,以简化工作流程和用户选择。此项重构已导致宏代码更改。

已移除以下类:

  • ProximityInterpolationModel.class
  • ConservativeInterpolationModel.class

要激活或停用解算方案插值,改用 SolutionInterpolationModel.class

以前版本 Simcenter STAR-CCM+ 2019.3
physicsContinuum_0.enable(ProximityInterpolationModel.class);
physicsContinuum_0.enable(SolutionInterpolationModel.class);
physicsContinuum_0.enable(ConservativeInterpolationModel.class);
physicsContinuum_0.enable(SolutionInterpolationModel.class); SolutionInterpolationModel solutionInterpolationModel_0 =
physicsContinuum_0.getModelManager().getModel(SolutionInterpolationModel.class);
solutionInterpolationModel_0.getConservationOption().setSelected(ConservationOption.Type.ENABLE);

以前在 ProximityInterpolationModelConservativeInterpolationModel 上可用的方法 getSolutionInterpolationMethodsetPerPartMapping,现在应在 SolutionInterpolationModel 上调用:

以前版本 Simcenter STAR-CCM+ 2019.3
ProximityInterpolationModel proximityInterpolationModel_0 =
physicsContinuum_0.getModelManager().getModel(ProximityInterpolationModel.class);
 proximityInterpolationModel_0.getSolutionInterpolationMethod().setSelected(SolutionInterpolationMethod.Type.MAPPER);
proximityInterpolationModel_0.setPerPartMapping(true);
SolutionInterpolationModel solutionInterpolationModel_0 =
physicsContinuum_0.getModelManager().getModel(SolutionInterpolationModel.class);
 solutionInterpolationModel_0.getSolutionInterpolationMethod().setSelected(SolutionInterpolationMethod.Type.MAPPER);
solutionInterpolationModel_0.setPerPartMapping(true);
ConservativeInterpolationModel conservativeInterpolationModel_0 =
physicsContinuum_0.getModelManager().getModel(ConservativeInterpolationModel.class);
conservativeInterpolationModel_0.setPerPartMapping(true);
SolutionInterpolationModel solutionInterpolationModel_0 =
physicsContinuum_0.getModelManager().getModel(SolutionInterpolationModel.class);
solutionInterpolationModel_0.setPerPartMapping(true);

以前在 ConservativeInterpolationModel 上可用的方法 setPerPartConservation 已移至 ConservativeMappingModel,它是 SolutionInterpolationModel 的子级:

以前版本 Simcenter STAR-CCM+ 2019.3
SolutionInterpolationModel solutionInterpolationModel_0 =
physicsContinuum_0.getModelManager().getModel(SolutionInterpolationModel.class);
ConservativeMappingModel conservativeMappingModel_0 =
solutionInterpolationModel_0.getConservativeMappingModel();
conservativeMappingModel_0.setPerPartConservation(true);
ConservativeInterpolationModel conservativeInterpolationModel_0 = 
physicsContinuum_1.getModelManager().getModel(ConservativeInterpolationModel.class);
conservativeInterpolationModel_0.setPerPartConservation(true);

有限元模型:对场函数的更改

为了保持一致性,在有限元固体应力和固体能量建模中,以下场函数已将其内部名称(不是其标题)更改为如下表所列。更新宏中这些场函数的所有实例。

UI 标题 以前版本中的内部名称 Simcenter STAR-CCM+ 2019.3 中的内部名称
刚体速度 FeRigidBodyVelocityVar RigidBodyVelocity
刚体加速度 FeRigidBodyAccelerationVar RigidBodyAcceleration
温度时间导数 FeSolidEnergyTemperatureTimeDerivative TemperatureTimeDerivative

重叠网格:重叠守恒选项已升级为连续体模型

分离流模型节点的守恒选项子节点已被移除,其功能现在位于新的重叠守恒模型节点中,因此导致宏代码的更改。

以前版本 Simcenter STAR-CCM+ 2019.3
import star.segregatedflow.ChimeraGridConservationOption;
...
SegregatedFlowModel segregatedFlowModel_1 = physicsContinuum_0.getModelManager().getModel(SegregatedFlowModel.class);
segregatedFlowModel_1.getChimeraGridConservationOption().setSelected(ChimeraGridConservationOption.Type.FLUX_CORRECTION);
import star.overset.OversetConservationModel;
import star.overset.OversetConservationOption;
...
PhysicsContinuum physicsContinuum_0 = ((PhysicsContinuum) sim.getContinuumManager().getContinuum("Physics 1"));
OversetConservationModel oversetConservationModel_0 = physicsContinuum_0.getModelManager().getModel(OversetConservationModel.class);
oversetConservationModel_0.getOversetConservationOption().setSelected(OversetConservationOption.Type.FLUX_CORRECTION);

多孔介质

对多孔区域分布的更改

在多孔区域和多孔介质中,与各向异性电阻指定相关的分布已得到改进,简化了工作流程,并重命名以与其他模型一致。

以前版本 Simcenter STAR-CCM+ 2019.3
porousInertialResistance_0.setMethod(PrincipalTensorProfileMethod.class);
porousInertialResistance_0.setMethod(OrthotropicTensorProfileMethod.class);
porousInertialResistance_0.setMethod(CompositeTensorProfileMethod.class);
porousInertialResistance_0.setMethod(AnisotropicTensorProfileMethod.class);
porousInertialResistance_0.setMethod(AxisymmetricTensorProfileMethod.class);
porousInertialResistance_0.setMethod(IsotropicTensorProfileMethod.class);
porousInertialResistance_0.setMethod(CompositeSymmetricTensorProfileMethod.class);
(Discontinued)

在分布级别不再指定分布的空间方向。新的分布具有独立的方位属性,后者可在其他分布中重新使用。

以前版本 Simcenter STAR-CCM+ 2019.3
VectorProfile vectorProfile_0 =
  porousInertialResistance_0.getMethod(PrincipalTensorProfileMethod.class).getXAxis();
vectorProfile_0.getMethod(ConstantVectorProfileMethod.class).getQuantity().setComponents(1.0, -1.0, 0.0);
PorousViscousResistance porousViscousResistance_0 =
  region_0.getValues().get(PorousViscousResistance.class);
VectorProfile vectorProfile_1 =
  porousViscousResistance_0.getMethod(PrincipalTensorProfileMethod.class).getXAxis();
vectorProfile_1.getMethod(ConstantVectorProfileMethod.class).getQuantity().setComponents(1.0, -1.0, 0.0);
LocalOrientation localOrientation_0 =
  region_0.getValues().get(LocalOrientationManager.class).CreateLocalOrientation();
porousInertialResistance_0.getMethod(OrthotropicTensorProfileMethod.class).setLocalOrientation(localOrientation_0);
OrientationAxisProfile orientationAxisProfile_0 =
  localOrientation_0.getOrientationAxis1();
orientationAxisProfile_0.getMethod(ConstantVectorProfileMethod.class).getQuantity().setComponents(1.0, -1.0, 0.0);
porousViscousResistance_0.getMethod(OrthotropicTensorProfileMethod.class).setLocalOrientation(localOrientation_0);

对各向异性固体导热率的更改

为了使各向异性固体导热率的指定更简单且少出错,此材料属性已重组,从而导致宏代码更改。

以前版本 Simcenter STAR-CCM+ 2019.3
SolidModel solidModel_0 =
  physicsContinuum_0.getModelManager().getModel(SolidModel.class);
Solid solid_0 =
  ((Solid) solidModel_0.getMaterial());
solid_0.getMaterialProperties().getMaterialProperty(ThermalConductivityProperty.class).setMethod(AnisotropicThermalConductivityMethod.class);
AnisotropicThermalConductivity anisotropicThermalConductivity_0 =
  region_0.getValues().get(AnisotropicThermalConductivity.class);
ScalarProfile scalarProfile_0 =
  anisotropicThermalConductivity_0.getMethod(PrincipalTensorProfileMethod.class).getProfile(0);
scalarProfile_0.getMethod(ConstantScalarProfileMethod.class).getQuantity().setValue(1.0);
VectorProfile vectorProfile_0 =
  anisotropicThermalConductivity_0.getMethod(PrincipalTensorProfileMethod.class).getXAxis();
vectorProfile_0.getMethod(ConstantVectorProfileMethod.class).getQuantity().setComponents(-1.0, 0.0, 0.0);
Solid solid_0 =
  ((Solid) solidModel_0.getMaterial());
OrthotropicThermalConductivityMethod orthotropicThermalConductivityMethod_0 =
  ((OrthotropicThermalConductivityMethod) solid_0.getMaterialProperties().getMaterialProperty(ThermalConductivityProperty.class).getMethod());
ConstantMaterialPropertyMethod constantMaterialPropertyMethod_0 =
  ((ConstantMaterialPropertyMethod) ((ScalarMaterialProperty) orthotropicThermalConductivityMethod_0.getScalarProperty(0)).getMethod());
constantMaterialPropertyMethod_0.getQuantity().setValue(1.0);
Region region_1 =
  simulation_0.getRegionManager().getRegion("Region 1");
LocalOrientation localOrientation_2 =
  region_1.getValues().get(LocalOrientationManager.class).CreateLocalOrientation();
OrientationAxisProfile orientationAxisProfile_3 =
  localOrientation_2.getOrientationAxis1();
orientationAxisProfile_3.getMethod(ConstantVectorProfileMethod.class).getQuantity().setComponents(-1.0, 0.0, 0.0);
ThermalConductivityOrientation thermalConductivityOrientation_0 =
  region_1.getValues().get(ThermalConductivityOrientation.class);
thermalConductivityOrientation_0.getMethod(OrientationProfileMethod.class).setLocalOrientation(localOrientation_2);

已努力将旧的宏行为自动映射到新的 API,但建议您在新版本中检查您的配置文件。

伴随:对成本函数的更改

Simcenter STAR-CCM+ 当前版本中,计算操作、步进和运行现在可以应用于各个成本函数,而不是简单地应用于所有成本函数。

以下示例显示了当前版本的新的宏代码,为单独的阻力升力成本函数运行伴随:

Simulation simulation_0 = getActiveSimulation();
AdjointSolver adjointSolver_0 = ((AdjointSolver) simulation_0.getSolverManager().getSolver(AdjointSolver.class));
ForceCostFunction forceCostFunction_0 = ((ForceCostFunction) simulation_0.getAdjointCostFunctionManager().getAdjointCostFunction("Drag"));
ForceCostFunction forceCostFunction_1 = ((ForceCostFunction) simulation_0.getAdjointCostFunctionManager().getAdjointCostFunction("Lift"));
adjointSolver_0.runAdjoint(Arrays.asList(forceCostFunction_0, forceCostFunction_1));

已引入新方法 clearAdjoint(),以允许清除所有成本函数或特定成本函数列表的伴随解:

Simulation simulation = getActiveSimulation();
AdjointSolver adjointSolver = ((AdjointSolver) simulation.getSolverManager().getSolver(AdjointSolver.class));

// Clear adjoint of specific cost functions
ForceCostFunction forceCostFunction_0 = ((ForceCostFunction) simulation.getAdjointCostFunctionManager().getAdjointCostFunction("Drag"));
ForceCostFunction forceCostFunction_1 = ((ForceCostFunction) simulation.getAdjointCostFunctionManager().getAdjointCostFunction("Lift"));
adjointSolver.clearAdjoint(Arrays.asList(forceCostFunction_0, forceCostFunction_1));

// Clear adjoint of all cost functions
adjointSolver.clearAdjoint();

此项改进还导致宏代码更改。

n 伴随步数

以前版本 Simcenter STAR-CCM+ 2019.3
Simulation simulation_0 = getActiveSimulation();
SimulationIterator simIt = simulation_0.getSimulationIterator();
AdjointSolver adjointSolver_0 = (simulation_0.getSolverManager().getSolver(AdjointSolver.class));
AdjointRunnableSolver adjointRunnableSolver_0 = adjointSolver_0.getAdjointRunnableSolver();
simIt.step(adjointRunnableSolver_0, n, true);
Simulation simulation_0 = getActiveSimulation();
AdjointSolver adjointSolver_0 = simulation_0.getSolverManager().getSolver(AdjointSolver.class);
adjointSolver_0.stepAdjoint(n);

正在计算网格灵敏度

以前版本 Simcenter STAR-CCM+ 2019.3
AdjointMeshSolver adjointMeshSolver_0 = ((AdjointMeshSolver) adjointSolver_0.getAdjointSolverManager().getSolver(AdjointMeshSolver.class));
adjointMeshSolver_0.computeMeshSensitivity();
AdjointSolver adjointSolver_0 = ((AdjointSolver) simulation.getSolverManager().getSolver(AdjointSolver.class));
adjointSolver_0.computeMeshSensitivity();

计算表面灵敏度

以前版本 Simcenter STAR-CCM+ 2019.3
Simulation simulation = getActiveSimulation();
AdjointSolver adjointSolver = ((AdjointSolver) simulation.getSolverManager().getSolver(AdjointSolver.class));
SurfaceSensitivitySolver surfaceSensitivitySolver = adjointSolver.getAdjointSolverManager().getSolver(SurfaceSensitivitySolver.class);   
surfaceSensitivitySolver.computeSurfaceSensitivity();
Simulation simulation = getActiveSimulation();
AdjointSolver adjointSolver = ((AdjointSolver) simulation.getSolverManager().getSolver(AdjointSolver.class));
adjointSolver.computeSurfaceSensitivity();

计算伴随误差估计

以前版本 Simcenter STAR-CCM+ 2019.3
Simulation simulation = getActiveSimulation();
AdjointSolver adjointSolver = ((AdjointSolver) simulation.getSolverManager().getSolver(AdjointSolver.class));
AdjointFlowSolver adjointFlowSolver = ((AdjointFlowSolver) adjointSolver.getAdjointSolverManager().getSolver(AdjointFlowSolver.class));
adjointFlowSolver.computeAdjointErrorEstimates();
Simulation simulation = getActiveSimulation();
AdjointSolver adjointSolver = ((AdjointSolver) simulation.getSolverManager().getSolver(AdjointSolver.class));
adjointSolver.computeAdjointErrorEstimates();

DEM:对强度指定的更改

以下 DEM 模型参数已重组,以使用实现例如从恒值切换到场函数的方法:

  • 简单失效模型参数:
    • 拉伸强度
    • 剪切强度
  • 恒定比率损坏模型参数:
    • 粘结强度
    • 初始损伤

此项改进导致宏代码更改。以下示例显示了在简单失效模型中为均匀分布的拉伸强度选择和设置参数:

以前版本 Simcenter STAR-CCM+ 2019.3
SimpleFailureDamageModel simpleFailureDamageModel_0 = 
  phaseInteraction_0.getModelManager().getModel(SimpleFailureDamageModel.class);
simpleFailureDamageModel_0.getTensileStrength().setMethod(UniformBondStrengthMethod.class);
UniformBondStrengthMethod uniformBondStrengthMethod_0 = 
  ((UniformBondStrengthMethod) simpleFailureDamageModel_0.getTensileStrength().getMethod());
uniformBondStrengthMethod_0.getLower().setValue(10.0);
uniformBondStrengthMethod_0.getUpper().setValue(20.0);
SimpleFailureDamageModel simpleFailureDamageModel_0 = 
  phaseInteraction_0.getModelManager().getModel(SimpleFailureDamageModel.class);
BondTensileStrengthProfile bondTensileStrengthProfile_0 = 
  simpleFailureDamageModel_0.getBondTensileStrengthProfile();
bondTensileStrengthProfile_0.setMethod(UniformRandomScalarProfileMethod.class);
bondTensileStrengthProfile_0.getMethod(UniformRandomScalarProfileMethod.class).getMinimum().setValue(10.0);
bondTensileStrengthProfile_0.getMethod(UniformRandomScalarProfileMethod.class).getMaximum().setValue(20.0);

欧拉多相:对 S-Gamma 破碎和聚结的更改

在 S-Gamma 模型的破碎和聚结中实施了改进,因此导致宏代码的更改。

以前版本 Simcenter STAR-CCM+ 2019.3
eulerianPhase_1.enable(EulerianPhaseSizeDistributionModelGroup.class);
eulerianPhase_1.enable(SgammaModel.class);
eulerianPhase_1.enable(EulerianPhaseSizeDistributionModelGroup.class);
eulerianPhase_1.enable(SgammaEnablerModel.class);
eulerianPhase_1.enable(SgammaModel.class);

VOF / N 相混合物

对流选项的重构

由于一致性和标签的改进,对流选项已重构,因此导致宏代码发生更改。

VOF 示例

以前版本 Simcenter STAR-CCM+ 2019.3
import star.flow.VolumeFractionProfile;
import star.multiphase.VolumeFractionUpwindOption;
SegregatedVofModel segregatedVofModel = getActiveSimulation().getContinuumManager().getContinuum("Physics 1")).getModelManager().getModel(SegregatedVofModel.class);
SegregatedVofModel segregatedVofModel = getActiveSimulation().getContinuumManager().getContinuum("Physics 1")).getModelManager().getModel(SegregatedVofModel.class);
segregatedVofModel.getUpwindOption().setSelected(UpwindOption.Type.FIRST_ORDER);
segregatedVofModel.getVolumeFractionUpwindOption().setSelected(VolumeFractionUpwindOption.Type.FIRST_ORDER);

分离 N 相混合物的示例

以前版本 Simcenter STAR-CCM+ 2019.3
import star.flow.VolumeFractionProfile;
import star.multiphase.VolumeFractionUpwindOption;
SegregatedNPhaseMixtureModel segregatedNPhaseMixtureModel = getActiveSimulation().getContinuumManager().getContinuum("Physics 1")).getModelManager().getModel(SegregatedNPhaseMixtureModel.class);
SegregatedNPhaseMixtureModel segregatedNPhaseMixtureModelModel = getActiveSimulation().getContinuumManager().getContinuum("Physics 1")).getModelManager().getModel(SegregatedNPhaseMixtureModel.class);
segregatedNPhaseMixtureModel.getUpwindOption().setSelected(UpwindOption.Type.FIRST_ORDER);
segregatedNPhaseMixtureModel.getVolumeFractionUpwindOption().setSelected(VolumeFractionUpwindOption.Type.FIRST_ORDER);

重命名默认对流选项

对于流体体积 (VOF) 模型节点,对流属性的默认设置已重命名以保持一致性。二阶设置现在是 HRIC(高分辨率交界面捕捉),从而导致宏代码更改。

此名称已针对 VOF 进行更改,但不适用于 N 相混合物。要更新您的宏,请参见以下示例:

以前版本 Simcenter STAR-CCM+ 2019.3
segregatedVofModel.getUpwindOption().setSelected(UpwindOption.Type.SECOND_ORDER);
segregatedNPhaseMixtureModel.getUpwindOption().setSelected(UpwindOption.Type.SECOND_ORDER);
segregatedVofModel.getVolumeFractionUpwindOption().setSelected(VolumeFractionUpwindOption.Type.HRIC);
segregatedNPhaseMixtureModel.getVolumeFractionUpwindOption().setSelected(VolumeFractionUpwindOption.Type.SECOND_ORDER);

移除已弃用的类

作为 VOF 重组的一部分,移除了以前弃用的一些类。此更改仅与版本 11.04 或更早版本中记录的宏相关。这些过时的类不会出现在使用较新版本记录的宏中。

替换 SegregatedVofFlowModel

11.04 和更早版本 Simcenter STAR-CCM+ 2019.3
import star.vof.SegregatedVofFlowModel
import star.mixturemultiphase.SegregatedVolumeFluxBasedFlowModel
physicsContinuum_0.enable(SegregatedVofFlowModel.class)
physicsContinuum_0.enable(SegregatedVolumeFluxBasedFlowModel.class)

替换 SegregatedVofPhaseSpeciesModel

11.04 和更早版本 Simcenter STAR-CCM+ 2019.3
import star.vof.SegregatedVofPhaseSpeciesModel
import star.mixturemultiphase.MmpPhaseSpeciesModel
physicsContinuum_0.enable(SegregatedVofPhaseSpeciesModel.class)
physicsContinuum_0.enable(MmpPhaseSpeciesModel.class)

替换 SegregatedVofTemperatureModel

11.04 和更早版本 Simcenter STAR-CCM+ 2019.3
import star.vof.SegregatedVofTemperatureModel
import star.mixturemultiphase.SegregatedMmpTemperatureModel
physicsContinuum_0.enable(SegregatedVofTemperatureModel.class)
physicsContinuum_0.enable(SegregatedMmpTemperatureModel.class)

替换 VofPhaseEnergyModel

11.04 和更早版本 Simcenter STAR-CCM+ 2019.3
import star.vof.VofPhaseEnergyModel
import star.mixturemultiphase.MmpPhaseEnergyModel
physicsContinuum_0.enable(VofPhaseEnergyModel.class)
physicsContinuum_0.enable(MmpPhaseEnergyModel.class)

电磁

电路元件的更改

作为实施励磁线圈电路模型链接的一部分,类 ExcitationCoilCircuitElement 已从 electromagnetism.common 移至 electromagnetism.magneticpotential

以前版本 Simcenter STAR-CCM+ 2019.3
import star.electromagnetism.common.ExcitationCoilCircuitElement;
import star.electromagnetism.magneticpotential.ExcitationCoilCircuitElement;

对节点力计算的更改

Simcenter STAR-CCM+ 以前版本中节点力在每次迭代过程中都计算,即使在未使用它们时也是如此。对于当前版本,为要查看这些值而必须选择的节点力提供了专用模型。对于向后兼容性,在恢复旧模拟时会激活模型。对于创建需要节点力的新模拟的宏,必须如下所示添加新模型。

以前版本 Simcenter STAR-CCM+ 2019.3
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(ElectromagnetismModel.class);
physicsContinuum_0.enable(FiniteElementMagneticVectorPotentialModel.class);
physicsContinuum_0.enable(ExcitationCoilModel.class);
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(ElectromagnetismModel.class);
physicsContinuum_0.enable(FiniteElementMagneticVectorPotentialModel.class);
physicsContinuum_0.enable(MagneticNodalForceModel.class);
physicsContinuum_0.enable(ExcitationCoilModel.class);

电化学/等离子体:电荷数材料属性的传输

由于引入了双极性扩散,ChargeNumberProperty 材料属性已从 electrochemicalspecies 移至 material,从而导致宏代码更改。现有的宏将继续按预期方式工作,但如果已编辑自动生成的宏,则可能无法再正确编译,必须如下所示修改代码。

以前版本 Simcenter STAR-CCM+ 2019.3
import star.electrochemicalspecies.ChargeNumberProperty;
import star.material.ChargeNumberProperty;

设计管理器:自动保存选项的转移

设计管理器中的自动保存选项已从各个设计研究的属性移至设计管理器项目的属性。尽管现有 Java 宏 API 通常未更改,但方法 getAutoSaveOnDesignCompletionsetAutoSaveOnDesignCompletionMdxLaunchSettings 类中已弃用,并且已添加到 MdxProject 类中。

这些已弃用的方法尚未从当前版本中移除,但 MdxLaunchSettings 方法现在引用 MdxProject 类以获取和设置值。因此,回放使用这些方法的较旧的宏可能会导致项目级别自动保存选项不按预期方式设置。因此,建议如以下示例所示通过更新宏来准备更改。

以前版本 Simcenter STAR-CCM+ 2019.3
MdxProject mdxProject_0 = 
  getActiveMdxProject();
MdxDesignStudy mdxDesignStudy_0 = 
  mdxProject_0.getDesignStudyManager().getDesignStudy("Design Study");
MdxStudySettings mdxStudySettings_0 = 
  mdxDesignStudy_0.getStudySettings();
MdxLaunchSettings mdxLaunchSettings_0 = 
  mdxStudySettings_0.getLaunchSettings();
mdxLaunchSettings_0.setAutoSaveOnDesignCompletion(true);
MdxProject mdxProject_0 = 
  getActiveMdxProject();
mdxProject_0.setAutoSaveOnDesignCompletion(true);

协同仿真:场指定的更改

场指定中的结构改进导致宏代码更改。每组更改之后都有一个示例,说明应如何更新宏代码。

CoSimStencilOption

CoSimLocationOption 类已重命名为 CoSimStencilOption

以前版本 Simcenter STAR-CCM+ 2019.3
scalarAuxiliaryExportSpecification_0.getCoSimLocationOption().setSelected(CoSimLocationOption.Type.VERTEX);
scalarFieldSpecification_0.getCoSimStencilOption().setSelected(CoSimStencilOption.Type.VERTEX);

ScalarFieldSpecification

以下类已替换为类 ScalarFieldSpecification

  • ScalarAuxiliaryExportSpecification
  • ScalarAuxiliaryImportSpecification
  • HeatTransferCoefficientExportSpecification
  • HeatTransferCoefficientImportSpecification
  • MassflowExportSpecification
  • MassflowImportSpecification
  • PressureExportSpecification
  • PressureImportSpecification
  • TemperatureExportSpecification
  • TemperatureImportSpecification
  • ReferenceTemperatureExportSpecification
  • ReferenceTemperatureImportSpecification
  • HeatFluxExportSpecification
  • HeatFluxImportSpecification
以前版本 Simcenter STAR-CCM+ 2019.3
ScalarAuxiliaryExportSpecification scalarAuxiliaryExportSpecification_0 =   ((ScalarAuxiliaryExportSpecification) coSimulationZone_0.getCoSimulationZoneConditions().get(ExportFieldSpecificationManager.class).getObject("Scalar Auxiliary Field 1"));
ScalarFieldSpecification scalarFieldSpecification_0 =   ((ScalarFieldSpecification) coSimulationZone_0.getCoSimulationZoneConditions().get(ExportFieldSpecificationManager.class).getObject("Scalar Auxiliary Field 1"));

VectorFieldSpecification

以下类已替换为类 VectorFieldSpecification

  • VectorAuxiliaryExportSpecification
  • VectorAuxiliaryImportSpecification
  • DisplacementExportSpecification
  • DisplacementImportSpecification
  • VelocityExportSpecification
  • VelocityImportSpecification
  • WallShearStressExportSpecification
  • WallShearStressImportSpecification
以前版本 Simcenter STAR-CCM+ 2019.3
DisplacementImportSpecification displacementImportSpecification_0 =   (DisplacementImportSpecification) coSimulationZone_0.getCoSimulationZoneConditions().get(ImportFieldSpecificationManager.class).addSpecification("Mechanical", "Displacement");
VectorFieldSpecification vectorFieldSpecification_0 =   ((VectorFieldSpecification) coSimulationZone_0.getCoSimulationZoneConditions().get(ImportFieldSpecificationManager.class).getObject("Displacement"));

ValueSpecification

ExportScalarValueSpecificationImportScalarValueSpecification 已替换为 ScalarValueSpecification

ExportVectorValueSpecificationImportVectorValueSpecification 已替换为 VectorValueSpecification

ExportIntScalarValueSpecificationImportIntScalarValueSpecification 已替换为 IntScalarValueSpecification

ExportBoolScalarValueSpecificationImportBoolScalarValueSpecification 已替换为 BoolScalarValueSpecification

ExportEnumValueSpecificationImportEnumValueSpecification 已替换为 EnumValueSpecification

ExportStringValueSpecificationImportStringValueSpecification 已替换为 StringValueSpecification

以前版本 Simcenter STAR-CCM+ 2019.3
ExportScalarValueSpecification exportScalarValueSpecification_0 =   ((ExportScalarValueSpecification) coSimulation_0.getCoSimulationConditions().get(ExportValueSpecificationManager.class).getObject("expseu_.P3_mass_exp"));
ScalarValueSpecification scalarValueSpecification_0 =   ((ScalarValueSpecification) coSimulation_0.getCoSimulationConditions().get(ExportValueSpecificationManager.class).getObject("expseu_.P3_mass_exp"));

Simcenter STAR-CCM+ In-Cylinder:因重命名 STAR-ICE 而发生的更改

3D-CAD 模型和场景已由 STAR-ICE 重命名为 In-Cylinder,从而导致宏代码更改。

以前版本 Simcenter STAR-CCM+ 2019.3
Simulation simulation_0 = 
  getActiveSimulation();
simulation_0.loadStarIce("StarIce");
Scene scene_0 = 
  simulation_0.getSceneManager().getScene("STAR-ICE 1");
scene_0.initializeAndWait();
StarIceEngine starIceEngine_0 = 
  simulation_0.get(StarIceEngine.class);
starIceEngine_0.startStarIce();
scene_0.setAdvancedRenderingEnabled(false);
SceneUpdate sceneUpdate_0 = 
  scene_0.getSceneUpdate();
HardcopyProperties hardcopyProperties_0 = 
  sceneUpdate_0.getHardcopyProperties();
hardcopyProperties_0.setCurrentResolutionWidth(872);
hardcopyProperties_0.setCurrentResolutionHeight(516);
scene_0.resetCamera();
simulation_0.loadStarIce("StarIce");
Scene scene_1 = 
  simulation_0.getSceneManager().createScene("3D-CAD View");
scene_1.initializeAndWait();
CadModel cadModel_0 = 
  ((CadModel) simulation_0.get(SolidModelManager.class).getObject("STAR-ICE 3D-CAD 1"));
simulation_0.get(SolidModelManager.class).editCadModel(cadModel_0, scene_1);
scene_1.open();
scene_1.setAdvancedRenderingEnabled(false);
SceneUpdate sceneUpdate_1 = 
  scene_1.getSceneUpdate();
HardcopyProperties hardcopyProperties_1 = 
  sceneUpdate_1.getHardcopyProperties();
hardcopyProperties_1.setCurrentResolutionWidth(25);
hardcopyProperties_1.setCurrentResolutionHeight(25);
hardcopyProperties_1.setCurrentResolutionWidth(872);
hardcopyProperties_1.setCurrentResolutionHeight(516);
scene_1.resetCamera();
simulation_0.get(SolidModelManager.class).endEditCadModel(cadModel_0);
simulation_0.getSceneManager().deleteScenes(new NeoObjectVector(new Object[] {scene_1}));
Simulation simulation_0 = 
  getActiveSimulation();
simulation_0.loadStarIce("StarIce");
Scene scene_0 = 
  simulation_0.getSceneManager().getScene("In-Cylinder 1");
scene_0.initializeAndWait();
StarIceEngine starIceEngine_0 = 
  simulation_0.get(StarIceEngine.class);
starIceEngine_0.startStarIce();
scene_0.setAdvancedRenderingEnabled(false);
SceneUpdate sceneUpdate_0 = 
  scene_0.getSceneUpdate();
HardcopyProperties hardcopyProperties_0 = 
  sceneUpdate_0.getHardcopyProperties();
hardcopyProperties_0.setCurrentResolutionWidth(872);
hardcopyProperties_0.setCurrentResolutionHeight(516);
scene_0.resetCamera();
simulation_0.loadStarIce("StarIce");
Scene scene_1 = 
  simulation_0.getSceneManager().createScene("3D-CAD View");
scene_1.initializeAndWait();
CadModel cadModel_0 = 
  ((CadModel) simulation_0.get(SolidModelManager.class).getObject("In-Cylinder 3D-CAD 1"));
simulation_0.get(SolidModelManager.class).editCadModel(cadModel_0, scene_1);
scene_1.open();
scene_1.setAdvancedRenderingEnabled(false);
SceneUpdate sceneUpdate_1 = 
  scene_1.getSceneUpdate();
HardcopyProperties hardcopyProperties_1 = 
  sceneUpdate_1.getHardcopyProperties();
hardcopyProperties_1.setCurrentResolutionWidth(25);
hardcopyProperties_1.setCurrentResolutionHeight(25);
hardcopyProperties_1.setCurrentResolutionWidth(872);
hardcopyProperties_1.setCurrentResolutionHeight(516);
scene_1.resetCamera();
simulation_0.get(SolidModelManager.class).endEditCadModel(cadModel_0);
simulation_0.getSceneManager().deleteScenes(new NeoObjectVector(new Object[] {scene_1}));