Macro API Changes 8.02

In Simcenter STAR-CCM+ 8.02, the macro API changed for VOF, directed meshing, battery modeling, melting, plots, and vaporization.

VOF Cavitation Model

The model is now called VofCavitationSingleComponentModel (previously CavitationModel).

The method for setting seed diameter and density has changed for consistency with other models that also use seeds.

Previous Release 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);

Directed Meshing

Due to multiple changes in the API for Directed meshing, you are recommended to re-record the macros. The Patch mesh code has been refactored and macro definitions have been improved.

In the previous version of directed meshing, you were required to enter an array of points that intersects the triangle mesh on which the patch curve lies. In the current version, you just enter the starting and ending point of the patch curve, not all the intermediate intersection points.

Replace the following items in your macros:

Previous Release 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 Modeling

Macros that use the multi-module model in the batteries simulation module require updating.

Previous Release 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"));

Melting

Macros that use the melting models require updating. Add import star.multiphase to the import section of your macros, as shown below.

Previous Release 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;

Getting Plot Samples

The methods, getPlotSamples and getAllSamples, return the samples that are stored by a monitor. Changes to the code have decoupled the monitor trigger type from the data series. In previous releases, the x-values were defined by the monitor trigger. In the current release, the x-values are specified by the monitor. The caller now has to specify the monitor used to convert the returned x-values.

Previous Release 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 );

Vaporization Latent Heat

Since Simcenter STAR-CCM+ 7.06, VaporizationLatentHeat (and classes that are related to it) have moved from star.lagrangian to star.energy. Macros that refer to a particular class might fail to compile. Macros that already have both star.lagrangian.* and star.energy.* are unaffected.

Previous Release 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);