宏 API 更改 12.02

Simcenter STAR-CCM+ 12.02 中,针对变形运动、欧拉多相、网格化和反应流体进行了宏 API 的更改。

变形运动:外部 STL 文件替换为零部件表面

对于边界,变形约束条件指定约束选项 STL 表面已替换为更常规的零部件表面选项。

在宏代码中,java 类选项 ConstraintSpecification.Type.SLIDE_ON_STL_SURFACE 已替换为 ConstraintSpecification.Type.SLIDE_ON_PART_SURFACE)

以下是宏代码的更改示例:

以前发行版本 Simcenter STAR-CCM+ v12.02

boundary_0.getConditions()
.get(MorpherSpecification.class)
.setSelected(MorpherSpecification.Type.CONSTRAINT);

boundary_0
.getConditions()
.get(ConstraintSpecification.class)
.setSelected(ConstraintSpecification.Type.SLIDE_ON_STL_SURFACE);

GuideSurfaceFileSettings guideSurfaceFileSettings_0 =
boundary_0
.getValues()
.get(GuideSurfaceFileSettings.class);

guideSurfaceFileSettings_0
.setFilePath("/users/iridium2/dmitry/guide_surface.stl");

// Step 1. Import STL file as a Part
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, 0}));

PartImportManager partImportManager_0 =
simulation_0
.get(PartImportManager.class);

partImportManager_0
.importStlPart(resolvePath("/users/iridium2/dmitry/guide_surface.stl"), "OneSurfacePerPatch", units_0, true, 1.0E-5);
    
Boundary boundary_0 = 
region_0
.getBoundaryManager()
.getBoundary("car-bdy");

// Step 2. Use Part surface

boundary_0.getConditions()
.get(MorpherSpecification.class)
.setSelected(MorpherSpecification.Type.CONSTRAINT);

boundary_0
.getConditions()
.get(ConstraintSpecification.class)
.setSelected(ConstraintSpecification.Type.SLIDE_ON_PART_SURFACE);

PartGuideSurfaceSettings partGuideSurfaceSettings_0 = 
boundary_0.getValues()
.get(PartGuideSurfaceSettings.class);

MeshPart meshPart_0 = 
((MeshPart) simulation_0
.get(SimulationPartManager.class)
.getPart("guide_surface"));

PartSurface partSurface_0 = 
((PartSurface) meshPart_0
.getPartSurfaceManager()
.getPartSurface("Surface"));

partGuideSurfaceSettings_0
.getGeometryObjectGroup()
.setObjects(partSurface_0);

欧拉多相:悬浮液和乳浊液流变模型更改

对于悬浮液和乳浊液流变模型,相间相互作用材料属性已重构,导致宏代码更改。 以前根据对象方法命名的对象现在为相模型类型进行命名。

下面的示例是用于乳浊液流变模型的 Krieger 和 Dougherty 相对粘度方法。

以前发行版本 Simcenter STAR-CCM+ v12.02

KriegerRelativeViscosityMethod kViscosityMethod_0 =
((KriegerRelativeViscosityMethod) phaseInteractionMaterial_0
.getMaterialProperties()
.getMaterialProperty(RelativeViscosityProperty.class)
.getMethod());

kViscosityMethod_0
.getMaximumPacking()
.setValue(maxPacking);

EmulsionRheologyModel emulsionRheologyModel_0 = 
phaseInteraction_0
.getModelManager()
.getModel(EmulsionRheologyModel.class);

emulsionRheologyModel_0
.getMaxPackingRheology()
.setValue(maxPacking);

下面的示例是用于悬浮液流变模型的 Morris 和 Boulay 相对粘度方法。

以前发行版本 Simcenter STAR-CCM+ v12.02

MorrisAndBoulayRelativeViscosityMethod morrisAndBoulayRelativeViscosityMethod_0 =
((MorrisAndBoulayRelativeViscosityMethod) phaseInteractionMaterial_0
.getMaterialProperties()
.getMaterialProperty(RelativeViscosityProperty.class)
.getMethod());

morrisAndBoulayRelativeViscosityMethod_0
.getMaximumPacking()
.setValue(maxPacking);

SuspensionRheologyModel suspensionRheologyModel_0 = 
phaseInteraction_0
.getModelManager()
.getModel(SuspensionRheologyModel.class);

suspensionRheologyModel_0
.getMaxPackingRheology()
.setValue(phimax);

网格化:布尔运算宏更改

表面修复中布尔运算的宏命令已得到增强,以允许为布尔减运算保留工具面。

仍支持在旧版 Simcenter STAR-CCM+ 中使用的布尔运算宏。 为了确保长期可靠性,建议利用最新版本的方法升级宏。

以下是宏代码的更改示例:

布尔合并运算

以前发行版本 Simcenter STAR-CCM+ v12.02
surfaceMeshWidgetIntersectOptions_0.setIntersectMode(1);
surfaceMeshWidgetIntersectOptions_0.setBooleanType(0); // Unite
surfaceMeshWidgetIntersectController_0.intersectFaces();
surfaceMeshWidgetIntersectOptions_0.setIntersectMode(1);
surfaceMeshWidgetIntersectOptions_0.setBooleanType(0);
surfaceMeshWidgetIntersectOptions_0.setKeepToolFaces(false);
surfaceMeshWidgetIntersectOptions_0.setRetainedFacesMode(0);
surfaceMeshWidgetIntersectController_0.booleanFaces(null);

布尔相交运算

以前发行版本 Simcenter STAR-CCM+ v12.02
surfaceMeshWidgetIntersectOptions_0.setIntersectMode(1);
surfaceMeshWidgetIntersectOptions_0.setBooleanType(1); // Intersect
surfaceMeshWidgetIntersectController_0.intersectFaces();
surfaceMeshWidgetIntersectOptions_0.setIntersectMode(1);
surfaceMeshWidgetIntersectOptions_0.setBooleanType(1);
surfaceMeshWidgetIntersectOptions_0.setKeepToolFaces(false);
surfaceMeshWidgetIntersectOptions_0.setRetainedFacesMode(0);
surfaceMeshWidgetIntersectController_0.booleanFaces(null);

布尔减运算

以前发行版本 Simcenter STAR-CCM+ v12.02
surfaceMeshWidgetIntersectOptions_0.setIntersectMode(1);
surfaceMeshWidgetIntersectOptions_0.setBooleanType(2); // Subtract
surfaceMeshWidgetIntersectController_0.intersectFaces();
surfaceMeshWidgetIntersectOptions_0.setIntersectMode(1);
surfaceMeshWidgetIntersectOptions_0.setBooleanType(2);
surfaceMeshWidgetIntersectOptions_0.setKeepToolFaces(false);
surfaceMeshWidgetIntersectOptions_0.setRetainedFacesMode(0);
surfaceMeshWidgetIntersectController_0.booleanFaces(null);

反应流体

重构导致更改

某些反应流体模型的对象已重构,导致宏代码更改。

以前发行版本 Simcenter STAR-CCM+ v12.02
import star.segregatedflow.*;
import star.segregatedenergy.*;
import star.combustion.*;
import star.segregatedflow.*;
import star.segregatedenergy.*;
import star.combustion.*;
import star.reactions.*;

表生成更改

为碳烟模型生成表的过程已合并到为燃烧生成表的过程。 因此从宏中移除了 ppdfSootFlameletTable 选项。 示例如下:

以前发行版本 Simcenter STAR-CCM+ v12.02
SootMomentTableModel sootMomentModel_0 = 
   physicsContinuum_0.getModelManager().getModel(SootMomentTableModel.class);
sootMomentModel_0.setThreshold(100);
PpdfSootFlameletTable ppdfSootFlameletTable_0 =
   ((PpdfSootFlameletTable) sootMomentModel_0.getPpdfSootFlameletTable());
PpdfTableAxis ppdfTableAxis_2 =
  ((PpdfTableAxis) ((PpdfTableAxisManager) ppdfSootFlameletTable_0.getPpdfTableAxisManager()).getComponent("Mixture Fraction Variance"));
ppdfTableAxis_2.setDimensionSize(1);
ppdfSootFlameletTable_0.importTable(resolveDataPath("case/sootFlameletLibrary.tbl"));
SootMomentTableModel sootMomentModel_0 = 
   physicsContinuum_0.getModelManager().getModel(SootMomentTableModel.class);
sootMomentModel_0.setThreshold(100);

12.02 中对碳灰矩模型进行了额外更改,尤其是弃用了某些模型选项,这可能会影响现有的宏。 有关详细信息,请参见 12.02 用户指南中的“恢复 11.06 碳灰矩模型”一节。

小火焰网格点数设置更改

设置小火焰网格点数的方法(如用于混合分数、混合分数偏差、热损失和过程变量)已更改,导致宏代码更改。 现在,可以将网格点数设为固定(类似于 v11.06)或自适应。 “自适应”现在是默认选项。

下面的示例适用于化学平衡燃烧模型:

以前发行版本 Simcenter STAR-CCM+ v12.02
EquilibriumTableGenerator equilibriumTableGenerator_0 =
physicsContinuum_0.get(EquilibriumTableGenerator.class);
PpdfEquilibriumTable ppdfEquilibriumTable_0 =
((PpdfEquilibriumTable) equilibriumTableGenerator_0.getPpdfEquilibriumTable());
PpdfTableAxis ppdfTableAxis_0 = ((PpdfTableAxis) ((PpdfTableAxisManager)
ppdfEquilibriumTable_0.getPpdfTableAxisManager()).getComponent("Mixture Fraction"));
ppdfTableAxis_0.setDimensionSize(61);
PpdfTableAxis ppdfTableAxis_1 =
((PpdfTableAxis) ((PpdfTableAxisManager)
ppdfEquilibriumTable_0.getPpdfTableAxisManager()).getComponent("Mixture Fraction Variance"));
ppdfTableAxis_1.setDimensionSize(31);
EquilibriumTableGenerator equilibriumTableGenerator_0 =
physicsContinuum_0.get(EquilibriumTableGenerator.class)
EquilibriumTableParameters equilibriumTableParameters_0 =
((EquilibriumTableParameters) equilibriumTableGenerator_0.getTableParameters());
EquilibriumNumericalSettings equilibriumNumericalSettings_0 =
((EquilibriumNumericalSettings)equilibriumTableParameters_0.getEquilibriumNumericalSettings());
TableAxisParameters tableAxisParameters_1 = ((TableAxisParameters)
equilibriumNumericalSettings_0.getTableAxisParametersManager().getComponent
("MixtureFraction"));
// Set number of points to adaptive based on tolerance
tableAxisParameters_0.setAdapt(true);
AdaptiveGridParameters adaptiveGridParameters_0 =
tableAxisParameters_0.getAdaptiveGridParameters();
adaptiveGridParameters_0.setMaxDimensionSize(61);
adaptiveGridParameters_0.setRangeTol(0.001);
// Set number of points to non-adaptive (fixed)
tableAxisParameters_0.setAdapt(false);
FixedGridParameters fixedGridParameters_0 =
tableAxisParameters_1.getFixedGridParameters();
fixedGridParameters_0.setDimensionSize(61);