Macro API Changes 11.02

In Simcenter STAR-CCM+ 11.02, the macro API changed for electrochemistry, combustion, erosion, GT-SUITE co-simulation, data mapping, and virtual disk modeling.

Electrochemistry: Renaming of Solid Electric Potential Profile

The profile SolidElectricPotentialProfile has been renamed to ElectrodeElectricPotentialProfile, resulting in changes to the macro code.

Within import sections of the macro code, as well as program instruction sections, all occurrences of SolidElectricPotentialProfile must be renamed accordingly. For example:

Previous Release Simcenter STAR-CCM+ v11.02
smo.setActiveMechanism("SurfaceMechanism");
SolidElectricPotentialProfile spp = _metalBoundary.getValues()
.get(SolidElectricPotentialProfile.class);
smo.setActiveMechanism("SurfaceMechanism");
ElectrodeElectricPotentialProfile spp = _metalBoundary.getValues()
.get(ElectrodeElectricPotentialProfile.class);

Electrochemistry: Renaming of Derivative Profile

The profile MolarConcentrationFluxDerivativeProfile has been renamed to ConcentrationFluxDerivativeProfile, resulting in changes to the macro code.

Within import sections of the macro code, as well as program instruction sections, all occurrences of MolarConcentrationFluxDerivativeProfile must be renamed accordingly. For example:

Previous Release Simcenter STAR-CCM+ v11.02
chlorideAnionFluxProfile.getMethod(FunctionScalarProfileMethod.class
).setFieldFunction(BoundarySpecifiedFluxClMinusFF);
MolarConcentrationFluxDerivativeProfile mcfdP = fluxBoundary
.getValues()
.get(MolarConcentrationFluxDerivativeProfile.class);
chlorideAnionFluxProfile.getMethod(FunctionScalarProfileMethod.class)
.setFieldFunction(BoundarySpecifiedFluxClMinusFF);
ConcentrationFluxDerivativeProfile mcfdP = fluxBoundary
.getValues()
.get(ConcentrationFluxDerivativeProfile.class);

Combustion: Transformation to Complex Chemistry

Combustion that involves DARS-CFD and complex chemistry has undergone extensive changes. Hence you are advised to re-record your macros, or at least the portions of those macros that affect the defining of models and properties.

As a rule, for macros defining complex chemistry:
  • Occurrences of import star.combustion.*; should be changed to:
    import star.combustion.*;
    import star.combustion.complexchemistry.*;
  • Occurrences of import star.combustion.ui.*; should be changed to:
    import star.combustion.ui.*;
    import star.combustion.complexchemistry.ui.*;

A general example of the changes to the macro code follows:

Previous Release Simcenter STAR-CCM+ v11.02
physicsContinuum_0.enable(HomogeneousCombustionModel.class);
physicsContinuum_0.enable(OperatorSplittingGasModel.class);
OperatorSplittingGasModel operatorSplittingGasModel_0 =
  physicsContinuum_0.getModelManager().getModel(OperatorSplittingGasModel.class);
operatorSplittingGasModel_0.setThreshold(50);
physicsContinuum_0.enable(DarsCfdGasReactionModel.class);
physicsContinuum_0.enable(DarsCfdIdealGasModel.class);
DarsCfdIdealGasModel darsCfdIdealGasModel_0 =
  physicsContinuum_0.getModelManager().getModel(DarsCfdIdealGasModel.class);
darsCfdIdealGasModel_0.getIdealGasEquationOption().setSelected(IdealGasEquationOption.BUILTIN);
physicsContinuum_0.enable(ComplexChemistryCombustionModel.class);
physicsContinuum_0.enable(IdealGasModel.class);
ComplexChemistryCombustionModel complexChemistryCombustionModel_0 = 
  physicsContinuum_0.getModelManager().getModel(ComplexChemistryCombustionModel.class);
complexChemistryCombustionModel_0.setThreshold(50);

Examples of macro steps follow for specific instances of combustion modeling:

Activating the Chemistry ADI gas phase model
Previous Release Simcenter STAR-CCM+ v11.02
physicsContinuum_0.enable(ReactingModel.class);
physicsContinuum_0.enable(NonPremixedCombustionFlameTypeModel.class);
physicsContinuum_0.enable(HomogeneousCombustionModel.class);
physicsContinuum_0.enable(ChemistryADIGasModel.class);
physicsContinuum_0.enable(DarsCfdGasReactionModel.class);
physicsContinuum_0.enable(ReactingModel.class);
physicsContinuum_0.enable(NonPremixedCombustionFlameTypeModel.class);
physicsContinuum_0.enable(ComplexChemistryCombustionModel.class);
ComplexChemistryCombustionModel complexChemistryCombustionModel_0 =
physicsContinuum_0.getModelManager().getModel(ComplexChemistryCombustionModel.class);
complexChemistryCombustionModel_0.getChemistrySolverOption().setSelected(ComplexChemistrySolverOption.Type.CADI);
Activating the Operator Splitting gas phase model
Previous Release Simcenter STAR-CCM+ v11.02
physicsContinuum_0.enable(ReactingModel.class);
physicsContinuum_0.enable(NonPremixedCombustionFlameTypeModel.class);
physicsContinuum_0.enable(HomogeneousCombustionModel.class);
physicsContinuum_0.enable(OperatorSplittingGasModel.class);
physicsContinuum_0.enable(DarsCfdGasReactionModel.class);
physicsContinuum_0.enable(ReactingModel.class);
physicsContinuum_0.enable(NonPremixedCombustionFlameTypeModel.class);
physicsContinuum_0.enable(ComplexChemistryCombustionModel.class);
ComplexChemistryCombustionModel complexChemistryCombustionModel_0 =
physicsContinuum_0.getModelManager().getModel(ComplexChemistryCombustionModel.class);
complexChemistryCombustionModel_0.getComplexChemistryOdeSolverOption().setSelected(OdeSolverOption.Type.DARSCFD);
Activating the Ideal Gas model for complex chemistry
Previous Release Simcenter STAR-CCM+ v11.02
physicsContinuum_0.enable(SegregatedSpeciesModel.class);
physicsContinuum_0.enable(DarsCfdIdealGasModel.class);
physicsContinuum_0.enable(SegregatedFluidEnthalpyModel.class);
physicsContinuum_0.enable(LaminarModel.class);
physicsContinuum_0.enable(SegregatedSpeciesModel.class);
physicsContinuum_0.enable(SegregatedFluidEnthalpyModel.class);
physicsContinuum_0.enable(IdealGasModel.class);
physicsContinuum_0.enable(LaminarModel.class);
Activating the Chemistry ADI surface/gas phase model
Previous Release Simcenter STAR-CCM+ v11.02
physicsContinuum_0.enable(NonPremixedCombustionFlameTypeModel.class);
physicsContinuum_0.enable(HomogeneousCombustionSurfaceChemistryModel.class);
physicsContinuum_0.enable(SurfaceChemistryModel.class);
physicsContinuum_0.enable(ChemistryADISurfaceGasModel.class);
physicsContinuum_0.enable(DarsCfdSurfaceGasReactionModel.class);
physicsContinuum_0.enable(SegregatedFlowModel.class);
physicsContinuum_0.enable(NonPremixedCombustionFlameTypeModel.class);
physicsContinuum_0.enable(ComplexChemistryCombustionModel.class);
physicsContinuum_0.enable(SegregatedFlowModel.class);
physicsContinuum_0.enable(SurfaceChemistryModel.class);
ComplexChemistryCombustionModel complexChemistryCombustionModel_0 =physicsContinuum_0.getModelManager().getModel(ComplexChemistryCombustionModel.class);
complexChemistryCombustionModel_0.getChemistrySolverOption().setSelected(ComplexChemistrySolverOption.Type.CADI);
Activating the Operator Splitting surface/gas phase model
Previous Release Simcenter STAR-CCM+ v11.02
physicsContinuum_0.enable(NonPremixedCombustionFlameTypeModel.class);
physicsContinuum_0.enable(HomogeneousCombustionSurfaceChemistryModel.class);
physicsContinuum_0.enable(SurfaceChemistryModel.class);
physicsContinuum_0.enable(OperatorSplittingSurfaceGasModel.class);
physicsContinuum_0.enable(DarsCfdSurfaceGasReactionModel.class);
physicsContinuum_0.enable(SegregatedFlowModel.class);
physicsContinuum_0.enable(NonPremixedCombustionFlameTypeModel.class);
physicsContinuum_0.enable(ComplexChemistryCombustionModel.class);
physicsContinuum_0.enable(SegregatedFlowModel.class);
physicsContinuum_0.enable(SurfaceChemistryModel.class);
ComplexChemistryCombustionModel complexChemistryCombustionModel_0 =physicsContinuum_0.getModelManager().getModel(ComplexChemistryCombustionModel.class);
complexChemistryCombustionModel_0.getComplexChemistryOdeSolverOption().setSelected(OdeSolverOption.Type.DARSCFD);
Setting the running trigger of complex chemistry models
Previous Release Simcenter STAR-CCM+ v11.02
OperatorSplittingGasModel operatorSplittingGasModel_0 = physicsContinuum_0.getModelManager().getModel(OperatorSplittingGasModel.class);
operatorSplittingGasModel_0.getCombustionObjectEnabledOption().setSelected(CombustionObjectEnabledOption.Type.AFTER_ITERATION);
operatorSplittingGasModel_0.setThreshold(20);
ComplexChemistryCombustionModel complexChemistryCombustionModel_0 =physicsContinuum_0.getModelManager().getModel(ComplexChemistryCombustionModel.class);
complexChemistryCombustionModel_0.getCombustionObjectEnabledOption().setSelected(CombustionObjectEnabledOption.Type.AFTER_ITERATION);
complexChemistryCombustionModel_0.setThreshold(20);
OperatorSplittingSurfaceGasModel operatorSplittingSurfaceGasModel_0 = physicsContinuum_0.getModelManager().getModel(OperatorSplittingSurfaceGasModel.class);
operatorSplittingSurfaceGasModel_0.getCombustionObjectEnabledOption().setSelected(CombustionObjectEnabledOption.Type.AFTER_ITERATION);
operatorSplittingSurfaceGasModel_0.setThreshold(20);
ChemistryADIGasModel chemistryADIGasModel_0 = physicsContinuum_0.getModelManager().getModel(ChemistryADIGasModel.class);
chemistryADIGasModel_0.getCombustionObjectEnabledOption().setSelected(CombustionObjectEnabledOption.Type.AFTER_ITERATION);
chemistryADIGasModel_0.setThreshold(20);
ChemistryADISurfaceGasModel chemistryADISurfaceGasModel_0 = physicsContinuum_0.getModelManager().getModel(ChemistryADISurfaceGasModel.class);
chemistryADISurfaceGasModel_0.getCombustionObjectEnabledOption().setSelected(CombustionObjectEnabledOption.Type.AFTER_ITERATION);
chemistryADISurfaceGasModel_0.setThreshold(20);
Dars-CFD properties
Previous Release Simcenter STAR-CCM+ v11.02
DarsCfdGasReactionModel darsCfdGasReactionModel_0 =physicsContinuum_0.getModelManager().getModel(DarsCfdGasReactionModel.class);
darsCfdGasReactionModel_0.setRunTimeCompile(false);
darsCfdGasReactionModel_0.setModuloProblemDescription(false);
DarsCfdProperties darsCfdProperties_0 =darsCfdGasReactionModel_0.getDarsCfdProperties();
darsCfdProperties_0.setUseReferenceValsTMinMax(false);
ComplexChemistryCombustionModel complexChemistryCombustionModel_0 =physicsContinuum_0.getModelManager().getModel(ComplexChemistryCombustionModel.class);
DarsCfdLibrary darsCfdLibrary_0 = complexChemistryCombustionModel_0.getDarsCfdLibrary();
DarsCfdBinaryRunOptions darsCfdBinaryRunOptions_0 =darsCfdLibrary_0.getDarsCfdBinaryRunOptions();
darsCfdBinaryRunOptions_0.setRunTimeCompile(false);
darsCfdLibrary_0.setModuloProblemDescription(false);
darsCfdLibrary_0.setUseReferenceValsTMinMax(false);
Dars-CFD model properties
Previous Release Simcenter STAR-CCM+ v11.02
DarsCfdGasReactionModel darsCfdGasReactionModel_0 =physicsContinuum_0.getModelManager().getModel(DarsCfdGasReactionModel.class);
darsCfdGasReactionModel_0.getColdFlowTempLimitScalar().setValue(400.0);
ComplexChemistryCombustionModel complexChemistryCombustionModel_0 =physicsContinuum_0.getModelManager().getModel(ComplexChemistryCombustionModel.class);
complexChemistryCombustionModel_0.getColdFlowTempLimitScalar().setValue(400.0);
DarsCfdSurfaceGasReactionModel darsCfdSurfaceGasReactionModel_0 =physicsContinuum_0.getModelManager().getModel(DarsCfdSurfaceGasReactionModel.class);
darsCfdSurfaceGasReactionModel_0.getColdFlowTempLimitScalar().setValue(400.0);
Dynamic Load Balancing for complex chemistry
Previous Release Simcenter STAR-CCM+ v11.02
DarsCfdIsatApproximationMethod darsCfdIsatApproximationMethod_0 =((DarsCfdIsatApproximationMethod) darsCfdProperties_0.getDarsCfdApproximation().getMethod());
darsCfdIsatApproximationMethod_0.setParallelRandomization(false);
ComplexChemistryCombustionModel complexChemistryCombustionModel_0 =physicsContinuum_0.getModelManager().getModel(ComplexChemistryCombustionModel.class);
complexChemistryCombustionModel_0.setParallelRandomization(false);
DarsCfdEqTsmApproximationMethod darsCfdEqTsmApproximationMethod_0 =((DarsCfdEqTsmApproximationMethod) darsCfdProperties_0.getDarsCfdApproximation().getMethod());
darsCfdEqTsmApproximationMethod_0.setParallelRandomization(false);
DarsCfdNoneApproximationMethod darsCfdNoneApproximationMethod_0 =((DarsCfdNoneApproximationMethod) darsCfdProperties_0.getDarsCfdApproximation().getMethod());
darsCfdINoneApproximationMethod_0.setParallelRandomization(false);
Deleting a complex chemistry case
Previous Release Simcenter STAR-CCM+ v11.02
DarsCfdGasReactionModel darsCfdGasReactionModel_0 = physicsContinuum_0.getModelManager().getModel(DarsCfdGasReactionModel.class);
darsCfdGasReactionModel_0.deleteCase(true);
ComplexChemistryCombustionModel complexChemistryCombustionModel_0 =physicsContinuum_0.getModelManager().getModel(ComplexChemistryCombustionModel.class);
complexChemistryCombustionModel_0.deleteCase(true);
DarsCfdSurfaceGasReactionModel darsCfdSurfaceGasReactionModel_0 = physicsContinuum_0.getModelManager().getModel(DarsCfdSurfaceGasReactionModel.class);
darsCfdSurfaceGasReactionModel_0.deleteCase(true);
Importing a complex chemistry definition (Dars-CFD format)
Previous Release Simcenter STAR-CCM+ v11.02
DarsCfdGasReactionModel darsCfdGasReactionModel_0 =physicsContinuum_0.getModelManager().getModel(DarsCfdGasReactionModel.class);
darsCfdGasReactionModel_0.importCase("darscfdstarccm+", resolvePath("macroChanges/DarsAsciiInput"));
ComplexChemistryCombustionModel complexChemistryCombustionModel_0 =physicsContinuum_0.getModelManager().getModel(ComplexChemistryCombustionModel.class);
DarsCfdLibrary darsCfdLibrary_0 = complexChemistryCombustionModel_0.getDarsCfdLibrary();
darsCfdLibrary_0.importCase("darscfdstarccm+", resolvePath("macroChanges/DarsAsciiInput"));
Importing a complex chemistry definition (Chemkin format), gas phase
Previous Release Simcenter STAR-CCM+ v11.02
DarsCfdGasReactionModel darsCfdGasReactionModel_0 =physicsContinuum_0.getModelManager().getModel(DarsCfdGasReactionModel.class);
darsCfdGasReactionModel_0.importCaseFromChemkin("chem.inp", "therm.dat", "tran.dat",  "StarccmProject", true, "darscfdstarccm+");
ComplexChemistryCombustionModel complexChemistryCombustionModel_0 =physicsContinuum_0.getModelManager().getModel(ComplexChemistryCombustionModel.class);
complexChemistryCombustionModel_0.importCaseFromChemkin("chem.inp", "therm.dat", "tran.dat", "", "");
Importing a complex chemistry definition (Chemkin format), surface/gas phase
Previous Release Simcenter STAR-CCM+ v11.02
DarsCfdSurfaceGasReactionModel darsCfdSurfaceGasReactionModel_0 =physicsContinuum_0.getModelManager().getModel(DarsCfdSurfaceGasReactionModel.class);
darsCfdSurfaceGasReactionModel_0.importCaseFromChemkin("chem.inp,surfChem.inp", "surfTherm.dat,therm.dat", "tran.dat", "StarccmProject", true, "darscfdstarccm+");
ComplexChemistryCombustionModel complexChemistryCombustionModel_0 =physicsContinuum_0.getModelManager().getModel(ComplexChemistryCombustionModel.class);
complexChemistryCombustionModel_0.importCaseFromChemkin("chem.inp", "therm.dat", "tran.dat", "surfChem.inp", "surfTherm.dat");
Activating ISAT and ISAT parameters
Previous Release Simcenter STAR-CCM+ v11.02
darsCfdProperties_0.getDarsCfdApproximation().setMethod(DarsCfdIsatApproximationMethod.class);
DarsCfdIsatApproximationMethod darsCfdIsatApproximationMethod_0 =((DarsCfdIsatApproximationMethod) darsCfdProperties_0.getDarsCfdApproximation().getMethod());
darsCfdIsatApproximationMethod_0.getDarsCfdPressureSpecificationOption().setSelected(DarsCfdPressureSpecificationOption.Type.CONST);
DarsCfdIsatTable darsCfdIsatTable_0 =((DarsCfdIsatTable) darsCfdIsatApproximationMethod_0.getDarsCfdIsatTableManager().getDarsCfdIsatTable("1"));
darsCfdIsatTable_0.getUpperTimeStep().setValue(1.0E-4);
complexChemistryCombustionModel_0.getIsatOption().setSelected(IsatOrEqTsmOption.Type.ISAT);
DarsCfdIsatCalculationMethod darsCfdIsatCalculationMethod_0 = complexChemistryCombustionModel_0.getDarsCfdIsatCalculationMethod();
darsCfdIsatCalculationMethod_0.getIsatPressureSpecificationOption().setSelected(IsatPressureSpecificationOption.Type.CONST);
DarsCfdIsatTable darsCfdIsatTable_0 =((DarsCfdIsatTable) darsCfdIsatCalculationMethod_0.getDarsCfdIsatTableManager().getDarsCfdIsatTable("1"));
darsCfdIsatTable_0.getUpperTimeStep().setValue(1.0E-4);
Activating the Relax to Equilibrium method and setting properties
Previous Release Simcenter STAR-CCM+ v11.02
darsCfdProperties_0.getDarsCfdApproximation().setMethod(DarsCfdEqTsmApproximationMethod.class);
DarsCfdEqTsmApproximationMethod darsCfdEqTsmApproximationMethod_0 =((DarsCfdEqTsmApproximationMethod) darsCfdProperties_0.getDarsCfdApproximation().getMethod());
darsCfdEqTsmApproximationMethod_0.setIncludeChemTime(true);
complexChemistryCombustionModel_0.getIsatOption().setSelected(IsatOrEqTsmOption.Type.EQTSM);
DarsCfdEqTsmCalculationMethod darsCfdEqTsmCalculationMethod_0 =complexChemistryCombustionModel_0.getDarsCfdEqTsmCalculationMethod();
darsCfdEqTsmCalculationMethod_0.setIncludeChemTime(true);

Combustion: Changes to Names for Post-Processing

The changes to complex chemistry include the renaming of various items from DarsCfd to ComplexChemistry.

The following example shows changes to the macro code for creating reports:

Previous Release Simcenter STAR-CCM+ v11.02
DarsCfdSumQuantityReport darsCfdSumQuantityReport_0 =
      simulation_0.getReportManager().createReport(DarsCfdSumQuantityReport.class);
darsCfdSumQuantityReport_0.getDarsCfdQuantityOption().setSelected(DarsCfdQuantityOption.Type.CPUTIME);
darsCfdSumQuantityReport_0.getDarsCfdQuantityAccumulationOption().setSelected(DarsCfdQuantityAccumulationOption.Type.PERITER);
ComplexChemistryMaxQuantityReport complexChemistryMaxQuantityReport_1 =
      simulation_0.getReportManager().createReport(ComplexChemistryMaxQuantityReport.class);
complexChemistryMaxQuantityReport_1.getComplexChemistryReportQuantityOption().setSelected(ComplexChemistryReportQuantityOption.Type.CPUTIME);
complexChemistryMaxQuantityReport_1.getComplexChemistryReportQuantityAccumulationOption().setSelected(ComplexChemistryReportQuantityAccumulationOption.Type.PERITER);

Combustion: Changes to Ideal Gas

The range of choices for ideal gas in combustion has been simplified. As a result, the Java macro classes IdealGasWithCombustionModel.class and DarsCfdIdealGasModel.class no longer exist. Update your macros as follows, depending on the combustion models that you are using:

  • Replace IdealGasWithCombustionModel.class as follows:
    • For Eddy Break-Up, Thickened Flame Model, Coherent Flame Model, and Turbulent Flame Speed Closure, use IdealGasModel.class.
    • For Non-Premixed PPDF Equilibrium Model, use PpdfIdealGasModel.class.
    • For Partially-Premixed CFM, use PcfmIdealGasModel.class.
    • For Non-Adiabatic PPDF Flamelet Model, use IdealGasWithNonAdiabaticFlameletModel.class.
  • For Complex Chemistry models, replace DarsCfdIdealGasModel.class with IdealGasModel.class.

An example from a macro with Eddy Break-Up follows:

Previous Release Simcenter STAR-CCM+ v11.02
(NonPremixedCombustionFlameTypeModel.class);
    physicsContinuum_0.enable(EbuGasCombustionModel.class);
    physicsContinuum_0.enable(SegregatedFlowModel.class);
    physicsContinuum_0.enable(SegregatedSpeciesModel.class);
    physicsContinuum_0.enable(IdealGasWithCombustionModel.class);
    physicsContinuum_0.enable(SegregatedFluidEnthalpyModel.class);
(NonPremixedCombustionFlameTypeModel.class);
    physicsContinuum_0.enable(EbuGasCombustionModel.class);
    physicsContinuum_0.enable(SegregatedFlowModel.class);
    physicsContinuum_0.enable(SegregatedSpeciesModel.class);
    physicsContinuum_0.enable(SegregatedFluidEnthalpyModel.class);
    physicsContinuum_0.enable(IdealGasModel.class);

Combustion: Changes to PPDF Tables

The way in which Simcenter STAR-CCM+ handles PPDF tables has changed. Modify your existing macros accordingly.

Previous Release Simcenter STAR-CCM+ v11.02
PpdfFlameletTable ppdfFlameletTable_0 = 
  ((PpdfFlameletTable) ppdfNonAdiabaticFlameletModel_0.getPpdfFlameletTable());
NonPpdfVar nonPpdfVar_0 = 
 ((NonPpdfVar) ((NonPpdfVarManager) ppdfFlameletTable_0.getNonPpdfVarManager()).getComponent("Scalar Dissipation Rate"));
nonPpdfVar_0.setDimensionSize(21);
PpdfTableAxis ppdfTableAxis_0 = 
  ((PpdfTableAxis) ((PpdfTableAxisManager) ppdfFlameletTable_0.getPpdfTableAxisManager()).getComponent("Mixture Fraction"));
PpdfFlameletTable ppdfFlameletTable_0 = 
  ((PpdfFlameletTable) ppdfNonAdiabaticFlameletModel_0.getPpdfFlameletTable());
PpdfTableAxis ppdfTableAxis_0 = 
    ((PpdfTableAxis) ((PpdfTableAxisManager)ppdfFlameletTable_0.getPpdfTableAxisManager()).getComponent("Scalar Dissipation Rate"));
ppdfTableAxis_0.setDimensionSize(21);
PpdfTableAxis ppdfTableAxis_0 = 
  ((PpdfTableAxis) ((PpdfTableAxisManager) ppdfFlameletTable_0.getPpdfTableAxisManager()).getComponent("Mixture Fraction"));

Change for Erosion Model

The Erosion model is now available with Eulerian granular modeling. As a result, the Erosion Ratio scalar profile has been changed from star.lagrangian.erosion.ErosionRatio to star.multiphase.erosion.ErosionRatio. Modify your existing macros accordingly.

Previous Release Simcenter STAR-CCM+ v11.02
import star.common.*;
import star.lagrangian.*;
import star.lagrangian.erosion.ErosionRatio;
DefaultBoundaryConditions defaultBoundaryConditions =
    (DefaultBoundaryConditions) getPhase().getDefaultBoundaryConditionsManager().getBoundaryConditions(WallBoundary.class);
ErosionRatio erosionRatio =
    defaultBoundaryConditions.getValues().get(ErosionRatio.class);
erosionRatio.setMethod(AhlertCorrelation.class);
import star.common.*;
import star.lagrangian.*;
import star.multiphase.erosion.ErosionRatio;
DefaultBoundaryConditions defaultBoundaryConditions =
    (DefaultBoundaryConditions) getPhase().getDefaultBoundaryConditionsManager().getBoundaryConditions(WallBoundary.class);
ErosionRatio erosionRatio =
    defaultBoundaryConditions.getValues().get(ErosionRatio.class);
erosionRatio.setMethod(AhlertCorrelation.class);

GT-SUITE Co-simulation: Changes Due to Refactoring

GT-SUITE 1D Co-simulation has been refactored for greater ease of use and maintainability. The changes to the macros for this co-simulation are extensive, so you are advised to re-record them.

Data Mapping: 2D Regions Now Treated as Surfaces

Data mappers now treat 2D regions as surfaces rather than as volumes, resulting in changes to the macro code.

Previous Release Simcenter STAR-CCM+ v11.02
VolumeDataMapper vdm = 
sim.get(DataMapperManager.class)
.createMapper(
VolumeDataMapper.class, "Volume Data Mapper"
);
vdm.setSourceStencil(2);
vdm.getSourceParts().setObjects(source2Dregion_0, source2Dregion_1);
vdm.setUpdateAvailableFields(true);
vdm.setScalarFieldFunctions(
new NeoObjectVector(new Object[] { getScFieldFunction(sim,"SCLR0001")})
);
VolumeTargetSpecification vts = 
((VolumeTargetSpecification) vdm.getTargetSpecificationManager().getObject("Volume 1"));
vts.setInterpolationMethod(1);
vts.setTargetStencil(2);
vts.getTargetParts().setObjects(target2Dregion_0, target2Dregion_1);
vdm.mapData();
SurfaceDataMapper sdm = sim.get(DataMapperManager.class)
.createMapper(
SurfaceDataMapper.class, "Surface Data Mapper"
);
sdm.setSourceStencil(1);
sdm.getSourceParts().setObjects(
source2Dregion_0, source2Dregion_1);
sdm.setUpdateAvailableFields(true);
sdm.setScalarFieldFunctions(
new NeoObjectVector(new Object[] { getScFieldFunction(sim,"SCLR0001")})
);
SurfaceTargetSpecification sts = (
(SurfaceTargetSpecification) sdm.getTargetSpecificationManager().getObject("Surface 1")
);
sts.setInterpolationMethod(1);
sts.setTargetStencil(1);
sts.getTargetParts().setObjects(target2Dregion_0, target2Dregion_1);
sdm.mapData();

Virtual Disk: Changes to Body Force Propeller and 1D Momentum Methods

Options have been added to the Body Force Propeller and 1D Momentum methods, resulting in changes to the macro code.

Previous Release Simcenter STAR-CCM+ v11.02
PropellerInflowVelocityPlane inflowPlane =  disk.getComponentsManager().get(PropellerInflowVelocityPlane.class);
inflowPlane.getRadius().setValue(0.6);
inflowPlane.getOffset().setValue(0.22);
VdmInflowSpecification inflowSpec = disk.getComponentsManager().get(VdmInflowSpecification.class);
inflowSpec.setActiveInflowMethod(VdmAverageInflowPlaneMethod.class);
VdmAverageInflowPlaneMethod velPlane = (VdmAverageInflowPlaneMethod) inflowSpec.getActiveInflowMethod();
velPlane.getRadius().setValue(0.6);
velPlane.getOffset().setValue(0.22);

Changes to Methods Related to Creation of the Simulation Process Object

The API related to creating a server and opening the simulation, as well as connecting to the running server, was changed. SimulationProcessObject is no longer created using its constructor directly but through the ApplicationManager and SimulationApplicaton management objects. If the SimulationProcessObject is created directly, the registration with the ApplicationManager is not properly done and the behavior is undefined.

Examples of recommended macro changes follow for specific instances of creating a simulation process object:

To create a simulation process object and simulation using the default server connection:
Previous Release Simcenter STAR-CCM+ v11.02
SimulationProcessObject spo = new SimulationProcessObject()
SimulationProcessObject spo = (SimulationProcessObject)ApplicationManager.getSingleton().getApplication(SimulationApplication.APPLICATION_TYPE).createRoot()
To create a simulation process object and simulation for the given file:
Previous Release Simcenter STAR-CCM+ v11.02
SimulationProcessObject spo = new SimulationProcessObject(filename)
SimulationProcessObject spo = (SimulationProcessObject)ApplicationManager.getSingleton().getApplication(SimulationApplication.APPLICATION_TYPE).createRoot(filename)
To create a simulation process object by connecting to the server process at the specified host and port:
Previous Release Simcenter STAR-CCM+ v11.02
SimulationProcessObject spo = new SimulationProcessObject(host, port)
SimulationProcessObject spo = (SimulationProcessObject)ApplicationManager.getSingleton().getApplication(SimulationApplication.APPLICATION_TYPE).connect(host, port)
To create a simulation process object by connecting to the server process at the specified host and port through an SSH tunnel:
Previous Release Simcenter STAR-CCM+ v11.02
SimulationProcessObject spo = new SimulationProcessObject(host, port, sshHost, sshUserName)
SimulationProcessObject spo = (SimulationProcessObject)ApplicationManager.getSingleton().getApplication(SimulationApplication.APPLICATION_TYPE).connect(host, port, sshHost, sshUserName)

Change to Management of Open Simulations

Management of the open simulations through the SimulationManager class has been deprecated. The class still exists and all its methods are functional, but going forward the preferred methods of managing open simulations are through the new ApplicationManager and SimulationApplication classes.

Examples of recommended macro changes follow for specific instances of managing open simulations:

To get all simulations open in the client:
Previous Release Simcenter STAR-CCM+ v11.02
Collection<Simulation> sl = SimulationManager.getSingleton().simulations();
Set<Simulation> sl = ApplicationManager.getSingleton().getApplicationAs(SimulationApplication.class, SimulationApplication.APPLICATION_TYPE).getRootObjects()
To get the simulation for the existing client server object:
Previous Release Simcenter STAR-CCM+ v11.02
Simulation s = SimulationManager.getSingleton().getSimulation(cso)
Simulation s = Simulation.getInstance(cso)
To check whether the application is exiting:
Previous Release Simcenter STAR-CCM+ v11.02
SimulationManager.getSingleton().isExiting()
ApplicationManager.getSingleton().isExiting()
To add an observer to be notified when a new simulation appears:
Previous Release Simcenter STAR-CCM+ v11.02
SimulationManager.getSingleton().addSimulationObserver(observer)
ApplicationManager.getSingleton().addRootObjectsChangedObserver(observer)
NoteTo make sure that you respond only to additions or removals of simulations, check the type of object in the handler. For example:
// Watch for new root objects
private static class RootObjectObserver extends RootObjectsChangedNotifier.NotifierReceiver {
    @Override
    protected void rootObjectAdded(RootObject root) {
        if (root instanceof Simulation) {
             // handle the new simulation added
        }
    }
}

Changes for Accessing the List of Simulation Processes

Functionality related to the list of active simulation process objects and the modified registry was moved to the new ApplicationManager class.

For reasons of compatibility, the methods of the previous version are still available, but marked as deprecated. It is recommended that you upgrade your macros with the methods of the current version for long-term reliability.

Examples of recommended macro changes follow for specific instances of accessing simulation processes:

To get the list of active simulation process objects:
Previous Release Simcenter STAR-CCM+ v11.02
SimulationProcessObject[] list = SimulationProcessObject.activeSimulationProcessObjects()
Set<RootProcessObject> set = ApplicationManager.getSingleton().getApplication(SimulationApplication.APPLICATION_TYPE).getActiveRootProcessObjects();
NoteAt this point the set contains all active SimulationProcessObjects (designated as the RootProcessObject base class).
To get the list of modified simulation process objects:
Previous Release Simcenter STAR-CCM+ v11.02
Set<SimulationProcessObject> set = SimulationProcessObject.getModifiedRegistry().getModifiedSet()
Set<RootProcessObject> set = ApplicationManager.getSingleton().getApplication(SimulationApplication.APPLICATION_TYPE).getModifiedRootProcessObjects()
To add an observer for changes in the list of modified simulation process objects:
Previous Release Simcenter STAR-CCM+ v11.02
SimulationProcessObject.getModifiedRegistry().addChangeListener(changeListener)
ApplicationManager.getSingleton().addModifiedRootProcessObjectsChangedListener(observer)
NoteTo make sure that you respond only to these changes, check the type of RootProcessObject that is passed to the observer.