Macro API Changes 2019.2

In Simcenter STAR-CCM+ 2019.2, the macro API changed for surface preparation, time, motion, adjoint, wall distance, aeroacoustics, multiphase, electromagnetics, reports, co-simulation, and STAR-ICE.

Surface Preparation

Changes to Thin Mesher Maximum Thickness Operation

The user interface for the Thin Mesher Maximum Thickness operation has changed, resulting in changes to the macro code.

Previous Release Simcenter STAR-CCM+ 2019.2
RelativeSize relativeSize_0 = ((RelativeSize) thinThicknessThreshold_0.getRelativeSizeValue());double value = relativeSize_0.getRelativeSize().getValue();
double value = thinThicknessThreshold_0.getRelativeSizeValue();
RelativeSize relativeSize_0 = ((RelativeSize) thinThicknessThreshold_0.getRelativeSizeValue());relativeSize_0.getRelativeSize().setValue(200.0);
thinThicknessThreshold_0.setRelativeSizeValue(200.0);
AbsoluteSize absoluteSize_0 = ((AbsoluteSize) thinThicknessThreshold_0.getAbsoluteSizeValue());double value = absoluteSize_0.getValue().getValue();
((ScalarPhysicalQuantity) thinThicknessThreshold_0.getAbsoluteSizeValue()).getValue();
AbsoluteSize absoluteSize_0 = ((AbsoluteSize) thinThicknessThreshold_0.getAbsoluteSizeValue());absoluteSize_0.getValue().setValue(1.0);
((ScalarPhysicalQuantity) thinThicknessThreshold_0.getAbsoluteSizeValue()).setValue(1.0);

Changes to Extract Volume Operation

Due to restructuring, the macro code for the Extract Volume operation has changed. While the following example shows the straightforward fix for the code, you are advised to use the non-deprecated API technique shown subsequently.

Previous Release Simcenter STAR-CCM+ 2019.2
ExtractVolumeOperation extractVolumeOperation_0 = ((ExtractVolumeOperation) simulation_0.get(MeshOperationManager.class).getObject("Extract Volume"));
Coordinate coordinate_0 = extractVolumeOperation_0.getVolumePoint();
Units units = getActiveSimulation().getUnitsManager().getPreferredUnits(new IntVector(new int[] {0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}));
coordinate_0.setCoordinate(units, units, units, new DoubleVector(new double[] {0.0, 0.0, 0.1}));
ExtractVolumeOperation extractVolumeOperation_0 = ((ExtractVolumeOperation) simulation_0.get(MeshOperationManager.class).getObject("Extract Volume"));
VectorPhysicalQuantity vectorPhysicalQuantity_0 = extractVolumeOperation_0.getVolumePoint();
vectorPhysicalQuantity_0.setVector(new DoubleVector(new double[] {0.0, 0.0, 0.1}));

For long-term reliability the non-deprecated API technique, which accesses the manual volume objects, is shown in the following example:

ExtractVolumeOperation extractVolumeOperation_0 = ((ExtractVolumeOperation) simulation_0.get(MeshOperationManager.class).getObject("Extract Volume"));
EVManualVolume eVManualVolume_0 = ((EVManualVolume) extractVolumeOperation_0.getManualVolumes().getObject("Extract Volume"));
EVSeedPoint eVSeedPoint_0 = ((EVSeedPoint) eVManualVolume_0.getVolumePoints().getObject("Seed Point 1"));
eVSeedPoint_0.getCoordinates().setComponents(0.0, 0.0, 0.1);

Time: Changes to Time-Step Framework

The Adaptive Time-Step framework combines two previously distinct frameworks, (Time-Step Control and Segregated Time Step), resulting in changes to the macro code:

  • Activating the adaptive time-step providers Convective CFL Condition and Thermal Diffusivity Condition:
    Previous Release Simcenter STAR-CCM+ 2019.2
    PhysicsContinuum physicsContinuum_0 = 
      ((PhysicsContinuum) getActiveSimulation().getContinuumManager().getContinuum("Physics 1"));
    physicsContinuum_0.enable(ConvectiveCflTimeStepControlModel.class);
    physicsContinuum_0.enable(EnergyBasedTimeStepControlModel.class)
    PhysicsContinuum physicsContinuum_0 = 
      ((PhysicsContinuum) getActiveSimulation().getContinuumManager().getContinuum("Physics 1"));
    physicsContinuum_0.enable(AdaptiveTimeStepModel.class);
    
    AdaptiveTimeStepModel adaptiveTimeStepModel_0 =
      physicsContinuum_0.getModelManager().getModel(AdaptiveTimeStepModel.class);
    
    adaptiveTimeStepModel_0.getTimeStepProviderManager().createObject(ConvectiveCflTimeStepProvider.class);
    adaptiveTimeStepModel_0.getTimeStepProviderManager().createObject(ThermalDiffusivityTimeStepProvider.class);
  • Activating the adaptive time-step providers Free Surface CFL Condition and Melting-Solidification Condition:
    Previous Release Simcenter STAR-CCM+ 2019.2
    PhysicsContinuum physicsContinuum_0 = 
      ((PhysicsContinuum) getActiveSimulation().getContinuumManager().getContinuum("Physics 1"));
    
    physicsContinuum_0.enable(SegregatedFluidTimeStepModel.class); 
    
    // above enables "VOF" and "Melting-Solidification" time-step methods
    // given that corresponding models exist
    PhysicsContinuum physicsContinuum_0 = 
      ((PhysicsContinuum) getActiveSimulation().getContinuumManager().getContinuum("Physics 1"));
    physicsContinuum_0.enable(AdaptiveTimeStepModel.class);
    
    AdaptiveTimeStepModel adaptiveTimeStepModel_0 =
      physicsContinuum_0.getModelManager().getModel(AdaptiveTimeStepModel.class);
    
    adaptiveTimeStepModel_0.getTimeStepProviderManager().createObject(FreeSurfaceCflTimeStepProvider.class);
    adaptiveTimeStepModel_0.getTimeStepProviderManager().createObject(VofEnthalpyMeltingTimeStepProvider.class);

    The former Segregated Time Step methods Flow and Energy have been deprecated. Though their use is discouraged, they can be activated with macros for backward compatibility purposes. Equivalent to the code above, these can be created using SegregatedFlowTimeStepMethod.class and SegregatedEnergyTimeStepMethod.class.

  • Modifying the properties of the Convective CFL Time-Step Control and Energy-Based Time-Step Control becomes modifying the properties of the Thermal Diffusivity Condition:
    Previous Release Simcenter STAR-CCM+ 2019.2
    TimeStepControlSolver timeStepControlSolver_0 = 
      ((TimeStepControlSolver) getActiveSimulation().getSolverManager().getSolver(TimeStepControlSolver.class));
    
    TimeStepControlSubSolverManager timeStepControlSubSolverManager_0 =
      ((TimeStepControlSubSolverManager) timeStepControlSolver_0.getTimeStepControlSubSolverManager());
    
    ConvectiveCflTimeStepControlSolver convectiveCflTimeStepControlSolver_0 = 
      ((ConvectiveCflTimeStepControlSolver) timeStepControlSubSolverManager_0.getSolver("Convective CFL Time-Step Control"));
    convectiveCflTimeStepControlSolver_0.getTargetMeanCfl().setValue(2.4);
    convectiveCflTimeStepControlSolver_0.getTargetMaxCfl().setValue(40.0);
    
    EnergyBasedTimeStepControlSolver energyTimeStepControlSolver_0 = 
      ((EnergyBasedTimeStepControlSolver) timeStepControlSubSolverManager_0.getSolver("Energy-Based Time-Step Control"));
    energyTimeStepControlSolver_0.getTargetMeanVonNeumannNumber().setValue(0.002);
    energyTimeStepControlSolver_0.getTargetMaxVonNeumannNumber().setValue(0.005);
    ConvectiveCflTimeStepProvider convectiveCflTimeStepProvider_0 = 
      ((ConvectiveCflTimeStepProvider) adaptiveTimeStepModel_0.getTimeStepProviderManager().getObject("Convective CFL Condition"));
    convectiveCflTimeStepProvider_0.getTargetMaxCfl().setValue(2.4);
    convectiveCflTimeStepProvider_0.getTargetMeanCfl().setValue(40.0);
    
    ThermalDiffusivityTimeStepProvider thermalDiffusivityTimeStepProvider_0 =
      ((ThermalDiffusivityTimeStepProvider) adaptiveTimeStepModel_0.getTimeStepProviderManager().getObject("Thermal Diffusivity Condition"));
    thermalDiffusivityTimeStepProvider_0.getTargetMeanVonNeumannNumber().setValue(0.002);
    thermalDiffusivityTimeStepProvider_0.getTargetMaxVonNeumannNumber().setValue(0.005);
  • Modifying the properties of the VOF and Melting-Solidification time-step methods becomes modifying the properties of the Free Surface CFL Condition and Melting-Solidification Condition:
    Previous Release Simcenter STAR-CCM+ 2019.2
    SegregatedFluidTimeStepModel segregatedFluidTimeStepModel_0 = 
      physicsContinuum_0.getModelManager().getModel(SegregatedFluidTimeStepModel.class);
    
    SegregatedVofTimeStepMethod segregatedVofTimeStepMethod_0 = 
      segregatedFluidTimeStepModel_0.getMethod(SegregatedVofTimeStepMethod.class);
    ((ScalarPhysicalQuantity) segregatedVofTimeStepMethod_0.getMaxConditionLimit()).setValue(0.2);
    ((ScalarPhysicalQuantity) segregatedVofTimeStepMethod_0.getSmoothingSteps()).setValue(3.0);
    
    EnthalpyMeltingTimeStepMethod enthalpyMeltingTimeStepMethod_0 = 
      segregatedFluidTimeStepModel_0.getMethod(EnthalpyMeltingTimeStepMethod.class);
    ((ScalarPhysicalQuantity) enthalpyMeltingTimeStepMethod_0.getMaxConditionLimit()).setValue(1.0);
    ((ScalarPhysicalQuantity) enthalpyMeltingTimeStepMethod_0.getSmoothingSteps()).setValue(0.0);
    FreeSurfaceCflTimeStepProvider freeSurfaceCflTimeStepProvider_0 = 
      ((FreeSurfaceCflTimeStepProvider) adaptiveTimeStepModel_0.getTimeStepProviderManager().getObject("Free Surface CFL Condition"));
    freeSurfaceCflTimeStepProvider_0.getMaxConditionLimit().setValue(0.2);
    freeSurfaceCflTimeStepProvider_0.getSmoothingSteps().setValue(3.0);
    
    VofEnthalpyMeltingTimeStepProvider vofEnthalpyMeltingTimeStepProvider_0 = 
      ((VofEnthalpyMeltingTimeStepProvider) adaptiveTimeStepModel_0.getTimeStepProviderManager().getObject("Melting-Solidification Condition"));
    vofEnthalpyMeltingTimeStepProvider_0.getMaxConditionLimit().setValue(1.0);
    vofEnthalpyMeltingTimeStepProvider_0.getSmoothingSteps().setValue(0.0);

    The former Segregated Time Step methods Flow and Energy have been deprecated. Though their use is discouraged, they can be activated with macros for backward compatibility purposes. Their display names are Flow (Segregated Time Step) and Energy (Segregated Time Step), respectively. Their properties can be modified equivalent to the above.

  • Modifying the properties of the Time-Step Control solver becomes modifying the properties of the Adaptive Time-Step solver:
    Previous Release Simcenter STAR-CCM+ 2019.2
    TimeStepControlSolver timeStepControlSolver_0 = 
      ((TimeStepControlSolver) getActiveSimulation().getSolverManager().getSolver(TimeStepControlSolver.class));
    
    ((ScalarPhysicalQuantity) timeStepControlSolver_0.getMinTimeStep()).setValue(1.0E-5);
    timeStepControlSolver_0.setMaxTimeStepChangeFactor(1.8);
    timeStepControlSolver_0.setVerbose(true);
    AdaptiveTimeStepSolver adaptiveTimeStepSolver_0 = 
      ((AdaptiveTimeStepSolver) getActiveSimulation().getSolverManager().getSolver(AdaptiveTimeStepSolver.class));
    
    adaptiveTimeStepSolver_0.setInitialTimeStepOption(AdaptiveTimeStepInitializationOption.MINIMUM);
    adaptiveTimeStepSolver_0.getMinimumTimeStep().setValue(1.0E-5);
    adaptiveTimeStepSolver_0.setVerbose(true);
    adaptiveTimeStepSolver_0.setChangeFactorBoundsOption(true);
    
    AdaptiveTimeStepChangeFactorBounds adaptiveTimeStepChangeFactorBounds_0 = 
      ((AdaptiveTimeStepChangeFactorBounds) adaptiveTimeStepSolver_0.getChangeFactorBounds());
    adaptiveTimeStepChangeFactorBounds_0.setMaximumChangeFactor(1.8);

    The minimum time-step is used as the initial time-step size. This needs to be specified explicitly for the Adaptive Time-Step solver. Moreover, the Time-Step Change Factor Bounds Option is by default inactive in the new solver.

  • Modifying the properties of the Segregated Time Step model becomes modifying the properties of the Adaptive Time-Step solver:
    Previous Release Simcenter STAR-CCM+ 2019.2
    SegregatedFluidTimeStepModel segregatedFluidTimeStepModel_0 = 
      physicsContinuum_0.getModelManager().getModel(SegregatedFluidTimeStepModel.class);
    
    ((ScalarPhysicalQuantity) segregatedFluidTimeStepModel_0.getStartTimeStep()).setValue(1.0E-4);
    ((ScalarPhysicalQuantity) segregatedFluidTimeStepModel_0.getMinTimeStep()).setValue(1.0E-5);
    segregatedFluidTimeStepModel_0.setMaxTimeStepChangeFactors(new DoubleVector(new double[] {1.8, 2.5}));
    segregatedFluidTimeStepModel_0.setVerboseFlag(true);
    AdaptiveTimeStepSolver adaptiveTimeStepSolver_0 = 
      ((AdaptiveTimeStepSolver) getActiveSimulation().getSolverManager().getSolver(AdaptiveTimeStepSolver.class));
    
    adaptiveTimeStepSolver_0.setInitialTimeStepOption(AdaptiveTimeStepInitializationOption.SPECIFIED);
    adaptiveTimeStepSolver_0.getSpecifiedInitialTimeStep().setValue(1.0E-4);
    adaptiveTimeStepSolver_0.getMinimumTimeStep().setValue(1.0E-5);
    adaptiveTimeStepSolver_0.setVerbose(true);
    adaptiveTimeStepSolver_0.setChangeFactorBoundsOption(true);
    
    AdaptiveTimeStepChangeFactorBounds adaptiveTimeStepChangeFactorBounds_0 = 
      ((AdaptiveTimeStepChangeFactorBounds) adaptiveTimeStepSolver_0.getChangeFactorBounds());
    adaptiveTimeStepChangeFactorBounds_0.setMaximumChangeFactor(1.8);
    adaptiveTimeStepChangeFactorBounds_0.setMinimumChangeFactor(1./2.5);

    The Time-Step Change Factor Bounds Option is disabled by default in the new solver. Moreover, the second value of the previous (Up, Down) Max. Time-Step Change Factor vector, now the Minimum Change Factor, is taken as the reciprocal value.

  • The following example shows modifying the properties of the Segregated Time Step model Start Time and End Time.

    The effect of End Time (given > Start Time) was not solely to deactivate the model after that time is reached, but also to make sure that time is reached exactly. In the new framework, as shown on the right-hand side, this two-fold meaning requires you to specify the value in two places, so that each time-step provider and the Adaptive Time-Step solver deactivate after that time.

    Previous Release Simcenter STAR-CCM+ 2019.2
    SegregatedFluidTimeStepModel segregatedFluidTimeStepModel_1 = 
      physicsContinuum_0.getModelManager().getModel(SegregatedFluidTimeStepModel.class);
    ((ScalarPhysicalQuantity) segregatedFluidTimeStepModel_1.getStartTime()).setValue(0.3);
    ((ScalarPhysicalQuantity) segregatedFluidTimeStepModel_1.getEndTime()).setValue(2.6);
    AdaptiveTimeStepModel adaptiveTimeStepModel_0 = 
      physicsContinuum_0.getModelManager().getModel(AdaptiveTimeStepModel.class);
    
    ConvectiveCflTimeStepProvider convectiveCflTimeStepProvider_0 = 
      ((ConvectiveCflTimeStepProvider) adaptiveTimeStepModel_0.getTimeStepProviderManager().getObject("Convective CFL Condition"));
    convectiveCflTimeStepProvider_0.setEnabledOption(AdaptiveTimeStepProviderOption.TIME_RANGE);
    
    EnabledTimeRange enabledTimeRange_0 = 
      ((EnabledTimeRange) convectiveCflTimeStepProvider_0.getEnabledTimeRange());
    enabledTimeRange_0.getStartTime().setValue(0.3);
    enabledTimeRange_0.setEnableStop(true);
    enabledTimeRange_0.getStopTime().setValue(2.6);
    
    AdaptiveTimeStepSolver adaptiveTimeStepSolver_0 = 
      ((AdaptiveTimeStepSolver) getActiveSimulation().getSolverManager().getSolver(AdaptiveTimeStepSolver.class));
    adaptiveTimeStepSolver_0.setCheckpointTimes(new DoubleVector(new double[] {2.6}));

Motion: Changes to Handling of Morphing Conditions

Due to improvements in the way Simcenter STAR-CCM+ works with boundary conditions, the RigidBody boundary condition and the MorpherSpecification have been deprecated. To ensure behavior that is consistent with previous versions of Simcenter STAR-CCM+, update your macros as shown in the following example.

Previous Release Simcenter STAR-CCM+ 2019.2
Boundary boundary_14 = boundaryManager.getBoundary("car-bdy");
boundary_14.getConditions().get(MorpherSpecification.class).setSelected(MorpherSpecification.Type.RIGIDBODY);
AngularDisplacementProfile angularDisplacementProfile_0 = boundary_14.getValues().get(AngularDisplacementProfile.class); 
Units units_0 = ((Units) sim.getUnitsManager().getObject("deg"));
((ConstantScalarProfileMethod) angularDisplacementProfile_0.getMethod()).getQuantity().setUnits(units_0);
((ConstantScalarProfileMethod) angularDisplacementProfile_0.getMethod()).getQuantity().setValue(1.0);
RigidBodyBCValues rigidBodyBCValues_0 = boundary_14.getValues().get(RigidBodyBCValues.class);
rigidBodyBCValues_0.setAXIS(new DoubleVector(new double[] {0.0, 1.0, 0.0}));
rigidBodyBCValues_0.setORIGIN(new DoubleVector(new double[] {0.5, 0.0, 0.3}));
// 1. create a new rigid motion with all the relevant parameters

RotatingAndTranslatingMotion rigidMotion = 
  sim.get(MotionManager.class).createMotion(RotatingAndTranslatingMotion.class,
                                            "Rotation and Translation");

rigidMotion.getAxisOrigin().setComponents(0.5, 0.0, 0.3);
rigidMotion.getAxisDirection().setComponents(0.0, 1.0, 0.0);
rigidMotion.getRotationRate().setDefinition("0.174533"); // old_angular_step / time_step

// 2. Assign rigid motion to boundary's conditions
boundary_14.getConditions().get(MorpherSpecification.class).setSelected(MorpherSpecification.Type.DISPLACEMENT);
MotionHandle motionHandle_0 = boundary_14.getValues().get(MotionHandle.class);
motionHandle_0.setMotion(rigidMotion);

In Simcenter STAR-CCM+ 2019.2 the following morpher boundary conditions, which were accessible through macros only, have been removed and are no longer supported.

  • MorpherSpecification.Type.GRID_VELOCITY
  • MorpherSpecification.Type.PROSTAR
  • MorpherSpecification.Type.FIXEDPLANE
  • MorpherSpecification.Type.BEAM
  • MorpherSpecification.Type.SOLIDSTRESS
  • MorpherSpecification.Type.RIGIDBODY
  • MorpherSpecification.Type.SLIDING
  • MorpherSpecification.Type.RIGIDSLIDING
  • MorpherSpecification.Type.ABAQUSCOSIMULATION
  • MorpherSpecification.Type.RIGIDMOTION
  • MorpherSpecification.Type.STARCOSIMULATION
  • MorpherSpecification.Type.INTERNAL
  • MorpherSpecification.Type.SLIDE_ON_SURFACE

Adjoint

In Simcenter STAR-CCM+ 2019.2, a high-level AdjointModel was introduced to act as a "gatekeeper" for other adjoint models. Therefore this new adjoint model is the prerequisite to activating any others.

Among the following instances of changes to the macro code, only activation of the AdjointModel is essential for your existing macros to continue to work as expected. However, for long-term reliability, it is recommended that you update your macros with all the other changes to the adjoint macro code listed here.

Change to Model Selection

To activate the AdjointFlowModel and AdjointSolidEnergyModel, add the activation of the AdjointModel:

Previous Release Simcenter STAR-CCM+ 2019.2
continuum.enable(AdjointFlowModel.class);
continuum.enable(AdjointModel.class);
continuum.enable(AdjointFlowModel.class);
continuum.enable(AdjointSolidEnergyModel.class);
continuum.enable(AdjointModel.class);
continuum.enable(AdjointSolidEnergyModel.class);

Change to Stepping and Running the Adjoint Solver

In Simcenter STAR-CCM+ 2019.2, the AdjointRunnableSolver has moved from the AdjointFlowSolver to the AdjointSolver. This means that to step or run the adjoint solver, macros should be modified so the new solver is used to access the AdjointRunnableSolver.

Previous Release Simcenter STAR-CCM+ 2019.2
AdjointFlowSolver adjointFlowSolver_0 = simulation.getSolverManager().getSolver(AdjointFlowSolver.class);
AdjointRunnableSolver adjointRunnableSolver_0 = adjointFlowSolver_0.getAdjointRunnableSolver();
simulation_0.getSimulationIterator().step(adjointRunnableSolver_0, 1);
AdjointSolver adjointSolver_0 = simulation.getSolverManager().getSolver(AdjointSolver.class);
AdjointRunnableSolver adjointRunnableSolver_0 = adjointSolver_0.getAdjointRunnableSolver();
simulation_0.getSimulationIterator().step(adjointRunnableSolver_0, 1);

The AdjointFlowSolver has a deprecated method for accessing the AdjointRunnableSolver so existing macros should continue to work, provided the AdjointSolver gets registered properly. For this to occur, you must activate the AdjointModel.

Change to Solver Access

In Simcenter STAR-CCM+ 2019.2, the AdjointFlowSolver, AdjointMeshSolver, and SurfaceSensitivitySolver were moved from the SolverManager to an AdjointSolverManager that exists underneath the high level AdjointSolver. Macros that access these solvers must be changed such that they go through this high-level solver first.

Previous Release Simcenter STAR-CCM+ 2019.2
simulation.getSolverManager().getSolver(AdjointFlowSolver.class);
simulation.getSolverManager().getSolver(AdjointSolver.class).getAdjointSolverManager().getSolver(AdjointFlowSolver.class);
simulation.getSolverManager().getSolver(AdjointMeshSolver.class);
simulation.getSolverManager().getSolver(AdjointSolver.class).getAdjointSolverManager().getSolver(AdjointMeshSolver.class);
simulation.getSolverManager().getSolver(SurfaceSensitivitySolver.class);
simulation.getSolverManager().getSolver(AdjointSolver.class).getAdjointSolverManager().getSolver(SurfaceSensitivitySolver.class);

Existing macros should continue to work, provided the AdjointSolver gets registered properly. For this to occur, you must activate the AdjointModel.

Changes to the Acceleration Option and GMRES Settings

In Simcenter STAR-CCM+ 2019.2, the AdjointAccelerationOption was moved from the AdjointFlowSolver to the AdjointSolver. To set the acceleration option, macros need to be changed to access the new solver.

Previous Release Simcenter STAR-CCM+ 2019.2
AdjointFlowSolver adjointFlowSolver_0 = simulation.getSolverManager().getSolver(AdjointFlowSolver.class);
AdjointAccelerationOption option = adjointFlowSolver_0.getAccelerationOption();
AdjointSolver adjointSolver_0 = simulation.getSolverManager().getSolver(AdjointSolver.class);
AdjointAccelerationOption option = adjointSolver_0.getAccelerationOption();

The GMRES settings have also changed location, from the GMRESDriver (and FlexGMRESDriver) to GmresSettings (and FlexibleGmresSettings). To set any of the GMRES properties (such as Krylov Space Dimension), update the macros so that they access the settings in the AdjointSolver.

Previous Release Simcenter STAR-CCM+ 2019.2
AdjointFlowSolver adjointFlowSolver_0 = simulation.getSolverManager().getSolver(AdjointFlowSolver.class);
GMRESDriver driver = adjointFlowSolver_0.getGMRESDriver();
driver.setKrylovSpaceDimension(50);
AdjointSolver adjointSolver_0 = simulation.getSolverManager().getSolver(AdjointSolver.class);
GmresSettings settings = adjointSolver_0.getGmresSettings();
settings.setKrylovSpaceDimension(50);

For both the acceleration option and the GMRES settings, existing macros should continue to work.

Wall Distance

Changes to Wall Distance Solver (and VOF Wave Zone Distance Solver)

The Wall Distance Solver Option property has been moved from the solver to the Wall Distance model properties, appearing as the Wall Distance Method property. This transfer has resulted in changes to the macro code. The VOF Wave Zone Distance Solver also inherits the properties of the Wall Distance Solver and hence requires similar macro code changes. To select a particular wall distance option, update your macros as shown in the following example.

Previous Release Simcenter STAR-CCM+ 2019.2
Simulation simulation_0 =
    getActiveSimulation();

WallDistanceSolver wallDistanceSolver_0 =
((WallDistanceSolver)
simulation_0.getSolverManager().getSolver(WallDistanceSolver.class));

wallDistanceSolver_0.getWallDistanceOption().
setSelected(WallDistanceOption.Type.IMPLICIT_TREE);
Simulation simulation_0 =
    getActiveSimulation();

PhysicsContinuum physicsContinuum_0
    = ((PhysicsContinuum)
simulation_0.getContinuumManager().getContinuum("Fluid"));

WallDistanceModel wallDistanceModel_0 =
physicsContinuum_0.getModelManager().getModel(WallDistanceModel.class);

wallDistanceModel_0.getBoundaryDistanceOption().setSelected(BoundaryDistanceOption.Type.IMPLICIT_TREE);

If your macro code is enabling the deprecated space-filling curves (SFC/SIMD) method for distance calculations, update it as shown in the following example.

The SFC/SIMD method was already deprecated in a previous release and selecting this option automatically chooses the Implicit Tree method.

Previous Release Simcenter STAR-CCM+ 2019.2
Simulation simulation_0 =
    getActiveSimulation();

WallDistanceSolver wallDistanceSolver_0 =
((WallDistanceSolver)
simulation_0.getSolverManager().getSolver(Wal
lDistanceSolver.class));

wallDistanceSolver_0.setUseSfcSimd(true);
Simulation simulation_0 =
    getActiveSimulation();

PhysicsContinuum physicsContinuum_0
    = ((PhysicsContinuum)
simulation_0.getContinuumManager().getContinuum("Fluid"));

WallDistanceModel wallDistanceModel_0 =
physicsContinuum_0.getModelManager().getModel(WallDistanceModel.class);

wallDistanceModel_0.getBoundaryDistanceOption().setSelected(BoundaryDistanceOption.Type.IMPLICIT_TREE);

Transfer of PDE Wall Distance Model

The PDE Wall Distance model node has been removed, and the option to compute wall distance using the PDE method has been added as an option under the Wall Distance Method property of the Wall Distance model node. This deletion has resulted in changes to macro code. To set up the PDE wall distance method, update your macros as shown in the following example.

Previous Release Simcenter STAR-CCM+ 2019.2
Simulation simulation_0 =
    getActiveSimulation();

PhysicsContinuum physicsContinuum_0
    = ((PhysicsContinuum)
simulation_0.getContinuumManager().getContinuum("Fluid"));

physicsContinuum_0.enable(PdeWallDistanceModel.class);
Simulation simulation_0 =
    getActiveSimulation();

PhysicsContinuum physicsContinuum_0
    = ((PhysicsContinuum)
simulation_0.getContinuumManager().getContinuum("Fluid"));

WallDistanceModel wallDistanceModel_0 =
physicsContinuum_0.getModelManager().getModel(WallDistanceModel.class);

wallDistanceModel_0.getBoundaryDistanceOption().setSelected(BoundaryDistanceOption.Type.PDE);

Aeroacoustics: Changes to Post Ffowcs Williams-Hawkings (FW-H) Model

For the Post Point Receiver (for the Post FW-H model), the property option Acoustic Data Source has moved to the Post FW-H Receivers node manager.

As a result, any old macro that uses the Post FW-H model with different Acoustic Data Source settings for different Post Point Receivers will automatically use the default option, Flow.

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

Multiphase: Consolidation of Wave Stripping and Edge Stripping

To simplify the workflow, wave and edge stripping have been refactored, resulting in changes to the macro code.

The following classes have been removed:

  • FilmEdgeStrippingDmpModel.class
  • FilmEdgeStrippingEMPModel.class
  • FilmEdgeStrippingLagrangianModel.class
  • FilmWaveStrippingDmpModel.class
  • FilmWaveStrippingEMPModel.class
  • FilmWaveStrippingLagrangianModel.class

To set up film stripping models, the following classes should be used:

  • FilmStrippingDmpModel.class
  • FilmStrippingEMPModel.class
  • FilmStrippingLagrangianModel.class

The method setStrippingOption should be called with the proper FilmStrippingOption. Three options are available:

  • ONLY_EDGE_STRIPPING
  • ONLY_WAVE_STRIPPING
  • EDGE_AND_WAVE_STRIPPING (default)

To change properties of stripping models, use the following to access the edge and wave sub-models:

  • getFilmEdgeStrippingSubModel()
  • getFilmWaveStrippingSubModel()

The following examples are for Dispersed Multiphase Model (DMP) stripping:

Edge stripping

Previous Release Simcenter STAR-CCM+ 2019.2
phaseInteraction_1.enable(FilmEdgeStrippingDmpModel.class);
phaseInteraction_1.enable(FilmStrippingDmpModel.class);
FilmStrippingDmpModel filmStrippingDmpModel_0 =
  phaseInteraction_1.getModelManager().getModel(FilmStrippingDmpModel.class);
filmStrippingDmpModel_0.setStrippingOption(FilmStrippingOption.ONLY_EDGE_STRIPPING);

Wave stripping

Previous Release Simcenter STAR-CCM+ 2019.2
phaseInteraction.enable(FilmWaveStrippingDmpModel.class);
phaseInteraction_1.enable(FilmStrippingDmpModel.class);
FilmStrippingDmpModel filmStrippingDmpModel_0 =
  phaseInteraction_1.getModelManager().getModel(FilmStrippingDmpModel.class);
filmStrippingDmpModel_0.setStrippingOption(FilmStrippingOption.ONLY_WAVE_STRIPPING);

Edge and wave stripping

Previous Release Simcenter STAR-CCM+ 2019.2
phaseInteraction_1.enable(FilmEdgeStrippingDmpModel.class);
phaseInteraction_1.enable(FilmWaveStrippingDmpModel.class);
phaseInteraction_1.enable(FilmStrippingDmpModel.class);

Changing properties

Previous Release Simcenter STAR-CCM+ 2019.2
phaseInteraction_1.getModelManager().getModel(FilmWaveStrippingDmpModel.class).setCShear2Free(15.0);
phaseInteraction_1.getModelManager().getModel(FilmStrippingDmpModel.class).getFilmWaveStrippingSubModel().setCShear2Free(15.0);

Electromagnetics: New Import of Eddy Current Suppression Model

Due to restructuring, the Eddy Current Suppression model is now imported from magnetic potential libraries rather than ohmic heating. To update your macros, replace all instances of import star.electromagnetism.ohmicheating.EddyCurrentSuppressionModel; with import star.electromagnetism.magneticpotential.EddyCurrentSuppressionModel;.

Reports: Changes to Sample Start Event Property for Statistics Reports

Due to restructuring of the monitoring of co-temporal values, the macro code has changed. 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.2
LastNSamplesFilter lastNSamplesFilter_0 = ((LastNSamplesFilter) statisticsReport_0.getSampleFilterManager().getObject("Last N Samples"));
SampleSetStartEventWatcher sampleSetStartEventWatcher_0 = lastNSamplesFilter_0.getSampleSetStartEventWatcher();
DeltaMonitorUpdateEvent deltaMonitorUpdateEvent_0 = ((DeltaMonitorUpdateEvent) simulation_0.getUpdateEventManager().getUpdateEvent("Monitor Delta"));
sampleSetStartEventWatcher_0.setUpdateEvent(deltaMonitorUpdateEvent_0);
LastNSamplesFilter lastNSamplesFilter_0 = ((LastNSamplesFilter) statisticsReport_0.getSampleFilterManager().getObject("Last N Samples"));
DeltaMonitorUpdateEvent deltaMonitorUpdateEvent_0 = ((DeltaMonitorUpdateEvent) simulation_0.getUpdateEventManager().getUpdateEvent("Monitor Delta"));
lastNSamplesFilter_0.setUpdateEvent(deltaMonitorUpdateEvent_0);

If you have edited the automatically generated macro, you may encounter a complication because the SampleSetStartEventWatcher is no longer a ClientServerObject. Consider the following example, in which the return value of the call to LastNSamples::getSampleStartEventWatcher() is assigned to a variable declared as a ClientServerObject, and afterward is cast to SampleSetStartEventWatcher so that the setUpdateEvent() method may be invoked:

LastNSamplesFilter lastNSamplesFilter_0 = ((LastNSamplesFilter) statisticsReport_0.getSampleFilterManager().getObject("Last N Samples"));
ClientServerObject cso = lastNSamplesFilter_0.getSampleSetStartEventWatcher();
DeltaMonitorUpdateEvent deltaMonitorUpdateEvent_0 = ((DeltaMonitorUpdateEvent)
simulation_0.getUpdateEventManager().getUpdateEvent("Monitor Delta"));
((SampleSetStartEventWatcher) sampleSetStartEventWatcher_0).setUpdateEvent(deltaMonitorUpdateEvent_0);

Such altered code executes properly in 2019.1, but not in 2019.2, and you will need to modify your code as suggested above.

Co-Simulation

Change of Coupling Terminology

For greater clarity, the term Coupling Time Step has been replaced with Coupling Interval, resulting in changes to the macro code.

star.cosimulation.abaqus.ConstantCouplingTimeStep has been replaced by star.cosimulation.common.CoSimCouplingInterval.

Previous Release Simcenter STAR-CCM+ 2019.2
// class import
import star.cosimulation.abaqus.ConstantCouplingTimeStep;

// class usage
ConstantCouplingTimeStep constantCouplingTimeStep_0 = coSimulation_0.getCoSimulationValues().get(ConstantCouplingTimeStep.class);
constantCouplingTimeStep_0.getValue().setValue(0.42);
// class import
import star.cosimulation.common.CoSimCouplingInterval;

// class usage
CoSimCouplingInterval coSimCouplingInterval_0 = coSimulation_0.getCoSimulationValues().get(CoSimCouplingInterval.class);
coSimCouplingInterval_0.getCouplingInterval().setValue(0.42);

star.cosimulation.common.CoSimCouplingTimeStep has been replaced by star.cosimulation.common.CoSimCouplingInterval.

Previous Release Simcenter STAR-CCM+ 2019.2
// class import
import star.cosimulation.common.CoSimCouplingTimeStep;

// class had the method getCouplingTimeStep
CoSimCouplingTimeStep coSimCouplingTimeStep_0 = coSimulation_0.getCoSimulationValues().get(CoSimCouplingTimeStep.class);
coSimCouplingTimeStep_0.getCouplingTimeStep().setValue(0.42);
// class import
import star.cosimulation.common.CoSimCouplingInterval;

// class now has the method getCouplingInterval instead
CoSimCouplingInterval coSimCouplingInterval_0 = coSimulation_0.getCoSimulationValues().get(CoSimCouplingInterval.class);
coSimCouplingInterval_0.getCouplingInterval().setValue(0.42);

star.cosimulation.common.CoSimAssignedCouplingTimeStep has been replaced by star.cosimulation.common.CoSimAssignedCouplingInterval.

Previous Release Simcenter STAR-CCM+ 2019.2
// class import
import star.cosimulation.common.CoSimAssignedCouplingTimeStep;

// class the method getCouplingTimeStep
CoSimAssignedCouplingTimeStep coSimCouplingTimeStep_0 = coSimulation_0.getCoSimulationValues().get(CoSimAssignedCouplingTimeStep.class);
coSimAssignedCouplingTimeStep_0.getCouplingTimeStep().setValue(0.42);
// class import
import star.cosimulation.common.CoSimAssignedCouplingInterval;

// class now has the method getCouplingInterval instead
CoSimAssignedCouplingInterval coSimCouplingInterval_0 = coSimulation_0.getCoSimulationValues().get(CoSimAssignedCouplingInterval.class);
CoSimAssignedCouplingInterval_0.getCouplingInterval().setValue(0.42);

Changes to Name Handling

Due to improvements in field storage and other name handling, changes have resulted to the macro code:

  • Export and import fields under the same zone that have the same name are no longer considered a valid setup. In such cases, the imports have been renamed.

    Previous Release Simcenter STAR-CCM+ 2019.2
    ScalarAuxiliaryImportSpecification scalarAuxiliaryImportSpecification_0 = 
      ((ScalarAuxiliaryImportSpecification) coSimulationZone_0.getCoSimulationZoneConditions().get(ImportFieldSpecificationManager.class).getObject("Scalar Auxiliary Field 1"));
    ScalarAuxiliaryImportSpecification scalarAuxiliaryImportSpecification_0 = 
      ((ScalarAuxiliaryImportSpecification) coSimulationZone_0.getCoSimulationZoneConditions().get(ImportFieldSpecificationManager.class).getObject("Scalar Auxiliary Field 1 2"));
  • Function names of co-simulation field functions have been changed to facilitate importing the same field under multiple zones.

    Previous Release Simcenter STAR-CCM+ 2019.2
    PrimitiveFieldFunction primitiveFieldFunction_0 = 
      ((PrimitiveFieldFunction) simulation_0.getFieldFunctionManager().getFunction("CosimImportScalarAuxiliaryField1"));
    PrimitiveFieldFunction primitiveFieldFunction_0 = 
      ((PrimitiveFieldFunction) simulation_0.getFieldFunctionManager().getFunction("Cosim.Scalar Auxiliary Field 1"));
  • Since export and import fields under the same zone can no longer have the same name, the import/export qualification has been removed from the names of initialization values, Simcenter Amesim port associations, and WAVE pin associations.

    Previous Release Simcenter STAR-CCM+ 2019.2
    CoSimScalarInitializationValue coSimScalarInitializationValue_0 = 
      ((CoSimScalarInitializationValue) coSimulationZone_0.getCoSimulationZoneValues().get(CoSimInitializationValueManager.class).getObject("Import: Scalar Auxiliary Field 1"));
    CoSimScalarInitializationValue coSimScalarInitializationValue_0 = 
      ((CoSimScalarInitializationValue) coSimulationZone_0.getCoSimulationZoneValues().get(CoSimInitializationValueManager.class).getObject("Scalar Auxiliary Field 1"));
    IdToSpecAssociation idToSpecAssociation_0 = 
      ((IdToSpecAssociation) coSimulation_0.getCoSimulationConditions().get(AmesimPortAssociationManager.class).getObject("Import: Scalar Auxiliary Field 1"));
    IdToSpecAssociation idToSpecAssociation_0 = 
      ((IdToSpecAssociation) coSimulation_0.getCoSimulationConditions().get(AmesimPortAssociationManager.class).getObject("Scalar Auxiliary Field 1"));
    IdToSpecAssociation idToSpecAssociation_0 = 
      ((IdToSpecAssociation) coSimulation_0.getCoSimulationConditions().get(WaveControlPinAssociationManager.class).getObject("Import: Scalar Auxiliary Field 1"));
    IdToSpecAssociation idToSpecAssociation_0 = 
      ((IdToSpecAssociation) coSimulation_0.getCoSimulationConditions().get(WaveControlPinAssociationManager.class).getObject("Scalar Auxiliary Field 1"));

STAR-ICE: Boolean Predicate No Longer Available for Automation

Due to restructuring in STAR-ICE, AutomationBoolPredicate is no longer available for automation. You are advised to replace instances of AutomationBoolPredicate with the default predicate as shown in the example below.

Previous Release Simcenter STAR-CCM+ 2019.2
Simulation simulation_0 = 
  getActiveSimulation();
SimDriverWorkflow simDriverWorkflow_0 = 
  ((SimDriverWorkflow) simulation_0.get(SimDriverWorkflowManager.class).getObject("MorphMap"));
LoopAutomationBlock loopAutomationBlock_0 = 
  ((LoopAutomationBlock) simDriverWorkflow_0.getBlocks().getObject("Loop"));
AutomationBoolPredicate AutomationBoolPredicate_0 = 
  ((AutomationBoolPredicate) loopAutomationBlock_0.getAutomationPredicateManager().getObject("Boolean Predicate"));
loopAutomationBlock_0.setSelectedPredicate(AutomationBoolPredicate);
Simulation simulation_0 = 
  getActiveSimulation();
SimDriverWorkflow simDriverWorkflow_0 = 
  ((SimDriverWorkflow) simulation_0.get(SimDriverWorkflowManager.class).getObject("MorphMap"));
LoopAutomationBlock loopAutomationBlock_0 = 
  ((LoopAutomationBlock) simDriverWorkflow_0.getBlocks().getObject("Loop"));
AutomationSolverStoppingCriterionPredicate automationSolverStoppingCriterionPredicate_0 = 
  ((AutomationSolverStoppingCriterionPredicate) loopAutomationBlock_0.getAutomationPredicateManager().getObject("Stopping Criterion Predicate"));
loopAutomationBlock_0.setSelectedPredicate(automationSolverStoppingCriterionPredicate_0);