Macro API Changes 2210

In Simcenter STAR-CCM+ 2210, the macro API changed for memory reporting, overset, material properties, aeroacoustics, reacting flow, Eulerian multiphase, electromagnetism, electrochemistry, and Design Manager.

Memory Reporting: End of Deprecated Virtual Memory Report

The Deprecated Virtual Memory Report (DEPRECATED_VIRTUAL), which is accessed only through macros and does not appear in the Simcenter STAR-CCM+ UI, has been removed. The Virtual Memory report can be used instead to monitor the virtual memory consumption of the simulation run.

To update your macro codes, replace instances of MemoryReportMetricOption.Type.DEPRECATED_VIRTUAL; with MemoryReportMetricOption.Type.VIRTUAL;.

Overset Mesh: Changes to Small Gap Handling

Due to improvements and simplification of the overset prism layer shrinkage, related macro code has changed.

The following classes have been discontinued as a result of the simplification:

  • star.common.OversetPrismLayerShrinkageOption
  • star.common.MaximumStretchFactor
  • star.common.PrismLayerDetectionControl

The following classes have been moved from common to the overset package due to refactoring:

Previous Release Simcenter STAR-CCM+ 2210
star.common.MinimumGapDistance
star.overset.MinimumGapDistance
star.common.NumAdaptivePrismLayers
star.overset.NumAdaptivePrismLayers
star.common.NumPrismLayersGap
star.overset.NumPrismLayersGap

Material Properties: Deprecation of Anisotropic Material Property Specification Methods

The material property specification methods Anisotropic and Anisotropic (Legacy) have been deprecated in Simcenter STAR-CCM+ 2210 and are planned to be removed in version 2306. For details about these methods and the planned replacements, see "Material Properties" in the Important Notes section of the 2210 Release Notes.

If any of your existing macros use the deprecated material property methods (9 Anisotropic components for Thermal Conductivity, Electrical Conductivity, Permeability, Permittivity, or Anisotropic (Legacy) for Thermal Conductivity), search for instances of following strings and update them as shown in the following table:

Previous Release Simcenter STAR-CCM+ 2210
AnisotropicElectricalConductivityMethodWithValues FullTensorElectricalConductivityMethodWithValues
AnisotropicPermeabilityMethodWithValues FullTensorPermeabilityMethodWithValues
AnisotropicPermittivityMethodWithValues FullTensorPermittivityMethodWithValues
AnisotropicThermalConductivityMethodWithValues FullTensorThermalConductivityMethodWithValues
AnisotropicThermalConductivityMethod FullTensorLegacyThermalConductivityMethod

Aeroacoustics: Changes to Use of Acoustic Modal Solver

With the introduction of new acoustic modal solver options, macro code has changed.

Previous Release Simcenter STAR-CCM+ 2210
Simulation simulation_0 = getActiveSimulation();

AcousticModalSolver acousticModalSolver_0 =
simulation_0.getSolverManager().getSolver(AcousticModalSolver.class);

acousticModalSolver_0.performNormalModesAnalysis();
Simulation simulation_0 = getActiveSimulation();

AcousticModalSolver acousticModalSolver_0 =
simulation_0.getSolverManager().getSolver(AcousticModalSolver.class);

acousticModalSolver_0.solveAcousticModes();

Reacting Flow: Changes to Table Generation

With the introduction of a new Laminar Flame Speed (LFS) table generator interface, macro code has changed.

Previous Release Simcenter STAR-CCM+ 2210
LfsTable lfsTable_0 =
  ((LfsTable) ((LaminarFlameSpeedTabulatedOption) flameSurfaceDensityRansModel_0.getLaminarFlameSpeedOptions().getMethod()).getLfsTable());
LfsEcfmTableGenerator lfsEcfmTableGenerator_0 =
  ((LfsEcfmTableGenerator) physicsContinuum_0.get(EcfmTableGeneratorManager.class).getObject("LFS Table Generator"));

LfsTable lfsTable_0 =
  ((LfsTable) lfsEcfmTableGenerator_0.getLfsTable());

Eulerian Multiphase (EMP)

Changes to Volume Fraction Specification

As described in the Important Notes section of the 2210 Release Notes, the specification of user-defined values or extrapolated values at the Pressure Outlet has changed.

Update your macros as shown in the following examples.

User-specified volume fraction for reverse flow at a pressure boundary

Previous Release Simcenter STAR-CCM+ 2210
boundary_0.getConditions().get(VolumeFractionSpecificationOption.class).setSelected(VolumeFractionSpecificationOption.Type.USER);
BackflowSpecification backflowSpecification_0 = boundary_0.getConditions().get(BackflowSpecification.class);
backflowSpecification_0.getReversedFlowScalarOption().setSelected(ReversedFlowScalarOption.Type.SPECIFIED);

Extrapolated volume fraction for reverse flow at a pressure boundary

Previous Release Simcenter STAR-CCM+ 2210
boundary_0.getConditions().get(VolumeFractionSpecificationOption.class).setSelected(VolumeFractionSpecificationOption.Type.EXTRAPOLATION);
BackflowSpecification backflowSpecification_0 = boundary_0.getConditions().get(BackflowSpecification.class);
backflowSpecification_0.getReversedFlowScalarOption().setSelected(ReversedFlowScalarOption.Type.EXTRAPOLATED);

If existing macros set the now removed Physics Conditions > Volume Fraction Specification to EXTRAPOLATION, then the Scalars property of the Physics Conditions > Backflow Specification boundary condition must be set to EXTRAPOLATED as shown in the preceding table.

If the previous setting of the Scalars property of the Physics Conditions > Backflow Specification was SPECIFIED (the default choice), then you must remove manually from the macro code the scalar profiles that are no longer needed. Profiles that must be removed in this situation are:

  • SauterMeanDiameterProfile sauterMeanDiameterProfile_0 = phaseConditions_0.getPhaseValueManager().get(SauterMeanDiameterProfile.class);
  • MassFractionProfile massFractionProfile_0 = phaseConditions_0.getPhaseValueManager().get(MassFractionProfile.class);
  • StaticTemperatureProfile staticTemperatureProfile_0 = phaseConditions_0.getPhaseValueManager().get(StaticTemperatureProfile.class);
  • PassiveScalarProfile passiveScalarProfile_0 = phaseConditions_0.getPhaseValueManager().get(PassiveScalarProfile.class);

Changes to Adaptive Time-Step for Granular Model

Improvement of the Adaptive Time-Step control for the granular model includes the introduction of the Threshold Frictional Solid Pressure property, resulting in changes to the macro code.

In this new property, the unit and value are specified. This substitutes for the Threshold Volume Fraction property that existed in Simcenter STAR-CCM+ 2206.

Previous Release Simcenter STAR-CCM+ 2210
Units units_0 = 
  ((Units) simulation_0.getUnitsManager().getObject(""));

maximumPackingTimeStepProvider_0.getThresholdvf().setValueAndUnits(0.6, units_0);
Units units_0 = 
  ((Units) simulation_0.getUnitsManager().getObject("Pa"));

maximumPackingTimeStepProvider_0.getThresholdfsp().setValueAndUnits(1000.0, units_0);

Electromagnetism: Renaming of Report to Regularized Magnetic Inductance

Due to the introduction of a new Magnetic Inductance report for the Excitation Coil Lumped Parameter model, the pre-existing Magnetic Inductance report has been renamed Regularized Magnetic Inductance.

This restructuring resulted in changes to the macro code.

Previous Release Simcenter STAR-CCM+ 2210
import star.electromagnetism.magneticpotential.fem.MagneticInductanceReport;
...
MagneticInductanceReport magneticInductanceReport_0 = simulation_0.getReportManager().createReport(MagneticInductanceReport.class);
import star.electromagnetism.magneticpotential.fem.RegularizedMagneticInductanceReport;
...
RegularizedMagneticInductanceReport magneticInductanceReport_0 = simulation_0.getReportManager().createReport(RegularizedMagneticInductanceReport.class);

Electrochemistry

Changes to Concentration Solution

With the introduction of Binary Concentrated Solution Theory, related macro code has changed. Specifically, the Li substring has been removed from class names as follows:

  • star.liionbatterycell.TemperatureLiConcentrationInterpolationTable is now star.liionbatterycell.TemperatureConcentrationInterpolationTable.
  • star.liionbatterycell.TemperatureLiConcentrationInterpolationTableMethod is nowstar.liionbatterycell.TemperatureConcentrationInterpolationTableMethod.

The following code contains an example of this change:

Previous Release Simcenter STAR-CCM+ 2210
import star.liionbatterycell.TemperatureLiConcentrationTableMethod;
    DataBaseMaterialManager dataBaseMaterialManager_0 =
      materialDataBase_0.getFolder("Liquids");
    DataBaseLiquid dataBaseLiquid_0 =
      ((DataBaseLiquid) dataBaseMaterialManager_0.getMaterial("LiPF6 EC31-EMC46-DEC23_Liquid"));
    Liquid electrolyte =
      (Liquid) singleComponentLiquidModel_0.replaceMaterial(liquid_0, dataBaseLiquid_0);
    electrolyte.getMaterialProperties().getMaterialProperty(ElectrolyteDlnfAOverdlncTermProperty.class).setMethod(TemperatureLiConcentrationTableMethod.class);
    electrolyte.getMaterialProperties().getMaterialProperty(LiIonBatteryConcentrationDiffusivityProperty.class).setMethod(TemperatureLiConcentrationTableMethod.class);
    electrolyte.getMaterialProperties().getMaterialProperty(ElectrolyteLiTransferanceProperty.class).setMethod(TemperatureLiConcentrationTableMethod.class);
    electrolyte.getMaterialProperties().getMaterialProperty(ElectricalConductivityProperty.class).setMethod(TemperatureLiConcentrationTableMethod.class);
    electrolyte.getMaterialProperties().getMaterialProperty(ElectrolyteDlnc0OverdlncTermProperty.class).setMethod(TemperatureLiConcentrationTableMethod.class);
import star.liionbatterycell.TemperatureConcentrationTableMethod;
    DataBaseMaterialManager dataBaseMaterialManager_0 =
      materialDataBase_0.getFolder("Liquids");
    DataBaseLiquid dataBaseLiquid_0 =
      ((DataBaseLiquid) dataBaseMaterialManager_0.getMaterial("LiPF6 EC31-EMC46-DEC23_Liquid"));
    Liquid electrolyte =
      (Liquid) singleComponentLiquidModel_0.replaceMaterial(liquid_0, dataBaseLiquid_0);
    electrolyte.getMaterialProperties().getMaterialProperty(ElectrolyteDlnfAOverdlncTermProperty.class).setMethod(TemperatureConcentrationTableMethod.class);
    electrolyte.getMaterialProperties().getMaterialProperty(LiIonBatteryConcentrationDiffusivityProperty.class).setMethod(TemperatureConcentrationTableMethod.class);
    electrolyte.getMaterialProperties().getMaterialProperty(ElectrolyteLiTransferanceProperty.class).setMethod(TemperatureConcentrationTableMethod.class);
    electrolyte.getMaterialProperties().getMaterialProperty(ElectricalConductivityProperty.class).setMethod(TemperatureConcentrationTableMethod.class);
    electrolyte.getMaterialProperties().getMaterialProperty(ElectrolyteDlnc0OverdlncTermProperty.class).setMethod(TemperatureConcentrationTableMethod.class);

Change to Electrochemical Species Model

As part of the implementation of electrode particle diffusion, certain macro actions with surface mechanisms for the Electrochemical Species model now require that the name of a surface mechanism (that is, the phase name) be specified:

  • To get the Boundary Species Electrochemical Reaction Flux of a solid mixture component from the surface mechanism, the name of the field function has changed to include the surface mechanism name.
  • To create or set a report's field function or use it in another field function, the field function name must now include the surface mechanism name appended at the end.
Previous Release Simcenter STAR-CCM+ 2210
FieldFunctionManager fm = _sim.getFieldFunctionManager();
FieldFunction ff = fm.getFunction("BoundarySpeciesElectrochemicalReactionFluxCu");
FieldFunctionManager fm = _sim.getFieldFunctionManager();
String surfaceMechanismName = "Anode";
FieldFunction ff = fm.getFunction("BoundarySpeciesElectrochemicalReactionFluxCu" + surfaceMechanismName);

Change to Solid Electrolyte Interface (SEI)

The sign convention for SEI activation energy has changed, resulting in a change to the macro code.

Previous Release Simcenter STAR-CCM+ 2210
propertiesOfSEI_0.getResistanceEsei().setValueAndUnits(1.0, units_0);
propertiesOfSEI_0.getResistanceEsei().setValueAndUnits(-1.0, units_0);

Design Manager: Support of Multiple Export Formats

With the introduction of support of multiple export formats in Design Manager, macro code has changed.

Select the export format on a Design Manager study scene

Previous Release Simcenter STAR-CCM+ 2210
MdxStudyScene mdxStudyScene_0 = 
      ((MdxStudyScene) mdxDesignStudy_0.getStudyScenes().getObject("Mesh"));
mdxStudyScene_0.setSceneFormat(MdxVisFormatEnum.HARDCOPY);
MdxStudyScene mdxStudyScene_0 = 
      ((MdxStudyScene) mdxDesignStudy_0.getStudyScenes().getObject("Mesh"));
mdxStudyScene_0.setExportFormats(EnumSet.of(MdxVisFormatEnum.HARDCOPY, MdxVisFormatEnum.SCENEFILE));

Select the export format on a Design Manager study plot

Previous Release Simcenter STAR-CCM+ 2210
MdxStudyPlot mdxStudyPlot_0 = 
      ((MdxStudyPlot) mdxDesignStudy_0.getStudyPlots().getObject("Residuals"));
mdxStudyPlot_0.setPlotFormat(MdxVisFormatEnum.SCENEFILE);
MdxStudyPlot mdxStudyPlot_0 = 
      ((MdxStudyPlot) mdxDesignStudy_0.getStudyPlots().getObject("Residuals"));
mdxStudyPlot_0.setExportFormats(EnumSet.of(MdxVisFormatEnum.HARDCOPY, MdxVisFormatEnum.SCENEFILE));