Macro API Changes 2402
In Simcenter STAR-CCM+ 2402, the macro API changed for 3D-CAD, motion, material properties, heat transfer, radiation, Eulerian multiphase, battery modeling, post-processing, and Design Manager.
3D-CAD: New Boolean Unite Option to Keep Original Faces
An option to keep original faces in the Boolean unite operation has been added to Simcenter STAR-CCM+ 2402. This new option allows you to specify whether or not to preserve any redundant edges that are imprinted by the unite bodies feature onto any of the input bodies. In previous releases, these redundant imprinted edges were automatically deleted by unite bodies features. This improvement has resulted in changes to the macro code.
The following member function has been
added to the class UniteBodiesFeature
of the package
star.cadmodeler
: void setKeepImprintedEdges(boolean
mode);
.
When you record a macro with the
creation of a default unite bodies feature in Version 2402, an additional statement
is recorded to the macro:
uniteBodiesFeature_0.setKeepImprintedEdges(false);
.
Previous Release | Simcenter STAR-CCM+ 2402 |
---|---|
|
|
Motion: Changes to Rotating Motion
Due to introduction of new rotating motion capabilities in Simcenter STAR-CCM+, the macro code for rotating motions and superposing rotating motions has changed.
Setting rotation rate in rotating motions
Previous Release | Simcenter STAR-CCM+ 2402 |
---|---|
|
|
Setting rotation axis direction and origin in rotating motions
Previous Release | Simcenter STAR-CCM+ 2402 |
---|---|
|
|
Setting rotation axis direction and origin in superposing rotating motions
Previous Release | Simcenter STAR-CCM+ 2402 |
---|---|
|
|
Setting rotation angle in rotating motions
Previous Release | Simcenter STAR-CCM+ 2402 |
---|---|
|
|
Setting rotation angle in superposing rotating motions
Previous Release | Simcenter STAR-CCM+ 2402 |
---|---|
|
|
Material Properties: Deprecation of Anisotropic Material Property Specification Methods
The material property specification methods Anisotropic and Anisotropic (Legacy) have been deprecated since version 2210 and are planned for removal from a future version. For details about these methods and the planned replacements, see Material Properties in Important 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+ 2402 |
---|---|
AnisotropicElectricalConductivityMethodWithValues |
FullTensorElectricalConductivityMethodWithValues |
AnisotropicPermeabilityMethodWithValues |
FullTensorPermeabilityMethodWithValues |
AnisotropicPermittivityMethodWithValues |
FullTensorPermittivityMethodWithValues |
AnisotropicThermalConductivityMethodWithValues |
FullTensorThermalConductivityMethodWithValues |
AnisotropicThermalConductivityMethod |
FullTensorLegacyThermalConductivityMethod |
Radiation: Changes to Photon Monte Carlo Modeling
Due to the introduction of Volumetric Photon Monte Carlo modeling, macro codes for the Photon Monte Carlo solver have changed.
Previous Release | Simcenter STAR-CCM+ 2402 |
---|---|
|
|
Eulerian Multiphase (EMP): Changes to Particle Induced Turbulence
In Version 2402, Eulerian multiphase mixture turbulence is now compatible with particle induced turbulence, resulting in changes to the macro code.
Previous Release | Simcenter STAR-CCM+ 2402 |
---|---|
|
|
|
|
|
|
|
|
Battery Modeling: Changes to Thermal Runaway
Due to the introduction of Q tables in thermal runaway modeling, related macro code has changed.
Previous Release | Simcenter STAR-CCM+ 2402 |
---|---|
|
|
Post-Processing: Planned Removal of ChartStyle Class from Java Framework (2406)
The ChartStyle
class
is currently planned for removal from the plotting framework in version 2406,
subject to further changes.
The following class structures, which
may be present in older Java macros where .plt
files were imported,
are no longer supported:
star.common.graph.ChartStyle
star.common.graph.ChartStyleManager
An example of the earlier use of this
class shows a dataset on an exampleXYPlot
, whose
ChartStyle
is being updated:
DataSet dataSet = exampleXYPlot.getYAxes().getAxisType("Y Type 1").getDataSets().getDataSet("Temperature");
dataSet.getChartStyle().setSymbolShape(JCSymbolStyle.NONE);
dataSet.getChartStyle().setLinePattern(JCLineStyle.SOLID);
dataSet.getChartStyle().setLineColor(Color.red);
dataSet.getChartStyle().setLineWidth(4);
In recent years,
Style
has been managed on its own sub-objects, making
ChartStyle
unnecessary.
For version 2402, you will need to make two changes:
- When applicable, update
Style
directly, instead of routing the request throughChartStyle
. - When no direct change is possible, remove the calls altogether.
Specific
Style
-to-Type
replacements:
- Replace
JCSymbolStyle
withSymbolShapeOption.Type
. - Replace
JCLineStyle
withLinePatternOption.Type
. - Replace
JCFillStyle
withFillPatternOption.Type
.
Detailed Instructions for Updating Code, with Examples
The following Line Style-related calls should be updated, as necessary:
ChartStyle.setLinePattern
ChartStyle.setLineColor
ChartStyle.setLineWidth
Examples of updates to API calls for Line Style:
// At the top of the macro
import star.common.LinePatternOption;
import star.common.LineStyle;
DataSet dataSet = exampleXYPlot.getYAxes().getAxisType("Y Type 1").getDataSets().getDataSet("Temperature");
// Step 1: Replace getChartStyle() calls with their direct 'set' calls.
// dataSet.getChartStyle().setLinePattern(JCLineStyle.SOLID);
dataSet.getLineStyle().setLinePatternOptionInput(LinePatternOption.Type.SOLID); // (Step 2) replacement for JCLineStyle.SOLID
// dataSet.getChartStyle().setLineColor(Color.red);
dataSet.getLineStyle().setColor(Color.red);
// dataSet.getChartStyle().setLineWidth(4);
dataSet.getLineStyle().setLineWidth(4);
The following Symbol Style-related calls should be updated, as necessary:
ChartStyle.setSymbolShape
ChartStyle.setSymbolSize
ChartStyle.setSymbolStrokeWidth
ChartStyle.setSymbolColor
Examples of updates to API calls for Symbol Style:
// At the top of the macro
import star.common.SymbolShapeOption;
import star.common.SymbolStyle;
DataSet dataSet = exampleXYPlot.getYAxes().getAxisType("Y Type 1").getDataSets().getDataSet("Temperature");
// Step 1: Replace getChartStyle() calls with their direct 'set' calls. Calls
// dataSet.getChartStyle().setSymbolShape(JCSymbolStyle.NONE);
dataSet.getSymbolStyle().setSymbolShapeOptionInput(SymbolShapeOption.Type.NONE); // (Step 2) replacement for JCSymbolStyle.NONE
// dataSet.getChartStyle().setSymbolSize(10);
dataSet.getSymbolStyle().setSize(10);
// dataSet.getChartStyle().setSymbolStrokeWidth(0.2);
dataSet.getSymbolStyle().setStrokeWidth(0.2);
// dataSet.getChartStyle().setSymbolColor(Color.red);
dataSet.getSymbolStyle().setColor(Color.red);
The following Fill Style-related calls should be updated, as necessary:
ChartStyle.setFillPattern
ChartStyle.setFillColor
ChartStyle.setFillBackground
Examples of updates to API calls for Fill Style:
// At the top of the macro
import star.common.FillPatternOption;
import star.common.FillStyle;
DataSet dataSet = exampleXYPlot.getYAxes().getAxisType("Y Type 1").getDataSets().getDataSet("Temperature");
// Step 1: Replace getChartStyle() calls with their direct 'set' calls.
// dataSet.getChartStyle().setFillPattern(JCFillStyle.SOLID);
dataSet.getFillStyle().setLinePatternOptionInput(FillPatternOption.Type.SOLID); // (Step 2) replacement for JCFillStyle.SOLID
// dataSet.getChartStyle().setFillColor(Color.red);
dataSet.getFillStyle().setColor(Color.red);
// dataSet.getChartStyle().setFillBackground(Color.blue);
dataSet.getFillStyle().setBackgroundColor(Color.blue);
The following API calls shall be removed altogether. Their handling has been discontinued/internalized.
ChartStyle.setLineCap
ChartStyle.setLineJoin
Examples of removal of API calls for Line Style:
DataSet dataSet = exampleXYPlot.getYAxes().getAxisType("Y Type 1").getDataSets().getDataSet("Temperature");
dataSet.getChartStyle().setLineCap(0);
dataSet.getChartStyle().setLineJoin(0);
Replacements of Old Symbol, Line, and Fill Style with Current Supported Types
Symbol Style:
import star.common.SymbolShapeOption;
Previous Release | Simcenter STAR-CCM+ 2402 |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Line Style:
import star.common.LinePatternOption;
Previous Release | Simcenter STAR-CCM+ 2402 |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Fill Style:
import star.common.FillPatternOption;
Previous Release | Simcenter STAR-CCM+ 2402 |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Style API Removal and Replacements
Line Style
Remove the following:
LineStyle.setVisible(boolean)
LineStyle.getJoin()
LineStyle.setJoin(int)
LineStyle.getCap()
LineStyle.setCap(int)
Replace code as follows:
Previous Release | Simcenter STAR-CCM+ 2402 |
---|---|
|
|
|
|
Symbol Style
Remove
SymbolStyle.setVisible(boolean)
.
Replace code as follows:
Previous Release | Simcenter STAR-CCM+ 2402 |
---|---|
|
|
|
|
Fill Style
Remove
FillStyle.setVisible(boolean)
.
Previous Release | Simcenter STAR-CCM+ 2402 |
---|---|
|
|
|
|
Design Manager: Changes to Output Tables and Default Views
In Design Manager output tables have been restructured, and the dashboard is now the default view when a study is run. These modifications have resulted in changes to the macro code.
There is a new class for the output
table, and the class openTableView
is now deprecated.
Previous Release | Simcenter STAR-CCM+ 2402 |
---|---|
|
|
Design Manager dashboards were introduced in Version 2402. When a study is run, dashboards are displayed instead of the output table. Dashboards can also be opened manually.
You may want to open a dashboard instead of the output table. The following code opens a dashboard:
MdxDesignStudy mdxDesignStudy_0 =
mdxProject_0.getDesignStudyManager().getDesignStudy("Test");
LayoutView layoutView_0 =
mdxDesignStudy_0.openStudyDashboard();
The following table shows macro code recorded during the run of a design study in the previous release and Version 2402.
Previous Release | Simcenter STAR-CCM+ 2402 |
---|---|
|
|