In
Simcenter STAR-CCM+ 12.06, the macro API changed for stopping criteria, surface preparation, mesh operations, species and material models, porous media, wall porosity, Eulerian multiphase, dispersed multiphase, reacting flows, DFBI, and monitors.
Stopping Criteria: Changes to Asymptotic Limit Default
In the current version of
Simcenter STAR-CCM+, you can choose between an absolute or normalized asymptotic limit for a stopping criterion that is created from a monitor.
The asymptotic limit is set to normalized by default (in the
Simcenter STAR-CCM+ UI, the
Normalized property of the
node is activated). To deactivate this setting in your macros, use the new macro code that is shown in the following example.
Previous Release
|
Simcenter STAR-CCM+ v12.06
|
MonitorIterationStoppingCriterion stopCrit = monitor.createIterationStoppingCriterion();
((MonitorIterationStoppingCriterionOption) stopCrit.getCriterionOption()).setSelected(MonitorIterationStoppingCriterionOption.ASYMPTOTIC);
|
MonitorIterationStoppingCriterion stopCrit = monitor.createIterationStoppingCriterion();
((MonitorIterationStoppingCriterionOption) stopCrit.getCriterionOption()).setSelected(MonitorIterationStoppingCriterionOption.ASYMPTOTIC);
MonitorIterationStoppingCriterionAsymptoticType stopCritAsymptoticLimit = ((MonitorIterationStoppingCriterionAsymptoticType) stopCrit.getCriterionType());
stopCritAsymptoticLimit.setNormalized(false);
|
Surface Preparation
Changes to Imprinter
The
Face Orientation parameter of the imprinter is now set by default to
Opposing Outward. Macros that create imprint operations or perform surface repair imprinting also default to this setting. If you wish to set the
Face Orientation back to
Opposing and Aligned, do so explicitly in the macro. Examples follow.
To create an imprint operation:
Previous Release
|
Simcenter STAR-CCM+ v12.06
|
ImprintPartsOperation imprintPartsOperation_0 =
(ImprintPartsOperation) simulation_0.get(MeshOperationManager.class).createImprintPartsOperation(new NeoObjectVector(new Object[] {part1, part_2}));
|
ImprintPartsOperation imprintPartsOperation_0 =
(ImprintPartsOperation) simulation_0.get(MeshOperationManager.class).createImprintPartsOperation(new NeoObjectVector(new Object[] {part1, part_2}));
ImprintFaceOrientation imprintFaceOrientation_0 =
imprintPartsOperation_0.getImprintValuesManager().get(ImprintFaceOrientation.class);
imprintFaceOrientation_0.getFaceOrientationOption().setSelected(ImprintFaceOrientationOption.Type.OPPOSING_AND_ALIGNED);
|
To perform a surface repair imprint:
Previous Release
|
Simcenter STAR-CCM+ v12.06
|
SurfaceMeshWidgetMergeImprintPartsController surfaceMeshWidgetMergeImprintPartsController_0 =
partSurfaceMeshWidget_0.getControllers().getController(SurfaceMeshWidgetMergeImprintPartsController.class);
|
SurfaceMeshWidgetMergeImprintPartsController surfaceMeshWidgetMergeImprintPartsController_0 =
partSurfaceMeshWidget_0.getControllers().getController(SurfaceMeshWidgetMergeImprintPartsController.class);
SurfaceMeshWidgetRepairController surfaceMeshWidgetRepairController_0 =
partSurfaceMeshWidget_0.getControllers().getController(SurfaceMeshWidgetRepairController.class);
SurfaceMeshWidgetMergeImprintOptions surfaceMeshWidgetMergeImprintOptions_0 =
surfaceMeshWidgetRepairController_0.getOptions().getMergeImprintOptions();
surfaceMeshWidgetMergeImprintOptions_0.getFaceOrientation().setSelected(ImprintFaceOrientationOption.Type.OPPOSING_AND_ALIGNED);
|
Changes to Tessellation of Multiple Parts
The
Re-tessellate command in parts has been updated to tessellate all selected parts together, resulting in changes to the macro code.
Previous Release
|
Simcenter STAR-CCM+ v12.06
|
simpleBlockPart_0.getTessellationDensityOption().setSelected(TessellationDensityOption.Type.FINE);
simpleBlockPart_0.getCadPartEdgeOption().setSelected(CadPartEdgeOption.Type.SHARP_EDGES);
simpleBlockPart_0.setSharpEdgeAngle(30.0);
simpleBlockPart_0.tessellate();
... // set tessellation parameters
simpleBlockPart_1.tessellate();
... // set tessellation parameters
simpleConePart_0.tessellate();
... // set tessellation parameters
cadPart_0.tessellate();
... // set tessellation parameters
simpleBlockPart_2.tessellate();
|
simpleBlockPart_0.getTessellationDensityOption().setSelected(TessellationDensityOption.Type.FINE);
simpleBlockPart_0.getCadPartEdgeOption().setSelected(CadPartEdgeOption.Type.SHARP_EDGES);
simpleBlockPart_0.setSharpEdgeAngle(30.0);
... // set tessellation parameters for each part
simpleBlockPart_0.tessellateParts(Arrays.asList(simpleBlockPart_0, simpleBlockPart_1, simpleConePart_0, cadPart_0, simpleBlockPart_2));
|
Changes to Handling of Mesh Contacts
Due to refactoring, the way in which
Simcenter STAR-CCM+ works with mesh contacts has changed, resulting in changes to the macro code. The following classes have been deleted from the client:
MeshContact
PatchMeshContact
EdgeMeshContact
VertexMeshContact
MeshContactManager
As a consequence the method
getMeshContact()
has also been deleted from the class
PartPeriodicTransform
.
For example, in previous versions, the
MeshContactManager
was obtained from the
PartContact
and the
MeshContact
classes were obtained from the
MeshContactManager
. In the current release, the contacting Part Surfaces and Patches are obtained directly from the
PartContact
.
Previous Release
|
Simcenter STAR-CCM+ v12.06
|
MeshContactManager mcm = pc.has(MeshContactManager.class);
if (mcm != null)
{ //if it exists
//iterate over all PatchMeshContacts
for (PatchMeshContact pmc : mcm.getObjectsOf(PatchMeshContact.class))
{
PartSurface ps0 = pmc.getPartSurface0();
int patch0 = pmc.getPatch0();
PartSurface ps1 = pmc.getPartSurface1();
int patch1 = pmc.getPatch1();
|
for (SimpleImmutableEntry<PartContact.PartSurfaceAndPatch, PartContact.PartSurfaceAndPatch> patchPair : pc.getPatchMeshContacts()) {
PartSurface ps0 = patchPair.getKey().getPartSurface();
int patch0 = patchPair.getKey().getPatch();
PartSurface ps1 = patchPair.getValue().getPartSurface();
int patch1 = patchPair.getValue().getPatch();
|
Mesh Operations: Changes to Selection Inherited Parts in Custom Controls
To accommodate inherited parts that were nested in multiple mesh operation parts, the techniques for handling proxies has changed, resulting in changes to the macro code.
Note | The old macros can still execute without any errors, but the selection of the inherited parts in custom controls may not work correctly.
|
Previous Release
|
Simcenter STAR-CCM+ v12.06
|
MeshOperationPart meshOperationPart_1 =
((MeshOperationPart) simulation_0.get(SimulationPartManager.class).getPart("Extract Volume 2"));
SimpleBlockPart simpleBlockPart_0 =
((SimpleBlockPart) simulation_0.get(SimulationPartManager.class).getPart("Block"));
GeometryObjectProxy geometryObjectProxy_0 =
meshOperationPart_1.getOrCreateProxyForObject(simpleBlockPart_0);
|
MeshOperationPart meshOperationPart_0 =
((MeshOperationPart) simulation_0.get(SimulationPartManager.class).getPart("Subtract 2"));
SimpleBlockPart simpleBlockPart_0 =
((SimpleBlockPart) simulation_0.get(SimulationPartManager.class).getPart("Block"));
GeometryObjectProxy geometryObjectProxy_0 =
meshOperationPart_0.getOrCreateProxyForObject(simpleBlockPart_0);
MeshOperationPart meshOperationPart_1 =
((MeshOperationPart) simulation_0.get(SimulationPartManager.class).getPart("Surface Wrapper"));
GeometryObjectProxy geometryObjectProxy_1 =
meshOperationPart_1.getOrCreateProxyForObject(geometryObjectProxy_0);
MeshOperationPart meshOperationPart_2 =
((MeshOperationPart) simulation_0.get(SimulationPartManager.class).getPart("Extract Volume 2"));
GeometryObjectProxy geometryObjectProxy_2 =
meshOperationPart_2.getOrCreateProxyForObject(geometryObjectProxy_1);
|
GeometryObjectProxy geometryObjectProxy_2 =
meshOperationPart_2.getPartProxies().getGeometryObjectProxy("Block");
|
MeshOperationPart meshOperationPart_0 =
((MeshOperationPart) simulation_0.get(SimulationPartManager.class).getPart("Subtract 2"));
SimpleBlockPart simpleBlockPart_0 =
((SimpleBlockPart) simulation_0.get(SimulationPartManager.class).getPart("Block"));
GeometryObjectProxy geometryObjectProxy_0 =
meshOperationPart_0.getPartProxies().getGeometryObjectProxy(simpleBlockPart_0);
MeshOperationPart meshOperationPart_1 =
((MeshOperationPart) simulation_0.get(SimulationPartManager.class).getPart("Surface Wrapper"));
GeometryObjectProxy geometryObjectProxy_1 =
meshOperationPart_1.getPartProxies().getGeometryObjectProxy(geometryObjectProxy_0);
MeshOperationPart meshOperationPart_2 =
((MeshOperationPart) simulation_0.get(SimulationPartManager.class).getPart("Extract Volume 2"));
GeometryObjectProxy geometryObjectProxy_2 =
meshOperationPart_2.getPartProxies().getGeometryObjectProxy(geometryObjectProxy_1);
|
Species and Material Models: Changes Due to Restructuring
Due to restructuring of code related to species and material components,
CoupledSpeciesManager
has been renamed to
CoupledMaterialComponentManager
, and
CoupledSpeciesComponentMap
has been renamed to
CoupledMaterialComponentMap
. Examples of changes to the macro code are as follows:
Previous Release
|
Simcenter STAR-CCM+ v12.06
|
// Importing the CoupledSpeciesManager and CoupledSpeciesComponentMap
import star.cosimulation.common.CoupledSpeciesManager;
import star.cosimulation.common.CoupledComponentMap;
// Getting the CoupledSpeciesManager and creating a new CoupedSpeciesComponent
CoupledSpeciesComponentMap coupledSpeciesComponentMap_0 =
coSimulation_0.getCoSimulationValues().get(CoupledSpeciesManager.class).createSpeciesComponent();
// Getting the CoupledSpeciesManager and setting a CoupledSpeciesComponent
CoupledSpeciesComponentMap coupledSpeciesComponentMap_0 =
coSimulation_0.getCoSimulationValues().get(CoupledSpeciesManager.class).getCoupledSpeciesComponentMap("indolene-combust");
coupledSpeciesComponentMap_0.setCoupledComponent(passiveScalarMaterial_0);
|
// Importing the CoupledMaterialComponentManager and CoupledMaterialComponentMap
import star.cosimulation.common.CoupledMaterialComponentManager;
import star.cosimulation.common.CoupledMaterialComponentMap;
// Getting the CoupledComponentMaterialManager and creating a new CoupedMaterialComponent
CoupledMaterialComponentMap coupledMaterialComponentMap_0 =
coSimulation_0.getCoSimulationValues().get(CoupledMaterialComponentManager.class).createMaterialComponent();
// Getting the CoupledComponentMaterialManager and setting a CoupledMaterialComponent
CoupledMaterialComponentMap coupledMaterialComponentMap_1 =
coSimulation_0.getCoSimulationValues().get(CoupledMaterialComponentManager.class).getCoupledMaterialComponentMap("indolene-combust");
coupledMaterialComponentMap_1.setCoupledComponent(passiveScalarMaterial_0);
|
Porous Media: Changes Due to Implementation of Tortuosity
As part of restructuring to implement tortuosity in porous media,
star.electromagnetism.common.BruggemanApproximationExponentProfile
has been renamed to
star.flow.BruggemanApproximationExponentProfile
. Replace all instances of
star.electromagnetism.common.BruggemanApproximationExponentProfile
in your macros accordingly.
Wall Porosity: Changes to Specification of Ambient Pressure
For the Wall Porosity model, ambient pressure is now to be specified for every boundary for which the
Method property of the
Wall Porosity Specification node is set to
Specified.
Previous Release
|
Simcenter STAR-CCM+ v12.06
|
Simulation simulation_0 =
getActiveSimulation();
Region region_0 =
simulation_0.getRegionManager().getRegion("Block_1");
PhaseConditions phaseConditions_0 =
((PhaseConditions) region_0.get(PhaseConditionsManager.class).getPhaseConditions("Gas1"));
VofWallPorosityAmbientPressureProfile vofWallPorosityAmbientPressureProfile_0 =
phaseConditions_0.getPhaseValueManager().get(VofWallPorosityAmbientPressureProfile.class);
vofWallPorosityAmbientPressureProfile_0.getMethod(ConstantScalarProfileMethod.class).getQuantity().setValue(1000.0);
|
Simulation simulation_0 =
getActiveSimulation();
Region region_0 =
simulation_0.getRegionManager().getRegion("Block_1");
InterfaceBoundary interfaceBoundary_0 =
((InterfaceBoundary) region_0.getBoundaryManager().getBoundary("x-max [Interface 1]"));
PhaseConditions phaseConditions_0 =
((PhaseConditions) interfaceBoundary_0.get(PhaseConditionsManager.class).getPhaseConditions("Gas1"));
VofWallPorosityAmbientPressureProfile vofWallPorosityAmbientPressureProfile_0 =
phaseConditions_0.getPhaseValueManager().get(VofWallPorosityAmbientPressureProfile.class);
vofWallPorosityAmbientPressureProfile_0.getMethod(ConstantScalarProfileMethod.class).getQuantity().setValue(1000.0);
|
Eulerian Multiphase: Changes to Suspension Rheology
The Suspension Rheology model has been removed from phase interaction and is now at the physics continuum level. This change allows multiple particle phases with different maximum packing and particle diameters, similar to the Granular Pressure Model. Changes to the macro code are as follows:
Dispersed Multiphase: Changes to Temperature Specification
On free-stream boundaries, the static temperature profile is no longer available for a dispersed phase, resulting in changes to the macro code.
Previous Release
|
Simcenter STAR-CCM+ v12.06
|
Simulation simulation_0 = getActiveSimulation();
Region region_0 = simulation_0.getRegionManager().getRegion("Region_1");
Boundary boundary_1 = region_0.getBoundaryManager().getBoundary("Inlet");
PhaseConditions phaseConditions_0 = ((PhaseConditions) boundary_1.get(PhaseConditionsManager.class).getPhaseConditions("DMP Phase"));
StaticTemperatureProfile staticTemperatureProfile_4 = phaseConditions_0.getPhaseValueManager().get(StaticTemperatureProfile.class);
staticTemperatureProfile_4.getMethod(ConstantScalarProfileMethod.class).getQuantity().setValue(258.4);
ScalarVolumeFractionProfile scalarVolumeFractionProfile_0 = phaseConditions_0.getPhaseValueManager().get(ScalarVolumeFractionProfile.class);
scalarVolumeFractionProfile_0.getMethod(ConstantScalarProfileMethod.class).getQuantity().setValue(3.42E-7);
|
Simulation simulation_0 = getActiveSimulation();
Region region_0 = simulation_0.getRegionManager().getRegion("Region_1");
Boundary boundary_1 = region_0.getBoundaryManager().getBoundary("Inlet");
PhaseConditions phaseConditions_0 = ((PhaseConditions) boundary_1.get(PhaseConditionsManager.class).getPhaseConditions("DMP Phase"));
ScalarVolumeFractionProfile scalarVolumeFractionProfile_0 = phaseConditions_0.getPhaseValueManager().get(ScalarVolumeFractionProfile.class);
scalarVolumeFractionProfile_0.getMethod(ConstantScalarProfileMethod.class).getQuantity().setValue(3.42E-7);
|
Reacting Flows
Discontinuation of Selection of CFM Partially-Premixed Reaction Model and TFC Partially-Premixed Reaction Model
Due to restructuring, two Partially-Premixed Reaction models in the UI became redundant. They have been removed for the following models: Coherent Flame Model (CFM) and Turbulent Flame Speed Closure (TFC).
This change is only a simplification of the UI—it does not change any results. You can continue using Partially-Premixed CFM and TFC combustion models as before.
To update your macros, remove any lines that have
CfmReactionPartiallyPremixedModel
or
TfcReactionPartiallyPremixedModel
. An example follows:
Previous Release
|
Simcenter STAR-CCM+ v12.06
|
public void enableSpecificModels(PhysicsContinuum physicsContinuum_0) {
super.enableSpecificModels(physicsContinuum_0);
physicsContinuum_0.enable(TfcCombustionPartiallyPremixedModel.class);
physicsContinuum_0.enable(TfcReactionPartiallyPremixedModel.class); }
|
public void enableSpecificModels(PhysicsContinuum physicsContinuum_0) {
super.enableSpecificModels(physicsContinuum_0);
physicsContinuum_0.enable(TfcCombustionPartiallyPremixedModel.class);
|
Changes to Ignitor Names
In the course of improving the user interface, all ignitors have been renamed. For example,
TemperatureIgnitor 1
which appears in the following line of macro code from v12.04,
((IgnitorManager) physicsContinuum_0.get(IgnitorManager.class)).getIgnitor("TemperatureIgnitor 1")
has been renamed to
Temperature Ignitor 1
.
The other ignitor objects have been renamed as follows:
EbuIgnitor 1
to
Ebu Ignitor 1
ProgressVariableIgnitor 1
to
Progress Variable Ignitor 1
FlameAreaDensityIgnitor 1
to
Flame Area Density Ignitor 1
Changes to Complex Chemistry
Due to restructuring, macro codes for Complex Chemistry have changed.
Previous Release
|
Simcenter STAR-CCM+ v12.06
|
ComplexChemistryCombustionModel complexChemistryModel_0 =
((ComplexChemistryCombustionModel)physicsContinuum_0.getModelManager().
getModel(ComplexChemistryCombustionModel.class));
DarsCfdLibrary darsCfdLibrary = complexChemistryModel_0.getDarsCfdLibrary();
darsCfdLibrary.getDarsCfdBinaryRunOptions().setRunTimeCompile(false);
darsCfdLibrary.getDarsCfdBinaryRunOptions().getDarsCfdUserCodingOption().
setSelected(DarsCfdUserCodingOption.CALCSRCTRM);
|
ReactingModel reactingModel_0 =
physicsContinuum_0.getModelManager().getModel(ReactingModel.class);
ReactingSystem reactingSystem_0 =
((ReactingSystem) reactingModel_0.getReactingSystem());
reactingSystem_0.getReactionProperties().get(ReactionsSourceProperty.class).
setReactionPropertyMethod(DarsCfdUserDefinedReactionsSource.class);
reactingSystem_0.getReactionProperties().get(ReactionsUserCodingTypeProperty.class).
setReactionPropertyMethod(UserCodingSourceTermCalculate.class);
|
ComplexChemistryCombustionModel complexChemistryModel_0 =
((ComplexChemistryCombustionModel)physicsContinuum_0.getModelManager().
getModel(ComplexChemistryCombustionModel.class));
DarsCfdLibrary darsCfdLibrary = complexChemistryModel_0.getDarsCfdLibrary();
darsCfdLibrary.getDarsCfdBinaryRunOptions().setRunTimeCompile(false);
darsCfdLibrary.getDarsCfdBinaryRunOptions().getDarsCfdUserCodingOption().
setSelected(DarsCfdUserCodingOption.MODSRCTRM);
|
ReactingModel reactingModel_0 =
physicsContinuum_0.getModelManager().getModel(ReactingModel.class);
ReactingSystem reactingSystem_0 =
((ReactingSystem) reactingModel_0.getReactingSystem());
reactingSystem_0.getReactionProperties().get(ReactionsSourceProperty.class).
setReactionPropertyMethod(DarsCfdUserDefinedReactionsSource.class);
reactingSystem_0.getReactionProperties().get(ReactionsUserCodingTypeProperty.class).
setReactionPropertyMethod(UserCodingSourceTermModify.class);
|
DFBI: Changes to Creation of Forces and Moments
To allow other physics models, such as electromagnetism and DEM, to add their own specific forces and moments to DFBI in future versions of
Simcenter STAR-CCM+, the methods for creating the related DFBI objects have changed, resulting in changes to the macro code.
Creation of a new force and moment within the force and moment manager
Previous Release
|
Simcenter STAR-CCM+ v12.06
|
body_1.getExternalForceAndMomentManager().createExternalForceAndMoment(PropulsionForce.class);
|
body_1.getExternalForceAndMomentManager().createForceAndMoment(PropulsionForce.class);
|
Replacement of ExternalFluidForceAndMoment with FluidForceAndMoment
Previous Release
|
Simcenter STAR-CCM+ v12.06
|
import star.sixdof.ExternalFluidForceAndMoment;
ExternalFluidForceAndMoment externalFluidForceAndMoment_1 =
body_1.getExternalForceAndMomentManager().createExternalForceAndMoment(ExternalFluidForceAndMoment.class);
ExternalFluidForceAndMoment externalFluidForceAndMoment_2 =
((ExternalFluidForceAndMoment) body_2.getExternalForceAndMomentManager().getObject("Fluid Force and Moment"));
|
import star.sixdof.FluidForceAndMoment;
FluidForceAndMoment fluidForceAndMoment_1 =
body_1.getExternalForceAndMomentManager().createForceAndMoment(FluidForceAndMoment.class);
FluidForceAndMoment fluidForceAndMoment_2 =
((FluidForceAndMoment) body_2.getExternalForceAndMomentManager().getObject("Fluid Force and Moment"));
|
Replacement of ExternalGravityForce with GravityForce
Previous Release
|
Simcenter STAR-CCM+ v12.06
|
import star.sixdof.ExternalGravityForce;
ExternalGravityForce externalGravityForce_1 =
body_1.getExternalForceAndMomentManager().createExternalForceAndMoment(ExternalGravityForce.class);
ExternalGravityForce externalGravityForce_2 =
((ExternalGravityForce) body_2.getExternalForceAndMomentManager().getObject("Gravity Force"));
|
import star.sixdof.GravityForce;
GravityForce gravityForce_1 =
body_1.getExternalForceAndMomentManager().createForceAndMoment(GravityForce.class);
GravityForce gravityForce_2 =
((GravityForce) body_2.getExternalForceAndMomentManager().getObject("Gravity Force"));
|
Replacement of ExternalVirtualDiskForce with VirtualDiskForce
Previous Release
|
Simcenter STAR-CCM+ v12.06
|
import star.sixdof.ExternalVirtualDiskForce;
ExternalVirtualDiskForce externalVirtualDiskForce_1 =
body_1.getExternalForceAndMomentManager().createExternalForceAndMoment(ExternalVirtualDiskForce.class);
ExternalVirtualDiskForce externalVirtualDiskForce_2 =
((ExternalVirtualDiskForce) body_2.getExternalForceAndMomentManager().getObject("VirtualDiskForce 1"));
|
import star.sixdof.VirtualDiskForce;
VirtualDiskForce virtualDiskForce_1 =
body_1.getExternalForceAndMomentManager().createForceAndMoment(VirtualDiskForce.class);
VirtualDiskForce virtualDiskForce_2 =
((VirtualDiskForce) body_2.getExternalForceAndMomentManager().getObject("VirtualDiskForce 1"));
|
Transfer of DofMorpherSolver to a new package
Previous Release
|
Simcenter STAR-CCM+ v12.06
|
import star.sixdof.DofMorpherSolver;
|
import star.sixdofmotion.DofMorpherSolver;
|
Note | Most of these deprecated methods and classes are still available for backward compatibility, so many existing macros can run without changes. However, any macro using
DofMorpherSolver needs to import
star.sixdofmotion.DofMorpherSolver .
|
Monitors: Discontinuation of Method
The method
PlotableMonitor.getMonitoredValueUnits()
has been discontinued from the macro API.
For report monitors, you can replace this method with
reportMonitor.getReport().getUnits()
. For other monitors, the units should be clear from the monitor type.