Macro API Changes 2206
In Simcenter STAR-CCM+ 2206, the macro API changed for materials, heat transfer, adjoint, reacting flow, multiphase, Eulerian multiphase, DFBI, solid stress, electromagnetism, electrochemistry, post-processing, and Simcenter STAR-CCM+ In-cylinder.
Materials: Changes to Database Properties
If any of your existing macros use material databases, update them as follows:
- Add
import star.material.backwardcompatibility.*;
- Search for instances of the following strings and correct them as
shown.
Previous Release Simcenter STAR-CCM+ 2206 dataBaseMaterialPropertySutherLandLawMethod_0get...
dataBaseMaterialPropertySutherLandLawMethod_0.get...
dataBaseMaterialPropertyAlphaBetaScalingMethod_0get...
dataBaseMaterialPropertyAlphaBetaScalingMethod_0.get...
"MoleculeType"
"LennardJonesMoleculeType"
"ThermalExpansionSolids"
"ThermalExpansion"
- Remove all instances of these properties and their corresponding
methods:
DataBaseMaterialPropertyEmissivity
DataBaseMaterialPropertyHeatTransferCoefficient
DataBaseMaterialPropertyThermalDiffusivity
DataBaseMaterialPropertyWettingAngle
DeadDataBaseMaterialPropertyLJPotential
- Change
<DataBasePropertyName>.class
to"<DataBasePropertyName>"
format.Previous Release Simcenter STAR-CCM+ 2206 DataBaseMaterialPropertyPermeability dataBaseMaterialPropertyPermeability_2 = ((DataBaseMaterialPropertyPermeability) materialDataBaseSolid_2.getMaterialProperty(DataBaseMaterialPropertyPermeability.class));
DataBaseMaterialPropertyPermeability dataBaseMaterialPropertyPermeability_2 = ((DataBaseMaterialPropertyPermeability) materialDataBaseSolid_2.getMaterialProperty("DataBaseMaterialPropertyPermeability"));
- Change table methods.
DataBaseMaterialTemperatureTablePropertyMethod
toTemperatureTableMethod
:Previous Release Simcenter STAR-CCM+ 2206 DataBaseMaterialTemperatureTablePropertyMethod dataBaseMaterialTemperatureTablePropertyMethod_0 = ((DataBaseMaterialTemperatureTablePropertyMethod) dataBaseMaterialPropertyDensity_0.getMethod("DataBaseMaterialTemperatureTablePropertyMethod")); MaterialTable materialTable_0 = dataBaseMaterialTemperatureTablePropertyMethod_0.getTable(); materialTable_0.extract(resolvePath("*.csv"));
import star.energy.TemperatureTableMethod;
FileTable fileTable_0 = (FileTable)simulation_0.getTableManager().createFromFile(resolvePath("*.csv")); TemperatureTableMethod temperaturTableMethod_0 = ((TemperatureTableMethod) dataBaseMaterialPropertyDensity_0.getMethod("TemperatureTableMethod")); temperaturTableMethod_0.getInterpolationTable().setTable(fileTable_0);
DataBaseMaterialTemperaturePressureTablePropertyMethod
toTemperaturePressureTableMethod
:Previous Release Simcenter STAR-CCM+ 2206 DataBaseMaterialTemperaturePressureTablePropertyMethod dataBaseMaterialTemperaturePressureTablePropertyMethod_0= ((DataBaseMaterialTemperaturePressureTablePropertyMethod) dataBaseMaterialPropertyDensity_0.getMethod("DataBaseMaterialTemperaturePressureTablePropertyMethod")); MaterialTable materialTable_0 = dataBaseMaterialTemperaturePressureTablePropertyMethod_0.getTable(); materialTable_0.extract(resolvePath("*.csv"));
import star.energy.TemperaturePressureTableMethod;
FileTable fileTable_0 = (FileTable)simulation_0.getTableManager().createFromFile(resolvePath("*.csv")); TemperaturePressureTableMethod temperaturPressureTableMethod_0 = ((TemperaturePressureTableMethod) dataBaseMaterialPropertyDensity_0.getMethod("TemperaturePressureTableMethod")); temperaturPressureTableMethod_0.getInterpolationTable().setTable(fileTable_0);
DataBaseMaterialTemperatureLiConcentrationTablePropertyMethod
toTemperatureLiConcentrationTableMethod
:Previous Release Simcenter STAR-CCM+ 2206 DataBaseMaterialTemperatureLiConcentrationTablePropertyMethod dataBaseMaterialTemperatureLiConcentrationTablePropertyMethod_0= ((DataBaseMaterialTemperatureLiConcentrationTablePropertyMethod) dataBaseMaterialPropertyElectricalConductivity_0.getMethod("DataBaseMaterialTemperatureLiConcentrationTablePropertyMethod ")); MaterialTable materialTable_0 = dataBaseMaterialPropertyElectricalConductivity_0.getTable(); materialTable_0.extract(resolvePath("*.csv"));
import star.liionbatterycell.TemperatureLiConcentrationTableMethod;
FileTable fileTable_0 = (FileTable)simulation_0.getTableManager().createFromFile(resolvePath("*.csv")); TemperatureLiConcentrationTableMethod temperatureLiConcentrationTableMethod_0 = ((TemperatureLiConcentrationTableMethod) dataBaseMaterialPropertyElectricalConductivity_0.getMethod("TemperatureLiConcentrationTableMethod")); temperatureLiConcentrationTableMethod_0.getInterpolationTable().setTable(fileTable_0);
DataBaseMaterialMagneticSusceptibilityTemperatureTablePropertyMethod
toMagneticSusceptibilityTemperatureTableMethod
:Previous Release Simcenter STAR-CCM+ 2206 DataBaseMaterialMagneticSusceptibilityTemperatureTablePropertyMethod dataBaseMaterialMagneticSusceptibilityTemperatureTablePropertyMethod_0= ((DataBaseMaterialMagneticSusceptibilityTemperatureTablePropertyMethod) dataBaseMaterialPropertyMagneticSusceptibilityTemperatureFactor_0.getMethod ("DataBaseMaterialMagneticSusceptibilityTemperatureTablePropertyMethod")); MaterialTable materialTable_0 = dataBaseMaterialMagneticSusceptibilityTemperatureTablePropertyMethod_0.getTable(); materialTable_0.extract(resolvePath("*.csv"));
import star.electromagnetism.common.MagneticSusceptibilityTemperatureTableMethod;
FileTable fileTable_0 = (FileTable)simulation_0.getTableManager().createFromFile(resolvePath("*.csv")); MagneticSusceptibilityTemperatureTableMethod magneticSusceptibilityTemperatureTableMethod_0 = ((MagneticSusceptibilityTemperatureTableMethod ) dataBaseMaterialPropertyMagneticSusceptibilityTemperatureFactor_0 .getMethod("MagneticSusceptibilityTemperatureTableMethod")); magneticSusceptibilityTemperatureTableMethod_0.getInterpolationTable().setTable(fileTable_0);
DataBaseMaterialBHCurveTablePropertyMethod
toPermeabilityTableMethod
:Previous Release Simcenter STAR-CCM+ 2206 DataBaseMaterialBHCurveTablePropertyMethod dataBaseMaterialBHCurveTablePropertyMethod_0= ((DataBaseMaterialBHCurveTablePropertyMethod) dataBaseMaterialPropertyPermeability_0.getMethod("DataBaseMaterialBHCurveTablePropertyMethod")); MaterialTable materialTable_0 = dataBaseMaterialBHCurveTablePropertyMethod_0.getTable(); materialTable_0.extract(resolvePath("*.csv"));
import star.electromagnetism.common.PermeabilityTableMethod;
FileTable fileTable_0 = (FileTable)simulation_0.getTableManager().createFromFile(resolvePath("*.csv")); PermeabilityTableMethod permeabilityTableMethod_0 = ((PermeabilityTableMethod) dataBaseMaterialPropertyPermeability_0.getMethod("PermeabilityTableMethod")); permeabilityTableMethod_0.getBandHInterpolationTable().setTable(fileTable_0);
DataBaseMaterialMagneticRemanenceFluxDensityTemperatureTablePropertyMethod
toMagneticRemanenceFluxDensityTemperatureTableMethod
:Previous Release Simcenter STAR-CCM+ 2206 DataBaseMaterialMagneticRemanenceFluxDensityTemperatureTablePropertyMethod dataBaseMaterialMagneticRemanenceFluxDensityTemperatureTablePropertyMethod_0= ((DataBaseMaterialMagneticRemanenceFluxDensityTemperatureTablePropertyMethod) dataBaseMaterialPropertyMagneticRemanenceFluxDensity_0 .getMethod("DataBaseMaterialMagneticRemanenceFluxDensityTemperatureTablePropertyMethod")); MaterialTable materialTable_0 = dataBaseMaterialMagneticRemanenceFluxDensityTemperatureTablePropertyMethod_0.getTable(); materialTable_0.extract(resolvePath("*.csv"));
import star.electromagnetism.common.MagneticRemanenceFluxDensityTemperatureTableMethod;
FileTable fileTable_0 = (FileTable)simulation_0.getTableManager().createFromFile(resolvePath("*.csv")); MagneticRemanenceFluxDensityTemperatureTableMethod magneticRemanenceFluxDensityTemperatureTableMethod_0 = ((MagneticRemanenceFluxDensityTemperatureTableMethod) dataBaseMaterialPropertyMagneticRemanenceFluxDensity_0 .getMethod("MagneticRemanenceFluxDensityTemperatureTableMethod")); magneticRemanenceFluxDensityTemperatureTableMethod_0.getInterpolationTable().setTable(fileTable_0);
Heat Transfer: Parts-Based Support Now Available for Actual Flow Dual Stream Heat Exchanger Model
The UI for the Actual Flow Dual Stream Heat Exchanger model has changed significantly, resulting in several changes in the user macros. There are seven Heat Exchanger Data Specification options that are currently supported: UAL Polynomial, UAL Table, UAG Table, Q Table, Q Map, UAL Map, and Volumetric UAL Table. The macro changes are illustrated for one of these options (Q Map) below, but are applicable to all the seven options. Dual Stream Heat Exchanger report macros have also changed accordingly, and are illustrated in the table below.
Previous Release | Simcenter STAR-CCM+ 2206 |
---|---|
|
|
|
|
|
|
|
|
Adjoint: Changes to Topology Optimization Solver
As part of the improvements to the Topology Optimization solver, property options have changed for the User-Defined Constraint sub-node ( ) and the Volume Ratio Constraint sub-node ( ).
In the Type property of this node, the Min/Max option has been eliminated. The Equality option has been added. The new augmented Lagrangian formulation naturally allows for this specific type of constraint.
Each option corresponds to the
selection of a specific CSO (Client-Server Object). The change to the
Type property means that the
MinMaxConstraintType
CSO no longer exists, while the new
EqualityConstraintType
CSO has been introduced.
Because the
MinMaxConstraintType
CSO has been removed, you need to update
any macros that use this CSO with one of the supported types,
EqualityConstraintType
, MinimumConstraintType
,
or MaximumConstraintType
, as shown in the following example.
Previous Release | Simcenter STAR-CCM+ 2206 |
---|---|
|
|
Reacting Flow: Changes to ECFM Table Generators
The workflow for ECFM table generators has been modified, resulting in changes to the macro code.
Previous Release | Simcenter STAR-CCM+ 2206 |
---|---|
|
|
|
|
|
|
Multiphase
Change to Abrasive Wear Boundary Physics Value
Due to restructuring, changes have been made to the macro code for the Archard method of the Abrasive Wear boundary physics value.
Specifically,
abrasiveWearProfile_0.setMethod(ArchardAbrasiveWearMethod.class);
has been changed to
abrasiveWearProfile_0.setMethod(GranularArchardAbrasiveWearMethod.class);
Changes to Fluid Film Evaporation
New model requirements for the Fluid
Film Evaporation model have resulted in changes to phase interaction behavior. To
restore the behavior of these objects to that of the previous release, add the
RaoultActivityCoefficientModel
to your previously saved macros,
as shown in the following example.
Previous Release | Simcenter STAR-CCM+ 2206 |
---|---|
|
|
Changes due to Resolved Eulerian-Lagrangian Transition
Due to improvements in the area of the Resolved Eulerian-Lagrangian Transition model and Blob Detection for the Mixture Multiphase (MMP) model, macro code has changed. Specifically, classes have been renamed as follows:
Previous Release | Simcenter STAR-CCM+ 2206 |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Eulerian Multiphase (EMP): Changes to Prandtl Number Profile
The way in which the S-Gamma and Adaptive Multiple Size-Group (AMUSIG) models use the Prandtl Number profile has changed, resulting in changes to the macro code.
-
S-Gamma model (both Pre-Integrated S-Gamma model and Discrete Quadrature S-Gamma model)
Previous Release Simcenter STAR-CCM+ 2206 SgammaTurbulentPrandtlNumberProfile sgammaTurbulentPrandtlNumberProfile_0 = sgammaModel_0.getSgammaTurbulentPrandtlNumberProfile();
TurbulentPrandtlNumberProfile turbulentPrandtlNumberProfile_0 = sgammaModel_0.getTurbulentPrandtlNumberProfile();
-
Adaptive Multiple Size-Group model
Previous Release Simcenter STAR-CCM+ 2206 NumberDensityTurbulentPrandtlNumberProfile numberDensityTurbulentPrandtlNumberProfile_0 = amusigModel_0.getNumberDensityTurbulentPrandtlNumberProfile();
TurbulentPrandtlNumberProfile turbulentPrandtlNumberProfile_0 = amusigModel_0.getTurbulentPrandtlNumberProfile();
DFBI: Greater Availability of Euler Angle
To make computations based on Euler
angles more broadly available in simulations with motion, the class
EulerAngleOption
was moved from module
star.sixdof
to module star.motion
. If any of
your existing DFBI macros use the class EulerAngleOption
, you need
to update them as shown in the examples below.
Previous Release | Simcenter STAR-CCM+ 2206 |
---|---|
|
|
|
|
Solid Stress: Changes to Solvers
Due to restructuring to facilitate improvements to the Acoustic Modal solver, macro code has changed for the Solid Stress solver's Solution View and Eigen Mode:
NormalModesSolutionView
has been renamed toFeSolidStressNormalModesSolutionView
.NormalModesSolutionViewEigenMode
has been renamed toFeSolidStressNormalModesSolutionViewEigenMode
.
Previous Release | Simcenter STAR-CCM+ 2206 |
---|---|
|
|
|
|
Electromagnetism
Changes to Excitation Coil and Related Models
Due to restructuring, changes have been made to macro code for the Excitation Coil model and related models. Update your macro codes as follows:
Excitation Coil model with 2D Transverse Magnetic Potential model
Previous Release | Simcenter STAR-CCM+ 2206 |
---|---|
|
|
Finite Element Excitation Coil model
Previous Release | Simcenter STAR-CCM+ 2206 |
---|---|
|
|
Note | The following macro code for the Excitation Coil model with 3D is unchanged: |
localDirectionFieldProfile_0.getMethod(LocalDirectionFieldFeatureCurveMethod.class).getFlipOption().setSelected(LocalDirectionFieldFeatureCurveFlipOption.Type.BACKWARD);
localDirectionFieldProfile_0.getMethod(LocalDirectionFieldFeatureCurveMethod.class).getFlipOption().setSelected(LocalDirectionFieldFeatureCurveFlipOption.Type.FORWARD);
Changes Due to New Magnetic Flux Linkage Report
With the introduction of a magnetic flux linkage report for the Transverse Magnetic Potential model, the macro code has changed.
Previous Release | Simcenter STAR-CCM+ 2206 |
---|---|
|
|
|
|
Changes to Material Property Defaults
Default values have changed for the following material properties of the Modified Steinmetz model:
- Eddy-Current Loss Coefficient
- Hysteresis Loss Coefficient
- Steinmetz Coefficient A
- Steinmetz Coefficient B
Rather than a non-zero default value, they are now set to zero.
To reinstate the previous defaults, use macro code as shown in the following example that works with the Eddy-Current Loss Coefficient:
import star.common.*;
import star.base.neo.*;
import star.material.*;
import star.electromagnetism.common.*;
import star.electromagnetism.ohmicheating.*;
PhysicsContinuum physicsContinuum_0 =
((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1"));
SolidModel solidModel_0 =
physicsContinuum_0.getModelManager().getModel(SolidModel.class);
Solid solid_0 =
((Solid) solidModel_0.getMaterial());
ConstantMaterialPropertyMethod constantMaterialPropertyMethod_0 =
((ConstantMaterialPropertyMethod) solid_0.getMaterialProperties().getMaterialProperty(EddyCurrentLossCoefficientProperty.class).getMethod());
Units units_0 =
((Units) simulation_0.getUnitsManager().getObject("W/kg"));
constantMaterialPropertyMethod_0.getQuantity().setValueAndUnits(1.0626E-5, units_0);
Electrochemistry: Change to Handling of Molar Concentration
With the introduction of the ability
to enter initial conditions and boundary conditions in units of molar concentration,
macro code has changed. Specifically MolarConcentrationProfile
has
been moved to the species
folder, and for Java macro files to
continue working change them as follows:
Previous Release | Simcenter STAR-CCM+ 2206 |
---|---|
|
|
Post-Processing: Change to Opening and Closing of Scenes and Plots
Due to improvements in the handling of
scene and plot displays, macro code has changed. Instances of
open()
should be changed to openInteractive()
,
and instances of close()
should be changed to
closeInteractive()
.
To improve batch runtime, remove these calls from your macro since they are ignored when Simcenter STAR-CCM+ runs in batch.
Simcenter STAR-CCM+ In-cylinder
Changes to Table Generators
Due to new features and refactoring, macro code has changed. If your macros refer to any of the tables contained in the following code from the previous release, they need to be updated.
Previous Release | Simcenter STAR-CCM+ 2206 |
---|---|
|
|
|
|
Changes to Use of Displayers
Some redundant scalar displayers have
been changed to part displayers. Therefore, in macro recordings in Simcenter STAR-CCM+ 2206,
scalarDisplayer_XX
is now recorded as
partDisplayer_XX
. Examples of affected displayers include:
- Intake Valve <N> Displayer 1
- Exhaust Valve <N> Displayer 1
- Cylinder Displayer 1
- Cylinder Piston Surface Displayer 1
- Cylinder Sector Displayer 1
While your existing macros are still expected to work, for maximum reliability, it is recommended that you update your macro code as shown in the following example:
Previous Release | Simcenter STAR-CCM+ 2206 |
---|---|
|
|