Macro API Changes 2020.3

In Simcenter STAR-CCM+ 2020.3, the macro API changed for 3D-CAD, motion, adjoint, Eulerian multiphase, DFBI, electromagnetism, and co-simulation.

3D-CAD: Changes to Defeature Panel

The Delete Interior Faces option of the Defeature panel has been expanded in the current release, resulting in changes to the macro code.

In the FeatureManager class, two member functions have been replaced as follows:

  • public Defeature createDefeature(List<Face> faces); has been replaced by public Defeature createDefeature_2(List<Face> faces);.
  • public Defeature createDefeature(); has been replaced by public Defeature createDefeature_2();.

Motion: Changes to the Trajectory Motion-Based Superposing Motions

Due to improvements in Trajectory Motion-based superposing motions—specifically Tangential Rotation, Constrained Rotation and Vantage Point Rotation—related macro code, such as for the coordinate systems used with those motions, has changed.

Previous Release Simcenter STAR-CCM+ 2020.3
// create Trajectory Motion 
TrajectoryMotion trajectoryMotion_0 = simulation_0.get(MotionManager.class).createMotion(TrajectoryMotion.class, "Trajectory");
// create Superposing Tangential Rotation
TangentialRotation tangentialRotation_0 = 
    trajectoryMotion_0.getSuperposingMotionManager().createSuperposingMotion(TangentialRotation.class, "Tangential Rotation");
// set Region's MotionSpec as TangentialRotation
Region region_0 = simulation_0.getRegionManager().getRegion("Block");
MotionSpecification motionSpecification_0 = region_0.getValues().get(MotionSpecification.class);
motionSpecification_0.setMotion(tangentialRotation_0);
// Generation of Coordinate system is manual
LabCoordinateSystem labCoordinateSystem_0 = simulation_0.getCoordinateSystemManager().getLabCoordinateSystem();
// first create a Cartesian CSys
CartesianCoordinateSystem cartesianCoordinateSystem_0 = 
  labCoordinateSystem_0.getLocalCoordinateSystemManager().createLocalCoordinateSystem(CartesianCoordinateSystem.class, "Cartesian");
// set up its attributes and name it as per Your requirements. For example "managedCSys"
cartesianCoordinateSystem_0.getOrigin().setValue(new DoubleVector(new double[] {2.0, 0.0, 0.0}));
cartesianCoordinateSystem_0.setBasis0(new DoubleVector(new double[] {1.0, 0.0, 0.0}));
cartesianCoordinateSystem_0.setBasis1(new DoubleVector(new double[] {0.0, 1.0, 0.0}));
cartesianCoordinateSystem_0.setPresentationName("managedCSys");
// It is then set as Managed by the TrajectoryMotion, which is the parent motion of the Tangential Rotation
trajectoryMotion_0.getManagedCoordinateSystems().setQuery(null);
trajectoryMotion_0.getManagedCoordinateSystems().setObjects(cartesianCoordinateSystem_0);
// If You want have a CSys which it to be managed by the TangentialRotation then
// create another CSys under the "managedCSys"
CartesianCoordinateSystem cartesianCoordinateSystem_1 =  
    cartesianCoordinateSystem_0.getLocalCoordinateSystemManager().createLocalCoordinateSystem(CartesianCoordinateSystem.class, "Cartesian");
// set up its attributes and name it as required. For example "rotatingCSys"
cartesianCoordinateSystem_1.getOrigin().setValue(new DoubleVector(new double[] {0.0, 0.0, 0.0}));
cartesianCoordinateSystem_1.setBasis0(new DoubleVector(new double[] {1.0, 0.0, 0.0}));
cartesianCoordinateSystem_1.setBasis1(new DoubleVector(new double[] {0.0, 1.0, 0.0}));
cartesianCoordinateSystem_1.setPresentationName("rotatingCSys");
// Then set it as managed by the Tangential Rotation
tangentialRotation_0.getManagedCoordinateSystems().setQuery(null);
tangentialRotation_0.getManagedCoordinateSystems().setObjects(cartesianCoordinateSystem_1);
// create Trajectory Motion 
TrajectoryMotion trajectoryMotion_0 = simulation_0.get(MotionManager.class).createMotion(TrajectoryMotion.class, "Trajectory");
// create Superposing Tangential Rotation
TangentialRotation tangentialRotation_0 = trajectoryMotion_0.getSuperposingMotionManager().createSuperposingMotion(TangentialRotation.class, "Tangential Rotation");
// set Region's MotionSpec as TangentialRotation
Region region_0 = simulation_0.getRegionManager().getRegion("Block");
MotionSpecification motionSpecification_0 = region_0.getValues().get(MotionSpecification.class);
motionSpecification_0.setMotion(tangentialRotation_0);
// generation of coordinate system is automatic as per the created Motions
LabCoordinateSystem labCoordinateSystem_0 = simulation_0.getCoordinateSystemManager().getLabCoordinateSystem();
// When a Superposing Motion is created, following actions are done w.r.t CSystems :
// - A Coordinate system is created with motion's name as Suffix
// - This CSystem is assigned as Managed Coordinate System of the Parent Motion (in this case - Trajectory Motion)
// - This CSystem is set the Coordinate System of the created Superposing Motion (in this case - Tangential Rotation)
// get hold of the already created Coordinate System, which is named according to the created Superposing Motion
CartesianCoordinateSystem cartesianCoordinateSystem_0 = 
    ((CartesianCoordinateSystem) labCoordinateSystem_0.getLocalCoordinateSystemManager().getObject("Tangential Rotation-CSys"));
Units units_0 = ((Units) simulation_0.getUnitsManager().getObject("m"));
// it is then configured as per the users requirement
cartesianCoordinateSystem_0.getOrigin().setCoordinate(units_0, units_0, units_0, new DoubleVector(new double[] {2.0, 0.0, 0.0}));
// Create another cartesian CSys under the "Tangential Rotation-CSys" - This step is/was optional if the user needed/required
// a CSys to be managed by the Leaf Motion i.e. Tangetial Rotation  
CartesianCoordinateSystem cartesianCoordinateSystem_1 = 
     cartesianCoordinateSystem_0.getLocalCoordinateSystemManager().createLocalCoordinateSystem(CartesianCoordinateSystem.class, "Cartesian");
// set up its attributes and name it as required. For example "ManagedByTangentialRotation"
cartesianCoordinateSystem_1.getOrigin().setValue(new DoubleVector(new double[] {0.0, 0.0, 0.0}));
cartesianCoordinateSystem_1.setBasis0(new DoubleVector(new double[] {1.0, 0.0, 0.0}));
cartesianCoordinateSystem_1.setBasis1(new DoubleVector(new double[] {0.0, 1.0, 0.0}));
cartesianCoordinateSystem_1.setPresentationName("ManagedByTangentialRotation");
// Then set it as managed by the Tangential Rotation
tangentialRotation_0.getManagedCoordinateSystems().setQuery(null);
tangentialRotation_0.getManagedCoordinateSystems().setObjects(cartesianCoordinateSystem_1);

Adjoint: Separation of Adjoint Mesh and Surface Sensitivity from Coupled Flow

To make adjoint modeling available without requiring the use of coupled flow, the Adjoint Mesh and Surface Sensitivity models have been restructured. In the current release, the models appear as optional models in the physics model selection dialog, with the former model and its solver having a new name, Adjoint Mesh Deformation, to reflect the primary association with mesh deformation.

The Adjoint Mesh Deformation model must now be activated to compute the adjoint of a cost function with respect to mesh vertex displacements.

These improvements have resulted in changes to the macro code.

The surface sensitivity model and solver that were in the star.coupledflow.* package are now in the star.morpher.* package.

Previous Release Simcenter STAR-CCM+ 2020.3
import star.coupledflow.SurfaceSensitivityModel;
import star.morpher.SurfaceSensitivityModel;

The adjoint mesh model and solver that were in the star.coupledflow.* package are now in the star.morpher.* package, and have been renamed from AdjointMesh* to AdjointMeshDeformation*.

Previous Release Simcenter STAR-CCM+ 2020.3
import star.coupledflow.AdjointMeshSolver;
import star.morpher.AdjointMeshDeformationSolver;

Eulerian Multiphase (EMP)

Changes to Granular Flow

For greater consistency and clarity, several class names for granular flow have changed. The following table shows examples of macro code containing some of these renamed classes:

Previous Release Simcenter STAR-CCM+ 2020.3
GranularTemperatureTransportModelProvider granularTemperatureTransportModelProvider_1 = physicsContinuum_0.getModelManager().getModel(GranularTemperatureTransportModelProvider.class);
GranularTemperatureTransportPhysicsModel GranularTemperatureTransportPhysicsModel_1 = physicsContinuum_0.getModelManager().getModel(GranularTemperatureTransportPhysicsModel.class);
GranularTemperatureModelProviderGroup granularTemperatureModelProviderGroup_0 = 
physicsContinuum_0.getModelManager().getModel(GranularTemperatureModelProviderGroup.class);
GranularTemperatureModelGroup granularTemperatureModelGroup_0 = 
physicsContinuum_0.getModelManager().getModel(GranularTemperatureModelGroup.class);

Additional classes have been renamed as follows:

Previous Release Simcenter STAR-CCM+ 2020.3
physicsContinuum_0.enable(GranularTemperatureTransportModelProvider.class);
physicsContinuum_0.enable(GranularTemperatureTransportPhysicsModel.class);
physicsContinuum_0.enable(GranularTemperatureModelProviderGroup.class);
physicsContinuum_0.enable(GranularTemperatureModelGroup.class);
physicsContinuum_0.enable(AlgebraicGranularTemperatureModelProvider.class);
physicsContinuum_0.enable(AlgebraicGranularTemperaturePhysicsModel.class);

Changes to Mass Transfer Model

To improve efficiency, the calculations of energy source terms have been relocated, resulting in changes to the macro code.

LsiInterphaseMassTransferGroup has been changed to MfrInterphaseMassTransferModel.

Previous Release Simcenter STAR-CCM+ 2020.3
phaseInteraction_0.enable(LsiInterphaseMassTransferGroup.class);
phaseInteraction_0.enable(MfrInterphaseMassTransferModel.class);

LsiBulkBoilingModel has been changed to MfrBoilingMassTransferRateModel.

Previous Release Simcenter STAR-CCM+ 2020.3
phaseInteraction_0.enable(LsiBulkBoilingModel.class);
phaseInteraction_0.enable(MfrBoilingMassTransferRateModel.class);
LsiBulkBoilingModel lsiBulkBoilingModel_0 = 
phaseInteraction_0.getModelManager().getModel(LsiBulkBoilingModel.class);
MfrBoilingMassTransferRateModel mfrBoilingMassTransferRateModel_0 = 
phaseInteraction_0.getModelManager().getModel(MfrBoilingMassTransferRateModel.class);

InterphaseMassFluxModel has been changed to UserDefinedInterphaseMassTransferRateModel.

Previous Release Simcenter STAR-CCM+ 2020.3
phaseInteraction_0.enable(InterphaseMassFluxModel.class);
phaseInteraction_0.enable(UserDefinedInterphaseMassTransferRateModel.class);
InterphaseMassFluxModel interphaseMassFluxModel_3 = 
phaseInteraction_0.getModelManager().getModel(InterphaseMassFluxModel.class);
UserDefinedInterphaseMassTransferRateModel userDefinedInterphaseMassTransferRateModel_3 = 
phaseInteraction_0.getModelManager().getModel(UserDefinedInterphaseMassTransferRateModel.class);

DFBI: Changes to Spring Coupling

To reflect the addition of damping forces, the Linear Spring node (in DFBI > Body Couplings) has been renamed and restructured:

  • The Linear Spring node and menu item have been renamed to Spring-Damper.
  • The Spring Constant property of the node has been changed to a sub-node named Elastic Coefficient. This sub-node allows polynomial and tabular values in addition to constants.
  • The corresponding force nodes under the External Forces and Moments sub-node of a 6-DOF body reflect the new default names.

These improvements have resulted in changes to the macro code.

Previous Release Simcenter STAR-CCM+ 2020.3
LinearSpringCoupling linearSpringCoupling_1 = 
simulation_0.get(SixDofBodyCouplingManager.class).createSixDofBodyCoupling(LinearSpringCoupling.class);
// To set a numeric value
linearSpringCoupling_1.getSpringConstant().setValue(1.0);
// To set an expression
linearSpringCoupling_1.getSpringConstant().setDefinition("$stiffness");
Units units_0 = 
  ((Units) simulation_0.getUnitsManager().getObject("N/m"));
linearSpringCoupling_1.getSpringConstant().setUnits(units_0);
BodyForceReport bodyForceReport_0 = 
  ((BodyForceReport) simulation_0.getReportManager().getReport("Force X"));
bodyForceReport_0.getForces().setQuery(null);
ContinuumBody continuumBody_0 = 
  ((ContinuumBody) simulation_0.get(star.sixdof.BodyManager.class).getObject("ship"));
LinearSpringForce linearSpringForce_1 = 
  ((LinearSpringForce) continuumBody_0.getExternalForceAndMomentManager().getObject("Linear Spring Force [Linear Spring 1]"));
bodyForceReport_0.getForces().setObjects(linearSpringForce_1);
BodyMomentReport bodyMomentReport_0 = 
  ((BodyMomentReport) simulation_0.getReportManager().getReport("Moment X"));
bodyMomentReport_0.getMoments().setQuery(null);
bodyMomentReport_0.getMoments().setObjects(linearSpringForce_1);

SpringElongationReport springElongationReport_0 =
  ((SpringElongationReport) simulation_0.getReportManager().getReport("6-DOF Body Spring Elongation 1"));
springElongationReport_0.setLinearSpringCoupling(linearSpringCoupling_1);
SpringDamperCoupling springDamperCoupling_0 = 
simulation_0.get(SixDofBodyCouplingManager.class).createSixDofBodyCoupling(SpringDamperCoupling.class);
ElasticCoefficientConstantMethod elasticCoefficientConstantMethod_0 = 
  ((ElasticCoefficientConstantMethod) springDamperCoupling_0.getElasticCoefficientMethodManager().getActiveMethod());
// To set a numeric value
elasticCoefficientConstantMethod_0.getCoefficient().setValue(1.0);
// To set an expression
elasticCoefficientConstantMethod_0.getCoefficient().setDefinition("$stiffness");
Units units_0 = 
  ((Units) simulation_0.getUnitsManager().getObject("N/m"));
elasticCoefficientConstantMethod_0.getCoefficient().setUnits(units_0);
BodyForceReport bodyForceReport_0 = 
  ((BodyForceReport) simulation_0.getReportManager().getReport("Force X"));
bodyForceReport_0.getForces().setQuery(null);
ContinuumBody continuumBody_0 = 
  ((ContinuumBody) simulation_0.get(star.sixdof.BodyManager.class).getObject("ship"));
SpringDamperForce springDamperForce_0 = 
  ((SpringDamperForce) continuumBody_0.getExternalForceAndMomentManager().getObject("Spring-Damper Force [Spring-Damper 1]"));
bodyForceReport_0.getForces().setObjects(springDamperForce_0);
BodyMomentReport bodyMomentReport_0 = 
  ((BodyMomentReport) simulation_0.getReportManager().getReport("Moment X"));
bodyMomentReport_0.getMoments().setQuery(null);
bodyMomentReport_0.getMoments().setObjects(springDamperForce_0);

SpringElongationReport springElongationReport_0 =
  ((SpringElongationReport) simulation_0.getReportManager().getReport("6-DOF Body Spring Elongation 1"));
springElongationReport_0.setSpringDamperCoupling(springDamperCoupling_0);

Electromagnetism: Changes to Excitation Coil Circuit Elements

The Excitation Coil Circuit Element has been combined with the Finite Element Excitation Coil Circuit Element, resulting in changes to the macro code.

Previous Release Simcenter STAR-CCM+ 2020.3
import star.electromagnetism.magneticpotential.fem.FiniteElementExcitationCoilCircuitElement;

FiniteElementExcitationCoilCircuitElement feExcitationCoilCircuitElement = 
circuit.getElements().createCircuitElement(FiniteElementExcitationCoilCircuitElement.class);
import star.electromagnetism.magneticpotential.ExcitationCoilCircuitElement;

ExcitationCoilCircuitElement feExcitationCoilCircuitElement = 
circuit.getElements().createCircuitElement(ExcitationCoilCircuitElement.class);

Co-Simulation

Changes to Zone Parts

To facilitate expanded export capabilities, zone part functionality has been refactored, resulting in changes to the macro code.

Previous Release Simcenter STAR-CCM+ 2020.3
import star.cosimulation.link.parts.ZoneCoupledParts;
coSimulationZone_0.getCoSimulationZoneConditions().get(ZoneCoupledParts.class);
// FOR SURFACE ZONE TYPE

import star.cosimulation.link.parts.InternalSurfaceParts;
coSimulationZone_0.getCoSimulationZoneConditions().get(InternalSurfaceParts.class);
// FOR VOLUME ZONE TYPE

import star.cosimulation.link.parts.InternalVolumeParts;
coSimulationZone_0.getCoSimulationZoneConditions().get(InternalVolumeParts.class);

Changes to CGNS External File Access

Due to improvements in the CGNS import/export techniques, the class star.cosimulation.link.oneway.ImportExportFile has been replaced by star.cosimulation.link.oneway.CgnsExternalFile, as shown in the following examples:

Previous Release Simcenter STAR-CCM+ 2020.3
// import
import star.cosimulation.link.oneway.ImportExportFile;
// import
import star.cosimulation.link.oneway.CgnsExternalFile;
// usage
ImportExportFile importExportFile_0 = coSimulation_0.getCoSimulationValues().get(ImportExportFile.class);
// usage
CgnsExternalFile cgnsExternalFile_0 = coSimulation_0.getCoSimulationValues().get(CgnsExternalFile.class);