宏 API 更改 2410

在 Simcenter STAR-CCM+ 2410 中,针对布局、体形状、网格化、材料属性、热传递、反应流体、多相、电磁、电池建模和后处理进行了宏 API 的更改。

原有布局的终点

Simcenter STAR-CCM+ 2410 已完全移除原有窗口布局。在先前版本中保存并具有这些布局的模拟文件将得到恢复,但被丢弃的布局对象除外。

这些布局不会与较新的布局视图混淆,新布局视图在布局视图节点中可用。

引用原有布局对象的任何现有宏必须经过更新,才能移除这些引用的实例。否则,这些宏不会在 Simcenter STAR-CCM+ 2410 中执行。具有此类引用的字符串包括:

  • getActiveMdxProject().get(LayoutManager.class).createLayout("Layout 1");
  • getActiveSimulation().get(LayoutManager.class).createLayout("Layout 1");
  • getActiveSimulation().get(LayoutManager.class).getObject("Layout 1")).setLayoutName("New Name");
  • public void execute() {
      Simulation sim = getActiveSimulation();
      Layout layout = (Layout) sim.get(LayoutManager.class).getObject("Layout 1");
      sim.deleteObject(layout);
    }

计划终止体形状节点宏

体形状已从 Simcenter STAR-CCM+ 2410 的用户界面中移除,因为此功能已在部件中提供。尽管这些对象在宏代码中仍然起作用,但已计划从将来的某个版本中移除它们。

例如,对于反应流体模拟中的点火器,可以使用形状部件。VolumeShape.class 在 Simcenter STAR-CCM+ 2410 中有效,但应替换为 SimpleShapePart.class。

以前版本 Simcenter STAR-CCM+ 2410
BrickVolumeShape brickVolumeShape_0 = (BrickVolumeShape) simulation_0.get(VolumeShapeManager.class).createBrickVolumeShape();
SimpleBlockPart simpleBlockPart_0 = simulation_0.get(MeshPartFactory.class).createNewBlockPart(simulation_0.get(SimulationPartManager.class));
ConeVolumeShape coneVolumeShape_0 =(ConeVolumeShape)
simulation_0.get(VolumeShapeManager.class).createConeVolumeShape();
SimpleConePart simpleConePart_0 = 
simulation_0.get(MeshPartFactory.class).createNewConePart(simulation_0.get(SimulationPartManager.class));
    CylinderVolumeShape cylinderVolumeShape_0 =(CylinderVolumeShape) simulation_0.get(VolumeShapeManager.class).createCylinderVolumeShape();
SimpleCylinderPart simpleCylinderPart_0 = 
simulation_0.get(MeshPartFactory.class).createNewCylinderPart(simulation_0.get(SimulationPartManager.class));
    SphereVolumeShape sphereVolumeShape_0 = (SphereVolumeShape) simulation_0.get(VolumeShapeManager.class).createSphereVolumeShape();
SimpleSpherePart simpleSpherePart_0 = 
simulation_0.get(MeshPartFactory.class).createNewSpherePart(simulation_0.get(SimulationPartManager.class));

要转换形状部件,使用 SimulationPartManager.class 而不是 VolumeShape.class。下面是创建和转换体形状(以前的发行版)和形状部件(当前发行版)的宏代码示例:

以前版本 Simcenter STAR-CCM+ 2410
Simulation simulation_0 = getActiveSimulation();
Units units_0 =  simulation_0.getUnitsManager().getPreferredUnits(Dimensions.Builder().length(1).build());
BrickVolumeShape brickVolumeShape_0 = (BrickVolumeShape) simulation_0.get(VolumeShapeManager.class).createBrickVolumeShape();
LabCoordinateSystem labCoordinateSystem_0 = simulation_0.getCoordinateSystemManager().getLabCoordinateSystem();
brickVolumeShape_0.translate(new DoubleVector(new double[] {0.0, 1.0, 0.0}), new ArrayList<>(Arrays.<Units>asList(units_0, units_0, units_0)), labCoordinateSystem_0);
Simulation simulation_0 = getActiveSimulation();
Units units_0 = simulation_0.getUnitsManager().getPreferredUnits(Dimensions.Builder().length(1).build());
MeshPartFactory meshPartFactory_0 = simulation_0.get(MeshPartFactory.class);
SimpleBlockPart simpleBlockPart_0 = simulation_0.get(MeshPartFactory.class).createNewBlockPart(simulation_0.get(SimulationPartManager.class));
LabCoordinateSystem labCoordinateSystem_0 = simulation_0.getCoordinateSystemManager().getLabCoordinateSystem();
simulation_0.get(SimulationPartManager.class).translateParts(new ArrayList<>(Arrays.<GeometryPart>asList(simpleBlockPart_0)), new DoubleVector(new double[] {0.0, 1.0, 0.0}), new ArrayList<>(Arrays.<Units>asList(units_0, units_0, units_0)), labCoordinateSystem_0);

网格化

计划终止初始化网格功能

因为 2302 版本中已移除了基于区域的网格化,宏代码中的“初始化网格”命令自 Simcenter STAR-CCM+ 2410 起已弃用,并计划从以后的某个版本中移除。要更新宏,移除以下代码的实例:

meshPipelineController_0.initializeMeshPipeline();

移除网格划分和能量模型之间的映射链接

由于移除了网格划分和能量模型之间的映射链接,因此宏代码已更改。因此,某些具有错误模型选择顺序的定制宏将开始失败。在 Simcenter STAR-CCM+ 客户端录制的宏不受影响。

以下是失败宏代码的示例:

protected final void enableModels(PhysicsContinuum pc) {
     pc.enable(TwoDimensionalModel.class);
     pc.enable(SteadyModel.class);
     pc.enable(SingleComponentLiquidModel.class);
     pc.enable(ConstantDensityModel.class);
     pc.enable(LaminarModel.class);
     pc.enable(ElectrochemistryModel.class);
     pc.enable(ElectrochemicalSpeciesModel.class);
     pc.enable(ElectromagnetismModel.class);
     pc.enable(ElectrodynamicsPotentialModel.class);
     pc.enable(SegregatedFluidIsothermalModel.class);
     SegregatedFluidIsothermalModel segregatedFluidIsothermalModel =
       pc.getModelManager().getModel(SegregatedFluidIsothermalModel.class);
     segregatedFluidIsothermalModel.getContinuumTemperature().setValue(298.15);

     ElectrochemicalSpeciesModel echemSpeciesModel = pc.getModelManager().getModel(ElectrochemicalSpeciesModel.class);
     echemSpeciesModel.getElectrochemicalSpeciesSolverOption().setSelected(ElectrochemicalSpeciesSolverOption.Type.SEGREGATED);
}

注意,ConstantDensityModel 在第 5 行激活。但是,除非选择能量模型,否则此模型不可供选择。在这种情况下,SegregatedFluidIsothermalModel 仅在第 11 行激活。上述宏是自定义构建的,由于网格化模型和能量模型之间存在映射链接,该宏在先前版本的 Simcenter STAR-CCM+ 中起作用。

必须以正确的顺序激活模型来修改此类宏,才能避免发生上述故障。推荐修改如下:

protected final void enableModels(PhysicsContinuum pc) {
     pc.enable(TwoDimensionalModel.class);
     pc.enable(SteadyModel.class);
     pc.enable(SingleComponentLiquidModel.class);
     pc.enable(SegregatedFluidIsothermalModel.class);
     pc.enable(ConstantDensityModel.class);
     pc.enable(LaminarModel.class);
     pc.enable(ElectrochemistryModel.class);
     pc.enable(ElectrochemicalSpeciesModel.class);
     pc.enable(ElectromagnetismModel.class);
     pc.enable(ElectrodynamicsPotentialModel.class);
     SegregatedFluidIsothermalModel segregatedFluidIsothermalModel =
       pc.getModelManager().getModel(SegregatedFluidIsothermalModel.class);
     segregatedFluidIsothermalModel.getContinuumTemperature().setValue(298.15);

     ElectrochemicalSpeciesModel echemSpeciesModel = pc.getModelManager().getModel(ElectrochemicalSpeciesModel.class);
     echemSpeciesModel.getElectrochemicalSpeciesSolverOption().setSelected(ElectrochemicalSpeciesSolverOption.Type.SEGREGATED);
}

注意,SegregatedFluidIsothermalModel 先于 ConstantDensityModel 激活。

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

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

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

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

热传递:基于部件的双流体热交换器中的部件处理的更改

接触模式直接区域交界面(与基于部件的实际流双流体热交换器模型关联)已重新设计,可将每个部件子组视为物理热交换器,而不是将每个部件接触均视为物理热交换器。此外,如果为接触模式直接区域交界面停用按部件子组指定选项,则整个交界面将被视为一个物理热交换器。

在以前的版本中,这种情况下每个部件接触都将被视为单独的物理热交换器。

尽管工作流程基本保持不变,但此更改的影响如下:

  • 如果以前版本 Simcenter STAR-CCM+ 中的工作流程仅对每个子组使用一个部件接触,则采用 Simcenter STAR-CCM+ 2410 时的结果将相同。
  • 如果先前的工作流程对任何子组使用多个部件接触,或如果根据部件子组指定选项已停用,并且接触模式直接区域交界面中存在多个部件接触,则采用 Simcenter STAR-CCM+ 2410 时的结果将不同。

要确保结果与 Simcenter STAR-CCM+ 2410 一致,建议通过以下更改来更新任何旧宏:

  • 激活按部件子组指定选项后,确保每个部件子组仅包含一个部件接触。如果在旧 Java 宏中指定了每个子组有多个部件接触,则将该子组拆分为多个子组(必要时创建新子组)。
  • 按部件子组指定选项停用后,如果接触模式直接区域交界面中存在多个部件接触,则激活按部件子组指定,并创建与该交界面中部件接触数量一样多的部件子组,将每个部件接触分配给独特的部件子组。

对于双流体热交换器报告,用户界面和关联的宏代码已更改,因为监视器接触属性已被监视器子组属性代替。

必要的更改显示在以下新旧宏代码示例中:

以前版本 Simcenter STAR-CCM+ 2410
HeatExchangerReport hxReport_0 = 
      simulation_0.getReportManager().createReport(HeatExchangerReport.class);
hxReport_0.setPresentationName("hx1-Q");
hxReport_0.setHeatExchanger(directRegionInterface_0);
hxReport_0.getMonitorContact().setQuery(null);
hxReport_0.getMonitorContact().setObjects(partContact_0);
HeatExchangerReport hxReport_0 = 
      simulation_0.getReportManager().createReport(HeatExchangerReport.class);
hxReport_0.setPresentationName("hx1-Q");
hxReport_0.setHeatExchanger(directRegionInterface_0);
hxReport_0.getMonitorSubgroup().setQuery(null);
hxReport_0.getMonitorSubgroup().setObjects(((NamedPartGroup) ((PartGrouping) directRegionInterface_0.get(PartGroupingManager.class).getObject("Subgrouping 1")).getObject("Subgroup 1")));

反应流体:终止体形状点火器选项

由于从 Simcenter STAR-CCM+ 2410 中移除了体形状(因为它们的功能在部件中也可用),体形状点火器指定选项从版本 2306 开始已弃用,并已从 Simcenter STAR-CCM+ 2410 中移除。

要更新宏,将使用体形状替换为使用部件,如下例中所示:

以前版本 Simcenter STAR-CCM+ 2410
Units units_0 = 
  simulation_0.getUnitsManager().getPreferredUnits(Dimensions.Builder().length(1).build());
BrickVolumeShape brickVolumeShape_0 = 
  (BrickVolumeShape) simulation_0.get(VolumeShapeManager.class).createBrickVolumeShape();
LabCoordinateSystem labCoordinateSystem_0 = 
  simulation_0.getCoordinateSystemManager().getLabCoordinateSystem();
brickVolumeShape_0.setCoordinateSystem(labCoordinateSystem_0);
brickVolumeShape_0.getCorner1().setCoordinateSystem(labCoordinateSystem_0);
brickVolumeShape_0.getCorner1().setCoordinate(units_0, units_0, units_0, new DoubleVector(new double[] {0.0, 0.0, 0.0}));
brickVolumeShape_0.getCorner1().setUnits0(units_0);
brickVolumeShape_0.getCorner1().setUnits1(units_0);
brickVolumeShape_0.getCorner1().setUnits2(units_0);
brickVolumeShape_0.getCorner1().setDefinition("");
brickVolumeShape_0.getCorner1().setValue(new DoubleVector(new double[] {0.0, 0.0, 0.0}));
brickVolumeShape_0.getCorner2().setCoordinateSystem(labCoordinateSystem_0);
brickVolumeShape_0.getCorner2().setCoordinate(units_0, units_0, units_0, new DoubleVector(new double[] {0.0, 0.0, 0.0}));
brickVolumeShape_0.getCorner2().setUnits0(units_0);
brickVolumeShape_0.getCorner2().setUnits1(units_0);
brickVolumeShape_0.getCorner2().setUnits2(units_0);
brickVolumeShape_0.getCorner2().setDefinition("");
brickVolumeShape_0.getCorner2().setValue(new DoubleVector(new double[] {1.0, 1.0, 1.0}));
Units units_0 = 
  simulation_0.getUnitsManager().getPreferredUnits(Dimensions.Builder().length(1).build());
MeshPartFactory meshPartFactory_0 = 
  simulation_0.get(MeshPartFactory.class);
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);
simpleBlockPart_0.getCorner1().setCoordinateSystem(labCoordinateSystem_0);
simpleBlockPart_0.getCorner1().setCoordinate(units_0, units_0, units_0, new DoubleVector(new double[] {0.0, 0.0, 0.0}));
simpleBlockPart_0.getCorner2().setCoordinateSystem(labCoordinateSystem_0);
simpleBlockPart_0.getCorner2().setCoordinate(units_0, units_0, units_0, new DoubleVector(new double[] {1.0, 1.0, 1.0}));
simpleBlockPart_0.rebuildSimpleShapePart();
simpleBlockPart_0.setDoNotRetessellate(false);

欧拉多相:颗粒子模型的更改

场函数选项现在可用于颗粒运动粘度和颗粒扩散系数函数方法。要为此更新宏,在包含 GranularPressureModel 或 SolidPressureModel 的所有宏的开头添加 star.emp.*,如以下摘录内容所示:

package base.eulerianMultiphaseGranular;
import java.util.*;
import star.multiphase.*;
import star.emp.*;
import star.material.*;
import star.common.*;
import star.base.neo.*;
import star.vis.*;
import star.flow.*;
import star.segregatedmultiphase.*;
import star.metrics.*;
import star.base.report.*;

public class SettlingSchaefferTransport extends GranularSettlingBase {
  public void execute() {
      importMesh();
      setPhysicsModels();   
      addGranularTemperatureModel();
      setGranularModelRegime();
      createPhases();
      defineMultiphaseInteractions();
      setInitialConditions();
      setSolver();
      setTimeStep();
      setTransportSolverURF();
      setStoppingCriteria();      
      createMaxParticleVFMonitor();
  }

液膜:优化参数的升级

对于流体膜表面张力,Alpha 和 Beta 调谐参数已升级为包含标量物理量,从而导致宏代码更改。以前版本中录制的宏仍然正确运行,但它们使用的设置器函数现已弃用。

下面显示为 Alpha 调谐参数进行此更改的示例:

以前版本 Simcenter STAR-CCM+ 2410
FilmSurfaceTensionModel filmSurfaceTensionModel_0
  = phaseInteraction_0.getModelManager().getModel(FilmSurfaceTensionModel.class);
filmSurfaceTensionModel_0.setAlpha(1.1);
FilmSurfaceTensionModel filmSurfaceTensionModel_0
  = phaseInteraction_0.getModelManager().getModel(FilmSurfaceTensionModel.class);

ScalarGlobalParameter alpha = (ScalarGlobalParameter) simulation_0.get(GlobalParameterManager.class).createGlobalParameter(ScalarGlobalParameter.class, "AlphaParam");
alpha.getQuantity().setValue(1.1);

filmSurfaceTensionModel_0.getAlpha().setDefinition("${AlphaParam}");

拉格朗日多相:NTC 碰撞模型的更改

Simcenter STAR-CCM+ 2410 中拉格朗日碰撞模型的碰撞网格功能是为了降低此模型的网格灵敏度而引入的,与先前版本相比更改了模型的默认行为。

可以在 Simcenter STAR-CCM+ 2410 中使用在拉格朗日相中激活 NTC(无时间计数器)碰撞模型的现有宏代码,但碰撞粒子束对的检测方法与先前版本不同。先前版本为每个网格单元检测碰撞粒子束对,而 Simcenter STAR-CCM+ 2410 会为每个碰撞网格(网格单元组)检测碰撞粒子束对。

恢复先前版本中保存的模拟文件时,模拟文件会为每个网格单元检测对,从而保持向后兼容性。但是,使用同一先前版本中录制的宏来设置新的模拟文件时,Simcenter STAR-CCM+ 2410 中的默认行为与先前版本不同。

以下宏代码将拉格朗日碰撞检测的碰撞检测方法改为旧方法(基于网格单元的方法):

LagrangianMultiphaseSolver lagrangianMultiphaseSolver_0 =
  ((LagrangianMultiphaseSolver) getActiveSimulation().getSolverManager().getSolver(LagrangianMultiphaseSolver.class));
CollisionDetectionSolver collisionDetectionSolver =
        ((CollisionDetectionSolver) lagrangianMultiphaseSolver_0.getSolvers().getSolver(CollisionDetectionSolver.class));
collisionDetectionSolver.getDetectionMethods().setMethod(CellBasedCollisionDetectionMethod.class);

在为拉格朗日相激活 NtcModel 之后,插入以上行:

lagrangianPhase_0.enable(NtcModel.class);

其中 lagrangianPhase_0 是计算拉格朗日碰撞的实例。

平滑颗粒流体动力学:稳定属性的更改

对于不可压缩流 (ISPH) 模型,属性自由表面稳定选项及其激活的方法之一自由表面稳定因子已分别重命名为速度稳定选项和速度稳定系数。

该重命名导致宏代码更改。如果任何现有宏使用这些对象,则搜索以下字符串的实例并更新它们,如下表中所示。

以前版本 Simcenter STAR-CCM+ 2410
FreeSurfaceStabilizationOption
VelocityStabilizationOption
FreeSurfaceStabilizationFactor
VelocityStabilizationCoefficient

电磁:电阻的更改

由于在 Simcenter STAR-CCM+ 2410 中引入了“电阻关联”选项,宏代码已更改。

获取边界的 TotalElectricalResistanceAreaProfile

以前版本 Simcenter STAR-CCM+ 2410
import star.electromagnetism.common.TotalElectricalResistanceProfile;
...
Boundary boundary = getBoundary(...);
TotalElectricalResistanceAreaProfile profile = boundary.getValues().get(TotalElectricalResistanceAreaProfile.class);
import star.electromagnetism.common.TotalElectricalResistanceAreaProfile;
import star.electromagnetism.common.TotalElectricalResistanceAreaAssociationProfile;
import star.electromagnetism.common.TotalElectricalResistanceAreaAssociationMethod;
...
Boundary boundary = getBoundary(...);
TotalElectricalResistanceAreaProfile profile = boundary.getValues().get(TotalElectricalResistanceAreaAssociationProfile.class).getMethod(TotalElectricalResistanceAreaAssociationMethod.class).getResistanceProfile();

获取边界交界面的 TotalElectricalResistanceAreaProfile

以前版本 Simcenter STAR-CCM+ 2410
import star.electromagnetism.common.TotalElectricalResistanceProfile;
...
BoundaryInterface contactInterface = getContactInterface(...);
TotalElectricalResistanceAreaProfile totalElectricalResistanceAreaProfile = contactInterface.getValues().get(TotalElectricalResistanceAreaProfile.class);
import star.electromagnetism.common.TotalElectricalResistanceAreaProfile;
import star.electromagnetism.common.TotalElectricalResistanceAreaAssociationProfile;
import star.electromagnetism.common.TotalElectricalResistanceAreaAssociationMethod;
...
BoundaryInterface contactInterface = getContactInterface(...);
TotalElectricalResistanceAreaProfile totalElectricalResistanceAreaProfile = contactInterface.getValues().get(TotalElectricalResistanceAreaAssociationProfile.class).getMethod(TotalElectricalResistanceAreaAssociationMethod.class).getResistanceProfile();

设置 ByPartProfileMethod

以前版本 Simcenter STAR-CCM+ 2410
import star.electromagnetism.common.TotalElectricalResistanceProfile;
...
BoundaryInterface contactInterface = getContactInterface(...);
TotalElectricalResistanceAreaProfile totalElectricalResistanceAreaProfile = contactInterface.getValues().get(TotalElectricalResistanceAreaProfile.class);
totalElectricalResistanceAreaProfile.setMethod(ByPartProfileMethod.class);

ProxyProfile proxyProfile = ((ProxyProfile) totalElectricalResistanceAreaProfile.getMethod(ByPartProfileMethod.class).getProfileManager().getObject(subgroup));
proxyProfile.getMethod(ConstantScalarProfileMethod.class).getQuantity().setValueAndUnits(val, units);
import star.electromagnetism.common.TotalElectricalResistanceAreaProfile;
import star.electromagnetism.common.TotalElectricalResistanceAreaAssociationProfile;
import star.electromagnetism.common.TotalElectricalResistanceAreaAssociationMethod;
...
BoundaryInterface contactInterface = getContactInterface(...);
TotalElectricalResistanceAreaAssociationProfile totalElectricalResistanceAreaAssociationProfile = contactInterface.getValues().get(TotalElectricalResistanceAreaAssociationProfile.class);
totalElectricalResistanceAreaAssociationProfile.setMethod(ByPartProfileMethod.class);

ProxyProfile proxyProfile = ((ProxyProfile) totalElectricalResistanceAreaAssociationProfile.getMethod(ByPartProfileMethod.class).getProfileManager().getObject(subgroup));
TotalElectricalResistanceAreaProfile totalElectricalResistanceAreaProfile = proxyProfile.getMethod(TotalElectricalResistanceAreaAssociationMethod.class).getResistanceProfile();
totalElectricalResistanceAreaProfile.getMethod(ConstantScalarProfileMethod.class).getQuantity().setValueAndUnits(val, units);

电池建模:新的质量损失模型导致更改

随着热失控质量损失模型的引入,宏代码已更改。串联电芯已重命名如下:

  • 热失控电池通风口模型重命名为热失控通风口气体模型
  • BatteryVentModelCorePartDensity 到 BatteryCorePartDensity
  • MaxCumulativeMassLoss 到 MaxVentMassLoss
  • MaxMassFlowRate 至 MaxVentFlowRate
  • MaxTime 重命名为 MaxVentTime
  • 体积平均值电池通风口模型核心部件密度监视图重命名为体积平均值电池核心部件密度监视图

以下示例说明如何在宏代码中使用重命名的串联电芯:

以前版本 Simcenter STAR-CCM+ 2410
ThermalRunawayBatteryVentModelDescription thermalRunawayBatteryVentModelDescription_0 = 
            ((ThermalRunawayBatteryVentModelDescription) userDefinedBatteryCell_0.getModelManager().getModelDescription("Thermal Runaway Battery Vent Model"));
ThermalRunawayBatteryVentModelDescription thermalRunawayBatteryVentModelDescription_0 = 
            ((ThermalRunawayBatteryVentModelDescription) userDefinedBatteryCell_0.getModelManager().getModelDescription("Thermal Runaway Vent Gas Model"));
PrimitiveFieldFunction primitiveFieldFunction_3 = 
              ((PrimitiveFieldFunction) simulation_0.getFieldFunctionManager().getFunction("BatteryVentModelCorePartDensity"));
PrimitiveFieldFunction primitiveFieldFunction_3 = 
              ((PrimitiveFieldFunction) 
simulation_0.getFieldFunctionManager().getFunction("BatteryCorePartDensity"));
batteryTool_0.getModules().createBatteryModuleReport(new NeoObjectVector(new Object[] {userDefinedBatteryModuleCell_0, userDefinedBatteryModuleCell_1, userDefinedBatteryModuleCell_2, userDefinedBatteryModuleCell_3, userDefinedBatteryModuleCell_4}), new StringVector(new String[] {"VolumeIntegralBatteryVolumetricHeat", "MaxTemperature", "MinTemperature", "VolumeAverageTemperature", "MaxBatterySOC", "VolumeAverageBatteryCellVoltage", "VolumeIntegralBatteryCumulativeHeat", "VolumeAverageDensity", "MaxCumulativeMassLoss", "MaxMassFlowRate", "MaxTime", "MaxTotalTemperature"}), 0);
batteryTool_0.getModules().createBatteryModuleReport(new NeoObjectVector(new Object[] {userDefinedBatteryModuleCell_0, userDefinedBatteryModuleCell_1, userDefinedBatteryModuleCell_2, userDefinedBatteryModuleCell_3, userDefinedBatteryModuleCell_4}), new StringVector(new String[] {"VolumeIntegralBatteryVolumetricHeat", "MaxTemperature", "MinTemperature", "VolumeAverageTemperature", "MaxBatterySOC", "VolumeAverageBatteryCellVoltage", "VolumeIntegralBatteryCumulativeHeat", "VolumeAverageDensity", "MaxVentMassLoss", "MaxVentFlowRate", "MaxVentTime", "MaxTotalTemperature"}), 0);
MonitorPlot monitorPlot_4 = 
      ((MonitorPlot) simulation_0.getPlotManager().getPlot("Volume Average Battery Vent Model Core Part Density Monitor Plot"));
MonitorPlot monitorPlot_4 = 
      ((MonitorPlot) simulation_0.getPlotManager().getPlot("Volume Average Battery Core Part Density Monitor Plot"));

后处理

图像导出设置的更改

场景、绘图和布局视图图像的导出过程已合并为新的属性导出分辨率、导出宽度和导出高度。有关这些新属性的详细信息,请参见《2410 发行说明》的“重要说明”章节中的“图像导出设置的更改”。

因此,以下属性已从对象中移除:

  • 场景、绘图和布局视图:宽高比、方向、宽度、高度
  • 更新 > 硬拷贝节点:输出放大倍率、输出宽度、输出高度、使用当前分辨率

宽高比功能已消失,因此调用 scene.setAspectRatio() 或 scene.setAspectRatioOrientation() 不执行任何操作。对 scene.getAspectRatio() 和 scene.getAspectRatioOrientation() 的调用仍然起作用,但前者只能返回 AspectRatioEnum.FIT_SCREEN、AspectRatioEnum.RATIO_16_9 和 AspectRatioEnum.RATIO_1_1。

可用于控制视图尺寸的新方法如下:

  • scene.setExportResolution(ExportResolution.HD);
  • scene.setExportResolution(ExportResolution.FULL_HD);
  • scene.setExportResolution(ExportResolution.FOUR_K);
  • scene.setExportResolution(ExportResolution.EIGHT_K);
  • scene.setExportResolution(ExportResolution.ONE_MP);
  • scene.setExportResolution(ExportResolution.FOUR_MP);
  • scene.setExportResolution(ExportResolution.SIXTEEN_MP);
  • scene.setExportResolution(ExportResolution.SIXTYFOUR_MP);
  • scene.setExportWidth(1000);
  • scene.setExportHeight(1000);

计划终止导出和导入非 PNG 和 JPG 图像格式 (2502)

从 Simcenter STAR-CCM+ 2502 开始,将不再支持导出和导入除 .png(便携式网络图像格式)和 .jpg(联合图像专家组)之外的图像格式。

宏代码将受到以下影响:

  • star.vis.Scene,公共静态最终整数成员 - 以下代码字符串标记为弃用:
    • star.vis.Scene.TIFF
    • star.vis.Scene.PNM
    • star.vis.Scene.BMP
    • star.vis.Scene.PS
  • star.vis.ImageFileFormat
    • 枚举条目 - 这些代码字符串标记为弃用,但没有计划立即移除:
      • star.vis.ImageFileFormat.TIFF
      • star.vis.ImageFileFormat.PNM
      • star.vis.ImageFileFormat.BMP
      • star.vis.ImageFileFormat.PS

      使用这些枚举条目的 Java 宏将继续编译,不会出现错误。使用 star.vis.ImageFileFormat 类型参数的方法会将任何已弃用的输入枚举值重新解释为 star.vis.ImageFileFormat.PNG。

  • 硬拷贝/图像导出 - 使用 star.vis.ImageFileFormat 枚举值的任何类方法将继续编译。
    • 其行为将发生变化,这样对 .tif、.pnm、.bmp 或 .ps 文件的请求将导致改为创建 .png 文件,并对输出文件替换为适当的文件扩展名。
    • 如果已创建的图像文件的格式和文件扩展名现已弃用,依赖于这种文件存在的自定义代码将不再起作用。
  • 图像导入:
    • star.vis.LogoAnnotation
    • star.vis.ImageAnnotation2D
    • star.vis.ImageAnnotation3D
    • star.vis.CubeEnvironmentMap
    • star.vis.SphericalEnvironmentMap
    • 对于上述类,使用图像文件名作为输入内容的方法,例如:
      • setFilePath(File f)
      • setFilePath(String s)

    行为将发生变化,导致打开 .tif、.pnm 或 .bmp 文件的请求静默地失败,而注释将改为显示文本图像文件格式不受支持。

协同仿真:终止支持 FMI 版本 1.01

对于用于协同仿真的功能实体模型单元 (FMU) 模型,Simcenter STAR-CCM+ 中不再支持功能模拟接口 (FMI) 标准 1.0.1 版本。无法导入或打开 FMI 版本 1.0.1 库。必须改用版本 2.0 或 3.0。

在宏代码中,不再支持字符串 FmiVersion.Type.V1_0_1。下面是使用此字符串宏代码的示例:

Simulation simulation_0 = getActiveSimulation();
CoSimulation coSimulation_0 = ((CoSimulation) simulation_0.get(CoSimulationManager.class).getObject("Link 1"));
coSimulation_0.getCoSimulationConditions().get(FmiVersion.class).setSelected(FmiVersion.Type.V1_0_1);

对于 FMI 2.0,FmiVersion.Type.V1_0_1 可替换为 FmiVersion.Type.V2_0,或对于 FMI 3.0,可替换为 FmiVersion.Type.V3_0。

在宏中进行版本替换后,FMU 模型还必须替换为该版本的受支持 FMU 模型。

替换为 FMI 2.0 宏后更新了宏代码

Simulation simulation_0 = getActiveSimulation();
CoSimulation coSimulation_0 = ((CoSimulation) simulation_0.get(CoSimulationManager.class).getObject("Link 1"));
coSimulation_0.getCoSimulationConditions().get(FmiVersion.class).setSelected(FmiVersion.Type.V2_0);

替换为 FMI 3.0 宏后更新了宏代码

Simulation simulation_0 = getActiveSimulation();
CoSimulation coSimulation_0 = ((CoSimulation) simulation_0.get(CoSimulationManager.class).getObject("Link 1"));
coSimulation_0.getCoSimulationConditions().get(FmiVersion.class).setSelected(FmiVersion.Type.V3_0);