宏 API 更改 2502

在 Simcenter STAR-CCM+ 2502 中,绘图、体形状、网格化、材料属性、风扇和风机、气动声学、混合多相、DFBI、固体应力、电磁和其他后处理的宏 API 已更改。

升级所有绘图

版本 2502 中引入了全面升级的 Simcenter STAR-CCM+ 绘图架构。

原有 XY、直方图和监视器绘图仍会在先前版本的 Simcenter STAR-CCM+ 保存的模拟文件中恢复。尽管无法从版本 2502 的用户界面内创建旧样式的新绘图,但当先前版本中录制的宏在当前版本中运行时,这些宏将继续生成那些绘图。

计划终止体形状节点宏 (2510)

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

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

以前版本 Simcenter STAR-CCM+ 2502
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);

对于反应流模拟中的点火器,无法再使用体形状部件。VolumeShape.class 必须替换为 SimpleShapePart.class。

以前版本 Simcenter STAR-CCM+ 2502
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));

网格化

计划终止初始化网格功能

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

meshPipelineController_0.initializeMeshPipeline();

计划的核心网格优化器自动化

在 Simcenter STAR-CCM+ 的未来版本中,将无法再在用户界面访问核心网格优化器的设置。

在激活了运行原有核心网格优化器的情况下,在以前版本中保存的模拟文件将使用预先存在的设置恢复。

但是,访问 TetQualityThreshold 并使用 LegacyCoreOptimizer 的宏代码必须将该命令设为 true。例如:

dualAutoMesher_0.setLegacyCoreOptimizer(true);
dualAutoMesher_0.setTetQualityThreshold(0.4); //changed from 0.8
dualAutoMesher_0.setTetOptimizeCycles(1);

具有 setLegacyCoreOptimizer(false) 设置的宏将生成错误。

因此,建议将 LegacyCoreOptimizer 设为 true,或从宏中移除此步骤。

终止 RBM 相关 API

以下代码对象已从宏 API 中移除,因为它们自基于区域网格化 (RBM) 终止以来不再有效:

  • MeshPipelineController:: validateSurface(SurfaceRep rep)
  • SurfaceMeshProxy 和所有基础函数 - 可以将 SurfaceMeshProxy::combineBoundaries 的每个实例替换为 MeshManager::combineBoundaries
  • SurfaceRep::intersectSurfaceBoundaries
  • SurfaceRep::mergeOverlappingBoundaries
  • SurfaceRep::createBlockSurface
  • SurfaceRep::createCylinderSurface
  • SurfaceRep::createSphereSurface
  • SurfaceRep::flattenBoundaryPatches
  • SurfaceRep::getExtents
  • RegionManager::newRegionFromBoundaries
  • BoundaryManager::copyBoundary
  • LeakDetector - 之前替换为 PartLeakDetector

材料属性

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

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

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

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

广义非牛顿模型参数允许的标量物理量

代码中三个广义牛顿模型的以下双参数已改为标量物理量,因此可以使参数与标量相关,例如温度。通过这种更改,可使用场函数设置广义幂律的一致性因子和幂律指数。

受影响的模型及其各自参数为:

  • 广义幂次定律
    • 一致性因子
    • 幂律指数
  • 广义 Cross 流体
    • Cross 速率常数
  • 广义 Carreau-Yasuda 流体
    • 幂律常数
    • a 参数

宏更改如下:

广义幂次定律

函数 setConsistencyFactor() 已弃用,但仍存在以用于向后兼容性。

函数 getConsistencyFactor() 现在返回 ScalarPhysicalQuantity 而不是双精度值。

因此,现在它的用途已更改,从:

double constFactor = nonNewtonianGeneralizedPowerLaw.getConsistencyFactor();

更改为:

double constFactor = nonNewtonianGeneralizedPowerLaw.getConsistencyFactor().getValue();

引入了一个新函数 getConsistencyFactorInput():

public ScalarPhysicalQuantityInput getConsistencyFactorInput();

引入了一个新函数 setConsistencyFactorInput():

public void setConsistencyFactorInput(ScalarPhysicalQuantityInput v);

函数 getPowerLawExponent() 现在返回 ScalarPhysicalQuantity 而不是双精度值。因此,它的用途已更改,从:

double powerLawExp = nonNewtonianGeneralizedPowerLaw0.getPowerLawExponent();

更改为:

double powerLawExp = nonNewtonianGeneralizedPowerLaw0.getPowerLawExponent().getValue();

引入了一个新函数 getPowerLawExponentInput():

public ScalarPhysicalQuantityInput getPowerLawExponentInput();

引入了一个新函数 setPowerLawExponentInput():

public void setPowerLawExponentInput(ScalarPhysicalQuantityInput v)

广义 Cross 流体

函数 setCrossRateConstant() 已弃用,但仍存在以用于向后兼容性。

函数 getCrossRateConstant() 现在返回 ScalarPhysicalQuantity 而不是双精度值。因此,它的用途已更改,从:

double n = nonNewtonianCrossLaw.getCrossRateConstant();

更改为:

double n = nonNewtonianCrossLaw.getCrossRateConstant().getValue();

引入了一个新函数 getCrossRateConstantInput():

public ScalarPhysicalQuantityInput getCrossRateConstantInput();

引入了一个新函数 setCrossRateConstantInput():

public void setCrossRateConstantInput(ScalarPhysicalQuantityInput v);

广义 Carreau-Yasuda 流体

函数 setPowerConstant() 已弃用,但仍存在以用于向后兼容性。

函数 getPowerConstant() 现在返回 ScalarPhysicalQuantity 而不是双精度值。

public ScalarPhysicalQuantity getPowerConstant();

因此,它的用途已更改,从:

double n = nonNewtonianCYLaw.getPowerConstant();

更改为:

double n = nonNewtonianCYLaw.getPowerConstant().getValue();

添加了一个新函数 getPowerConstantInput():

public ScalarPhysicalQuantityInput getPowerConstantInput();

添加了一个新函数 setPowerConstantInput():

public void setPowerConstantInput(ScalarPhysicalQuantityInput v);

函数 setAParameter() 已弃用,但仍存在以用于向后兼容性。

getAParameter() 现在返回 ScalarPhysicalQuantity 而不是双精度值。

public ScalarPhysicalQuantity getAParameter();

添加了一个新函数 getAParameterInput():

public ScalarPhysicalQuantityInput getAParameterInput();

添加了一个新函数 setAParameterInput():

public void setAParameterInput(ScalarPhysicalQuantityInput v);

添加到广义牛顿模型的屈服应力

Herschel-Bulkley 模型(广义幂律)的两个参数,即屈服应力阈值和屈服粘度,已引入其他两个广义牛顿模型中:广义 Cross 流体和广义 Carreau-Yasuda 流体。因此,参数已从幂律中移出,并进入公共基类。而且,这些参数已更改为标量物理量。此修改导致了一些宏更改:

NonNewtonianGeneralizedCrossMethod 和 NonNewtonianGeneralizedCarreauYasudaMethod 的可用新功能:

  • public ScalarPhysicalQuantity getYieldStressThreshold();
  • public ScalarPhysicalQuantityInput getYieldStressThresholdInput();
  • public void setYieldStressThresholdInput(ScalarPhysicalQuantityInput v);
  • public ScalarPhysicalQuantity getYieldingViscosity();
  • public ScalarPhysicalQuantityInput getYieldingViscosityInput();
  • public void setYieldingViscosityInput(ScalarPhysicalQuantityInput v);

拟合工具现在可用于非牛顿流体

为了创建轻型模块以包含拟合流变数据所需的部件而无需有限元法的所有重型物理特性,viscous 计算流变学模块中使用的材料拟合工具已共享,并且公共部件已移至名为 complexfluids 的新共享模块中。

宏更改仅涉及将文件从 viscous 移至 complexfluids,因此它们只影响导入文件头。

  • ConstitutiveModeProperty(八个类,ConstitutiveModeProperty1 到 ConstitutiveModeProperty8)- 例如:

    import star.viscous.ConstitutiveModeProperty1; 已替换为 import star.complexfluids.ConstitutiveModeProperty1;

  • InputTableManager

    import star.viscous.InputTableManager; 已替换为 import star.complexfluids.InputTableManager;

  • InputTableRateSpecification

    import star.viscous.InputTableRateSpecification; 已替换为 import star.complexfluids.InputTableRateSpecification;

  • InputTableTemperatureSpecification

    import star.viscous.InputTableTemperatureSpecification; 已替换为 import star.complexfluids.InputTableTemperatureSpecification;

  • InputTableType

    import star.viscous.InputTableType; 已替换为 import star.complexfluids.InputTableType;

风扇和风机:指定方法的更改

风扇曲线(表或多项式)具有指定方法的输入内容。有四个选项:“局部速度”、“质量平均速度”、“体积流率”和“质量流率”。第二个选项(质量平均速度)已重命名为“平均速度”。更新宏如以下示例所示。

以前版本 Simcenter STAR-CCM+ 2502
BoundaryInterface boundaryInterface_0 = 
      ((BoundaryInterface) simulation_0.getInterfaceManager().getInterface("Block/Block 2"));
FanCurveTable fanCurveTable_0 = 
      boundaryInterface_0.getValues().get(FanCurveTable.class);
FanCurveTableLeaf fanCurveTableLeaf_0 = 
      fanCurveTable_0.getModelPartValue();
fanCurveTableLeaf_0.getFanCurveMethodOption().setSelected(FanCurveMethodOption.Type.MASS_AVERAGE_VELOCITY);
BoundaryInterface boundaryInterface_0 = 
      ((BoundaryInterface) simulation_0.getInterfaceManager().getInterface("Block/Block 2"));
FanCurveTable fanCurveTable_0 = 
      boundaryInterface_0.getValues().get(FanCurveTable.class);
FanCurveTableLeaf fanCurveTableLeaf_0 = 
      fanCurveTable_0.getModelPartValue();
fanCurveTableLeaf_0.getFanCurveMethodOption().setSelected(FanCurveMethodOption.Type.AVERAGE_VELOCITY);

气动声学:海绵层模型的更改

海绵层模型已扩展为与其他状态方程模型兼容,可用于更广泛的情况。当声速法设为“理想气体(密度和参考压力)”或“理想气体(参考温度)”时,此改进导致了宏代码的更改。

以前版本 Simcenter STAR-CCM+ 2502
import java.util.*;
import star.common.*;
import star.material.*;
import star.acoustics.*;
import star.flow.*;
import java.util.*;
import star.common.*;
import star.material.*;
import star.flow.*;
import star.energy.*;

混合多相:液膜-LMP 相互作用的更改

吸收模型已扩展,可模拟附壁颗粒包与液膜之间的相互作用。因此,它已重命名为 WallBoundFilmTransitionModel 并有两个选项:“吸收”和“等效厚度”。此项改进导致宏代码更改。

以前版本 Simcenter STAR-CCM+ 2502
Simulation simulation_0 = 
  getActiveSimulation();
PhysicsContinuum physicsContinuum_0 = 
  ((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1"));
MultiPhaseInteractionModel multiPhaseInteractionModel_0 = 
  physicsContinuum_0.getModelManager().getModel(MultiPhaseInteractionModel.class);
PhaseInteraction phaseInteraction_0 = 
  ((PhaseInteraction) multiPhaseInteractionModel_0.getPhaseInteractionManager().getPhaseInteraction("Phase Interaction 1"));
phaseInteraction_0.enable(FilmAbsorptionModel.class);
Simulation simulation_0 = 
  getActiveSimulation();
PhysicsContinuum physicsContinuum_0 = 
  ((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1"));
MultiPhaseInteractionModel multiPhaseInteractionModel_0 = 
  physicsContinuum_0.getModelManager().getModel(MultiPhaseInteractionModel.class);
PhaseInteraction phaseInteraction_0 = 
  ((PhaseInteraction) multiPhaseInteractionModel_0.getPhaseInteractionManager().getPhaseInteraction("Phase Interaction 1"));
phaseInteraction_0.enable(WallBoundFilmTransitionModel.class);
WallBoundFilmTransitionModel wallBoundFilmTransitionModel_2 = 
  phaseInteraction_0.getModelManager().getModel(WallBoundFilmTransitionModel.class);
wallBoundFilmTransitionModel_2.getTransitionOption().setSelected(WallBoundDropletTransitionOption.Type.ABSORPTION);

DFBI:体属性的更改

6 自由度体的以下属性已移至名为体属性的新体子节点:

  • 质量
  • 释放时间
  • 缓冲时间

这种重构导致宏代码发生更改。要更新宏,更改下表所示的以下字符串实例:

以前版本 Simcenter STAR-CCM+ 2502
body.getBodyMass().setValue(1.); body.getBodyProperties().getMass().setValue(1.);
body.getReleaseTime().setValue(1.); body.getBodyProperties().getReleaseTime().setValue(1.);
body.getRampTime().setValue(1.); body.getBodyProperties().getRampTime().setValue(1.);

固体应力:FSI 函数的更改

为了保持一致性,FSI 牵引和映射 FSI 牵引函数的类名称已更改,从而导致宏代码发生更改。

以下示例对 FsiTraction 和 MappedFsiTraction 均适用。

以前版本 Simcenter STAR-CCM+ 2502
PrimitiveFieldFunction tractionFF = ((PrimitiveFieldFunction) sim.getFieldFunctionManager().getFunction("Mapped Fsi Traction"));
userFieldFunction_0.setDefinition("dot($${Mapped Fsi Traction}, $${Normal})");
PrimitiveFieldFunction tractionFF = ((PrimitiveFieldFunction) sim.getFieldFunctionManager().getFunction("MappedFsiTraction"));
userFieldFunction_0.setDefinition("dot($${MappedFsiTraction}, $${Normal})");

电磁:材料属性法的更改

导电率、磁导率和介电常数方法已重构以保持一致性,从而导致宏代码发生更改。

以前版本 Simcenter STAR-CCM+ 2502
Simulation sim = ...
PrimitiveFieldFunction permeabilityFF = ((PrimitiveFieldFunction) sim.getFieldFunctionManager().getFunction("Permeability (Symmetric Tensor)"));
PrimitiveFieldFunction conductivityFF = ((PrimitiveFieldFunction) sim.getFieldFunctionManager().getFunction("ElectricalConductivity (Symmetric Tensor)"));
PrimitiveFieldFunction permittivityFF = ((PrimitiveFieldFunction) sim.getFieldFunctionManager().getFunction("Permittivity (Symmetric Tensor)"));
Simulation sim = ...
PrimitiveFieldFunction permeabilityFF = ((PrimitiveFieldFunction) sim.getFieldFunctionManager().getFunction("Permeability Tensor"));
PrimitiveFieldFunction conductivityFF = ((PrimitiveFieldFunction) sim.getFieldFunctionManager().getFunction("Electrical Conductivity Tensor"));
PrimitiveFieldFunction permittivityFF = ((PrimitiveFieldFunction) sim.getFieldFunctionManager().getFunction("Permittivity Tensor"));

后处理

终止导出和导入非 PNG 和 JPG 图像格式

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

宏代码将受到以下影响:

  • star.vis.Scene, public static final Integer member - 这些代码字符串已标记为弃用:
    • 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 文件的请求静默地失败,而注释将改为显示文本图像文件格式不受支持。

场景和显示器的更改

由于重构,场景和显示器的宏代码已更改。虽然预计现有宏将继续起作用,但为实现最大可靠性,建议根据以下内容更新宏代码:

  • 场景
    • Scene 具有新的超类 (SceneBase),它接管了它的一些方法。
    • Displayer 具有新的超类 (DisplayerBase),它接管了它的一些方法。
  • SceneManager
    • SceneManager 现在是 GroupableSimulationObjectManager<SceneBase>,因此 get/hasObject(s)() 返回 SceneBase 的实例而不是场景的实例。可以将其强制转换为场景,并像以前一样通过此代码继续使用它:
      SceneBase scenebase_0 = simulation_0.getSceneManager.getObject("Scene Name");
      if (scenebase_0 instanceof Scene scene_0) {
          // ... use scene_0
      }

      在不久的将来,将引入 SceneBase 的新子类。如果宏使用 getObjects() 在 SceneManager 中的所有场景中循环,则现在可能必须确保仅处理场景类型的对象,并准备好 SceneManager 中并非所有对象都是该类型。getScenes() 方法将继续仅返回与场景类型匹配的对象。

  • DisplayerManager
    • DisplayerManager 现在是 ClientServerObjectManager<DisplayerBase>,因此 get/hasObject(s)() 现在返回 DisplayerBase 的实例而不是显示器的实例。可以像以前一样继续将其强制转换为预期的特定显示器类型:
      ScalarDisplayer scalarDisplayer_0 = (ScalarDisplayer) scene_0.getDisplayerManager.getObject("Displayer Name");
      if (scalarDisplayer_0 != null) {
          // ... use scalarDisplayer_0
      }
    • DisplayerManager 具有新方法 getDisplayers(),为方便起见,该方法会返回显示器类型对象的列表。在不久的将来,将引入一种新型场景,它将具有 DisplayerManager 来管理不同类型的对象。
    • DisplayerManager.getScene() 现在返回 SceneBase 的实例。如果需要场景类型对象,则需要对它进行强制转换,首选使用 instanceof 检查:
      SceneBase scenebase_0 = displayerManager_0.getScene();
      if (scenebase_0 instanceof Scene scene_0) {
          // ... use scene_0
      }

多相:计划移除显式多步求解器 (2506)

显式多步求解器从 Simcenter STAR-CCM+ 2402 开始弃用,并计划从版本 2506 中移除,从而导致对版本 2506 及之后版本的宏代码进行更改。

注这些宏更改仅从 Simcenter STAR-CCM+ 2506 开始生效,但现在提供是为了您需要做准备。

移除显式多步求解器 - 对 VOF 的影响

在本例中,将“显式多步”切换为“动态隐式多步”。

以前版本 Simcenter STAR-CCM+ 2506
SegregatedVofSolver segregatedVofSolver_0 = ((SegregatedVofSolver) simulation_0.getSolverManager().getSolver(SegregatedVofSolver.class));
segregatedVofSolver_0.setSolverTypeOption(SolverTypeOption.EXPLICIT_MULTI_STEP);
SegregatedVofSolver segregatedVofSolver_0 = ((SegregatedVofSolver) simulation_0.getSolverManager().getSolver(SegregatedVofSolver.class));
segregatedVofSolver_0.setSubStepSpecification(VolumeFractionSolverSubStepSpecificationOption.DYNAMIC);

移除 SegregatedVolumeFractionSingleStepSolver/SegregatedVolumeFractionImplicitMultiStepSolver 子求解器的子求解器设计,并将属性迁移到相应的 SegregatedVofSolver/SegregatedMmpSolver - VOF 和 MMP

在这个采用 VOF 的示例中,为分离 VOF 单步求解器调整了 AMG 容差。

以前版本 Simcenter STAR-CCM+ 2506
SegregatedVofSolver segregatedVofSolver_0 = ((SegregatedVofSolver) sim.getSolverManager().getSolver(SegregatedVofSolver.class));
SegregatedVolumeFractionSingleStepSolver segregatedVolumeFractionSingleStepSolver_0 = ((SegregatedVolumeFractionSingleStepSolver) segregatedVofSolver_0.getSubSolverManager().getSolver(SegregatedVolumeFractionSingleStepSolver.class));
AMGLinearSolver aMGLinearSolver_1 = segregatedVolumeFractionSingleStepSolver_0.getAMGLinearSolver();
aMGLinearSolver_1.setConvergeTol(1.0E-6);
SegregatedVofSolver segregatedVofSolver_0 = ((SegregatedVofSolver) sim.getSolverManager().getSolver(SegregatedVofSolver.class));
AMGLinearSolver aMGLinearSolver_1 = segregatedVofSolver_0.getAMGLinearSolver();
aMGLinearSolver_1.setConvergeTol(1.0E-6);

在这个采用 VOF 的示例中,“单步”设置切换为使用“隐式多步”及四个子步。

以前版本 Simcenter STAR-CCM+ 2506
SegregatedVofSolver segregatedVofSolver_0 = ((SegregatedVofSolver) getActiveSimulation().getSolverManager().getSolver(SegregatedVofSolver.class));
segregatedVofSolver_0.setSolverTypeOption(SolverTypeOption.IMPLICIT_MULTI_STEP);
SegregatedVolumeFractionImplicitMultiStepSolver segregatedVolumeFractionImplicitMultiStepSolver_0                = ((SegregatedVolumeFractionImplicitMultiStepSolver) segregatedVofSolver_0.getSubSolverManager().getSolver(SegregatedVolumeFractionImplicitMultiStepSolver.class));
segregatedVolumeFractionImplicitMultiStepSolver_0.setSubStepCount(4);
SegregatedVofSolver segregatedVofSolver_0 = ((SegregatedVofSolver) getActiveSimulation().getSolverManager().getSolver(SegregatedVofSolver.class));
segregatedVofSolver_0.setSubStepCount(4);

在此 VOF 示例中,激活“隐式多步”及“动态子步指定”,并设置“目标子步 CFL”属性。

以前版本 Simcenter STAR-CCM+ 2506
SegregatedVofSolver segregatedVofSolver_0 = ((SegregatedVofSolver) simulation_0.getSolverManager().getSolver(SegregatedVofSolver.class));
segregatedVofSolver_0.setSolverTypeOption(SolverTypeOption.IMPLICIT_MULTI_STEP);

SegregatedVolumeFractionImplicitMultiStepSolver segregatedVolumeFractionImplicitMultiStepSolver_0 = ((SegregatedVolumeFractionImplicitMultiStepSolver) segregatedVofSolver_0.getSubSolverManager().getSolver(SegregatedVolumeFractionImplicitMultiStepSolver.class));
segregatedVolumeFractionImplicitMultiStepSolver_0.setSubStepSpecification(VolumeFractionSolverSubStepSpecificationOption.DYNAMIC);
segregatedVolumeFractionImplicitMultiStepSolver_0.getTargetCfl().setValue(0.1);
SegregatedVofSolver segregatedVofSolver_0 = ((SegregatedVofSolver) simulation_0.getSolverManager().getSolver(SegregatedVofSolver.class));
segregatedVofSolver_0.setSubStepSpecification(VolumeFractionSolverSubStepSpecificationOption.DYNAMIC);
segregatedVofSolver_0.getTargetCfl().setValue(0.1);

在此 MMP 示例中,激活物理连续体中的混合多相 (MMP) 模型。

以前版本 Simcenter STAR-CCM+ 2506
physicsContinuum.enable(SegregatedNPhaseMixtureModel.class);
physicsContinuum.enable(SegregatedMmpModel.class);

在此 MMP 示例中,更改分离 MMP 求解器中的 URF。

以前版本 Simcenter STAR-CCM+ 2506
SegregatedNPhaseMixtureSolver segregatedNPhaseMixtureSolver_0 = ((SegregatedNPhaseMixtureSolver) simulation_0.getSolverManager().getSolver(SegregatedNPhaseMixtureSolver.class));
SegregatedVolumeFractionSingleStepSolver segregatedVolumeFractionSingleStepSolver_0 = ((SegregatedVolumeFractionSingleStepSolver) segregatedNPhaseMixtureSolver_0.getSubSolverManager().getSolver(SegregatedVolumeFractionSingleStepSolver.class));
segregatedVolumeFractionSingleStepSolver_0.setUrf(0.5);
SegregatedMmpSolver segregatedMmpSolver_0 = ((SegregatedMmpSolver) simulation_0.getSolverManager().getSolver(SegregatedMmpSolver.class));
segregatedMmpSolver_0.setUrf(0.5);

将 Piso 特定 UpdateFrequencyOption 重命名为 PisoUpdateFrequencyOption - VOF 和液膜

在这个采用液膜的示例中,“更新频率”改为“每个修正器”(之前称为“每次迭代”)。

以前版本 Simcenter STAR-CCM+ 2506
SegregatedFluidFilmMultiphaseSolver segregatedFluidFilmMultiphaseSolver_0 = ((SegregatedFluidFilmMultiphaseSolver) simulation_0.getSolverManager().getSolver(SegregatedFluidFilmMultiphaseSolver.class));
segregatedFluidFilmMultiphaseSolver_0.getUpdateFrequencyOption().setSelected(UpdateFrequencyOption.Type.EVERY_ITERATION);
SegregatedFluidFilmMultiphaseSolver segregatedFluidFilmMultiphaseSolver_0 = ((SegregatedFluidFilmMultiphaseSolver) simulation_0.getSolverManager().getSolver(SegregatedFluidFilmMultiphaseSolver.class));
segregatedFluidFilmMultiphaseSolver_0.getPisoUpdateFrequencyOption().setSelected(PisoUpdateFrequencyOption.Type.EVERY_CORRECTOR);

激活(整数)表达式作为“子步数”和“最大子步数”属性的输入内容 - VOF + MMP

在这个 VOF 新功能的示例中,使用“固定”子步步进,且“子步数”= 1 + ${TimeLevel}/2。

SegregatedVofSolver segregatedVofSolver_0 = ((SegregatedVofSolver) simulation_0.getSolverManager().getSolver(SegregatedVofSolver.class));
segregatedVofSolver_0.setSubStepSpecification(VolumeFractionSolverSubStepSpecificationOption.FIXED);

IntegerValue integerValue_0 = segregatedVofSolver_0.getFixedSubStepCount();
integerValue_0.getQuantity().setDefinition("1 + ${TimeLevel}/2");

在这个 VOF 新功能的示例中,使用“动态”子步步进,且“最大子步数”= 5*${TimeLevel}。

SegregatedVofSolver segregatedVofSolver_0 = ((SegregatedVofSolver) simulation_0.getSolverManager().getSolver(SegregatedVofSolver.class));
segregatedVofSolver_0.setSubStepSpecification(VolumeFractionSolverSubStepSpecificationOption.DYNAMIC);

IntegerValue integerValue_0 = segregatedVofSolver_0.getMaxDynamicSubStepCount();
integerValue_0.getQuantity().setDefinition("5*${TimeLevel}");