Macro API Changes 2022.1
In Simcenter STAR-CCM+ 2022.1, the macro API changed for multiphase, DFBI, visualization, and update events.
Multiphase
Removal of Models
Two multiphase models, Multiphase Equation of State and Eulerian Multiphase Mixture, have been removed from the Simcenter STAR-CCM+ UI. They have no properties and are not required as information to the user.
To update your macro code, remove instances of the use of these models as shown in the following example:
import star.common.EulerianMultiphaseMixtureModel;
...
PhysicsContinuum physicsContinuum = ((PhysicsContinuum) simulation.getContinuumManager().getContinuum("Physics 1"));
physicsContinuum.enable(EulerianMultiphaseMixtureModel.class)
Total Pressure and Total Temperature Now Available per Phase in Mixture Multiphase and VOF
Beginning with Simcenter STAR-CCM+ 2022.1, support for total pressure
and total temperature per physics continuum has been discontinued from Mixture
Multiphase and VOF simulations. Instead, these values are now available per phase.
Simulation files that used total pressure and/or total temperature in
post-processing need to be updated, and macros have to be changed. In the following
example, total pressure is evaluated and a phase with the name
Water
is to be used in the updated macro code:
Previous Release | Simcenter STAR-CCM+ 2022.1 |
---|---|
|
|
Changes to VOF Waves Model Properties
The following properties of the VOF Waves model can now be set as parameters (scalar quantities, field functions, or global parameters):
- Damping Constant 1
- Damping Constant 2
- Damping Exponent
- Forcing Constant
As a result, macro code has changed. For backward compatibility, macros recorded in previous releases still work in Simcenter STAR-CCM+ 2022.1.
Previous Release | Simcenter STAR-CCM+ 2022.1 |
---|---|
|
|
It is also possible to use a shorter way of setting values without the units:
VofWaveModel vofWaveModel_0 = physicsContinuum_0.getModelManager().getModel(VofWaveModel.class);
vofWaveModel_0.getDampingConstantOne().setValue(11.0);
vofWaveModel_0.getDampingConstantTwo().setValue(12.0);
vofWaveModel_0.getDampingExponent().setValue(3.0);
vofWaveModel_0.getForcingConstant().setValue(11.0);
DFBI: Automation of Specific Forces and Moments
For creation and removal of the following forces and moments an automatic handling has been introduced:
- Fluid Force and Moment
- DEM Force and Moment
- Electromagnetic Force and Moment
These forces and moments can no longer be created or removed manually.
In previous versions of Simcenter STAR-CCM+, the Fluid Force and Moment was created by default together with a new continuum body. In Simcenter STAR-CCM+ 2022.1, no Fluid Force and Moment is created when you create a continuum body. The Fluid Force and Moment is created automatically as soon as a boundary with relation to a supported flow model is added to the body surface definition.
As a result, the macro code has changed to set up the body surface and the flow model before accessing the Fluid Force and Moment, as shown in the following example:
Previous Release | Simcenter STAR-CCM+ 2022.1 |
---|---|
|
|
No manual removal of forces and moments
Automatically handled forces and moments cannot be removed manually. They need to be disabled instead. For backward compatibility reasons, the old macro calls to remove these forces and moments are still accepted, but they disable the forces and moments instead of removing them.
Previous Release | Simcenter STAR-CCM+ 2022.1 |
---|---|
|
|
No manual creation of forces and moments
Automatically handled forces and moments cannot be created manually. For backward compatibility reasons, the functionality of creating these forces and moments with a macro call is still made available. Creating these forces and moments in existing macros should still work, and the obtained force and moment objects can be further manipulated within the macro. However, the newly created forces and moments are not made visible in the UI and they are not used for computations unless the automatic mechanism detects that they are needed for the simulation.
Previous Release | Simcenter STAR-CCM+ 2022.1 |
---|---|
|
|
Visualization: Changes to Advanced Rendering Materials
Advanced rendering materials have undergone a variety of changes in Simcenter STAR-CCM+ 2022.1. Yet in macros that involve rendering materials, the Preset Material and Advanced Rendering Material settings of a displayer should continue to function without change. In addition, the creation of new rendering materials works in macros as before, even though the node now contains new subfolder nodes for material types.
However, macros that reference one of
the renamed or deleted default materials by name, when applied to a simulation file
that is created in Simcenter STAR-CCM+ 2022.1, must
be updated. Specifically, the only macro function that is directly affected by the
object changes is RayTraceMaterialManager.get/hasObject()
, which
must be called with the new material name when run on a simulation file that does
not contain the old materials:
Previous Release | Simcenter STAR-CCM+ 2022.1 |
---|---|
|
|
Alternatively, you can export old materials from earlier simulation files and import them into new ones.
Update Events
Change to Control of Inner Samples
For the Monitor Asymptote update event, macro codes have been changed for the activation and deactivation of the Inner Samples checkbox property:
getOnlyInnerSamples
has been replaced bygetInnerSamples
.setOnlyInnerSamples
has been replaced bysetInnerSamples
.
Your existing macros will continue to work as expected, but for maximum reliability, it is recommended that you update your macro code.
Change to Evaluated Status Information
In update event objects under the Update Events node, the Satisfied checkbox property has been replaced by a new Evaluated Status property. The read-only states, Satisfied, Unsatisfied, and Unevaluated, clarify the evaluation status of the update event.
The old macro call that returns a
boolean, updateEvent.getEvaluatedState()
, remains unchanged, but
the value returned corresponds to the state of the current iteration rather than the
state when the update event was evaluated last (as in previous releases).
Another API has been added,
updateEvent.getEvaluatedStatus()
, that returns the status of
the update event at the current iteration (status returned is one of the following :
'Unsatisfied' - 0, 'Satisfied' - 1, 'Unevaluated' - 2).