Macro API Changes 2021.1
In Simcenter STAR-CCM+ 2021.1, the macro API changed for parts and regions, reacting flows, multiphase, Lagrangian multiphase, Eulerian multiphase, electromagnetism, visualization, and Design Manager.
Parts and Regions: Change to Part Surface-to-Boundary Assignment
The techniques for defining parts and regions, and for associating them with each other, have been improved. These improvements have resulted in changes to the macro code.
The return type has changed for the
method Boundary.getPartSurfaceGroup()
. In previous releases, the
return type was PartSurfaceGroup
. The new type is
BoundaryPartSurfaceGroup
, as shown in the following
example:
Previous Release | Simcenter STAR-CCM+ 2021.1 |
---|---|
|
|
Alternatively, you can use the new
container that holds more generic GeometryPartEntity
objects
directly:
GeometryPartEntityGroup gpeg = boundary.getGeometryPartEntityGroup();
for (GeometryPartEntity gpe : gpeg.getObjects()) {
// process objects
}
Reacting Flows
Changes to Reactor Network Model
The Soot Sectional model option has been added to the Reactor Network model, resulting in changes to the macro code. Specifically, instances of
RNSootMomentOption rNSootMomentOption_0 = reactorNetworkEmissions_0.getSootMomentOption();
should be changed to
RNSootOption rNSootOption_0 = reactorNetworkEmissions_0.getSootMomentOption();
Laminar Flame Speed Restructured
Due to restructuring, macro codes for Laminar Flame Speed have changed.
Previous Release | Simcenter STAR-CCM+ 2021.1 |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Multiphase: Thin Film Model Activation No Longer Allowed with Multiphase Models
If you have macros from previous releases that activate the Thin Film model in combination with Eulerian Multiphase models (VOF, Eulerian Multiphase, and Mixture Multiphase), you are advised to re-record them.
Issues resulted from using this combination of models, for which Thin Film was not designed and therefore does not work. In response, Simcenter STAR-CCM+ 2021.1 does not allow activation of Thin Film with the Multiphase models.
A macro that includes this combination does not work in Simcenter STAR-CCM+ 2021.1. Instead, it triggers a warning similar to the following:
Warning: The model star.windshield.WindShieldModel is incompatible with the currently enabled models in ...: star.material.EulerianMultiphaseModel
Lagrangian Multiphase: Change to Treatment of Particles
In Simcenter STAR-CCM+ 2021.1, a new treatment mode has been added for Lagrangian particles on mixing planes: Transmit. This new treatment is now the default mode.
In previous releases, the only treatment mode for Lagrangian particles was Escape mode, so it was activated automatically. To use a previously recorded macro with Escape mode in Simcenter STAR-CCM+ 2021.1, update your macro code as shown in the following example.
Simulation simulation_0 =
getActiveSimulation();
PhysicsContinuum physicsContinuum_0 =
((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1"));
LagrangianMultiphaseModel lagrangianMultiphaseModel_0 =
physicsContinuum_0.getModelManager().getModel(LagrangianMultiphaseModel.class);
LagrangianPhase lagrangianPhase_0 =
((LagrangianPhase) lagrangianMultiphaseModel_0.getPhaseManager().getPhase("Phase 1"));
DefaultBoundaryConditions defaultBoundaryConditions_0 =
((DefaultBoundaryConditions) lagrangianPhase_0.getDefaultBoundaryConditionsManager().getBoundaryConditions(MixingPlaneInflowBoundary.class));
BoundaryInteractionModeManager boundaryInteractionModeManager_0 =
defaultBoundaryConditions_0.getConditions().get(BoundaryInteractionModeManager.class);
boundaryInteractionModeManager_0.setActiveMode(EscapeMode.class);
DefaultBoundaryConditions defaultBoundaryConditions_1 =
((DefaultBoundaryConditions) lagrangianPhase_0.getDefaultBoundaryConditionsManager().getBoundaryConditions(MixingPlaneOutflowBoundary.class));
BoundaryInteractionModeManager boundaryInteractionModeManager_1 =
defaultBoundaryConditions_1.getConditions().get(BoundaryInteractionModeManager.class);
boundaryInteractionModeManager_1.setActiveMode(EscapeMode.class);
Eulerian Multiphase (EMP)
Changes to Mass Transfer Models
Refactoring of Eulerian Multiphase mass transfer models has resulted in changes to the macro code. To update your macros, remove instances of the following code:
MusigNucleationModel.class
SgammaNucleationModel.class
For example:
Previous Release | Simcenter STAR-CCM+ 2021.1 |
---|---|
|
|
|
|
|
|
|
|
Changes to Turbulence Model Structure
For Eulerian multiphase mixture turbulence in Simcenter STAR-CCM+ 2021.1, the turbulence model structure has been modified, resulting in changes to the macro code.
If your macros from previous releases
use multiphase turbulence, you must add
PhasicTurbulenceSpecificationModel
as follows:
- In the import header:
import star.eulerianmultiphaseturb.PhasicTurbulenceSpecificationModel;
- After multiphase turbulence is selected. For example:
Previous Release | Simcenter STAR-CCM+ 2021.1 |
---|---|
|
|
Electromagnetism: Removal of Porous Media Electromagnetism Model
The Porous Media Electromagnetism model has been removed from Simcenter STAR-CCM+ 2021.1. Any simulation files that were saved with this model in previous versions of Simcenter STAR-CCM+ will continue to work.
However, for your old macros to work,
you must remove instances of PorousMediaElectromagnetismModel
. For
example, delete lines such as:
physicsContinuum.enable(PorousMediaElectromagnetismModel.class);
Visualization: Change to Displayer Handling in Macros
The function
DisplayerManager.getDisplayer()
has been deprecated since it
did not do an exact match on the displayer name specified, leading to unexpected
results. This function continues to work as before. However, two alternatives are
available with which you can improve your macro code:
- Replace
DisplayerManager.getDisplayer()
withDisplayerManager.getObject()
. This function returns the displayer with the exact name supplied as an argument, and this is what you should typically use as a direct replacement for the deprecated function. - Use the new function
DisplayerManager.getDisplayerByName()
if you want to find a displayer whose name starts with the supplied argument, replicating the old functionality.
Design Manager: Change to Auto Save for Project Node
The Auto Save property of the Design Manager project node has been modified, resulting in changes to the macro code.
Previous Release | Simcenter STAR-CCM+ 2021.1 |
---|---|
|
|