Macro API Changes 13.02

In Simcenter STAR-CCM+ 13.02, the macro API changed for surface preparation, boundary conditions, harmonic balance, heat transfer, DFBI, aeroacoustics, reacting flows, Eulerian multiphase, turbulence, monitors, plots, Design Manager, and co-simulation.

Surface Preparation

Changes to Unite and Intersect Operations

Due to adjustments for consistency in the functionality of mesh operations, the Unite and Intersect operations no longer set a Target Part. Therefore a statement such as unitePartsOperation_0.setTargetPart(meshPart_0); causes the current version of Simcenter STAR-CCM+ to generate an error message. Modify your existing macros accordingly.

Changes to Extruder Operation

A change was implemented to facilitate copy-and-paste of the Surface Extruder mesh operation. Previously, when a Surface Extruder operation was created, an output part named Surface Extruder was created immediately. However, this output part was not reused, but deleted, when the mode of the Surface Extruder operation was changed to Per Part Surface. Consequently, when a subsequent Surface Extruder output part was created by a copy-and-paste of the Surface Extruder operation, its name was incremented by one.

In the following example, the output part obtained in the last line was named Surface Extruder 2:

SurfaceExtruderOperation surfaceExtruderOperation_4 = 
  (SurfaceExtruderOperation) simulation_0.get(MeshOperationManager.class).createSurfaceExtruderOperation(
          new NeoObjectVector(new Object[] {simpleBlockPart_0}),"Surface Extruder");     // <-- create Surface Extruder operation
  surfaceExtruderOperation_4.setOutputMode(SurfaceExtruderOperation.OutputMode.PER_PART_SURFACE);  // <-- change output mode
  surfaceExtruderOperation_4.getPartSurfaces().setQuery(null); 
  PartSurface partSurface_0 = 
 	   ((PartSurface) simpleBlockPart_0.getPartSurfaceManager().getPartSurface("right")); 
  surfaceExtruderOperation_4.getPartSurfaces().setObjects(partSurface_0);                    // <-- set part surfaces after changing mode
  MeshOperationPart meshOperationPart_1 = 
  	   ((MeshOperationPart) simulation_0.get(SimulationPartManager.class).getPart("Surface Extruder 2"));  // <-- notice first output part was replaced and name was incremented

This behavior has been improved and the default output part Surface Extruder is now reused. If your macros include working with Surface Extruder operations and output parts in the manner described above, update your macros to obtain the correct Surface Extruder output parts.

Previous Release Simcenter STAR-CCM+ v13.02
MeshOperationPart meshOperationPart_1 = 
  	   ((MeshOperationPart) simulation_0.get(SimulationPartManager.class).getPart("Surface Extruder 2"));
MeshOperationPart meshOperationPart_1 = 
            ((MeshOperationPart) simulation_0.get(SimulationPartManager.class).getPart("Surface Extruder"));

Boundary Conditions: Change of Free Stream Conditions

As part of restructuring free stream boundary conditions, the FreeStreamOption class has been moved from flow to energy.

Previous Release Simcenter STAR-CCM+ v13.02
import star.flow.FreeStreamOption;
import star.energy.FreeStreamOption;

Harmonic Balance: Change to Flutter Motion

The Harmonic Balance Flutter motion has changed to allow for larger blade pitching motions, resulting in changes to the macro code.

Previous Release Simcenter STAR-CCM+ v13.02
boundary.getConditions().get(HbMorphingOption.class).setSelected(HbMorphingOption.DISPLACEMENT);
 HbRealDisplacementProfile hbRealDisplacementProfile_0 = boundary.getValues().get(HbRealDisplacementProfile.class);
 hbRealDisplacementProfile_0.getMethod(ConstantVectorProfileMethod.class).getQuantity().setComponents(0.0, 0.0050, 0.0);
 HbImagDisplacementProfile hbImagDisplacementProfile_0 = boundary.getValues().get(HbImagDisplacementProfile.class);
 hbImagDisplacementProfile_0.getMethod(ConstantVectorProfileMethod.class).getQuantity().setComponents(0.0, 0.0010, 0.0);
boundary.getConditions().get(HbMorphingOption.class).setSelected(HbMorphingOption.Type.HARMONIC_DISPLACEMENT);
 HarmonicDisplacement harmonicDisplacement_0 = boundary.getValues().get(HarmonicDisplacement.class);
 HbRealDisplacementProfile hbRealDisplacementProfile_0 = harmonicDisplacement_0.getHbRealDisplacementProfile();
 hbRealDisplacementProfile_0.getMethod(ConstantVectorProfileMethod.class).getQuantity().setComponents(0.0, 0.0050, 0.0);
 HbImagDisplacementProfile hbImagDisplacementProfile_0 = harmonicDisplacement_0.getHbImagDisplacementProfile();
 hbImagDisplacementProfile_0.getMethod(ConstantVectorProfileMethod.class).getQuantity().setComponents(0.0, 0.0010, 0.0);

Heat Transfer: Changes to Participating Media Models and Properties

As part of restructuring of discrete ordinate radiation models, certain classes associated with models and material properties were changed.

The following classes were moved from star.radiation.dom to star.radiation.common. There will be no backward compatibility for macros for these models, but there should be backward compatibility for old simulation files.

  • GrayRefractionModel
  • MultiBandRefractionModel
  • ParticipatingGrayModel
  • ParticipatingMultiBandModel
  • ParticipatingSpectrumModel

These classes are used in the same way, but they simply must be imported from a different library location:

Previous Release Simcenter STAR-CCM+ v13.02
import star.radiation.dom.GrayRefractionModel;

import star.radiation.dom.MultiBandRefractionModel;

import star.radiation.dom.ParticipatingGrayModel;

import star.radiation.dom.ParticipatingMultiBandModel;

import star.radiation.dom.ParticipatingSpectrumModel;
import star.radiation.common.GrayRefractionModel;

import star.radiation.common.MultiBandRefractionModel;

import star.radiation.common.ParticipatingGrayModel;

import star.radiation.common.ParticipatingMultiBandModel;

import star.radiation.common.ParticipatingSpectrumModel;

Certain classes were moved from star.radiation.dom to star.radiation.common, and renamed.

  • The class AbsorptionCoefficientProperty has been renamed to AbsorptionCoefficientMaterialProperty.
  • The class ScatteringCoefficientProperty has been renamed to ScatteringCoefficientMaterialProperty.
  • The class RefractiveIndexProperty has been renamed to RefractiveIndexMaterialProperty.
  • The class WsggMethod has been renamed to WsggPropertyMethod.

In addition, RadiationSpectrumManager has been renamed to MultiBandSpectrumManager.

The FireSmokeDialog class links to AbsorptionCoefficientMaterialProperty and ParticipatingGrayModel in the radiation.common library.

Examples of using the renamed classes follow:

AbsorptionCoefficientMaterialProperty

Previous Release Simcenter STAR-CCM+ v13.02
   // set absorption coefficient to 0.1 1/m
   ConstantMaterialPropertyMethod constantMaterialPropertyMethod_0 = 
((ConstantMaterialPropertyMethod) liquid_0.getMaterialProperties().getMaterialProperty(AbsorptionCoefficientProperty.class).getMethod());
   constantMaterialPropertyMethod_0.getQuantity().setValue(0.1);
   // set absorption coefficient to 0.1 1/m
   ConstantMaterialPropertyMethod constantMaterialPropertyMethod_0 = 
((ConstantMaterialPropertyMethod) liquid_0.getMaterialProperties().getMaterialProperty(AbsorptionCoefficientMaterialProperty.class).getMethod());
   constantMaterialPropertyMethod_0.getQuantity().setValue(0.1);

ScatteringCoefficientMaterialProperty

Previous Release Simcenter STAR-CCM+ v13.02
ConstantMaterialPropertyMethod constantMaterialPropertyMethod_0 = 
  ((ConstantMaterialPropertyMethod) gasMixture_0.getMaterialProperties().getMaterialProperty(ScatteringCoefficientProperty.class).getMethod());

constantMaterialPropertyMethod_0.getQuantity().setValue(0.1);
ConstantMaterialPropertyMethod constantMaterialPropertyMethod_0 = 
  ((ConstantMaterialPropertyMethod) gasMixture_0.getMaterialProperties().getMaterialProperty(ScatteringCoefficientMaterialProperty.class).getMethod());

constantMaterialPropertyMethod_0.getQuantity().setValue(0.1);

RefractiveIndexMaterialProperty

Previous Release Simcenter STAR-CCM+ v13.02
ConstantMaterialPropertyMethod constantMaterialPropertyMethod_0 = 
  ((ConstantMaterialPropertyMethod) gas_0.getMaterialProperties().
  getMaterialProperty(RefractiveIndexProperty.class).getMethod());

constantMaterialPropertyMethod_0.getQuantity().setValue(0.1);
ConstantMaterialPropertyMethod constantMaterialPropertyMethod_0 = 
  ((ConstantMaterialPropertyMethod) gas_0.getMaterialProperties().
  getMaterialProperty(RefractiveIndexMaterialProperty.class).getMethod());

constantMaterialPropertyMethod_0.getQuantity().setValue(0.1);

WsggPropertyMethod

Previous Release Simcenter STAR-CCM+ v13.02
GasMixture gasMixture_0 = 
     ((GasMixture) multiComponentGasModel_0.getMixture());
   gasMixture_0.getMaterialProperties().getMaterialProperty(AbsorptionCoefficientProperty.class).setMethod(WsggMethod.class);

   WsggMethod wsggMethod_0 = 
     ((WsggMethod) gasMixture_0.getMaterialProperties().getMaterialProperty(AbsorptionCoefficientProperty.class).getMethod());

   wsggMethod_0.getOpticalPathLength().setValue(0.0036);
GasMixture gasMixture_0 = 
      ((GasMixture) multiComponentGasModel_0.getMixture());
    gasMixture_0.getMaterialProperties().getMaterialProperty(AbsorptionCoefficientMaterialProperty.class).setMethod(WsggPropertyMethod.class);

WsggPropertyMethod wsggMethod_0 = 
      ((WsggPropertyMethod) gasMixture_0.getMaterialProperties().getMaterialProperty(AbsorptionCoefficientMaterialProperty.class).getMethod());

    wsggMethod_0.getOpticalPathLength().setValue(0.0036);

MultiBandSpectrumManager

Previous Release Simcenter STAR-CCM+ v13.02
ParticipatingMultiBandModel participatingMultiBandModel_0 = 
  continuum.getModelManager().getModel(ParticipatingMultiBandModel.class);
SpectralBand spectralBand_0 = 
  participatingMultiBandModel_0.getRadiationSpectrumManager().createThermalSpectralBand(SpectralBand.class);
ParticipatingMultiBandModel participatingMultiBandModel_0 = 
  continuum.getModelManager().getModel(ParticipatingMultiBandModel.class);
SpectralBand spectralBand_0 = 
        participatingMultiBandModel_0.getMultiBandSpectrumManager().createThermalSpectralBand(SpectralBand.class);

DFBI: Changes to Creation of Bodies

With the introduction of pure Mechanical Bodies (that is, bodies with no representation in the volume mesh and no interaction with physics continua except for gravity), the classical Body has been renamed to Continuum Body (that is, a body interacting with physics continua and driving volume mesh motion). Accordingly, the class name has changed from Body to ContinuumBody.

NoteThe class Body is still supported as a base class. However, for long-term reliability, it is recommended that you upgrade your macros with the classes of the current version.
Previous Release Simcenter STAR-CCM+ v13.02
boolean is3D = true; // or false for 2D
star.sixdof.Body sixdofBody_0 = 
  simulation_0.get(star.sixdof.BodyManager.class).createBody(is3D);

boolean createDefaultForcesAndMoments = false;
star.sixdof.Body sixdofBody_1 = 
  simulation_0.get(star.sixdof.BodyManager.class).createBody(is3D, createDefaultForcesAndMoments);

star.sixdof.Body sixdofBody_2= 
  simulation_0.get(star.sixdof.BodyManager.class).createBody("Body name", is3D);
boolean is3D = true; // or false for 2D
ContinuumBody continuumBody_0 = 
  simulation_0.get(star.sixdof.BodyManager.class).createContinuumBody(is3D);

boolean createDefaultForcesAndMoments = false;
ContinuumBody continuumBody_1 = 
  simulation_0.get(star.sixdof.BodyManager.class).createContinuumBody(is3D, createDefaultForcesAndMoments);

ContinuumBody continuumBody_2 = 
  simulation_0.get(star.sixdof.BodyManager.class).createContinuumBody("Body name", is3D);

The method Body.setObjects() has been moved to ContinuumBody.setObjects().

Previous Release Simcenter STAR-CCM+ v13.02
star.sixdof.Body body_0 = 
  ((star.sixdof.Body) simulation_0.get(star.sixdof.BodyManager.class).getObject("Body 1"));

Boundary boundary_0 = 
  region_0.getBoundaryManager().getBoundary("hull");

Boundary boundary_1 = 
  region_0.getBoundaryManager().getBoundary("deck");

Vector<NamedObject> boundaries = new Vector<NamedObject>();
boundaries.add(boundary_0);
boundaries.add(boundary_1);

body_0.setObjects(boundaries);
ContinuumBody continuumBody_0 = 
  ((ContinuumBody) simulation_0.get(star.sixdof.BodyManager.class).getObject("Body 1"));

Boundary boundary_0 = 
  region_0.getBoundaryManager().getBoundary("hull");

Boundary boundary_1 = 
  region_0.getBoundaryManager().getBoundary("deck");

Vector<NamedObject> boundaries = new Vector<NamedObject>();
boundaries.add(boundary_0);
boundaries.add(boundary_1);

continuumBody_0.setObjects(boundaries);

Aeroacoustics: Changes to Post Ffowcs Williams-Hawkings (FW-H) Receiver

As part of a change in the Convective Acoustic Effects option of post point receivers, the object ConvectiveVelocityProfile has been renamed to FwhConvectiveVelocityProfile. Within macro code, all occurrences of ConvectiveVelocityProfile must be renamed accordingly. For example:

Previous Release Simcenter STAR-CCM+ v13.02
ConvectiveVelocityProfile convectiveVelocityProfile = pointFwhPostProcessingReceiver.getConvectiveVelocityProfile();
FwhConvectiveVelocityProfile fwhConvectiveVelocityProfile = pointFwhPostProcessingReceiver.getFwhConvectiveVelocityProfile();

Reacting Flows: Changes to Progress Variable

User options have been changed for the Progress Variable source, resulting in changes to the macro code.

Previous Release Simcenter STAR-CCM+ v13.02
tfcCombustionPartiallyPremixedModel_0.getTurbulentFlameSpeedControlOption().setSelected(TurbulentFlameSpeedControlOption.PETERS);
tfcCombustionPartiallyPremixedModel_0.getTurbulentFlameSpeedControlOption().setSelected(TurbulentFlameSpeedControlOption.PETERS_TFS);
tfcCombustionPartiallyPremixedModel_0.getTurbulentFlameSpeedControlOption().setSelected(TurbulentFlameSpeedControlOption.ZIMONT);
tfcCombustionPartiallyPremixedModel_0.getTurbulentFlameSpeedControlOption().setSelected(TurbulentFlameSpeedControlOption.ZIMONT_TFS);
tfcCombustionPartiallyPremixedModel_0.getTurbulentFlameSpeedControlOption().setSelected(TurbulentFlameSpeedControlOption.USERDEFINED);
tfcCombustionPartiallyPremixedModel_0.getTurbulentFlameSpeedControlOption().setSelected(TurbulentFlameSpeedControlOption.USERDEFINED_TFS);

Eulerian Multiphase: Changes to Turbulence Damping

The turbulence damping model has been improved by providing additional turbulence damping formulation method. In the model, the damping parameters have to be specified phase wise. The turbulence damping formulation used in the previous releases is now exposed for selection. It is called Egorov formulation and it should be explicitly selected as compared to previous releases where it was done internally. This improvement has resulted in changes to the macro code.

Previous Release Simcenter STAR-CCM+ v13.02
     LsiTurbDampingModel lsiTurbDampingModel_0 = 
       phaseInteraction_0.getModelManager().getModel(LsiTurbDampingModel.class);

     lsiTurbDampingModel_0.getDampingConstant().setValue(1100.0);
    phaseInteraction_0.enable(LargeInterfaceDetectionModel.class);
    phaseInteraction_0.enable(LsiTurbDampingModel.class);

    LsiTurbDampingModel lsiTurbDampingModel_0 = 
      phaseInteraction_0.getModelManager().getModel(LsiTurbDampingModel.class);

    PrimaryPhaseTurbulenceDampingParameters primaryPhaseTurbulenceDampingParameters_1 = 
      lsiTurbDampingModel_0.getPrimaryPhaseTurbulenceDampingParameters();

    KwTurbTurbulenceDampingParameters kwTurbTurbulenceDampingParameters_1 = 
      primaryPhaseTurbulenceDampingParameters_1.getKwTurbTurbulenceDampingParameters();

    kwTurbTurbulenceDampingParameters_1.getDampingFormulationOption().setSelected(LsiTurbDampingFormulationOption.Type.EGOROV);

    kwTurbTurbulenceDampingParameters_1.getKWTurbDampingConstant().setValue(1100.0);

    kwTurbTurbulenceDampingParameters_1.getInterfaceDistanceOption().setSelected(LsiTurbDampingInterfaceDistanceOption.Type.VOLUMEBASED);

    SecondaryPhaseTurbulenceDampingParameters secondaryPhaseTurbulenceDampingParameters_0 = 
      lsiTurbDampingModel_0.getSecondaryPhaseTurbulenceDampingParameters();

    KwTurbTurbulenceDampingParameters kwTurbTurbulenceDampingParameters_2 = 
      secondaryPhaseTurbulenceDampingParameters_0.getKwTurbTurbulenceDampingParameters();

    kwTurbTurbulenceDampingParameters_2.getDampingFormulationOption().setSelected(LsiTurbDampingFormulationOption.Type.EGOROV);

    kwTurbTurbulenceDampingParameters_2.getKWTurbDampingConstant().setValue(1100.0);

    kwTurbTurbulenceDampingParameters_2.getInterfaceDistanceOption().setSelected(LsiTurbDampingInterfaceDistanceOption.Type.VOLUMEBASED);

Turbulence: Removal of Constant from Spalart-Allmaras Detached Eddy Model

Due to a change in formulation, the constant Cv2 was removed. Remove instances of this constant from your existing macros.

Previous Release Simcenter STAR-CCM+ v13.02
SaTurbDesModel.setCv2(5.0);
//SaTurbDesModel.setCv2(5.0);

Monitors: Change in Name Syntax

Due to refactoring, the string cpu has been changed to uppercase: CPU. Modify your existing macros accordingly.

Plots: Changes to Colors

As part of improvement of colors in plots, macro codes have changed for axis labels, axis ticks, and heatmap style.

An example of the code change follows:

Previous Release Simcenter STAR-CCM+ v13.02
setColor(new IntVector(new int[] {255, 255, 0, 255}));
setColor(new DoubleVector(new double[] {1.0, 1.0, 0.0}));

Design Manager MdxDataSet: End of Support for Methods

Due to restructuring of the class MdxDataSet, certain methods that were available in v12.04 or v12.06 have been deprecated. Remove these methods from your macros.

    
public boolean getNeedsSorting()
public void setNeedsSorting(boolean newValue) 
public double getXOffset()
public void setXOffset(double v)
public double getYOffset()
public void setYOffset(double v)
public double getXScale()
public void setXScale(double v)
public double getYScale()
public void setYScale(double v)

Co-Simulation

Removal of Field Import and Export Options

Due to removal of the Field Import Option and Field Export Option from the GT-SUITE co-simulation zone conditions, the following macro commands will stop working and need to be removed (no replacement is needed):

  • import star.cosimulation.common.FieldImportOption;
  • import star.cosimulation.common.FieldExportOption;
  • coSimulationZone_0.getCoSimulationZoneConditions().get(FieldImportOption.class).setSelected(FieldImportOption.Type.VELOCITY);
  • coSimulationZone_0.getCoSimulationZoneConditions().get(FieldImportOption.class).setSelected(FieldImportOption.Type.VELOCITY_AND_DENSITY);
  • coSimulationZone_0.getCoSimulationZoneConditions().get(FieldImportOption.class).setSelected(FieldImportOption.Type.MASS);
  • coSimulationZone_0.getCoSimulationZoneConditions().get(FieldImportOption.class).setSelected(FieldImportOption.Type.PRESSURE);
  • coSimulationZone_0.getCoSimulationZoneConditions().get(FieldExportOption.class).setSelected(FieldExportOption.Type.VELOCITY);
  • coSimulationZone_0.getCoSimulationZoneConditions().get(FieldExportOption.class).setSelected(FieldExportOption.Type.MASS);
  • coSimulationZone_0.getCoSimulationZoneConditions().get(FieldExportOption.class).setSelected(FieldExportOption.Type.PRESSURE);
  • coSimulationZone_0.getCoSimulationZoneConditions().get(FieldExportOption.class).setSelected(FieldExportOption.Type.MASS_FLOW_RATE_VIA_FILE);

Changes Due to Refactoring

Structural improvements in co-simulation have resulted in changes to the macro code.

Previous Release Simcenter STAR-CCM+ v13.02
abaqusOrStarccmplusCoSimulationSolver_0.setVerbosity(2);

// VERBOSITY LEVEL CORRESPONDENCE:

// None = 0
// Low = 1
// High = 2
import star.cosimulation.common.VerbosityLevel; // THIS GOES AT THE BEGINNING OF THE FILE WITH THE OTHER IMPORTS

coSimulation_0.getCoSimulationConditions()
              .get(VerbosityLevel.class)
              .setSelected(VerbosityLevel.Type.HIGH);

// VERBOSITY LEVEL CORRESPONDENCE:

// None = VerbosityLevel.Type.NONE
// Low = VerbosityLevel.Type.LOW
// High = VerbosityLevel.Type.HIGH

The following classes have been moved from star.cosimulation.starccmplus to star.cosimulation.link.starccmplus:

  • StarccmplusConnectionFile
  • StarccmplusCoSimLaunch
  • StarccmplusCoSimHostPort

As a result, update the import statements in your macros as follows:

Previous Release Simcenter STAR-CCM+ v13.02
import star.cosimulation.starccmplus.StarccmplusConnectionFile;

import star.cosimulation.starccmplus.StarccmplusCoSimLaunch;

import star.cosimulation.starccmplus.StarccmplusCoSimHostPort;
import star.cosimulation.link.starccmplus.StarccmplusConnectionFile;

import star.cosimulation.link.starccmplus.StarccmplusCoSimLaunch;

import star.cosimulation.link.starccmplus.StarccmplusCoSimHostPort;

The following classes have been moved from star.cosimulation.common to star.cosimulation.link.common:

  • AbaqusCoSimulationType
  • AmesimCoSimulationType
  • ConsistencyCheckOption
  • CoSimAssignedHostPort
  • CoSimCommandLine
  • CoSimConnectionFile
  • CoSimHostPort
  • CoSimulation
  • CoSimulationConditionManager
  • CoSimulationConnectOption
  • CoSimulationEditor
  • CoSimulationLaunchOption
  • CoSimulationLoadPartnerLibraryOption
  • CoSimulationManager
  • CoSimulationPartner
  • CoSimulationType
  • CoSimulationValueManager
  • CoSimulationZone
  • CoSimulationZoneConditionManager
  • CoSimulationZoneManager
  • CoSimulationZoneType
  • CoSimulationZoneValueManager
  • CouplingPrecisionOption
  • DisconnectOption
  • FilePath
  • GtPowerCoSimulationType
  • IndexedOption
  • IndexedOptionNameComparator
  • LocalFilePath
  • OlgaCoSimulationType
  • PartnerFileSystemOption
  • PointCoSimulationZoneType
  • ReactingChannelCoSimulationType
  • RelapCoSimulationType
  • StarccmplusCoSimulationType
  • SurfaceCoSimulationZoneType
  • VolumeCoSimulationZoneType
  • WaveCoSimulationType

Examples follow of how to update the import statements in your macros:

Previous Release Simcenter STAR-CCM+ v13.02
import star.cosimulation.common.CoSimulation;

import star.cosimulation.common.ConsistencyCheckOption;

import star.cosimulation.common.CoSimAssignedHostPort;
import star.cosimulation.link.common.CoSimulation;

import star.cosimulation.link.common.ConsistencyCheckOption;

import star.cosimulation.link.common.CoSimAssignedHostPort;

The following classes that were part of the package star.cosimulation.common were deleted:

  • CoSimulationWithDomain
  • NullCoSimulation