Macro API Changes 8.06

In Simcenter STAR-CCM+ 8.06, the macro API changed for dataset functions, the Turbulent Dispersion model, part contacts, planar motion, the Granular Temperature model, the Solid Stress model, and mesh operations.

Surface Time-History Dataset Functions

The TimeHistoryImportedModelDerivedData class has been renamed to ProbeTimeHistoryImportedModelDerivedData.

Previous Release Simcenter STAR-CCM+ v8.06

public void testhL(){

double[] verificationValue = {17762, 1156700};

TimeHistoryImportedModelDerivedData  h_l1 = (TimeHistoryImportedModelDerivedData)        getSimulation().get(DerivedDataManager.class).hasObject("h_l1");

DerivedDataView3D derivedDataView3D = h_l1.getDerivedDataView3D();

SingleSliderValue singleSliderValue = derivedDataView3D.getSliderVal();

singleSliderValue.setValue(0.5);

double[] range = createScalarScene(h_l1);

setMessage(FourierTransformsUtils.verifyFieldFunctionValue(range, verificationValue));

}

public void testhL(){

double[] verificationValue = {17762, 1156700};

ProbeTimeHistoryImportedModelDerivedData  h_l1 = (ProbeTimeHistoryImportedModelDerivedData) 

getSimulation().get(DerivedDataManager.class).hasObject("h_l1");

DerivedDataView3D derivedDataView3D = h_l1.getDerivedDataView3D();

SingleSliderValue singleSliderValue = derivedDataView3D.getSliderVal();

singleSliderValue.setValue(0.5);

double[] range = createScalarScene(h_l1);

setMessage(FourierTransformsUtils.verifyFieldFunctionValue(range, verificationValue));

}

Changes to the Turbulent Dispersion Model

The Turbulent Prandtl Number has moved from being a property of the Turbulent Dispersion Model to having its own manager, now supporting Constant, Field Function, and specific models as alternative methods. As a result, any old macro that sets this property explicitly, rather than by default, will fail to compile.

Previous Release Simcenter STAR-CCM+ v8.06

PhaseInteraction phaseInteraction_0 =

((PhaseInteraction) multiPhaseInteractionModel_0.getPhaseInteractionManager().getPhaseInteraction("Phase Interaction 1"));

TurbulentDispersionForceModel turbulentDispersionForceModel_0 =

phaseInteraction_0.getModelManager().getModel(TurbulentDispersionForceModel.class);

turbulentDispersionForceModel_0.setPrandtlNo_t(0.9);

PhaseInteraction phaseInteraction_0 =

((PhaseInteraction) multiPhaseInteractionModel_0.getPhaseInteractionManager().getPhaseInteraction("Phase Interaction 1"));

TurbulentDispersionForceModel turbulentDispersionForceModel_0 =

phaseInteraction_0.getModelManager().getModel(TurbulentDispersionForceModel.class);

ConstantInteractionCoefficientMethod constantInteractionCoefficientMethod_0 =

turbulentDispersionForceModel_0.getTurbulentPrandtlNumber().getMethod(ConstantInteractionCoefficientMethod.class);

constantInteractionCoefficientMethod_0.getQuantity().setValue(0.9);

Part Contacts

In previous versions of Simcenter STAR-CCM+, contacts were not journaled with sufficient information to identify the correct contact. For example, when composite parts were involved, two contacts could have the same name. In Simcenter STAR-CCM+ v8.06, the macro API for part contacts has changed to improve journaling, and now contacts are correctly identified. Update these macros as follows:

Previous Release Simcenter STAR-CCM+ v8.06

Body body_0 = 

((Body) cadModel_0.getBodyManager().getObject("Body 1"));

Body body_1 = 

((Body) cadModel_0.getBodyManager().getObject("Body 2"));

cadModel_0.createParts(new NeoObjectVector(new Object[] {body_0, body_1}), "SharpEdges", 30.0, 2, true, 1.0E-5);

PartContact partContact_0 = 

((PartContact) simulation_0.get(PartContactManager.class).getObject("Part Contact"));

Body body_0 = 

((Body) cadModel_0.getBodyManager().getObject("Body 1"));

Body body_1 = 

((Body) cadModel_0.getBodyManager().getObject("Body 2"));

cadModel_0.createParts(new NeoObjectVector(new Object[] {body_0, body_1}), "SharpEdges", 30.0, 2, true, 1.0E-5);

SolidModelPart solidModelPart_0 = 

((SolidModelPart) simulation_0.get(SimulationPartManager.class).getPart("Body 1"));

SolidModelPart solidModelPart_1 = 

((SolidModelPart) simulation_0.get(SimulationPartManager.class).getPart("Body 2"));

PartContact partContact_0 = 

simulation_0.get(PartContactManager.class).getPartContact(solidModelPart_0,solidModelPart_1);

Planar Motion

Some properties of the Planar Motion Mechanism in DFBI have been renamed for clarity. Java macros that were recorded in Simcenter STAR-CCM+ v8.04 will still work in v8.06, however support for these macros may be dropped in the future.

Previous Release Simcenter STAR-CCM+ v8.06

Simulation simulation_0 = 

getActiveSimulation();

Body body_0 = 

((Body) simulation_0.get(BodyManager.class).getObject("Boat"));

((PlanarMotionCarriage) body_0.getMotionType()).getPlanarMotionOption().setSelected(PlanarMotionOption.PLANAR_MOTION_MECHANISM);

((PlanarMotionMechanism) ((PlanarMotionCarriage) body_0.getMotionType()).getPlanarMotionType()).getForwardVelocity().setValue(1.0);

((PlanarMotionMechanism) ((PlanarMotionCarriage) body_0.getMotionType()).getPlanarMotionType()).getSwayAmplitude().setValue(2.0);

((PlanarMotionMechanism) ((PlanarMotionCarriage) body_0.getMotionType()).getPlanarMotionType()).getSwayFrequency().setValue(0.1);

Simulation simulation_0 = 

getActiveSimulation();

Body body_0 = 

((Body) simulation_0.get(BodyManager.class).getObject("Boat"));

((PlanarMotionCarriage) body_0.getMotionType()).getPlanarMotionOption().setSelected(PlanarMotionOption.PLANAR_MOTION_MECHANISM);

((PlanarMotionMechanism) ((PlanarMotionCarriage) body_0.getMotionType()).getPlanarMotionType()).getVelocityX().setValue(1.0);

((PlanarMotionMechanism) ((PlanarMotionCarriage) body_0.getMotionType()).getPlanarMotionType()).getAmplitudeY().setValue(2.0);

((PlanarMotionMechanism) ((PlanarMotionCarriage) body_0.getMotionType()).getPlanarMotionType()).getOscillationFrequency().setValue(0.1);

Changes to the Granular Temperature Model in EMP

In Simcenter STAR-CCM+ v8.04, the Granular Temperature Model was selected automatically after selecting the Granular Pressure Model. In Simcenter STAR-CCM+ v8.06, the GranularTemperatureModel class is replaced by the GranularTemperatureProviderGroup class. This group provides options to select any of the 3 types of granular temperature models: Algebraic (AlgebraicGranularTemperatureModelProvider), Transport (GranularTemperatureTransportModelProvider), and User-defined (UserDefinedGranularTemperatureModelProvider).

The Kinetic Regime of the GranularPressureModel class has been removed. The KineticTheoryProvider class has also been removed, meaning that the getKineticTheory() and getKineticRegimeOption() methods of the GranularPressureModel class have been removed in Simcenter STAR-CCM+ v8.06.

Previous Release Simcenter STAR-CCM+ v8.06

Simulation simulation_0 = getActiveSimulation();

PhysicsContinuum physicsContinuum_0 = ((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1"));

physicsContinuum_0.enable(GranularTemperatureModel.class);

Simulation simulation_0 = getActiveSimulation();

PhysicsContinuum physicsContinuum_0 = ((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1"));

physicsContinuum_0.enable(GranularTemperatureProviderGroup.class);

physicsContinuum_0.enable(AlgebraicGranularTemperatureModelProvider.class);

Simulation simulation_0 = getActiveSimulation();

PhysicsContinuum physicsContinuum_0 = ((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1"));

physicsContinuum_0.enable(GranularTemperatureModel.class);

GranularPressureModel granularPressureModel_0 = physicsContinuum_0.getModelManager().getModel(GranularPressureModel.class);

granularPressureModel_0.getKineticRegimeOption().setSelected(KineticRegimeOption.NONE);

Simulation simulation_0 = getActiveSimulation();

PhysicsContinuum physicsContinuum_0 = ((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1"));

Solid Stress Model Name Change

In Simcenter STAR-CCM+ v8.06, the SolidStress class has been renamed to FvSolidStressModel.

Previous Release Simcenter STAR-CCM+ v8.06

private void execute0() {

    Simulation simulation_0 = 

      getActiveSimulation();

    PhysicsContinuum physicsContinuum_0 = 

      simulation_0.getContinuumManager().createContinuum(PhysicsContinuum.class);

    physicsContinuum_0.enable(ThreeDimensionalModel.class);

    physicsContinuum_0.enable(SteadyModel.class);

    physicsContinuum_0.enable(SolidModel.class);

    physicsContinuum_0.enable(SolidStressModel.class);

    physicsContinuum_0.enable(LinearIsotropicElasticModel.class);

    physicsContinuum_0.enable(ConstantDensityModel.class);

    physicsContinuum_0.enable(SegregatedSolidEnergyModel.class);

    physicsContinuum_0.enable(CellQualityRemediationModel.class);

  }

private void execute0() {

    Simulation simulation_0 = 

      getActiveSimulation();

    PhysicsContinuum physicsContinuum_0 = 

      simulation_0.getContinuumManager().createContinuum(PhysicsContinuum.class);

    physicsContinuum_0.enable(ThreeDimensionalModel.class);

    physicsContinuum_0.enable(SteadyModel.class);

    physicsContinuum_0.enable(SolidModel.class);

    physicsContinuum_0.enable(FvSolidStressModel.class);

    physicsContinuum_0.enable(LinearIsotropicElasticModel.class);

    physicsContinuum_0.enable(ConstantDensityModel.class);

    physicsContinuum_0.enable(SegregatedSolidEnergyModel.class);

    physicsContinuum_0.enable(CellQualityRemediationModel.class);

  }

Removal of Flat List and Flat List & Merge Options from the Output Part Options Property in Mesh Operations

In Simcenter STAR-CCM+ v8.06, the Flat List and Flat List & Merge by Name options are removed from the Output Parts Options property. This property was found in the Extract Volume, Unite, Intersect, and Subtract mesh operation dialogs. Any reference to these options must be removed from your old macros.

Previous Release Simcenter STAR-CCM+ v8.06

ExtractVolumeOperation extractVolumeOperation_2 = 

      (ExtractVolumeOperation) simulation_0.get(MeshOperationManager.class).createExtractVolumeOperation();

    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}));

    SolidModelPart solidModelPart_0 = 

      ((SolidModelPart) simulation_0.get(SimulationPartManager.class).getPart("Body 1"));

    SolidModelPart solidModelPart_1 = 

      ((SolidModelPart) simulation_0.get(SimulationPartManager.class).getPart("Body 2"));

    SolidModelPart solidModelPart_2 = 

      ((SolidModelPart) simulation_0.get(SimulationPartManager.class).getPart("Body 3"));

    extractVolumeOperation_1.getInputGeometryObjects().setObjects(solidModelPart_0, solidModelPart_1, solidModelPart_2);

    extractVolumeOperation_1.getVolumeModeOption().setSelected(ExtractVolumeOption.AUTOMATIC);

    extractVolumeOperation_1.execute();

    extractVolumeOperation_1.getDisplayMode().setSelected(MeshOperationDisplayModeOption.FLAT_UNMERGED);

ExtractVolumeOperation extractVolumeOperation_1 = 

      (ExtractVolumeOperation) simulation_0.get(MeshOperationManager.class).createExtractVolumeOperation();

    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}));

    SolidModelPart solidModelPart_0 = 

      ((SolidModelPart) simulation_0.get(SimulationPartManager.class).getPart("Body 1"));

    SolidModelPart solidModelPart_1 = 

      ((SolidModelPart) simulation_0.get(SimulationPartManager.class).getPart("Body 2"));

    SolidModelPart solidModelPart_2 = 

      ((SolidModelPart) simulation_0.get(SimulationPartManager.class).getPart("Body 3"));

    extractVolumeOperation_1.getInputGeometryObjects().setObjects(solidModelPart_0, solidModelPart_1, solidModelPart_2);

    extractVolumeOperation_1.getVolumeModeOption().setSelected(ExtractVolumeOption.AUTOMATIC);

    extractVolumeOperation_1.execute();