宏 API 更改 8.02

Simcenter STAR-CCM+ 8.02 中,针对 VOF、定向网格化、电池建模、融化、绘图和汽化进行了宏 API 的更改。

VOF 空化模型

该模型现在称为 VofCavitationSingleComponentModel(以前称为 CavitationModel)。

设置种子直径和密度的方法已更改,以便与同样使用种子的其他模型保持一致。

以前发行版本 Simcenter STAR-CCM+ 8.02

Simulation simulation = getActiveSimulation();

PhysicsContinuum physicsContinuum = 

  ((PhysicsContinuum) simulation.getContinuumManager().getContinuum("Physics 1"));

Simulation simulation = getActiveSimulation();

PhysicsContinuum physicsContinuum = 

  ((PhysicsContinuum) simulation.getContinuumManager().getContinuum("Physics 1"));

MultiPhaseInteractionModel multiPhaseInteractionModel =  physicsContinuum.getModelManager().getModel(MultiPhaseInteractionModel.class);

PhaseInteraction phaseInteraction =  ((PhaseInteraction) multiPhaseInteractionModel.getPhaseInteractionManager().getPhaseInteraction("Phase Interaction 1"));

phaseInteraction.enable(CavitationModel.class);

MultiPhaseInteractionModel multiPhaseInteractionModel =  physicsContinuum.getModelManager().getModel(MultiPhaseInteractionModel.class);

PhaseInteraction phaseInteraction =  ((PhaseInteraction) multiPhaseInteractionModel.getPhaseInteractionManager().getPhaseInteraction("Phase Interaction 1"));

phaseInteraction.enable(VofCavitationSingleComponentModel.class);

CavitationModel cavitationModel =  phaseInteraction.getModelManager().getModel(CavitationModel.class);

ConstantInteractionCoefficientMethod constantInteractionCoefficientMethod_0 =  cavitationModel.getCavitationSeedDensity().getMethod(ConstantInteractionCoefficientMethod.class);

constantInteractionCoefficientMethod_0.getQuantity().setValue(1.0E13);

ConstantInteractionCoefficientMethod constantInteractionCoefficientMethod_1 =  cavitationModel.getCavitationSeedDiameter().getMethod(ConstantInteractionCoefficientMethod.class);

constantInteractionCoefficientMethod_1.getQuantity().setValue(1.0E-5);

PhaseInteractionMaterialModel phaseInteractionMaterialModel_0 =  phaseInteraction.getModelManager().getModel(PhaseInteractionMaterialModel.class);

PhaseInteractionMaterial phaseInteractionMaterial_0 =  ((PhaseInteractionMaterial) phaseInteractionMaterialModel_0.getMaterial());

ConstantMaterialPropertyMethod constantMaterialPropertyMethod_0 =  ((ConstantMaterialPropertyMethod) phaseInteractionMaterial_0.getMaterialProperties().getMaterialProperty(VofSeedDensityProperty.class).getMethod());

constantMaterialPropertyMethod_0.getQuantity().setValue(1.0E13);

ConstantMaterialPropertyMethod constantMaterialPropertyMethod_1 =  ((ConstantMaterialPropertyMethod) phaseInteractionMaterial_0.getMaterialProperties().getMaterialProperty(VofSeedDiameterProperty.class).getMethod());

constantMaterialPropertyMethod_1.getQuantity().setValue(1.0E-5);

定向网格化

由于定向网格化的 API 中有多项更改,建议重新录制宏。 块网格代码已重构,宏定义已改进。

在以前版本的定向网格化中,需要输入一组与块曲线所在的三角形网格相交的点。 在当前版本中,只需输入块曲线的起点和终点,无需输入所有中间的交点。

替换宏中的以下项:

以前发行版本 Simcenter STAR-CCM+ 8.02

PatchCurve patchCurve_1 = 

((PatchCurve) directedPatchSourceMesh_0.getPatchCurveManager().getObject("PatchCurve 17"));

    directedPatchSourceMesh_0.splitPatchCurveAtPickedPointMacro(patchCurve_1, new DoubleVector(new double[] {-0.0029531574676181487, 0.04985268359976114, 0.025}), new IntVector(new int[] {0, 36, 2, 3, 2}));

PatchCurve patchCurve_1 = 

((PatchCurve) directedPatchSourceMesh_0.getPatchCurveManager().getObject("PatchCurve 17"));

    directedPatchSourceMesh_0.splitPatchCurve(patchCurve_1, new DoubleVector(new double[] {-0.0025257023394583402, 0.049875541256511474, 0.02500000037252903}));

PatchVertex patchVertex_1 = 

((PatchVertex) directedPatchSourceMesh_0.getPatchVertexManager().getObject("PatchVertex 18"));

    directedPatchSourceMesh_0.createPatchCurveMacro(new DoubleVector(new double[] {-0.009581887163221836, 0.03874162957072258, 0.02500000037252903, -0.007917706854641438, 0.0392085425555706, 0.02500000037252903}), new IntVector(new int[] {0, 0}), new IntVector(new int[] {30, 27}), new IntVector(new int[] {2, 1}), new IntVector(new int[] {0, 346}), new IntVector(new int[] {}), patchVertex_1, patchVertex_0, 2, 0, new BooleanVector(new boolean[] {false, true}));

PatchVertex patchVertex_1 = 

      ((PatchVertex) directedPatchSourceMesh_0.getPatchVertexManager().getObject("PatchVertex 19"));

    directedPatchSourceMesh_0.createPatchCurve(patchVertex_0, patchVertex_1, new DoubleVector(new double[] {}), new StringVector(new String[] {}));

    directedPatchSourceMesh_0.initializePatchCurveCreation();

currentView_1.setInput(new DoubleVector(new double[] {-0.001121880186180152, 0.037023192911687784, 0.024997045777624932}), new DoubleVector(new double[] {-0.001121880186180152, 0.037023192911687784, 0.09296125688392529}), new DoubleVector(new double[] {0.0, 1.0, 0.0}), 0.013750805976838906, 1);

currentView_1.setInput(new DoubleVector(new double[] {-0.001121880186180152, 0.037023192911687784, 0.024997045777624932}), new DoubleVector(new double[] {-0.001121880186180152, 0.037023192911687784, 0.09296125688392529}), new DoubleVector(new double[] {0.0, 1.0, 0.0}), 0.013750805976838906, 1);

directedPatchSourceMesh_0.DefineMeshMultiplePatchCurvesMacro(new IntVector(new int[] {20, 8, 35, 37, 7, 22, 14, 33, 34, 36, 38, 18}), 14, false);

directedPatchSourceMesh_0.defineMeshMultiplePatchCurves(new NeoObjectVector(new Object[] {patchCurve_16, patchCurve_17, patchCurve_18, patchCurve_19, patchCurve_20, patchCurve_21, patchCurve_22, patchCurve_23, patchCurve_24, patchCurve_25, patchCurve_26, patchCurve_27}), 14, false);

directedPatchSourceMesh_0.DefineMeshPatchCurveMacro(6, patchCurve_6.getStretchingFunction(), 0.1, 0.1, 5, false, false);

directedPatchSourceMesh_0.defineMeshPatchCurve(patchCurve_6, patchCurve_6.getStretchingFunction(), 0.1, 0.1, 5, false, false);

directedPatchSourceMesh_0.splitPatchCurveAtConstructionPointMacro(patchVertex_1, patchCurve_13);

directedPatchSourceMesh_0.splitPatchCurve(patchVertex_1, patchCurve_13);

directedPatchSourceMesh_0.createPatchCurveVertexModificationMacro(patchVertex_0, new DoubleVector(new double[] {-0.06413809210062027, -0.0012215570313856006, 0.5}), new DoubleVector(new double[] {0.004088500048965216, ..., 0.5}), new IntVector(new int[] {0, 36}), new DoubleVector(new double[] {}), new IntVector(new int[] {0, 0}), new NeoObjectVector(new Object[] {patchVertex_1, patchVertex_0, patchVertex_0, patchVertex_2}), new IntVector(new int[] {2, 2}), new NeoObjectVector(new Object[] {patchCurve_0, patchCurve_1}), new IntVector(new int[] {2, 2}), null);

directedPatchSourceMesh_0.movePatchVertex(patchVertex_0, new DoubleVector(new double[] {-0.06413809210062027, -0.0012215570313856006, 0.5}), "ON_SURFACE");

directedPatchSourceMesh_0.DefineMeshMultiplePatchCurvesMacro(new IntVector(new int[] {2, 6, 7, 10}), 20, false);

directedPatchSourceMesh_0.defineMeshMultiplePatchCurves(new NeoObjectVector(new Object[] {patchCurve_0, patchCurve_1, patchCurve_2}), 20, false);

电池建模

使用 Battery Simulation Module 中的多模块模型的宏需要更新。

以前发行版本 Simcenter STAR-CCM+ 8.02

SolidModelPart solidModelPart_0 = 

((SolidModelPart) simulation_0.get(SimulationPartManager.class).getPart("Battery Module: Battery Module Cell 0,0: +Ve Tab Root"));

CadPart solidModelPart_0 = 

((CadPart) simulation_0.get(SimulationPartManager.class).getPart("Battery Module: Battery Module Cell 0,0: +Ve Tab Root"));

融化

使用融化模型的宏需要更新。 将 import star.multiphase 添加到宏的导入部分,如下所示。

以前发行版本 Simcenter STAR-CCM+ 8.02

package base.multiphaseFlow;

import java.io.File;

import java.util.*;

import star.base.neo.*;

import star.base.report.*;

import star.common.*;

import star.energy.*;

import star.segregatedenergy.*;

import star.flow.*;

import star.keturb.*;

import star.material.*;

import star.metrics.*;

import star.turbulence.*;

import star.vis.*;

import star.vof.*;

import star.common.StarMacro;

package base.multiphaseFlow;

import java.io.File;

import java.util.*;

import star.base.neo.*;

import star.base.report.*;

import star.common.*;

import star.energy.*;

import star.segregatedenergy.*;

import star.flow.*;

import star.keturb.*;

import star.material.*;

import star.metrics.*;

import star.turbulence.*;

import star.vis.*;

import star.vof.*;

import star.multiphase.*;

import star.common.StarMacro;

获取绘图样本

getPlotSamplesgetAllSamples 方法返回监视器所存储的样本。 代码的更改已经从数据系列解耦监视器触发类型。 在以前的版本中,x 值由监视器触发定义。 在当前版本中,x 值由监视器指定。 调用程序现在必须指定用于转换返回的 x 值的监视器。

以前发行版本 Simcenter STAR-CCM+ 8.02

// NOTE: The returned xvalues
 used to be // defined by the monitor trigger.

<plotableMonitor>.setTrigger( MonitorTriggerOption.ITER

ATION );

MonitorData allIterations =

<plotableMonitor>.getAllSamples();

MonitorData plotIterations =

<plotableMonitor>.getPlotSamples();

// NOTE: The data previously is cleared

// for a monitor when the triggers are

// changed. This is NO LONGER true.

<plotableMonitor>.setTrigger( MonitorTriggerOption.TIME

STEP );

MonitorData allTime =

<plotableMonitor>.getAllSamples();

MonitorData plotTime =

<plotableMonitor>.getPlotSamples();

// NOTE: The returned xvalues
 are now

// specified by the specified monitor.

MonitorData allIterations =

<plotableMonitor>.getAllSamples( <monitorManager>.getIterationMonit

or() );

MonitorData plotIterations =

<plotableMonitor>.getPlotSamples( <monitorManager>.getIterationMoni

tor() );

// NOTE: The trigger does not need to be

// changed, just the specified monitor.

MonitorData allTime =

<plotableMonitor>.getAllSamples( <monitorManager>.getPhysicalTimeMo

nitor() );

MonitorData plotTime =

<plotableMonitor>.getPlotSamples( <monitorManager>.getPhysicalTimeM

onitor() );

// NOTE: This supports a general

// monitorvsmonitor
 data requests.

PlotableMonitor xMonitor =

<monitorManager>.getMonitor(“Monitor 2”);

MonitorData allOtherX =

<plotableMonitor>.getAllSamples( xMonitor );

MonitorData plotOtherX =

<plotableMonitor>.getPlotSamples( xMonitor );

汽化潜热

Simcenter STAR-CCM+ 7.06 起,VaporizationLatentHeat(以及与其相关的类)已从 star.lagrangian 移至 star.energy。 引用特定类的宏可能无法编译。 同时具有 star.lagrangian.*star.energy.* 的宏不受影响。

以前发行版本 Simcenter STAR-CCM+ 8.02

ConstantMaterialPropertyMethod constantMaterialPropertyMethod_0 = 

((ConstantMaterialPropertyMethod) singleComponentDropletMaterial_0.getMaterialProperties().getMaterialProperty(star.lagrangian.VaporizationLatentHeatProperty.class).getMethod());

ConstantMaterialPropertyMethod constantMaterialPropertyMethod_0 = 

((ConstantMaterialPropertyMethod) singleComponentDropletMaterial_0.getMaterialProperties().getMaterialProperty(star.energy.VaporizationLatentHeatProperty.class).getMethod());

singleComponentDropletMaterial_1.getMaterialProperties().getMaterialProperty(star.lagrangian.VaporizationLatentHeatProperty.class).setMethod(star.lagrangian.ClausiusClapeyronLatentHeatMethod.class);

singleComponentDropletMaterial_1.getMaterialProperties().getMaterialProperty(star.energy.VaporizationLatentHeatProperty.class).setMethod(star.energy.ClausiusClapeyronLatentHeatMethod.class);