Macro API Changes 2019.1

In Simcenter STAR-CCM+ 2019.1, the macro API changed for meshing, derived units, finite element models, aeroacoustics, reacting flows, Lagrangian multiphase, Eulerian multiphase, electromagnetics, statistics reports, co-simulation, and STAR-ICE.

Meshing: Transfer of Interpolation Option Property

The Interpolation Option property, which selects the method for mapping a solution from an existing volume mesh to a newly generated one, has been moved from the mesh continuum to the physics continuum—to the Proximity Interpolation model which is a new feature in Simcenter STAR-CCM+ 2019.1.

This transfer has resulted in changes to the macro code. Your existing macros will continue to work as expected, but for maximum reliability, it is recommended that you update your macro code as shown in the following example:

Previous Release Simcenter STAR-CCM+ 2019.1
Simulation simulation_0 =   getActiveSimulation();
PartsMeshContinuum partsMeshContinuum_0 = 
  ((PartsMeshContinuum) simulation_0.getContinuumManager().getContinuum("Parts Meshes"));
partsMeshContinuum_0.getSolutionInterpolationOption().setSelected(SolutionInterpolationOption.Type.MAPPER);
Simulation simulation_0 = getActiveSimulation();
PhysicsContinuum physicsContinuum_0 = 
  ((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Fluid"));
physicsContinuum_0.enable(ProximityInterpolationModel.class);
ProximityInterpolationModel proximityInterpolationModel_1 = 
  physicsContinuum_0.getModelManager().getModel(ProximityInterpolationModel.class);
proximityInterpolationModel_1.getSolutionInterpolationMethod().setSelected(SolutionInterpolationMethod.Type.MAPPER);

Scalar and Vector Quantities: Simpler Technique for Derived Units

The technique for setting up a derived unit in a macro (corresponding to the Dimensions property of a scalar or vector quantity in the UI) has been simplified. In previous releases, the class IntVector required you to specify exponents within a long series of numeric entries. In Simcenter STAR-CCM+ 2019.1, the replacement Builder class lets you specify the exponent of each individual dimension which is named.

For example, when setting up a derived unit for acceleration in a macro:

  • In the previous release, you would write:
    (new IntVector(new int[] {0, 1, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}));
  • In Simcenter STAR-CCM+ 2019.1 you would write:
    (Dimensions.Builder().length(1).time(-2).build());

Your existing macros will continue to work as expected, but for maximum reliability, it is recommended that you update your macro code as shown in the following example:

Previous Release Simcenter STAR-CCM+ 2019.1
public void execute() {
  execute0();
}

  private void execute0() {

  Simulation simulation_0 = 
    getActiveSimulation();

  UserUnits userUnits_0 = 
    simulation_0.getUnitsManager().createUnits("Units");

  userUnits_0.setDimensionsVector(new IntVector(new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0}));
}
public void execute() {
  execute0();
}

private void execute0() {

  Simulation simulation_0 = 
    getActiveSimulation();

  UserUnits userUnits_0 = 
    simulation_0.getUnitsManager().createUnits("Units");

  userUnits_0.setDimensions(Dimensions.Builder().volume(1).build());
}

Finite Element Models: Setting Direct Solver Properties

With the offering of an iterative solver for some finite element methods, the way the direct solver properties are accessed and set has changed, resulting in changes to the macro code.

The affected solvers are:

  • ExcitationCoilLumpedParameterSolver
  • FeSolidEnergySolver
  • FiniteElementStressSolver
  • ViscousSolver
  • FiniteElementMagneticVectorPotentialSolver

The following example shows macro changes for the ViscousSolver:

Previous Release Simcenter STAR-CCM+ 2019.1
Simulation simulation_0 = getActiveSimulation();
ViscousSolver viscousSolver = ((ViscousSolver) simulation_0.getSolverManager().getSolver(ViscousSolver.class));
SparseSolverProperties sparseSolverProperties_0 = viscousSolver.getSparseSolverProperties();
sparseSolverProperties_0.setVerbosity(Verbosity.HIGH);
Simulation simulation_0 = getActiveSimulation();
ViscousSolver viscousSolver_0 = ((ViscousSolver) simulation_0.getSolverManager().getSolver(ViscousSolver.class));
ViscousSolverMethods viscousSolverMethods = viscousSolver_0.getSolverMethods();
MumpsPardisoDirectSolver mumpsPardisoDirectSolver_0 =
    viscousSolverMethods.getMethod(MumpsPardisoDirectSolver.class);
SparseSolverProperties sparseSolverProperties_0 = mumpsPardisoDirectSolver_0.getSparseSolverProperties();
sparseSolverProperties_0.setVerbosity(Verbosity.HIGH);

For the FiniteElementStressSolver and the ViscousSolver, the current API method getSparseSolverProperties() remains available.

Aeroacoustics: Changes to On-the-Fly FW-H model and Post FW-H Model

Due to the addition of a new Acoustic Perturbation Equation (APE) option for the Acoustic Data Source property, the preexisting APE option has been renamed to Flow + APE.

For the macro code, AcousticDataSourceOption.Type.APE is now AcousticDataSourceOption.Type.FLOW_APE. Modify your existing macros accordingly.

Previous Release Simcenter STAR-CCM+ 2019.1
simulation_0.get(ReceiverManager.class).getAcousticDataSourceOption().setSelected(AcousticDataSourceOption.Type.APE);
simulation_0.get(ReceiverManager.class).getAcousticDataSourceOption().setSelected(AcousticDataSourceOption.Type.FLOW_APE);
pointFwhPostProcessingReceiver_0.getAcousticDataSourceOption().setSelected(AcousticDataSourceOption.Type.APE);
pointFwhPostProcessingReceiver_0.getAcousticDataSourceOption().setSelected(AcousticDataSourceOption.Type.FLOW_APE);

Reacting Flows

Change in Distribution of Heat to Phases and Interfaces

Phases

The heat from surface chemistry is now distributed to solid phases in addition to fluid phases, resulting in changes to the macro code. To update your macros, replace all instances of physicsContinuum_0.enable(SurfaceChemistryModel.class); with physicsContinuum_0.enable(SurfaceChemistryFluidModel.class);.

Interfaces

In previous releases, you would choose an interface boundary of a region on which to apply surface chemistry. In the current release, you apply it to the interface itself. As a result, macro codes have changed.

Previous Release Simcenter STAR-CCM+ 2019.1
Simulation simulation_0 = 
  getActiveSimulation();
Region region_0 = 
  simulation_0.getRegionManager().getRegion("Fluid");
InterfaceBoundary interfaceBoundary_0 = 
  ((InterfaceBoundary) region_0.getBoundaryManager().getBoundary("fluidSphere [Interface]"));
SurfaceMechanismOption surfaceMechanismOption_0 = 
  interfaceBoundary_0.getConditions().get(SurfaceMechanismOption.class);
surfaceMechanismOption_0.setActiveMechanism("CATALYST");
BulkSurfaceFractionProfile bulkSurfaceFractionProfile_0 = 
  ((BulkSurfaceFractionProfile) interfaceBoundary_0.getValues().get(BulkSurfaceFractionProfileManager.class).getProfile(0));
bulkSurfaceFractionProfile_0.getMethod(ConstantArrayProfileMethod.class).getQuantity().setArray(new DoubleVector(new double[] {1.0}));
SiteSurfaceFractionProfile siteSurfaceFractionProfile_0 = 
  ((SiteSurfaceFractionProfile) interfaceBoundary_0.getValues().get(SiteSurfaceFractionProfileManager.class).getProfile(0));
siteSurfaceFractionProfile_0.getMethod(ConstantArrayProfileMethod.class).getQuantity().setArray(new DoubleVector(new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0}));
Simulation simulation_0 = 
  getActiveSimulation();
BoundaryInterface boundaryInterface_0 = 
  ((BoundaryInterface) simulation_0.getInterfaceManager().getInterface("Interface"));
SurfaceMechanismOption surfaceMechanismOption_0 = 
  boundaryInterface_0.getConditions().get(SurfaceMechanismOption.class);
surfaceMechanismOption_0.setActiveMechanism("CATALYST");
BulkSurfaceFractionProfile bulkSurfaceFractionProfile_0 = 
  ((BulkSurfaceFractionProfile) boundaryInterface_0.getValues().get(BulkSurfaceFractionProfileManager.class).getProfile(0));
bulkSurfaceFractionProfile_0.getMethod(ConstantArrayProfileMethod.class).getQuantity().setArray(new DoubleVector(new double[] {1.0}));
SiteSurfaceFractionProfile siteSurfaceFractionProfile_0 = 
  ((SiteSurfaceFractionProfile) boundaryInterface_0.getValues().get(SiteSurfaceFractionProfileManager.class).getProfile(0));
siteSurfaceFractionProfile_0.getMethod(ConstantArrayProfileMethod.class).getQuantity().setArray(new DoubleVector(new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0}));

Extension of Interphase Reactions

In Lagrangian Multiphase modeling, multi-component liquid droplets can now undergo chemical reactions, resulting in changes to the macro code. To update your macros, replace all instances of ParticleReactionComponent particleReactionComponent_0 = particleReaction_0.getParticleReactants().addSolidReactant(solidComponent_1); with ParticleReactionComponent particleReactionComponent_0 = particleReaction_0.getParticleReactants().addLagrangianReactant(solidComponent_1);.

Lagrangian Multiphase: Changes to Collision Dynamics Settings

In Simcenter STAR-CCM+ 2019.1, the simulation of collision dynamics offers a choice between two methods: O'Rourke and Ashgriz. This expansion has resulted in changes to the macro code.

Since the O'Rourke method has been used in previous versions of Simcenter STAR-CCM+, your existing macros will continue to work as expected. However, for maximum reliability, it is recommended that you update your macro code as shown in the following example:

Previous Release Simcenter STAR-CCM+ 2019.1
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("Droplets"));
lagrangianPhase_0.enable(NtcModel.class);
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("Droplets"));
lagrangianPhase_0.enable(NtcModel.class);
NtcModel ntcModel_0 = 
  lagrangianPhase_0.getModelManager().getModel(NtcModel.class);
ntcModel_0.getCollisionDynamics().setMethod(ORourkeCollisionDynamicsMethod.class);

Eulerian Multiphase

Changes to Specification of Porous Viscous and Inertial Resistance

Porous viscous and inertial resistance can now be specified per phase in N-phase mixture, two-phase thermodynamic equilibrium, and VOF setups. In these cases, the resistance can no longer be specified under Physics Values for the continuum, but must be specified per phase. This allows different values of resistance for each phase.

Update your macros as shown in the following example for two phases named Liquid and Gas, and isotropic resistance tensors.

Porous viscous resistance

Previous Release Simcenter STAR-CCM+ 2019.1
Simulation simulation_0 = getActiveSimulation();
Region region_0 = simulation.getRegionManager.getRegion("Region");
PorousViscousResistance porousViscousResistance_0 = region_0.getValues().get(PorousViscousResistance.class);
porousViscousResistance_0.setMethod(IsotropicTensorProfileMethod.class);
ScalarProfile scalarProfile_0 = porousViscousResistance_0.getMethod(IsotropicTensorProfileMethod.class).getIsotropicProfile();
scalarProfile_0.getMethod(ConstantScalarProfileMethod.class).getQuantity().setValue(1e8);
Simulation simulation_0 = getActiveSimulation();
Region region_0 = simulation.getRegionManager.getRegion("Region");
PhaseConditions phaseConditions_0 = ((PhaseConditions) region_0.get(PhaseConditionsManager.class).getPhaseConditions("Liquid"));
PorousViscousResistance porousViscousResistance_0 = phaseConditions_0.getPhaseValueManager().get(PorousViscousResistance.class);
porousViscousResistance_0.setMethod(IsotropicTensorProfileMethod.class);
ScalarProfile scalarProfile_0 = porousViscousResistance_0.getMethod(IsotropicTensorProfileMethod.class).getIsotropicProfile();
scalarProfile_0.getMethod(ConstantScalarProfileMethod.class).getQuantity().setValue(1e8);    

PhaseConditions phaseConditions_1 = ((PhaseConditions) region_0.get(PhaseConditionsManager.class).getPhaseConditions("Gas"));
PorousViscousResistance porousViscousResistance_1 = phaseConditions_1.getPhaseValueManager().get(PorousViscousResistance.class);
porousViscousResistance_1.setMethod(IsotropicTensorProfileMethod.class);
ScalarProfile scalarProfile_1 = porousViscousResistance_1.getMethod(IsotropicTensorProfileMethod.class).getIsotropicProfile();
scalarProfile_1.getMethod(ConstantScalarProfileMethod.class).getQuantity().setValue(1e7);

Porous inertial resistance

Previous Release Simcenter STAR-CCM+ 2019.1
Simulation simulation_0 = getActiveSimulation();
Region region_0 = simulation.getRegionManager.getRegion("Region");
PorousInertialResistance porousInertialResistance_0 = region_0.getValues().get(PorousInertialResistance.class);
porousInertialResistance_0.setMethod(IsotropicTensorProfileMethod.class);
ScalarProfile scalarProfile_0 = porousInertialResistance_0.getMethod(IsotropicTensorProfileMethod.class).getIsotropicProfile();
scalarProfile_0.getMethod(ConstantScalarProfileMethod.class).getQuantity().setValue(1e8);
Simulation simulation_0 = getActiveSimulation();
Region region_0 = simulation.getRegionManager.getRegion("Region");
PhaseConditions phaseConditions_0 = ((PhaseConditions) region_0.get(PhaseConditionsManager.class).getPhaseConditions("Liquid"));
PorousInertialResistance porousInertialResistance_0 = phaseConditions_0.getPhaseValueManager().get(PorousInertialResistance.class);
porousInertialResistance_0.setMethod(IsotropicTensorProfileMethod.class);
ScalarProfile scalarProfile_0 = porousInertialResistance_0.getMethod(IsotropicTensorProfileMethod.class).getIsotropicProfile();
scalarProfile_0.getMethod(ConstantScalarProfileMethod.class).getQuantity().setValue(1e8);

PhaseConditions phaseConditions_1 = ((PhaseConditions) region_0.get(PhaseConditionsManager.class).getPhaseConditions("Gas"));
PorousInertialResistance porousInertialResistance_1 = phaseConditions_1.getPhaseValueManager().get(PorousInertialResistance.class);
porousInertialResistance_1.setMethod(IsotropicTensorProfileMethod.class);
ScalarProfile scalarProfile_1 = porousInertialResistance_1.getMethod(IsotropicTensorProfileMethod.class).getIsotropicProfile();
scalarProfile_1.getMethod(ConstantScalarProfileMethod.class).getQuantity().setValue(1e7);

Changes to Selection of Slip Models

Beginning with Simcenter STAR-CCM+ 2019.1, different methods for the phase slip velocity can be selected per region, for example allowing for different slip velocity models in fluid and porous regions.

Update your macros as shown in the following examples:

User-defined slip velocity

Previous Release Simcenter STAR-CCM+ 2019.1
MultiPhaseInteractionModel multiPhaseInteractionModel_0 = physicsContinuum_0.getModelManager().getModel(MultiPhaseInteractionModel.class);
PhaseInteraction phaseInteraction_0 = multiPhaseInteractionModel_0.createPhaseInteraction();
phaseInteraction_0.enable(MmpMmpPhaseInteractionModel.class);
phaseInteraction_0.enable(MmpUserSlipVelocityModel.class);

MmpUserSlipVelocityModel mmpUserSlipVelocityModel_0 = phaseInteraction_0.getModelManager().getModel(MmpUserSlipVelocityModel.class); 
MmpUserSlipVelocityProfile mmpUserSlipVelocityProfile_0 = mmpUserSlipVelocityModel_0.getUserSlipVelocityProfile();
mmpUserSlipVelocityProfile_0.getMethod(ConstantVectorProfileMethod.class).getQuantity().setComponents(0.0, 0.0, -1.0);
MultiPhaseInteractionModel multiPhaseInteractionModel_0 = physicsContinuum_0.getModelManager().getModel(MultiPhaseInteractionModel.class);
PhaseInteraction phaseInteraction_0 = multiPhaseInteractionModel_0.createPhaseInteraction();
phaseInteraction_0.enable(MmpMmpPhaseInteractionModel.class);
phaseInteraction_0.enable(MmpSlipVelocityModel.class);

PhaseConditions phaseConditions_0 = ((PhaseConditions) region.get(PhaseConditionsManager.class).getPhaseConditions("Phase Interaction 1"));
phaseConditions_0.getPhaseConditionManager().get(SlipVelocityMethodOption.class).setSelected(SlipVelocityMethodOption.Type.USER_SLIP);

MmpUserSlipVelocityProfile mmpUserSlipVelocityProfile_0 = phaseConditions.getPhaseValueManager().get(MmpUserSlipVelocityProfile.class);
mmpUserSlipVelocityProfile_0.getMethod(ConstantVectorProfileMethod.class).getQuantity().setComponents(0.0, 0.0, -1.0);

Drag-based slip velocity

Previous Release Simcenter STAR-CCM+ 2019.1
MultiPhaseInteractionModel multiPhaseInteractionModel_0 = physicsContinuum_0.getModelManager().getModel(MultiPhaseInteractionModel.class);
PhaseInteraction phaseInteraction_0 = multiPhaseInteractionModel_0.createPhaseInteraction();
phaseInteraction_0.enable(MmpMmpPhaseInteractionModel.class);
phaseInteraction_0.enable(MmpDragBasedSlipVelocityModel.class);
phaseInteraction_0.enable(MmpInteractionLengthScaleModel.class);
MultiPhaseInteractionModel multiPhaseInteractionModel_0 = physicsContinuum_0.getModelManager().getModel(MultiPhaseInteractionModel.class);
PhaseInteraction phaseInteraction_0 = multiPhaseInteractionModel_0.createPhaseInteraction();
phaseInteraction_0.enable(MmpMmpPhaseInteractionModel.class);
phaseInteraction_0.enable(MmpSlipVelocityModel.class);
phaseInteraction_0.enable(MmpInteractionLengthScaleModel.class);

PhaseConditions phaseConditions_0 = ((PhaseConditions) region_0.get(PhaseConditionsManager.class).getPhaseConditions("Phase Interaction 1"));
phaseConditions_0.getPhaseConditionManager().get(SlipVelocityMethodOption.class).setSelected(SlipVelocityMethodOption.Type.DRAG_BASED);

Electromagnetics: Changes to Magnetic Force Report

The expanded functionality of reports in Electromagnetics modeling has led to restructuring, resulting in changes to the macro code. To update your macros, replace all instances of magneticpotential.fem.MagneticForceReport with magneticpotential.MagneticForceReport.

Previous Release Simcenter STAR-CCM+ 2019.1
import star.electromagnetism.magneticpotential.fem.MagneticForceReport;
import star.electromagnetism.magneticpotential.MagneticForceReport;

Statistics Reports: Change to Sample Collection Policy

With the introduction of co-temporal monitors in Simcenter STAR-CCM+ 2019.1, the macro code was restructured to help ensure backward compatibility. Your existing macros will continue to work as expected, but for maximum reliability, it is recommended that you update your macro code as shown in the following example:

Previous Release Simcenter STAR-CCM+ 2019.1
statisticsReport_0.getSampleFilterManager().getSampleFilterOption()
                          .setSelected(SampleFilterOption.Type.LAST_N_SAMPLES);
statisticsReport_0.setSampleFilterOption(SampleFilterOption.LastNSamples);

If you have altered the automatically generated code in the macro, by declaring variables and assigning to them one or more of the intermediate return values, it may no longer compile as expected, and you will need to modify the code as suggested above. Consider the following example:

SampleFilterManager manager = statisticsReport_0.getSampleFilterManager();
EnumeratedOption option = manager.getSampleFilterOption();
SampleFilterOption.Type value = SampleFilterOption.Type.LAST_N_SAMPLES;
option.setSelected(value);

This code will fail to compile because getSampleFilterOption() now returns an enumerated type value, rather than an instance of EnumeratedOption.

Co-Simulation: Refactoring of FieldSpecification Class

Due to refactoring of the classes FieldSpecification and FieldSpecificationManager, the macro code has changed.

Class imports

Previous Release Simcenter STAR-CCM+ 2019.1
import star.cosimulation.common.ExportSpecificationManager;
import star.cosimulation.common.ImportSpecificationManager;
import star.cosimulation.common.ExportFieldSpecificationManager;
import star.cosimulation.common.ImportFieldSpecificationManager;

Getting the import/export field specification managers and adding/removing field specifications

Previous Release Simcenter STAR-CCM+ 2019.1
ReferenceTemperatureExportSpecification referenceTemperatureExportSpecification_0 =
(ReferenceTemperatureExportSpecification) coSimulationZone_0.getCoSimulationZoneConditions().get(ExportSpecificationManager.class).addFieldSpecification("Thermal", "ReferenceTemperature");

coSimulationZone_0.getCoSimulationZoneConditions().get(ExportSpecificationManager.class).removeFieldSpecifications(new NeoObjectVector(new Object[] {referenceTemperatureExportSpecification_0}));

TemperatureImportSpecification temperatureImportSpecification_0 =
  (TemperatureImportSpecification) coSimulationZone_0.getCoSimulationZoneConditions().get(ImportSpecificationManager.class).addFieldSpecification("Thermal", "Temperature");

coSimulationZone_0.getCoSimulationZoneConditions().get(ImportSpecificationManager.class).removeFieldSpecifications(new NeoObjectVector(new Object[] {temperatureImportSpecification_0}));
ReferenceTemperatureExportSpecification referenceTemperatureExportSpecification_0 =
  (ReferenceTemperatureExportSpecification) coSimulationZone_0.getCoSimulationZoneConditions().get(ExportFieldSpecificationManager.class).addSpecification("Thermal", "ReferenceTemperature");

coSimulationZone_0.getCoSimulationZoneConditions().get(ExportFieldSpecificationManager.class).removeSpecifications(new NeoObjectVector(new Object[] {referenceTemperatureExportSpecification_0}));

TemperatureImportSpecification temperatureImportSpecification_0 =
  (TemperatureImportSpecification) coSimulationZone_0.getCoSimulationZoneConditions().get(ImportFieldSpecificationManager.class).addSpecification("Thermal", "Temperature");

coSimulationZone_0.getCoSimulationZoneConditions().get(ImportFieldSpecificationManager.class).removeSpecifications(new NeoObjectVector(new Object[] {temperatureImportSpecification_0}));

Setting up the field specification initialization value

Previous Release Simcenter STAR-CCM+ 2019.1
coSimScalarInitializationValue_0.getValue().setValue(3.0);
coSimVectorInitializationValue_0.getValue().setComponents(0.0, 3.0, 0.0);
coSimScalarInitializationValue_0.getInitializationValue().setValue(3.0);
coSimVectorInitializationValue_0.getInitializationValue().setComponents(0.0, 3.0, 0.0);

STAR-ICE

Changes to Macro Startup Routine

The STAR-ICE macro recording process has been consolidated so that only essential settings are recorded during startup. This modification prevents STAR-ICE from making any unwanted changes to your settings.

Previous Release Simcenter STAR-CCM+ 2019.1
Simulation simulation_0 = 
  getActiveSimulation();
simulation_0.loadStarIce("StarIce");
Units units_0 = 
  ((Units) simulation_0.getUnitsManager().getObject("deg"));
units_0.setPreferred(true);
AutoSave autoSave_0 = 
  simulation_0.getSimulationIterator().getAutoSave();
autoSave_0.setMaxAutosavedFiles(2);
StarUpdate starUpdate_0 = 
  autoSave_0.getStarUpdate();
starUpdate_0.setEnabled(true);
starUpdate_0.getUpdateModeOption().setSelected(StarUpdateModeOption.Type.TIMESTEP);
TimeStepUpdateFrequency timeStepUpdateFrequency_0 = 
  starUpdate_0.getTimeStepUpdateFrequency();
timeStepUpdateFrequency_0.setTimeSteps(100);
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(923);
hardcopyProperties_0.setCurrentResolutionHeight(517);
scene_0.resetCamera();
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(517);
scene_0.resetCamera();

Changes to Model Selection

In Simcenter STAR-CCM+ 2019.1, the following changes were included in STAR-ICE modeling:
  • When opened, the model selector now has no models activated.
  • The Motored model is no longer explicitly selected.
  • The Single Fuel model has been renamed to Fuel.

As a result, StarIceFuelCountNoneModel no longer functions in macros. Delete lines of macro code that activate or deactivate this model. Other changes to the macro code are shown in the following annotated example:

Previous Release Simcenter STAR-CCM+ 2019.1
    simulation_0.loadStarIce("StarIce");

    StarIcePhysicsContinuum starIcePhysicsContinuum_0 = 
      starIceEngine_0.getStarIcePhysicsContinuum();


//From within the UI, deactivate "Motor" and then activate "Single Fuel".
    StarIceFuelCountNoneModel starIceFuelCountNoneModel_0 = 
      starIcePhysicsContinuum_0.getModelManager().getModel(StarIceFuelCountNoneModel.class);

    starIcePhysicsContinuum_0.disableModel(starIceFuelCountNoneModel_0);

    starIcePhysicsContinuum_0.enable(StarIceFuelCountSingleModel.class);
//--end--


//From within the UI, deactivate "Single Fuel" and then activate "Motored" 
    StarIceFuelCountSingleModel starIceFuelCountSingleModel_0 = 
      starIcePhysicsContinuum_0.getModelManager().getModel(StarIceFuelCountSingleModel.class);

    starIcePhysicsContinuum_0.disableModel(starIceFuelCountSingleModel_0);

    starIcePhysicsContinuum_0.enable(StarIceFuelCountNoneModel.class);
//--end--
    simulation_0.loadStarIce("StarIce");

    StarIcePhysicsContinuum starIcePhysicsContinuum_0 = 
      starIceEngine_0.getStarIcePhysicsContinuum();


//From within the UI, activate "Fuel"
    starIcePhysicsContinuum_0.enable(StarIceFuelCountSingleModel.class);
//--end--


//From within the UI, deactivate "Fuel"
    StarIceFuelCountSingleModel starIceFuelCountSingleModel_0 = 
      starIcePhysicsContinuum_0.getModelManager().getModel(StarIceFuelCountSingleModel.class);

    starIcePhysicsContinuum_0.disableModel(starIceFuelCountSingleModel_0);
//--end--