宏 API 更改 9.02

Simcenter STAR-CCM+ 9.02 中,针对 OLGA 耦合、相耦合等温模型、Haugen 侵蚀相关性、零部件表面接触、平面工具、分子扩散率模型、DFBI 和简单形状零部件创建进行了宏 API 的更改。

OLGA 5

Simcenter STAR-CCM+ v9.02 中,可与 OLGA 5 和 OLGA 7 耦合(对于 Linux 版本的 Simcenter STAR-CCM+)。 由于添加了 OLGA 7,Simcenter STAR-CCM+ 中的 OLGA 对象名称已更改。 在 OLGA 5 的宏中,将 OlgaNode 的所有实例替换为 Olga5Node。 注意,为 OLGA 5 编写的宏不能用于 OLGA 7,因为耦合过程不同。

以前发行版本 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");

相耦合等温模型更改

Simcenter STAR-CCM+ v9.02 中,旧相耦合流体等温模型已被移除并替换为更有集中性的模型。 仅当不对热传递建模时,分离流体等温选项才用于支持需要温度的状态方程模型(如理想气体密度模型)。 只有当在相级别关闭相耦合热传递的情况下为该相选择此类状态方程模型时,此选项才在每个项下变为可用。 使用此新结构,当只有一个相可能需要 SegregatedFluidIsothermalModel 时,所有相都不需要它。

以前发行版本 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);

Haugen 侵蚀相关性的名称更改

Simcenter STAR-CCM+ v9.02 中,HaugenCorrelation 类重命名为 DNVCorrelation。 包含此侵蚀模型的任何宏都需要更新。

以前发行版本 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}));

零部件表面接触更改

Simcenter STAR-CCM+ v9.02 中,未记录足够的零部件表面接触宏 API 的信息来标识正确的接触。 按以下说明更新宏:

以前发行版本 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);

平面的矢量和点输入更改

Simcenter STAR-CCM+ v9.02 中,为表面修复工具引入了新的统一平面工具面板,以合并和简化定义平面所需的选项。

以前发行版本 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();

分子扩散率模型更改

Simcenter STAR-CCM+ v9.02 中,UserMultiComponentDiffusivityMethod.class 已重命名为 ProfileMolecularDiffusivityMethod.class,MultiComponentKineticTheoryDiffusivityMethod.class 已重命名为 KineticTheoryDiffusivityMethod.class。

以前发行版本 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);

除了类名称中的更改,还必须更改以前使用 ComponentMolecularDiffusivityProperty 指定每个组分的分子扩散率的宏,因为不再显示属性。 现在在混合物级别进行指定,单个扩散率直接输入到组分表分布。

以前发行版本 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);

DFBI 更改

Simcenter STAR-CCM+ v9.02 中,体属性零部件已重命名为体表面以避免与几何零部件相混淆。 引用此属性的宏需要更新,如下所示:

以前发行版本 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);

体属性初始质心初始速度Initial Angular Velocity(初始角速度)Initial Coordinate System(初始坐标系)Moments of Inertia(惯性矩)Off Diagonal Moments of Inertia(非对角惯性矩) 已移到体的新初始值管理器节点。 现在,可以在用户自定义的坐标系中指定这些属性中的每个属性。 需要更改相应的宏,如下所示:

以前发行版本 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);

在以前版本的 Simcenter STAR-CCM+ 中,只能指定相对于初始坐标系和体质心的体惯性矩。 新的惯性矩节点可用于指定相对于任意坐标系及其原点的惯性矩。 要获得旧版本的行为,需要将以下内容添加到现有宏:


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);

零部件:简单形状零部件创建更改

Simcenter STAR-CCM+ 创建简单形状零部件的方式已更改。 对现有的宏做出相应修改。

以前发行版本 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);