Macro API Changes 2019.3

In Simcenter STAR-CCM+ 2019.3, the macro API changed for meshing, finite element models, overset, porous media, adjoint, DEM, Eulerian multiphase, VOF and N-Phase mixtures, electromagnetics, electrochemistry and plasma, Design Manager, co-simulation, and STAR-ICE (now Simcenter STAR-CCM+ In-cylinder).

Meshing: Changes to Model Selection for Solution Interpolation

The models related to solution interpolation have been refactored to simplify the workflow and user selection. This refactoring has resulted in changes to the macro code.

The following classes have been removed:

  • ProximityInterpolationModel.class
  • ConservativeInterpolationModel.class

To activate or deactivate solution interpolation, use SolutionInterpolationModel.class instead:

Previous Release Simcenter STAR-CCM+ 2019.3
physicsContinuum_0.enable(ProximityInterpolationModel.class);
physicsContinuum_0.enable(SolutionInterpolationModel.class);
physicsContinuum_0.enable(ConservativeInterpolationModel.class);
physicsContinuum_0.enable(SolutionInterpolationModel.class); SolutionInterpolationModel solutionInterpolationModel_0 =
physicsContinuum_0.getModelManager().getModel(SolutionInterpolationModel.class);
solutionInterpolationModel_0.getConservationOption().setSelected(ConservationOption.Type.ENABLE);

The methods getSolutionInterpolationMethod and setPerPartMapping, which were previously available on ProximityInterpolationModel and ConservativeInterpolationModel, should now be called on SolutionInterpolationModel:

Previous Release Simcenter STAR-CCM+ 2019.3
ProximityInterpolationModel proximityInterpolationModel_0 =
physicsContinuum_0.getModelManager().getModel(ProximityInterpolationModel.class);
 proximityInterpolationModel_0.getSolutionInterpolationMethod().setSelected(SolutionInterpolationMethod.Type.MAPPER);
proximityInterpolationModel_0.setPerPartMapping(true);
SolutionInterpolationModel solutionInterpolationModel_0 =
physicsContinuum_0.getModelManager().getModel(SolutionInterpolationModel.class);
 solutionInterpolationModel_0.getSolutionInterpolationMethod().setSelected(SolutionInterpolationMethod.Type.MAPPER);
solutionInterpolationModel_0.setPerPartMapping(true);
ConservativeInterpolationModel conservativeInterpolationModel_0 =
physicsContinuum_0.getModelManager().getModel(ConservativeInterpolationModel.class);
conservativeInterpolationModel_0.setPerPartMapping(true);
SolutionInterpolationModel solutionInterpolationModel_0 =
physicsContinuum_0.getModelManager().getModel(SolutionInterpolationModel.class);
solutionInterpolationModel_0.setPerPartMapping(true);

The method setPerPartConservation, which was previously available on ConservativeInterpolationModel, has been moved to ConservativeMappingModel which is a child of SolutionInterpolationModel:

Previous Release Simcenter STAR-CCM+ 2019.3
SolutionInterpolationModel solutionInterpolationModel_0 =
physicsContinuum_0.getModelManager().getModel(SolutionInterpolationModel.class);
ConservativeMappingModel conservativeMappingModel_0 =
solutionInterpolationModel_0.getConservativeMappingModel();
conservativeMappingModel_0.setPerPartConservation(true);
ConservativeInterpolationModel conservativeInterpolationModel_0 = 
physicsContinuum_1.getModelManager().getModel(ConservativeInterpolationModel.class);
conservativeInterpolationModel_0.setPerPartConservation(true);

Finite Element Models: Changes to Field Functions

For consistency, the following field functions in finite element solid stress and solid energy modeling have had their internal names, not their titles, changed as listed in the following table. Update all instances of these field functions in your macros.

UI Title Internal Name in Previous Release Internal Name in Simcenter STAR-CCM+ 2019.3
Rigid Body Velocity FeRigidBodyVelocityVar RigidBodyVelocity
Rigid Body Acceleration FeRigidBodyAccelerationVar RigidBodyAcceleration
Temperature Time Derivative FeSolidEnergyTemperatureTimeDerivative TemperatureTimeDerivative

Overset Mesh: Overset Conservation Option Upgraded to Continuum Model

The Conservation Option sub-node of the Segregated Flow model node has been removed, and its functionality is now available in the new Overset Conservation model node, resulting in changes to the macro code.

Previous Release Simcenter STAR-CCM+ 2019.3
import star.segregatedflow.ChimeraGridConservationOption;
...
SegregatedFlowModel segregatedFlowModel_1 = physicsContinuum_0.getModelManager().getModel(SegregatedFlowModel.class);
segregatedFlowModel_1.getChimeraGridConservationOption().setSelected(ChimeraGridConservationOption.Type.FLUX_CORRECTION);
import star.overset.OversetConservationModel;
import star.overset.OversetConservationOption;
...
PhysicsContinuum physicsContinuum_0 = ((PhysicsContinuum) sim.getContinuumManager().getContinuum("Physics 1"));
OversetConservationModel oversetConservationModel_0 = physicsContinuum_0.getModelManager().getModel(OversetConservationModel.class);
oversetConservationModel_0.getOversetConservationOption().setSelected(OversetConservationOption.Type.FLUX_CORRECTION);

Porous Media

Changes to Porous Region Profiles

Profiles related to anisotropic resistance specifications in porous regions and porous media have been improved to simplify the workflow, and renamed to be consistent with other models.

Previous Release Simcenter STAR-CCM+ 2019.3
porousInertialResistance_0.setMethod(PrincipalTensorProfileMethod.class);
porousInertialResistance_0.setMethod(OrthotropicTensorProfileMethod.class);
porousInertialResistance_0.setMethod(CompositeTensorProfileMethod.class);
porousInertialResistance_0.setMethod(AnisotropicTensorProfileMethod.class);
porousInertialResistance_0.setMethod(AxisymmetricTensorProfileMethod.class);
porousInertialResistance_0.setMethod(IsotropicTensorProfileMethod.class);
porousInertialResistance_0.setMethod(CompositeSymmetricTensorProfileMethod.class);
(Discontinued)

The spatial orientations of profiles are no longer specified at the profile level. New profiles have an independent Orientation property which can be re-used in other profiles.

Previous Release Simcenter STAR-CCM+ 2019.3
VectorProfile vectorProfile_0 =
  porousInertialResistance_0.getMethod(PrincipalTensorProfileMethod.class).getXAxis();
vectorProfile_0.getMethod(ConstantVectorProfileMethod.class).getQuantity().setComponents(1.0, -1.0, 0.0);
PorousViscousResistance porousViscousResistance_0 =
  region_0.getValues().get(PorousViscousResistance.class);
VectorProfile vectorProfile_1 =
  porousViscousResistance_0.getMethod(PrincipalTensorProfileMethod.class).getXAxis();
vectorProfile_1.getMethod(ConstantVectorProfileMethod.class).getQuantity().setComponents(1.0, -1.0, 0.0);
LocalOrientation localOrientation_0 =
  region_0.getValues().get(LocalOrientationManager.class).CreateLocalOrientation();
porousInertialResistance_0.getMethod(OrthotropicTensorProfileMethod.class).setLocalOrientation(localOrientation_0);
OrientationAxisProfile orientationAxisProfile_0 =
  localOrientation_0.getOrientationAxis1();
orientationAxisProfile_0.getMethod(ConstantVectorProfileMethod.class).getQuantity().setComponents(1.0, -1.0, 0.0);
porousViscousResistance_0.getMethod(OrthotropicTensorProfileMethod.class).setLocalOrientation(localOrientation_0);

Changes to Anisotropic Solid Thermal Conductivity

To make the specification of anisotropic solid thermal conductivity simpler and less error-prone, this material property has been restructured, resulting in changes to the macro code.

Previous Release Simcenter STAR-CCM+ 2019.3
SolidModel solidModel_0 =
  physicsContinuum_0.getModelManager().getModel(SolidModel.class);
Solid solid_0 =
  ((Solid) solidModel_0.getMaterial());
solid_0.getMaterialProperties().getMaterialProperty(ThermalConductivityProperty.class).setMethod(AnisotropicThermalConductivityMethod.class);
AnisotropicThermalConductivity anisotropicThermalConductivity_0 =
  region_0.getValues().get(AnisotropicThermalConductivity.class);
ScalarProfile scalarProfile_0 =
  anisotropicThermalConductivity_0.getMethod(PrincipalTensorProfileMethod.class).getProfile(0);
scalarProfile_0.getMethod(ConstantScalarProfileMethod.class).getQuantity().setValue(1.0);
VectorProfile vectorProfile_0 =
  anisotropicThermalConductivity_0.getMethod(PrincipalTensorProfileMethod.class).getXAxis();
vectorProfile_0.getMethod(ConstantVectorProfileMethod.class).getQuantity().setComponents(-1.0, 0.0, 0.0);
Solid solid_0 =
  ((Solid) solidModel_0.getMaterial());
OrthotropicThermalConductivityMethod orthotropicThermalConductivityMethod_0 =
  ((OrthotropicThermalConductivityMethod) solid_0.getMaterialProperties().getMaterialProperty(ThermalConductivityProperty.class).getMethod());
ConstantMaterialPropertyMethod constantMaterialPropertyMethod_0 =
  ((ConstantMaterialPropertyMethod) ((ScalarMaterialProperty) orthotropicThermalConductivityMethod_0.getScalarProperty(0)).getMethod());
constantMaterialPropertyMethod_0.getQuantity().setValue(1.0);
Region region_1 =
  simulation_0.getRegionManager().getRegion("Region 1");
LocalOrientation localOrientation_2 =
  region_1.getValues().get(LocalOrientationManager.class).CreateLocalOrientation();
OrientationAxisProfile orientationAxisProfile_3 =
  localOrientation_2.getOrientationAxis1();
orientationAxisProfile_3.getMethod(ConstantVectorProfileMethod.class).getQuantity().setComponents(-1.0, 0.0, 0.0);
ThermalConductivityOrientation thermalConductivityOrientation_0 =
  region_1.getValues().get(ThermalConductivityOrientation.class);
thermalConductivityOrientation_0.getMethod(OrientationProfileMethod.class).setLocalOrientation(localOrientation_2);

Efforts have been made to map old macro behavior automatically to the new API, but you are advised to inspect your profiles in the new version.

Adjoint: Changes to Cost Functions

In the current release of Simcenter STAR-CCM+, compute actions, stepping, and running can now be applied to individual cost functions, rather than simply to all cost functions.

The following example shows new macro code for the current release, running adjoint for individual Drag and Lift cost functions:

Simulation simulation_0 = getActiveSimulation();
AdjointSolver adjointSolver_0 = ((AdjointSolver) simulation_0.getSolverManager().getSolver(AdjointSolver.class));
ForceCostFunction forceCostFunction_0 = ((ForceCostFunction) simulation_0.getAdjointCostFunctionManager().getAdjointCostFunction("Drag"));
ForceCostFunction forceCostFunction_1 = ((ForceCostFunction) simulation_0.getAdjointCostFunctionManager().getAdjointCostFunction("Lift"));
adjointSolver_0.runAdjoint(Arrays.asList(forceCostFunction_0, forceCostFunction_1));

A new method clearAdjoint() has been introduced, to allow clearing the adjoint solution of all cost functions or of a list of specific cost functions:

Simulation simulation = getActiveSimulation();
AdjointSolver adjointSolver = ((AdjointSolver) simulation.getSolverManager().getSolver(AdjointSolver.class));

// Clear adjoint of specific cost functions
ForceCostFunction forceCostFunction_0 = ((ForceCostFunction) simulation.getAdjointCostFunctionManager().getAdjointCostFunction("Drag"));
ForceCostFunction forceCostFunction_1 = ((ForceCostFunction) simulation.getAdjointCostFunctionManager().getAdjointCostFunction("Lift"));
adjointSolver.clearAdjoint(Arrays.asList(forceCostFunction_0, forceCostFunction_1));

// Clear adjoint of all cost functions
adjointSolver.clearAdjoint();

This improvement has also resulted in changes to the macro code.

n adjoint steps

Previous Release Simcenter STAR-CCM+ 2019.3
Simulation simulation_0 = getActiveSimulation();
SimulationIterator simIt = simulation_0.getSimulationIterator();
AdjointSolver adjointSolver_0 = (simulation_0.getSolverManager().getSolver(AdjointSolver.class));
AdjointRunnableSolver adjointRunnableSolver_0 = adjointSolver_0.getAdjointRunnableSolver();
simIt.step(adjointRunnableSolver_0, n, true);
Simulation simulation_0 = getActiveSimulation();
AdjointSolver adjointSolver_0 = simulation_0.getSolverManager().getSolver(AdjointSolver.class);
adjointSolver_0.stepAdjoint(n);

Computing mesh sensitivity

Previous Release Simcenter STAR-CCM+ 2019.3
AdjointMeshSolver adjointMeshSolver_0 = ((AdjointMeshSolver) adjointSolver_0.getAdjointSolverManager().getSolver(AdjointMeshSolver.class));
adjointMeshSolver_0.computeMeshSensitivity();
AdjointSolver adjointSolver_0 = ((AdjointSolver) simulation.getSolverManager().getSolver(AdjointSolver.class));
adjointSolver_0.computeMeshSensitivity();

Computing surface sensitivity

Previous Release Simcenter STAR-CCM+ 2019.3
Simulation simulation = getActiveSimulation();
AdjointSolver adjointSolver = ((AdjointSolver) simulation.getSolverManager().getSolver(AdjointSolver.class));
SurfaceSensitivitySolver surfaceSensitivitySolver = adjointSolver.getAdjointSolverManager().getSolver(SurfaceSensitivitySolver.class);   
surfaceSensitivitySolver.computeSurfaceSensitivity();
Simulation simulation = getActiveSimulation();
AdjointSolver adjointSolver = ((AdjointSolver) simulation.getSolverManager().getSolver(AdjointSolver.class));
adjointSolver.computeSurfaceSensitivity();

Computing adjoint error estimates

Previous Release Simcenter STAR-CCM+ 2019.3
Simulation simulation = getActiveSimulation();
AdjointSolver adjointSolver = ((AdjointSolver) simulation.getSolverManager().getSolver(AdjointSolver.class));
AdjointFlowSolver adjointFlowSolver = ((AdjointFlowSolver) adjointSolver.getAdjointSolverManager().getSolver(AdjointFlowSolver.class));
adjointFlowSolver.computeAdjointErrorEstimates();
Simulation simulation = getActiveSimulation();
AdjointSolver adjointSolver = ((AdjointSolver) simulation.getSolverManager().getSolver(AdjointSolver.class));
adjointSolver.computeAdjointErrorEstimates();

DEM: Changes to Strength Specification

The following DEM model parameters have been restructured to use methods that allow, for example, switching from a constant value to a field function:

  • Simple Failure model parameters:
    • Tensile Strength
    • Shear Strength
  • Constant Rate Damage model parameters:
    • Bond Strength
    • Initial Damage

This improvement has resulted in changes to the macro code. The following example shows selecting and setting the parameter for a uniformly distributed tensile strength in the Simple Failure model:

Previous Release Simcenter STAR-CCM+ 2019.3
SimpleFailureDamageModel simpleFailureDamageModel_0 = 
  phaseInteraction_0.getModelManager().getModel(SimpleFailureDamageModel.class);
simpleFailureDamageModel_0.getTensileStrength().setMethod(UniformBondStrengthMethod.class);
UniformBondStrengthMethod uniformBondStrengthMethod_0 = 
  ((UniformBondStrengthMethod) simpleFailureDamageModel_0.getTensileStrength().getMethod());
uniformBondStrengthMethod_0.getLower().setValue(10.0);
uniformBondStrengthMethod_0.getUpper().setValue(20.0);
SimpleFailureDamageModel simpleFailureDamageModel_0 = 
  phaseInteraction_0.getModelManager().getModel(SimpleFailureDamageModel.class);
BondTensileStrengthProfile bondTensileStrengthProfile_0 = 
  simpleFailureDamageModel_0.getBondTensileStrengthProfile();
bondTensileStrengthProfile_0.setMethod(UniformRandomScalarProfileMethod.class);
bondTensileStrengthProfile_0.getMethod(UniformRandomScalarProfileMethod.class).getMinimum().setValue(10.0);
bondTensileStrengthProfile_0.getMethod(UniformRandomScalarProfileMethod.class).getMaximum().setValue(20.0);

Eulerian Multiphase: Changes to S-Gamma Breakup and Coalescence

Improvements have been implemented in the breakup and coalescence of the S-Gamma model, resulting in changes to the macro code.

Previous Release Simcenter STAR-CCM+ 2019.3
eulerianPhase_1.enable(EulerianPhaseSizeDistributionModelGroup.class);
eulerianPhase_1.enable(SgammaModel.class);
eulerianPhase_1.enable(EulerianPhaseSizeDistributionModelGroup.class);
eulerianPhase_1.enable(SgammaEnablerModel.class);
eulerianPhase_1.enable(SgammaModel.class);

VOF / N-Phase Mixture

Restructuring of Convection Option

Due to improvements in consistency and labeling, the convection option has been reworked, resulting in changes to the macro code.

Example for VOF

Previous Release Simcenter STAR-CCM+ 2019.3
import star.flow.VolumeFractionProfile;
import star.multiphase.VolumeFractionUpwindOption;
SegregatedVofModel segregatedVofModel = getActiveSimulation().getContinuumManager().getContinuum("Physics 1")).getModelManager().getModel(SegregatedVofModel.class);
SegregatedVofModel segregatedVofModel = getActiveSimulation().getContinuumManager().getContinuum("Physics 1")).getModelManager().getModel(SegregatedVofModel.class);
segregatedVofModel.getUpwindOption().setSelected(UpwindOption.Type.FIRST_ORDER);
segregatedVofModel.getVolumeFractionUpwindOption().setSelected(VolumeFractionUpwindOption.Type.FIRST_ORDER);

Example for Segregated N-Phase mixture

Previous Release Simcenter STAR-CCM+ 2019.3
import star.flow.VolumeFractionProfile;
import star.multiphase.VolumeFractionUpwindOption;
SegregatedNPhaseMixtureModel segregatedNPhaseMixtureModel = getActiveSimulation().getContinuumManager().getContinuum("Physics 1")).getModelManager().getModel(SegregatedNPhaseMixtureModel.class);
SegregatedNPhaseMixtureModel segregatedNPhaseMixtureModelModel = getActiveSimulation().getContinuumManager().getContinuum("Physics 1")).getModelManager().getModel(SegregatedNPhaseMixtureModel.class);
segregatedNPhaseMixtureModel.getUpwindOption().setSelected(UpwindOption.Type.FIRST_ORDER);
segregatedNPhaseMixtureModel.getVolumeFractionUpwindOption().setSelected(VolumeFractionUpwindOption.Type.FIRST_ORDER);

Renaming of Default Convection Option

For the Volume of Fluid (VOF) model node, the default setting of the Convection property has been renamed for consistency. The 2nd-order setting is now HRIC (High-Resolution Interface Capturing), resulting in change to the macro code.

This name was changed for VOF, but not for N-Phase mixture. To update your macros, see the following example:

Previous Release Simcenter STAR-CCM+ 2019.3
segregatedVofModel.getUpwindOption().setSelected(UpwindOption.Type.SECOND_ORDER);
segregatedNPhaseMixtureModel.getUpwindOption().setSelected(UpwindOption.Type.SECOND_ORDER);
segregatedVofModel.getVolumeFractionUpwindOption().setSelected(VolumeFractionUpwindOption.Type.HRIC);
segregatedNPhaseMixtureModel.getVolumeFractionUpwindOption().setSelected(VolumeFractionUpwindOption.Type.SECOND_ORDER);

Removal of Deprecated Classes

As part of restructuring of VOF, some classes that were deprecated in the past have been removed. This change is only relevant for macros recorded in Version 11.04 or earlier. These outdated classes do not appear in macros recorded with newer versions.

Replacement of SegregatedVofFlowModel

11.04 and Earlier Releases Simcenter STAR-CCM+ 2019.3
import star.vof.SegregatedVofFlowModel
import star.mixturemultiphase.SegregatedVolumeFluxBasedFlowModel
physicsContinuum_0.enable(SegregatedVofFlowModel.class)
physicsContinuum_0.enable(SegregatedVolumeFluxBasedFlowModel.class)

Replacement of SegregatedVofPhaseSpeciesModel

11.04 and Earlier Releases Simcenter STAR-CCM+ 2019.3
import star.vof.SegregatedVofPhaseSpeciesModel
import star.mixturemultiphase.MmpPhaseSpeciesModel
physicsContinuum_0.enable(SegregatedVofPhaseSpeciesModel.class)
physicsContinuum_0.enable(MmpPhaseSpeciesModel.class)

Replacement of SegregatedVofTemperatureModel

11.04 and Earlier Releases Simcenter STAR-CCM+ 2019.3
import star.vof.SegregatedVofTemperatureModel
import star.mixturemultiphase.SegregatedMmpTemperatureModel
physicsContinuum_0.enable(SegregatedVofTemperatureModel.class)
physicsContinuum_0.enable(SegregatedMmpTemperatureModel.class)

Replacement of VofPhaseEnergyModel

11.04 and Earlier Releases Simcenter STAR-CCM+ 2019.3
import star.vof.VofPhaseEnergyModel
import star.mixturemultiphase.MmpPhaseEnergyModel
physicsContinuum_0.enable(VofPhaseEnergyModel.class)
physicsContinuum_0.enable(MmpPhaseEnergyModel.class)

Electromagnetics

Change of Circuit Element

As a part of implementing the excitation coil circuit model link, the class ExcitationCoilCircuitElement has been moved from electromagnetism.common to electromagnetism.magneticpotential.

Previous Release Simcenter STAR-CCM+ 2019.3
import star.electromagnetism.common.ExcitationCoilCircuitElement;
import star.electromagnetism.magneticpotential.ExcitationCoilCircuitElement;

Changes to Nodal Force Calculation

In previous releases of Simcenter STAR-CCM+ nodal forces were calculated during every iteration even in cases when they were not used. For the current release, a dedicated model is provided for nodal forces that you must select in order to see these values. For backwards compatibility the model is activated when restoring old simulations. For macros that create new simulations in which nodal forces are required you must add the new model as shown below.

Previous Release Simcenter STAR-CCM+ 2019.3
Simulation simulation_0 = 
  getActiveSimulation();
PhysicsContinuum physicsContinuum_0 = 
  simulation_0.getContinuumManager().createContinuum(PhysicsContinuum.class);
physicsContinuum_0.enable(ThreeDimensionalModel.class);
physicsContinuum_0.enable(SteadyModel.class);
physicsContinuum_0.enable(SolidModel.class);
physicsContinuum_0.enable(ElectromagnetismModel.class);
physicsContinuum_0.enable(FiniteElementMagneticVectorPotentialModel.class);
physicsContinuum_0.enable(ExcitationCoilModel.class);
Simulation simulation_0 = 
  getActiveSimulation();
PhysicsContinuum physicsContinuum_0 = 
  simulation_0.getContinuumManager().createContinuum(PhysicsContinuum.class);
physicsContinuum_0.enable(ThreeDimensionalModel.class);
physicsContinuum_0.enable(SteadyModel.class);
physicsContinuum_0.enable(SolidModel.class);
physicsContinuum_0.enable(ElectromagnetismModel.class);
physicsContinuum_0.enable(FiniteElementMagneticVectorPotentialModel.class);
physicsContinuum_0.enable(MagneticNodalForceModel.class);
physicsContinuum_0.enable(ExcitationCoilModel.class);

Electrochemistry/Plasma: Transfer of Charge Number Material Property

Due to the introduction of ambipolar diffusion, the ChargeNumberProperty material property has moved from electrochemicalspecies to material, resulting in changes to the macro code. Your existing macros will continue to work as expected, but if you have edited the automatically generated macro, it may no longer compile properly, and you must modify the code as shown below.

Previous Release Simcenter STAR-CCM+ 2019.3
import star.electrochemicalspecies.ChargeNumberProperty;
import star.material.ChargeNumberProperty;

Design Manager: Transfer of Auto Save Option

The Auto Save option in Design Manager has been moved from the properties of the individual design study to those of the Design Manager project. While the existing Java macro APIs have generally not changed, the methods getAutoSaveOnDesignCompletion and setAutoSaveOnDesignCompletion have been deprecated in the MdxLaunchSettings class and added to the MdxProject class.

These deprecated methods have not yet been removed from the current release, but the MdxLaunchSettings methods now refer to the MdxProject class to get and set the value. Because of this, playing back an older macro that uses these methods may result in the project-level Auto Save option not being set as intended. Therefore it is recommended that you prepare for the change by updating your macros as shown in the following example.

Previous Release Simcenter STAR-CCM+ 2019.3
MdxProject mdxProject_0 = 
  getActiveMdxProject();
MdxDesignStudy mdxDesignStudy_0 = 
  mdxProject_0.getDesignStudyManager().getDesignStudy("Design Study");
MdxStudySettings mdxStudySettings_0 = 
  mdxDesignStudy_0.getStudySettings();
MdxLaunchSettings mdxLaunchSettings_0 = 
  mdxStudySettings_0.getLaunchSettings();
mdxLaunchSettings_0.setAutoSaveOnDesignCompletion(true);
MdxProject mdxProject_0 = 
  getActiveMdxProject();
mdxProject_0.setAutoSaveOnDesignCompletion(true);

Co-Simulation: Changes of Field Specifications

Structural improvements in field specifications have resulted in changes to the macro code. Each set of changes is followed by an example of how macro code should be updated.

CoSimStencilOption

The CoSimLocationOption class was renamed to CoSimStencilOption.

Previous Release Simcenter STAR-CCM+ 2019.3
scalarAuxiliaryExportSpecification_0.getCoSimLocationOption().setSelected(CoSimLocationOption.Type.VERTEX);
scalarFieldSpecification_0.getCoSimStencilOption().setSelected(CoSimStencilOption.Type.VERTEX);

ScalarFieldSpecification

The following classes were replaced by the class ScalarFieldSpecification:

  • ScalarAuxiliaryExportSpecification
  • ScalarAuxiliaryImportSpecification
  • HeatTransferCoefficientExportSpecification
  • HeatTransferCoefficientImportSpecification
  • MassflowExportSpecification
  • MassflowImportSpecification
  • PressureExportSpecification
  • PressureImportSpecification
  • TemperatureExportSpecification
  • TemperatureImportSpecification
  • ReferenceTemperatureExportSpecification
  • ReferenceTemperatureImportSpecification
  • HeatFluxExportSpecification
  • HeatFluxImportSpecification
Previous Release Simcenter STAR-CCM+ 2019.3
ScalarAuxiliaryExportSpecification scalarAuxiliaryExportSpecification_0 =   ((ScalarAuxiliaryExportSpecification) coSimulationZone_0.getCoSimulationZoneConditions().get(ExportFieldSpecificationManager.class).getObject("Scalar Auxiliary Field 1"));
ScalarFieldSpecification scalarFieldSpecification_0 =   ((ScalarFieldSpecification) coSimulationZone_0.getCoSimulationZoneConditions().get(ExportFieldSpecificationManager.class).getObject("Scalar Auxiliary Field 1"));

VectorFieldSpecification

The following classes were replaced by the class VectorFieldSpecification:

  • VectorAuxiliaryExportSpecification
  • VectorAuxiliaryImportSpecification
  • DisplacementExportSpecification
  • DisplacementImportSpecification
  • VelocityExportSpecification
  • VelocityImportSpecification
  • WallShearStressExportSpecification
  • WallShearStressImportSpecification
Previous Release Simcenter STAR-CCM+ 2019.3
DisplacementImportSpecification displacementImportSpecification_0 =   (DisplacementImportSpecification) coSimulationZone_0.getCoSimulationZoneConditions().get(ImportFieldSpecificationManager.class).addSpecification("Mechanical", "Displacement");
VectorFieldSpecification vectorFieldSpecification_0 =   ((VectorFieldSpecification) coSimulationZone_0.getCoSimulationZoneConditions().get(ImportFieldSpecificationManager.class).getObject("Displacement"));

ValueSpecification

The classes ExportScalarValueSpecification and ImportScalarValueSpecification were replaced by ScalarValueSpecification.

The classes ExportVectorValueSpecification and ImportVectorValueSpecification were replaced by VectorValueSpecification.

The classes ExportIntScalarValueSpecification and ImportIntScalarValueSpecification were replaced by IntScalarValueSpecification.

The classes ExportBoolScalarValueSpecification and ImportBoolScalarValueSpecification were replaced by BoolScalarValueSpecification.

The classes ExportEnumValueSpecification and ImportEnumValueSpecification were replaced by EnumValueSpecification.

The classes ExportStringValueSpecification and ImportStringValueSpecification were replaced by StringValueSpecification.

Previous Release Simcenter STAR-CCM+ 2019.3
ExportScalarValueSpecification exportScalarValueSpecification_0 =   ((ExportScalarValueSpecification) coSimulation_0.getCoSimulationConditions().get(ExportValueSpecificationManager.class).getObject("expseu_.P3_mass_exp"));
ScalarValueSpecification scalarValueSpecification_0 =   ((ScalarValueSpecification) coSimulation_0.getCoSimulationConditions().get(ExportValueSpecificationManager.class).getObject("expseu_.P3_mass_exp"));

Simcenter STAR-CCM+ In-Cylinder: Changes Due to Renaming of STAR-ICE

3D-CAD models and scenes have been renamed from STAR-ICE to In-Cylinder, resulting in changes to the macro code.

Previous Release Simcenter STAR-CCM+ 2019.3
Simulation simulation_0 = 
  getActiveSimulation();
simulation_0.loadStarIce("StarIce");
Scene scene_0 = 
  simulation_0.getSceneManager().getScene("STAR-ICE 1");
scene_0.initializeAndWait();
StarIceEngine starIceEngine_0 = 
  simulation_0.get(StarIceEngine.class);
starIceEngine_0.startStarIce();
scene_0.setAdvancedRenderingEnabled(false);
SceneUpdate sceneUpdate_0 = 
  scene_0.getSceneUpdate();
HardcopyProperties hardcopyProperties_0 = 
  sceneUpdate_0.getHardcopyProperties();
hardcopyProperties_0.setCurrentResolutionWidth(872);
hardcopyProperties_0.setCurrentResolutionHeight(516);
scene_0.resetCamera();
simulation_0.loadStarIce("StarIce");
Scene scene_1 = 
  simulation_0.getSceneManager().createScene("3D-CAD View");
scene_1.initializeAndWait();
CadModel cadModel_0 = 
  ((CadModel) simulation_0.get(SolidModelManager.class).getObject("STAR-ICE 3D-CAD 1"));
simulation_0.get(SolidModelManager.class).editCadModel(cadModel_0, scene_1);
scene_1.open();
scene_1.setAdvancedRenderingEnabled(false);
SceneUpdate sceneUpdate_1 = 
  scene_1.getSceneUpdate();
HardcopyProperties hardcopyProperties_1 = 
  sceneUpdate_1.getHardcopyProperties();
hardcopyProperties_1.setCurrentResolutionWidth(25);
hardcopyProperties_1.setCurrentResolutionHeight(25);
hardcopyProperties_1.setCurrentResolutionWidth(872);
hardcopyProperties_1.setCurrentResolutionHeight(516);
scene_1.resetCamera();
simulation_0.get(SolidModelManager.class).endEditCadModel(cadModel_0);
simulation_0.getSceneManager().deleteScenes(new NeoObjectVector(new Object[] {scene_1}));
Simulation simulation_0 = 
  getActiveSimulation();
simulation_0.loadStarIce("StarIce");
Scene scene_0 = 
  simulation_0.getSceneManager().getScene("In-Cylinder 1");
scene_0.initializeAndWait();
StarIceEngine starIceEngine_0 = 
  simulation_0.get(StarIceEngine.class);
starIceEngine_0.startStarIce();
scene_0.setAdvancedRenderingEnabled(false);
SceneUpdate sceneUpdate_0 = 
  scene_0.getSceneUpdate();
HardcopyProperties hardcopyProperties_0 = 
  sceneUpdate_0.getHardcopyProperties();
hardcopyProperties_0.setCurrentResolutionWidth(872);
hardcopyProperties_0.setCurrentResolutionHeight(516);
scene_0.resetCamera();
simulation_0.loadStarIce("StarIce");
Scene scene_1 = 
  simulation_0.getSceneManager().createScene("3D-CAD View");
scene_1.initializeAndWait();
CadModel cadModel_0 = 
  ((CadModel) simulation_0.get(SolidModelManager.class).getObject("In-Cylinder 3D-CAD 1"));
simulation_0.get(SolidModelManager.class).editCadModel(cadModel_0, scene_1);
scene_1.open();
scene_1.setAdvancedRenderingEnabled(false);
SceneUpdate sceneUpdate_1 = 
  scene_1.getSceneUpdate();
HardcopyProperties hardcopyProperties_1 = 
  sceneUpdate_1.getHardcopyProperties();
hardcopyProperties_1.setCurrentResolutionWidth(25);
hardcopyProperties_1.setCurrentResolutionHeight(25);
hardcopyProperties_1.setCurrentResolutionWidth(872);
hardcopyProperties_1.setCurrentResolutionHeight(516);
scene_1.resetCamera();
simulation_0.get(SolidModelManager.class).endEditCadModel(cadModel_0);
simulation_0.getSceneManager().deleteScenes(new NeoObjectVector(new Object[] {scene_1}));