Macro API Changes 7.02

In Simcenter STAR-CCM+ 7.02, the macro API changed for energy source options, battery modeling, thermal resistance, derived parts, harmonic balance, and thermal comfort.

Changes to Class Names for Energy Source Options

Various API changes have been made to Energy Source Options for regions (solid, porous and fluid). Additional changes to the Energy Source Options have been made for contact and baffle interfaces.

Previous Release Simcenter STAR-CCM+ 7.02.011

Changes to Energy Source Options: the class name for FluidEnergyUserSourceOption (fluid and porous regions) and EnergyUserSourceOption (solid regions) is now EnergyUserVolumeSourceOption.

region.getConditions()

.get(FluidEnergyUserSourceOption.class)

.setSelected(EnergyUserSourceOption.SPECIFIED);

region.getConditions()

.get(EnergyUserVolumeSourceOption.class)

.setSelected(EnergyUserVolumeSourceOption.VOLUMETRIC_HEAT_SOURCE);

region.getConditions()

.get(EnergyUserSourceOption.class)

.setUserSourceOption(true);

region.getConditions()

.get(EnergyUserVolumeSourceOption.class)

.setSelected(EnergyUserVolumeSourceOption.VOLUMETRIC_HEAT_SOURCE);

Changes to Energy Source Options for solid regions: the class name for EnergyUserSource has changed to VolumetricHeatSourceProfile.

EnergyUserSource src = region

.getValues()

.get(EnergyUserSource.class);

VolumetricHeatSourceProfile src = region

.getValues()

.get(VolumetricHeatSourceProfile.class);

Changes to Energy Source Options for contact and baffle Interfaces: the class name for EnergyUserSourceOption is now EnergyUserSurfaceSourceOption.

interface.getConditions() .get(EnergyUserSourceOption.class) .setUserSourceOption(true);

HeatFluxProfile src = interface

.getValues() .get(HeatFluxProfile.class);

interface.getConditions()

.get(EnergyUserSurfaceSourceOption.class)

.setSelected(EnergyUserSurfaceSourceOption.HEAT_FLUX);

HeatFluxProfile src =

interface

.getValues()

.get(HeatFluxProfile.class);

Changes in Boundary Names in the Battery Model

The boundary names in the battery model have changed format. The new names are now cleaner, dropping the extra information that used to appear before the boundary name. Consider the example shown below where the boundary is called Stack Front.

Previous Release Simcenter STAR-CCM+ 7.02.011

Boundary boundary_2 =

region_0

.getBoundaryManager()

.getBoundary("Battery Module: Battery Module Cell 0,0: Stack.Stack Front");

Boundary boundary_2 =

region_0

.getBoundaryManager()

.getBoundary("Stack Front");

All boundary names will need to be updated so that only the name appears in .getBoundary().

Baffle Interface Thermal Resistance Option

A new wall thermal resistance interface has been added to the code and contains an effective resistance and a multi-layer resistance option. In contrast to the baffle multi-layer resistance, the wall multi-layer resistance is implemented as a Profile method on a general ThermalResistance profile.

Previous Release Simcenter STAR-CCM+ 7.02.011

Setting effective baffle resistance:

directBoundaryInterface_0 .getConditions() .get(BaffleThermalOption.class) .setSelected(BaffleThermalOption.CONDUCTING);

directBoundaryInterface_0 .getConditions() .get(BaffleThermalResistanceOption.class) .setSelected(BaffleThermalResistanceOption.EFFECTIVE_RESISTANCE);

BaffleConductivityProfile baffleConductivityProfile_0 = directBoundaryInterface_0 .getValues() .get(BaffleConductivityProfile.class);

((ConstantScalarProfileMethod) baffleConductivityProfile_0.getMethod()).getQuantity().setDefinition("0");

directBoundaryInterface_0

.getConditions()

.get(BaffleThermalOption.class)

.setSelected(BaffleThermalOption.CONDUCTING);

ThermalResistanceProfile thermalResistanceProfile_0 =

directBoundaryInterface_0 .getValues()

.get(ThermalResistanceProfile.class);

thermalResistanceProfile_0

.getMethod(ConstantScalarProfileMethod.class)

.getQuantity()

.setValue(0.0);

Setting multi-layer baffle resistance:

directBoundaryInterface_1

.getConditions()

.get(BaffleThermalOption.class)

.setSelected(BaffleThermalOption.CONDUCTING);

directBoundaryInterface_1.getConditions()

.get(BaffleThermalResistanceOption.class)

.setSelected(BaffleThermalResistanceOption.MULTI_LAYER);

MultiLayerBaffleResistance multiLayerBaffleResistance_0 = directBoundaryInterface_1 .getValues() .get(MultiLayerBaffleResistance.class);

multiLayerBaffleResistance_0 .setNLayers(1);

multiLayerBaffleResistance_0 .setLayerThickness(new DoubleVector(new double[] {2.0}));

multiLayerBaffleResistance_0 .setLayerConductivity(new DoubleVector(new double[] {1.2}));

directBoundaryInterface_1

.getConditions()

.get(BaffleThermalOption.class)

.setSelected(BaffleThermalOption.CONDUCTING);

ThermalResistanceProfile thermalResistanceProfile_1 =

directBoundaryInterface_1

.getValues()

.get(ThermalResistanceProfile.class);

thermalResistanceProfile_1

.setMethod(MultiLayerThermalResistanceMethod.class);

MultiLayerThermalResistanceMethod multiLayerMethod =

thermalResistanceProfile_1

.getMethod(MultiLayerThermalResistanceMethod.class);

multiLayerMethod

.setNLayers(1);

multiLayerMethod .getLayerThickness()

.setArray(new DoubleVector(new double[] {2.0}));

multiLayerMethod .getLayerConductivity()

.setArray(new DoubleVector(new double[] {1.2}));

Units Support for Derived Parts

In order to add the ability to supply units for the values used in derived parts, it was necessary to change the APIs to create and set values for these objects. The existing APIs will be kept in place, assuming that the values specified are in internal units.

Previous Release Simcenter STAR-CCM+ 7.02.011

The PartManager.createIsoPart no longer accepts the number of contour levels followed by a set of values. Values are now supplied using the SingleIsoValue, MultiIsoValue, and MultiRangeIsoValue APIs which use ScalarPhysicalQuantity and ArrayPhysicalQuantity objects to specify values with units. The PartManager.createImplicitPart will be changed similarly.

IsoPart isoPart_0 =

simulation_0 .getPartManager() .createIsoPart(new NeoObjectVector(new Object[] {region_0}), 1, new DoubleVector(new double[] {50.0}), primitiveFieldFunction_0);

IsoPart isoPart_0 =

simulation_0 .getPartManager() .createIsoPart(new NeoObjectVector(new Object[] {region_0}), primitiveFieldFunction_0);

isoPart_0 .setMode(0);

SingleIsoValue singleIsoValue_0 =

isoPart_0 .getSingleIsoValue();

singleIsoValue_0 .getValueQuantity() .setValue(50.0);

singleIsoValue_0 .getValueQuantity() .setUnits(units_1);

isoPart_0 .setMode(0);

singleIsoValue_0 .getValueQuantity() .setUnits(units_1);

singleIsoValue_0 .getValueQuantity() .setValue(50.0);

The PartManager.createThreshold continues to specify two values in a range parameter, but it is now followed by units.

ThresholdPart thresholdPart_0 =

simulation_0 .getPartManager() .createThresholdPart(new NeoObjectVector(new Object[] {region_0}), new DoubleVector(new double[] {-25.0, 112.0}), primitiveFieldFunction_0, 0);

ThresholdPart thresholdPart_0 =

simulation_0

.getPartManager()

.createThresholdPart(new NeoObjectVector(new Object[] {region_0}), new DoubleVector(new double[] {-25.0, 112.0}), units_1, primitiveFieldFunction_0, 0);

Simplified the Number of Blades Input for the Harmonic Balance Model

In the past, the number of blades were specified as equal to (2π/Pitch). While this is acceptable for 3D cases, where it corresponds to the physical number of blades on the wheel, it is prone to errors in 2D cases, since this is a non-integral number. The current version now considers the number of blades input to be an integer value for both 3D and 2D cases. In the case of 2D, it now corresponds to the number of passages being modeled.

Previous Release Simcenter STAR-CCM+ 7.02.011

For 2D cases the NumberOfBlades object needs to be set to 1. The Pitch object needs to be set to (2π/old NumberOfBlades). In the example below, the old NumberOfBlades was 12.56637061, resulting in a Pitch of 0.5.

HbBladeRow hbBladeRow_0 = harmonicBalanceFlowModel_0 .createBladeRow();

hbBladeRow_0 .setNumberOfBlades(12.56637061);

HbBladeRow hbBladeRow_0 = harmonicBalanceFlowModel_0 .createBladeRow();

hbBladeRow_0 .getBladesPerPitch() .setNumberOfBlades(1);

hbBladeRow_0 .getBladesPerPitch() .getPitch() .setValue(0.5);

FourierCoefficientsWakeSpecifier fourierCoefficientsWakeSpecifier_0 = boundary_0 .getValues() .get(FourierCoefficientsWakeSpecifier.class);

fourierCoefficientsWakeSpecifier_0 .setWakeBlades(12.56637061);

FourierCoefficientsWakeSpecifier fourierCoefficientsWakeSpecifier_0 = boundary_0 .getValues() .get(FourierCoefficientsWakeSpecifier.class);

fourierCoefficientsWakeSpecifier_0 .getWakeBladesPerPitch() .setNumberOfBlades(1);

fourierCoefficientsWakeSpecifier_0 .getWakeBladesPerPitch() .getPitch() .setValue(0.5);

For 3D cases, the NumberOfBlades needs to be set to the old value (12 in the example below). The Pitch needs to be set so that it equals 2π radians (6.283185307 shown below).

HbBladeRow hbBladeRow_0 = harmonicBalanceFlowModel_0 .createBladeRow();

hbBladeRow_0 .setNumberOfBlades(12);

HbBladeRow hbBladeRow_0 = harmonicBalanceFlowModel_0 .createBladeRow();

hbBladeRow_0 .getBladesPerPitch() .setNumberOfBlades(12);

hbBladeRow_0 .getBladesPerPitch() .getPitch() .setValue(6.283185307);

FourierCoefficientsWakeSpecifier fourierCoefficientsWakeSpecifier_0 = boundary_0 .getValues() .get(FourierCoefficientsWakeSpecifier.class);

fourierCoefficientsWakeSpecifier_0 .setWakeBlades(12);

FourierCoefficientsWakeSpecifier fourierCoefficientsWakeSpecifier_0 = boundary_0 .getValues() .get(FourierCoefficientsWakeSpecifier.class);

fourierCoefficientsWakeSpecifier_0 .getWakeBladesPerPitch() .setNumberOfBlades(12);

fourierCoefficientsWakeSpecifier_0 .getWakeBladesPerPitch() .getPitch() .setValue(6.283185307);

This change applies to all other wake options: Gaussian Wake, Sine Wake, Hodson Wake.

Thermal Comfort Model Now Only Contains Relevant Boundary Conditions

Depending on the boundary type, Simcenter STAR-CCM+ now only holds the specific boundary conditions, as opposed to all possible boundary conditions. For example a TCM inlet boundary only allows specification of mass flux and inlet temperature. As a result, the boundary type for each boundary needs to be specified in the macro with an additional line.

Previous Release Simcenter STAR-CCM+ 7.02.011

In the example below, the left InletDashLeft boundary will have the mass flux and inlet temperature conditions set to 0.007 and 12.0 respectively. A new line specifying the boundary type should be added after defining these values:

TcmBoundary tcmBoundary_3 = simulation_0 .get(TcmBoundaryManager.class) .createTcmBoundary();

Boundary boundary_10 = region_0 .getBoundaryManager() .getBoundary("InletDashLeft");

tcmBoundary_3 .setTcmBoundaryName(boundary_10);

tcmBoundary_3 .setPresentationName("Fluid: InletDashLeft: 0");

tcmBoundary_3 .getTcmBoundaryTime() .setValue(0.0);

tcmBoundary_3 .getTcmBoundaryInletFlux() .setValue(0.007);

tcmBoundary_3 .getTcmBoundaryInletT() .setUnits(units_2);

tcmBoundary_3 .getTcmBoundaryInletT() .setValue(12.0);

TcmBoundary tcmBoundary_3 = simulation_0 .get(TcmBoundaryManager.class) .createTcmBoundary();

Boundary boundary_10 = region_0 .getBoundaryManager() .getBoundary("InletDashLeft");

tcmBoundary_3 .setTcmBoundaryName(boundary_10);

tcmBoundary_3 .setPresentationName("Fluid: InletDashLeft: 0");

tcmBoundary_3 .getTcmBoundaryTime() .setValue(0.0);

tcmBoundary_3 .getTcmBoundaryInletFlux() .setValue(0.007);

tcmBoundary_3 .getTcmBoundaryInletT() .setUnits(units_2);

tcmBoundary_3 .getTcmBoundaryInletT() .setValue(12.0);

tcmBoundary_3 .getTcmBoundaryOption() .setSelected(TcmBoundaryOption.INLET);

Other boundary conditions that are affected are:

  • Convection (CONVECTION)
  • Wall Temperature (WALL_TEMPERATURE)
  • Wall Heat Flux (WALL_HEAT_FLUX)
  • Convection with Conduction (CONVECTION_CONDUCTION)
  • Convection and Radiation (CONVECTION_RADIATION)
  • Convection and Radiation with Conduction (CONVECTION_CONDUCTION_RADIATION)