In
Simcenter STAR-CCM+ 9.02, the macro API changed for OLGA coupling, the Phase Coupled Isothermal model, the Haugen Erosion Correlation, part surface contacts, the plane tool, the Molecular Diffusivity model, DFBI, and simple shape part creation.
OLGA 5
In
Simcenter STAR-CCM+ v9.02, you can couple with OLGA 5 and OLGA 7 (for Linux versions of
Simcenter STAR-CCM+ only). The name of OLGA objects in
Simcenter STAR-CCM+ have changed due to the addition of OLGA 7. In macros for OLGA 5, replace all instances of
OlgaNode with
Olga5Node. Note that macros written for OLGA 5 cannot be used with OLGA 7, as the coupling process is different.
Previous Release
|
Simcenter STAR-CCM+ v9.02
|
Simulation simulation_0 =
getActiveSimulation();
OlgaNode olgaNode_0 =
((OlgaNode) simulation_0.get(CoSimulationManager.class).getObject("OLGA-5 1"));
olgaNode_0.setOlgaPort(12340);
olgaNode_0.setOlgaHostName("olga-server");
olgaNode_0.setOlgaInputFile("");
olgaNode_0.setOlgaInputFile("C:\\EXAMPLE\\OLGA\\");
olgaNode_0.setOlgaInputFile("C:\\EXAMPLE\\OLGA\\OLGAInput");
olgaNode_0.setOlgaInputFile("C:\\Work\\OLGAInput");
olgaNode_0.setOlgaPropsFile("3phase.tab");
|
Simulation simulation_0 =
getActiveSimulation();
Olga5Node olga5Node_0 =
((Olga5Node) simulation_0.get(CoSimulationManager.class).getObject("OLGA-5 1"));
olga5Node_0.setOlgaPort(12340);
olga5Node_0.setOlgaHostName("olga-server");
olga5Node_0.setOlgaInputFile("");
olga5Node_0.setOlgaInputFile("C:\\EXAMPLE\\OLGA\\");
olga5Node_0.setOlgaInputFile("C:\\EXAMPLE\\OLGA\\OLGAInput");
olga5Node_0.setOlgaInputFile("C:\\Work\\OLGAInput");
olga5Node_0.setOlgaPropsFile("3phase.tab");
|
Change to the Phase Coupled Isothermal Model
In
Simcenter STAR-CCM+ v9.02, the old Phase Coupled Fluid Isothermal Model has been removed and is replaced by something more focussed. The Segregated Fluid Isothermal option is used only to support the equation of state models that require temperature, such as the Ideal Gas density model, when you are not modelling heat transfer. This option becomes available under each phase when such equation of state models are selected for that phase only if Phase Coupled Heat Transfer is turned off at the phase level. With this new structure, all phases do not need the
SegregatedFluidIsothermalModel when only one phase may require it.
Previous Release
|
Simcenter STAR-CCM+ v9.02
|
PhysicsContinuum physicsContinuum_0 =
((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1 2D"));
physicsContinuum_0.enable(SteadyModel.class);
physicsContinuum_0.enable(MultiPhaseMaterialModel.class);
physicsContinuum_0.enable(SegregatedMultiPhaseModel.class);
physicsContinuum_0.enable(MultiPhaseLaminarModel.class);
physicsContinuum_0.enable(GravityModel.class);
physicsContinuum_0.enable(PhaseCoupledFluidIsothermalModel.class);
|
PhysicsContinuum physicsContinuum_0 =
((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1 2D"));
physicsContinuum_0.enable(SteadyModel.class);
physicsContinuum_0.enable(MultiPhaseMaterialModel.class);
physicsContinuum_0.enable(SegregatedMultiPhaseModel.class);
physicsContinuum_0.enable(MultiPhaseLaminarModel.class);
physicsContinuum_0.enable(GravityModel.class);
|
EulerianPhase eulerianPhase_1 =
eulerianMultiPhaseModel_0.createPhase();
eulerianPhase_1.setPresentationName("gas");
eulerianPhase_1.enable(SinglePhaseGasModel.class);
eulerianPhase_1.enable(IdealGasModel.class);
SinglePhaseGasModel singlePhaseGasModel_0 =
eulerianPhase_1.getModelManager().getModel(SinglePhaseGasModel.class);
SinglePhaseGas singlePhaseGas_0 =
((SinglePhaseGas) singlePhaseGasModel_0.getMaterial());
ConstantMaterialPropertyMethod constantMaterialPropertyMethod_2 =
((ConstantMaterialPropertyMethod) singlePhaseGas_0.getMaterialProperties().getMaterialProperty(DynamicViscosityProperty.class).getMethod());
constantMaterialPropertyMethod_2.getQuantity().setValue(2.0E-5);
ConstantMaterialPropertyMethod constantMaterialPropertyMethod_3 =
((ConstantMaterialPropertyMethod) singlePhaseGas_0.getMaterialProperties().getMaterialProperty(MolecularWeightProperty.class).getMethod());
constantMaterialPropertyMethod_3.getQuantity().setValue(24.95);
|
EulerianPhase eulerianPhase_1 =
eulerianMultiPhaseModel_0.createPhase();
eulerianPhase_1.setPresentationName("gas");
eulerianPhase_1.enable(SinglePhaseGasModel.class);
eulerianPhase_1.enable(IdealGasModel.class);
eulerianPhase_1.enable(SegregatedFluidIsothermalModel.class);
SinglePhaseGasModel singlePhaseGasModel_0 =
eulerianPhase_1.getModelManager().getModel(SinglePhaseGasModel.class);
SinglePhaseGas singlePhaseGas_0 =
((SinglePhaseGas) singlePhaseGasModel_0.getMaterial());
ConstantMaterialPropertyMethod constantMaterialPropertyMethod_2 =
((ConstantMaterialPropertyMethod) singlePhaseGas_0.getMaterialProperties().getMaterialProperty(DynamicViscosityProperty.class).getMethod());
constantMaterialPropertyMethod_2.getQuantity().setValue(2.0E-5);
ConstantMaterialPropertyMethod constantMaterialPropertyMethod_3 =
((ConstantMaterialPropertyMethod) singlePhaseGas_0.getMaterialProperties().getMaterialProperty(MolecularWeightProperty.class).getMethod());
constantMaterialPropertyMethod_3.getQuantity().setValue(24.95);
|
Name Change for the Haugen Erosion Correlation
In
Simcenter STAR-CCM+ v9.02, the
HaugenCorrelation class is renamed to
DNVCorrelation. Any macros you have that contain this erosion model will require updating.
Previous Release
|
Simcenter STAR-CCM+ v9.02
|
ErosionRatio er =
defaultBoundaryConditions_0.getValues().get(ErosionRatio.class);
er.setMethod(HaugenCorrelation.class);
er.getMethod(HaugenCorrelation.class).getReferenceVelocity().setValue(1.2);
er.getMethod(HaugenCorrelation.class).setVelocityExponent(2.4);
er.getMethod(HaugenCorrelation.class).getMaterialCoefficient().setValue(2.3E-9);
er.getMethod(HaugenCorrelation.class).getAngleFunction().setCoefficients(new DoubleVector(new double[] {0.0594, -0.00105707, 5.18692E-6}));
|
ErosionRatio er =
defaultBoundaryConditions_0.getValues().get(ErosionRatio.class);
er.setMethod(DNVCorrelation.class);
er.getMethod(DNVCorrelation.class).getReferenceVelocity().setValue(1.2);
er.getMethod(DNVCorrelation.class).setVelocityExponent(2.4);
er.getMethod(DNVCorrelation.class).getMaterialCoefficient().setValue(2.3E-9);
Polynomial poly = erosionRatio_0.getMethod(DNVCorrelation.class).getAngleFunction();
poly.setCoefficients(new DoubleVector(new double[] {0.062, -0.00105707, 5.18692E-6}));
|
Change in Part Surface Contacts
In
Simcenter STAR-CCM+ v9.02, the macro API for part surface contacts were not journaled with sufficient information to identify the correct contact. Update your macros as follows:
Previous Release
|
Simcenter STAR-CCM+ v9.02
|
PartContact partContact_1 =
simulation_0.get(PartContactManager.class).getPartContact(simpleBlockPart_1,simpleBlockPart_0);
InPlacePartSurfaceContact inPlacePartSurfaceContact_0 =
((InPlacePartSurfaceContact) partContact_1.get(PartSurfaceContactManager.class).getObject("In Place Contact"));
partContact_1.get(PartSurfaceContactManager.class).remove(inPlacePartSurfaceContact_0);
|
PartContact partContact_1 =
simulation_0.get(PartContactManager.class).getPartContact(simpleBlockPart_1,simpleBlockPart_0);
PartSurface partSurface_0 =
((PartSurface) simpleBlockPart_0.getPartSurfaceManager().getPartSurface("PartSurface_Body 1_Body 2"));
PartSurface partSurface_1 =
((PartSurface) simpleBlockPart_1.getPartSurfaceManager().getPartSurface("PartSurface_Body 2_Body 1"));
InPlacePartSurfaceContact inPlacePartSurfaceContact_0 =
((InPlacePartSurfaceContact) partContact_1.get(PartSurfaceContactManager.class).getPartSurfaceContact(partSurface_0,partSurface_1));
partContact_1.get(PartSurfaceContactManager.class).remove(inPlacePartSurfaceContact_0);
|
Changes to the Vector and Point Input for Planes
In
Simcenter STAR-CCM+ v9.02, a new unified plane tool panel is introduced to the Surface Repair tool, so as to consolidate and simplify the options required to define a plane.
Previous Release
|
Simcenter STAR-CCM+ v9.02
|
surfaceMeshWidgetRepairOptions_0.setProjectVerticesType(0);
surfaceMeshWidgetRepairOptions_0.setProjectPlaneType(0);
surfaceMeshWidgetRepairOptions_0.setPlaneNormalType(0);
surfaceMeshWidgetRepairOptions_0.setProjectionPlaneOrigin(coordinate_0);
surfaceMeshWidgetRepairOptions_0.setProjectionPlaneNormal(new DoubleVector(new double[] {0.0, 0.0, 1.0}));
surfaceMeshWidgetRepairController_0.projectSelectedVertices();
|
surfaceMeshWidgetRepairOptions_0.setProjectVerticesType(0);
surfaceMeshWidgetRepairOptions_0.setPlaneNormalType(0);
surfaceMeshWidgetRepairOptions_0.setProjectionPlaneOrigin(coordinate_0);
surfaceMeshWidgetRepairOptions_0.setUseOriginForPlanePoint(false);
surfaceMeshWidgetRepairOptions_0.setProjectionPlaneNormal(new DoubleVector(new double[] {0.0, 0.0, 1.0}));
surfaceMeshWidgetRepairController_0.projectSelectedVertices();
|
surfaceMeshWidgetRepairOptions_0.setProjectVerticesType(0);
surfaceMeshWidgetRepairOptions_0.setProjectPlaneType(0);
surfaceMeshWidgetRepairOptions_0.setPlaneNormalType(1);
surfaceMeshWidgetRepairOptions_0.setProjectionPlaneOrigin(coordinate_0);
surfaceMeshWidgetRepairOptions_0.setNormalSpecificationPoint1(coordinate_1);
surfaceMeshWidgetRepairOptions_0.setNormalSpecificationPoint2(coordinate_2);
surfaceMeshWidgetRepairOptions_0.setNormalSpecificationPoint3(coordinate_3);
surfaceMeshWidgetRepairController_0.projectSelectedVertices();
|
surfaceMeshWidgetRepairOptions_0.setProjectVerticesType(0);
surfaceMeshWidgetRepairOptions_0.setPlaneNormalType(1);
surfaceMeshWidgetRepairOptions_0.setUseOriginForPlanePoint(false);
surfaceMeshWidgetRepairOptions_0.setProjectionPlaneOrigin(coordinate_0);
surfaceMeshWidgetRepairOptions_0.setProjectionPlanePoint1(coordinate_1);
surfaceMeshWidgetRepairOptions_0.setProjectionPlanePoint2(coordinate_2);
surfaceMeshWidgetRepairOptions_0.setProjectionPlanePoint3(coordinate_3);
surfaceMeshWidgetRepairController_0.projectSelectedVertices();
|
Changes to the Molecular Diffusivity Model
In
Simcenter STAR-CCM+ v9.02, the UserMultiComponentDiffusivityMethod.class has been renamed to ProfileMolecularDiffusivityMethod.class and the MultiComponentKineticTheoryDiffusivityMethod.class been renamed to KineticTheoryDiffusivityMethod.class.
Previous Release
|
Simcenter STAR-CCM+ v9.02
|
PhysicsContinuum physicsContinuum_0 =
((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1"));
MultiComponentGasModel multiComponentGasModel_0 =
physicsContinuum_0.getModelManager().getModel(MultiComponentGasModel.class);
GasMixture gasMixture_0 =
((GasMixture) multiComponentGasModel_0.getMixture());
gasMixture_0.getMaterialProperties().getMaterialProperty(MolecularDiffusivityProperty.class).setMethod(UserMultiComponentDiffusivityMethod.class);
|
PhysicsContinuum physicsContinuum_0 =
((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1"));
MultiComponentGasModel multiComponentGasModel_0 =
physicsContinuum_0.getModelManager().getModel(MultiComponentGasModel.class);
GasMixture gasMixture_0 =
((GasMixture) multiComponentGasModel_0.getMixture());
gasMixture_0.getMaterialProperties().getMaterialProperty(MolecularDiffusivityProperty.class).setMethod(ProfileMolecularDiffusivityMethod.class);
|
PhysicsContinuum physicsContinuum_0 =
((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1"));
MultiComponentGasModel multiComponentGasModel_0 =
physicsContinuum_0.getModelManager().getModel(MultiComponentGasModel.class);
GasMixture gasMixture_0 =
((GasMixture) multiComponentGasModel_0.getMixture());
gasMixture_0.getMaterialProperties().getMaterialProperty(MolecularDiffusivityProperty.class).setMethod(MultiComponentKineticTheoryDiffusivityMethod.class);
|
PhysicsContinuum physicsContinuum_0 =
((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1"));
MultiComponentGasModel multiComponentGasModel_0 =
physicsContinuum_0.getModelManager().getModel(MultiComponentGasModel.class);
GasMixture gasMixture_0 =
((GasMixture) multiComponentGasModel_0.getMixture());
gasMixture_0.getMaterialProperties().getMaterialProperty(MolecularDiffusivityProperty.class).setMethod(KineticTheoryDiffusivityMethod.class);
|
In addition to the changes in class names, macros that previously used
ComponentMolecularDiffusivityProperty to specify the molecular diffusivity of each component must be changed because that property is no longer exposed. The specification is now done at the mixture level and the individual diffusivities are input directly into an array profile.
Previous Release
|
Simcenter STAR-CCM+ v9.02
|
gasMixture_0.getMaterialProperties().getMaterialProperty(MolecularDiffusivityProperty.class).
setMethod(MixtureUserDiffusivityMethod.class);
UserDiffusivityMethod userDiffusivityMethod_0 =
((UserDiffusivityMethod) gasComponent_0.getMaterialProperties().
getMaterialProperty(ComponentMolecularDiffusivityProperty.class).getMethod());
UserDiffusivity userDiffusivity_0 =
userDiffusivityMethod_0.getUserDiffusivity();
userDiffusivity_0.setMethod(UserScalarProfileMethod.class);
|
gasMixture_0.getMaterialProperties().getMaterialProperty(MolecularDiffusivityProperty.class).
setMethod(ProfileMolecularDiffusivityMethod.class);
ProfileMolecularDiffusivityMethod profileMolecularDiffusivityMethod_0 =
((ProfileMolecularDiffusivityMethod) gasMixture_0.getMaterialProperties().
getMaterialProperty(MolecularDiffusivityProperty.class).getMethod());
ComponentDiffusivityArray componentDiffusivityArray_0 =
profileMolecularDiffusivityMethod_0.getComponentDiffusivityArray();
componentDiffusivityArray_0.setMethod(CompositeArrayProfileMethod.class);
ScalarProfile componentDiffusivity_0 =
componentDiffusivityArray_0.getMethod(CompositeArrayProfileMethod.class).
getProfile(gasComponent_0.getArrayIndex());
componentDiffusivity_0.setMethod(UserScalarProfileMethod.class);
|
Changes to DFBI
In
Simcenter STAR-CCM+ v9.02, the body property,
Parts, has been renamed to
Body Surface so as to avoid confusion with geometry parts. Macros that refer to this property require updating as follows:
Previous Release
|
Simcenter STAR-CCM+ v9.02
|
Body body_0 =
((Body) simulation_0.get(BodyManager.class).getObject("Boat"));
Region region_0 =
simulation_0.getRegionManager().getRegion("Region_1");
Boundary boundary_0 =
region_0.getBoundaryManager().getBoundary("hull");
body_0.getParts().setObjects(boundary_0);
|
Body body_0 =
((Body) simulation_0.get(BodyManager.class).getObject("Boat"));
Region region_0 =
simulation_0.getRegionManager().getRegion("Region_1");
Boundary boundary_0 =
region_0.getBoundaryManager().getBoundary("hull");
body_0.getBodySurface().setObjects(boundary_0);
|
The body properties
Initial Center of Mass,
Initial Velocity,
Initial Angular Velocity,
Initial Coordinate System,
Moments of Inertia and
Off Diagonal Moments of Inertia have been moved to a new
node of the body. Each of these properties can now be specified in a user-defined coordinate system. Corresponding macros need to be changed as follows:
Previous Release
|
Simcenter STAR-CCM+ v9.02
|
Body body_0 =
((Body) simulation_0.get(BodyManager.class).getObject("Boat"));
body_0.getInitialPosition().setComponents(1.0, 0.0, 0.0);
|
Body body_0 =
((Body) simulation_0.get(BodyManager.class).getObject("Boat"));
CenterOfMass centerOfMass_0 =
((CenterOfMass) body_0.getInitialValueManager().getObject("Center of Mass"));
Coordinate coordinate_0 =
centerOfMass_0.getPosition();
Units units_0 =
((Units) simulation_0.getUnitsManager().getObject("m"));
coordinate_0.setCoordinate(units_0, units_0, units_0, new DoubleVector(new double[] {1.0, 0.0, 0.0}));
|
Body body_0 =
((Body) simulation_0.get(BodyManager.class).getObject("Boat"));
body_0.getInitialVelocity().setComponents(0.0, 0.0, 1.0);
|
Body body_0 =
((Body) simulation_0.get(BodyManager.class).getObject("Boat"));
Velocity velocity_0 =
((Velocity) body_0.getInitialValueManager().getObject("Velocity"));
velocity_0.getValue().setComponents(0.0, 0.0, 1.0);
|
Body body_0 =
((Body) simulation_0.get(BodyManager.class).getObject("Boat"));
body_0.getInitialAngularVelocity().setComponents(1.0, 0.0, 0.0);
|
Body body_0 =
((Body) simulation_0.get(BodyManager.class).getObject("Boat"));
AngularVelocity angularVelocity_0 =
((AngularVelocity) body_0.getInitialValueManager().getObject("Angular Velocity"));
angularVelocity_0.getValue().setComponents(1.0, 0.0, 0.0);
|
Body body_0 =
((Body) simulation_0.get(BodyManager.class).getObject("Boat"));
LabCoordinateSystem labCoordinateSystem_0 =
simulation_0.getCoordinateSystemManager().getLabCoordinateSystem();
body_0.setInitialCoordinateSystem(labCoordinateSystem_0);
|
Body body_0 =
((Body) simulation_0.get(BodyManager.class).getObject("Boat"));
Orientation orientation_0 =
((Orientation) body_0.getInitialValueManager().getObject("Orientation"));
LabCoordinateSystem labCoordinateSystem_0 =
simulation_0.getCoordinateSystemManager().getLabCoordinateSystem();
orientation_0.setCoordinateSystem(labCoordinateSystem_0);
|
Body body_0 =
((Body) simulation_0.get(BodyManager.class).getObject("Boat"));
body_0.getMomentsOfInertia().setComponents(100.0, 100.0, 100.0);
body_0.getOffDiagonalMomentsOfInertia().setComponents(50.0, 20.0, 20.0);
|
Body body_0 =
((Body) simulation_0.get(BodyManager.class).getObject("Boat"));
MomentOfInertia momentOfInertia_0 =
((MomentOfInertia) body_0.getInitialValueManager().getObject("Moment of Inertia"));
momentOfInertia_0.getDiagonalComponents().setComponents(100.0, 100.0, 100.0);
momentOfInertia_0.getOffDiagonalComponents().setComponents(50.0, 20.0, 20.0);
|
In previous versions of
Simcenter STAR-CCM+, it was only possible to specify the body's moment of inertia with respect to the initial coordinate system and the body's center of mass. The new
node lets you specify the moment of inertia with respect to an arbitrary coordinate system and its origin. To get the old behavior, you may need to add the following to existing macros:
Body body_0 =
((Body) simulation_0.get(BodyManager.class).getObject("Boat"));
Orientation orientation_0 =
((Orientation) body_0.getInitialValueManager().getObject("Orientation"));
CoordinateSystem orientationCoordinateSystem_0 =
orientation_0.getCoordinateSystem();
MomentOfInertia momentOfInertia_0 =
((MomentOfInertia) body_0.getInitialValueManager().getObject("Moment of Inertia"));
momentOfInertia_0.setCoordinateSystem(orientationCoordinateSystem_0);
momentOfInertia_0.setUseCenterOfMass(true);
Parts: Changes to Simple Shape Part Creation
The way in which
Simcenter STAR-CCM+ creates simple shape parts has changed. Modify your existing macros accordingly.
Previous Release
|
Simcenter STAR-CCM+ v9.02
|
MeshPartFactory meshPartFactory_0 =
simulation_0.get(MeshPartFactory.class);
SimpleBlockPart simpleBlockPart_0 =
meshPartFactory_0.createNewBlockPart(simulation_0.get(SimulationPartManager.class));
LabCoordinateSystem labCoordinateSystem_0 =
simulation_0.getCoordinateSystemManager().getLabCoordinateSystem();
simpleBlockPart_0.setCoordinateSystem(labCoordinateSystem_0);
Coordinate coordinate_0 =
simpleBlockPart_0.getCorner1();
coordinate_0.setCoordinate(units_0, units_0, units_0, new DoubleVector(new double[] {-1.0, -1.0, -1.0}));
Coordinate coordinate_1 =
simpleBlockPart_0.getCorner2();
coordinate_1.setCoordinate(units_0, units_0, units_0, new DoubleVector(new double[] {1.0, 1.0, 1.0}));
coordinate_0.setValue(new DoubleVector(new double[] {1.0, 1.0, 1.0}));
coordinate_1.setValue(new DoubleVector(new double[] {2.0, 2.0, 2.0}));
|
MeshPartFactory meshPartFactory_0 =
simulation_0.get(MeshPartFactory.class);
SimpleBlockPart simpleBlockPart_0 =
meshPartFactory_0.createNewBlockPart(simulation_0.get(SimulationPartManager.class));
simpleBlockPart_0.setDoNotRetessellate(true);
LabCoordinateSystem labCoordinateSystem_0 =
simulation_0.getCoordinateSystemManager().getLabCoordinateSystem();
simpleBlockPart_0.setCoordinateSystem(labCoordinateSystem_0);
Coordinate coordinate_0 =
simpleBlockPart_0.getCorner1();
coordinate_0.setCoordinateSystem(labCoordinateSystem_0);
coordinate_0.setCoordinate(units_0, units_0, units_0, new DoubleVector(new double[] {-1.0, -1.0, -1.0}));
coordinate_0.setValue(new DoubleVector(new double[] {1.0, 1.0, 1.0}));
Coordinate coordinate_1 =
simpleBlockPart_0.getCorner2();
coordinate_1.setCoordinateSystem(labCoordinateSystem_0);
coordinate_1.setCoordinate(units_0, units_0, units_0, new DoubleVector(new double[] {1.0, 1.0, 1.0}));
coordinate_1.setValue(new DoubleVector(new double[] {2.0, 2.0, 2.0}));
simpleBlockPart_0.rebuildSimpleShapePart();
simpleBlockPart_0.setDoNotRetessellate(false);
|