Macro API Changes 11.06
In Simcenter STAR-CCM+ 11.06, the macro API changed for electrochemistry, Eulerian multiphase, reacting flows, directed meshing, mesh deformation, client-server, tags, and meshing.
Electrochemistry: Replacement of Tafel Method Classes
Electrochemical reactions modeling has been modified to account for the consumption of multi-component gas species that are involved in reactions. In the macro code, the Combined classes in the previous version have been replaced by their corresponding Potential classes:
Tafel
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
Tafel Slope
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
Transport Limited Tafel Slope
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
All occurrences of the combined variant have to be replaced with the potential variant. For example:
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
Note | Remove the following statements if they are present in your Java macro:
|
Eulerian Multiphase
-
The objects of the Volume of Fluid (VOF) and Two-Phase Equilibrium models have been restructured, resulting in changes to the macro code for importing:
- For VOF,
star.vof.AlphaFilmBoilingProfile has changed to
star.mixturemultiphase.AlphaFilmBoilingProfile.
To accommodate this change in your macro, you can insert an extra import statement:
import star.mixturemultiphase.AlphaFilmBoilingProfile;
Note Remove import star.vof.AlphaFilmBoilingProfile if it is present in your macro. - For Two-Phase Equilibrium,
mixturemultiphase has changed to
twophaseequilibrium.
To accommodate this change in your macro, you can insert an extra import statement:
import star.twophaseequilibrium.AlphaFilmBoilingProfile;
-
To ensure backward compatibility, all occurrences of SegregatedVofPhaseSpeciesModel should be changed to MmpPhaseSpeciesModel, and all occurrences of VofPhaseEnergyModel should be changed to MmpPhaseEnergyModel. Examples of the changes to the macro code follow:
Previous Release Simcenter STAR-CCM+ v11.06 SegregatedVofPhaseSpeciesModel segregatedVofPhaseSpeciesModel_0 = eulerianPhase_0.getModelManager().getModel(SegregatedVofPhaseSpeciesModel.class); segregatedVofPhaseSpeciesModel_0.getUpwindOption().setSelected(ConvectiveFluxOption.Type.MUSCL_3RD_ORDER);
MmpPhaseSpeciesModel mmpPhaseSpeciesModel_0 = eulerianPhase_0.getModelManager().getModel(MmpPhaseSpeciesModel.class); mmpPhaseSpeciesModel_0.getUpwindOption().setSelected(ConvectiveFluxOption.Type.MUSCL_3RD_ORDER);
VofPhaseEnergyModel vofPhaseEnergyModel_0 = eulerianPhase_0.getModelManager().getModel(VofPhaseEnergyModel.class); vofPhaseEnergyModel_0.getUpwindOption().setSelected(ConvectiveFluxOption.Type.MUSCL_3RD_ORDER);
MmpPhaseEnergyModel mmpPhaseEnergyModel_0 = eulerianPhase_0.getModelManager().getModel(MmpPhaseEnergyModel.class); mmpPhaseEnergyModel_0.getUpwindOption().setSelected(ConvectiveFluxOption.Type.MUSCL_3RD_ORDER);
- For VOF,
star.vof.AlphaFilmBoilingProfile has changed to
star.mixturemultiphase.AlphaFilmBoilingProfile.
-
Two field functions that were available with the Macro Porosity (pure thermal) model have been removed: Void Phase Source of XY and Liquid Zone Volume Change Rate.
Macros from previous versions of Simcenter STAR-CCM+ that activate the Macro Porosity (pure thermal) model must select the Field Function method for the Solid Cell Indicator to achieve the same behavior, as shown in the following example of the new macro code:
MacroPorosityPureThermalModel macroPorosityPureThermalModel_0 = phaseInteraction_0.getModelManager().getModel(MacroPorosityPureThermalModel.class); SolidCellIndicatorProfile solidCellIndicatorProfile_0 = ((SolidCellIndicatorProfile) macroPorosityPureThermalModel_0.getSolidCellIndicatorProfile()); solidCellIndicatorProfile_0.setMethod(FunctionScalarProfileMethod.class);
Reacting Flows
Changes to Soot Moment Model
The Soot Moment model has been extended to work with complex chemistry, resulting in changes to the macro code.
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
Removal of UnburntTemperatureControlOption
The UnburntTemperatureControlOption object is no longer available. Therefore remove statements such as the following:
cfmCombustionModel_0.getUnburntTemperatureControlOption().setSelected(UnburntTemperatureControlOption.ISENTROPIC_RELATION);
New User Interface
For further details about the v11.06 changes, see New Features > Physics > CFD > Reacting Flows.
The classifications have been changed from:
PremixedCombustionFlameTypeModel
PartiallyPremixedCombustionFlameTypeModel
NonPremixedCombustionFlameTypeModel
to:
ReactingSpeciesTransportBasedModel
FlameletBasedModel
Therefore when your macro activates the Eddy Break-Up, Complex Chemistry, or Eddy Contact Micromixing model, make the following change in your macro code:
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
When your macro activates the PPDF Equilibrium (now Chemical Equilibrium), PPDF Flamelet (now Steady Laminar Flame, or SLF), or Flamelet Generated Manifold (FGM), make the following change in your macro code:
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
Changes to Flamelet Generation
The species order has been changed. The new species list is sorted alphanumerically.
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
The name of the Third Body Coefficient object has changed.
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
Enabling the Thermal NOx model: previous models are now obsolete and there is only one Nox model that models thermal nox, Nox Zeldovich (NoxThreeEquationZeldovichModel).
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
Chemical Equilibrium
For the Chemical Equilibrium model, you do not need to set the default material database.
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
For the Chemical Equilibrium model, the equilibrium algorithm selection is automated.
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
The following example shows the specification of species for Chemical Equilibrium.
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
Tables
When generating or using flamelets, include tablegenerator and ppdftable packages.
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
The object constructTable has been renamed to constructFlameletTable.
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
Fluid Streams
The Thickened Flame Model (TFM) requires additional commands for fluid streams.
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
Fluid stream objects are now accessed through the EquilibriumTableGenerator, FlameletTableGenerator and FGMTableGenerator objects. The following example shows the specification of stream temperature:
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
The following example of fluid stream objects shows the specification of stream compositions:
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
Setting the fluid stream for the Soot Two-Equation model:
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
Inert Stream manipulation:
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
Changes to Thickened Flame Model
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
|
|
Time-Step Control: Renaming of Solvers
The Time-Step Control solvers have been renamed, resulting in changes to the macro code.
Convective CFL Time-Step Control
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
Energy-Based Time-Step Control
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
The following code example is for the Convective CFL Time-Step Control solver:
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
Directed Meshing: Changes to Definitions of Closed-Loop Part Collections
In closed-loop part collections, for example toroidal geometry with multiple parts, the technique for defining the source mesh has changed to ensure accuracy. If you use a simulation file or a Java macro from a previous version and notice inconsistency in the mesh definition, consider recording a new macro.
Mesh Deformation: Change from Control Points to Point Sets
For mesh deformation, point sets have replaced control points. Unlike control points, point sets are not linked to regions. The following examples show the types of changes to the macro code.
Create Each Type of Control Point/Point Set
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
Edit Lattice Point Generator
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
Edit Line Point Generator
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
Edit Part Point Generator
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
Edit Table Point Generator
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
Activate/Deactivate
Previous Release | Simcenter STAR-CCM+ v11.06 |
---|---|
|
|
Tags: Custom Icons No Longer Supported
With the extension of the tags feature to most simulation objects, the customization of the tag node icon is no longer available. Therefore the
getCustomizableIcon()
function in
star.common.UserTag
has been deprecated. Remove the use of this function from your macros.
Client-Server: Changes to StarCommandParser API
The StarCommandParser is used to parse and modify an instance of a command line used to start the Simcenter STAR-CCM+ server. Previously the API permitted you to modify the internal container that the StarCommandParser uses. In the current version of Simcenter STAR-CCM+, changes to the API prevent you from directly modifying the internal data; however you may still modify the command that the StarCommandParser manages.
Instantiating the Command Parser
The StarCommandParser is instantiated in the same way:
StarCommandParser cmdParser = new StarCommandParser("starccm+ -server");
Adding a Single Option
The command
cmdParser.addLast("-cpubind");
has been deprecated. Use the existing alternative:
cmdParser.addOption("-cpubind");
Adding an Option and a Value
The following statement
cmdParser.addLast("-licpath");
cmdParser.addLast("/my/license/path");
has been replaced with the existing alternative:
cmdParser.addOptionAndValue("-licpath","/my/license/path");
Query Option
The command
cmdParser.indexOf("-cpubind");
can be replaced with
cmdParser.hasOption("-cpubind");
Removing a Single Option
The statement
int idx = cmdParser.indexOf("-cpubind");
if ( idx != -1 ) cmdParser.remove(idx);
can be replaced with
cmdParser.remove("-cpubind");
Removing an Option and a Value
To remove the first instance of -licpath <value> from the command line, the statement
int idx = cmdParser.indexOf("-licpath");
if ( idx != -1 ) {
cmdParser.remove(idx);
cmdParser.remove(idx);
}
can be replaced with
if ( cmdParser.hasOption("-licpath") ) {
cmdParser.remove("-licpath", cmdParser.getArg("-licpath"));
}
To remove all instances of -licpath <value> from the command line:
cmdParser.removeAll("-licpath");
Replacing an Option
The statement
int idx = cmdParser.indexOf("-licpath");
if ( idx != -1 ) {
cmdParser.set(idx+1, "/a/different/license/path");
}
can be replaced with
cmdParser.replaceOptionAndValue("-licpath", "/a/different/license/path");
Meshing: Changes to Surface Preparation Macros
The Java macros produced when launching surface repair and wrapper leak detection have been shortened by removing unnecessary commands and introducing new commands where appropriate. The end result is that these macros are easier to read and modify while still maintaining functionality for older macros.
Note | Macros that worked in the previous version of Simcenter STAR-CCM+ are still supported. |
A summary of the changes for each tool is provided below.
Surface Repair Launch Macro Changes
The following new command has been introduced:
partSurfaceMeshWidget_0.startSurfaceRepairControllers();
The above command replaces the following commands:
partSurfaceMeshWidget_0.startSurfaceMeshDiagnostics();
partSurfaceMeshWidget_0.startSurfaceMeshRepair();
partSurfaceMeshWidget_0.startMergeImprintController();
partSurfaceMeshWidget_0.startIntersectController();
partSurfaceMeshWidget_0.startLeakFinderController();
partSurfaceMeshWidget_0.startSurfaceMeshQueryController();
The following commands are no longer included in the macro for launching surface repair:
Removal of Feature Diagnostics Default Display State (Reason: Now Done on Server)
SurfaceMeshWidgetDiagnosticsController surfaceMeshWidgetDiagnosticsController_0 = partSurfaceMeshWidget_0.getControllers().getController(SurfaceMeshWidgetDiagnosticsController.class);
surfaceMeshWidgetDiagnosticsController_0.setSoftFeatureErrorsActive(true);
surfaceMeshWidgetDiagnosticsController_0.setHardFeatureErrorsActive(true);
See also Macro Changes Common to Both Tools.
Wrapper Leak Detection Launch Macro Changes
The following new command has been introduced:
partSurfaceMeshWidget_0.startWrapperLeakDetectionControllers();
The above command replaces the following commands:
partSurfaceMeshWidget_0.startSurfaceMeshRepair();
partSurfaceMeshWidget_0.startMergeImprintController();
partSurfaceMeshWidget_0.startLeakFinderController();
partSurfaceMeshWidget_0.startSurfaceMeshDiagnostics();
The following commands are no longer included in the macro for launching wrapper leak detection:
Removal of Mesh Override Mode (Reason: Duplicate)
scene_0.setMeshOverrideMode(2);
Removal of Disabling of Default Diagnostics (Reason: Now Done Silently via the setCheckAll() Command)
PiercedFacesThreshold piercedFacesThreshold_0 =
((PiercedFacesThreshold) surfaceMeshWidgetDiagnosticsController_0.getOptions().getThresholdDiagnosticsManager().getObject("Pierced faces (default) 1"));
piercedFacesThreshold_0.setIsEnabled(false);
FaceQualityThreshold faceQualityThreshold_0 =
((FaceQualityThreshold) surfaceMeshWidgetDiagnosticsController_0.getOptions().getThresholdDiagnosticsManager().getObject("Face quality (default) 1"));
faceQualityThreshold_0.setIsEnabled(false);
FaceProximityThreshold faceProximityThreshold_0 =
((FaceProximityThreshold) surfaceMeshWidgetDiagnosticsController_0.getOptions().getThresholdDiagnosticsManager().getObject("Face proximity (default) 1"));
faceProximityThreshold_0.setIsEnabled(false);
FreeEdgesThreshold freeEdgesThreshold_0 =
((FreeEdgesThreshold) surfaceMeshWidgetDiagnosticsController_0.getOptions().getThresholdDiagnosticsManager().getObject("Free edges (default) 1"));
freeEdgesThreshold_0.setIsEnabled(false);
NonManifoldEdgesThreshold nonManifoldEdgesThreshold_0 =
((NonManifoldEdgesThreshold) surfaceMeshWidgetDiagnosticsController_0.getOptions().getThresholdDiagnosticsManager().getObject("Non-manifold edges (default) 1"));
nonManifoldEdgesThreshold_0.setIsEnabled(false);
NonManifoldVerticesThreshold nonManifoldVerticesThreshold_0 =
((NonManifoldVerticesThreshold) surfaceMeshWidgetDiagnosticsController_0.getOptions().getThresholdDiagnosticsManager().getObject("Non-manifold vertices (default) 1"));
nonManifoldVerticesThreshold_0.setIsEnabled(false);
Note | The setCheckAll() command now disables all diagnostics, not just the default ones. |
Macro Changes Common to Both Tools
Removal of Units Objects (Reason: Not Used)
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,0}));
Units units_1 = simulation_0.getUnitsManager().getPreferredUnits(new IntVector(new int[]{0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}));
Removal of Displayer Initialization (Reason: Has No Effect)
SurfaceMeshWidgetDisplayer surfaceMeshWidgetDisplayer_0 = ((SurfaceMeshWidgetDisplayer)scene_0.getDisplayerManager().getDisplayer("Widget displayer 1"));
surfaceMeshWidgetDisplayer_0.initialize();