在 Simcenter STAR-CCM+ 11.02 中,针对电化学、燃烧、侵蚀、GT-SUITE 协同仿真、数据映射和虚拟盘体建模进行了宏 API 的更改。
电化学:固体电势分布重命名
电势分布 SolidElectricPotentialProfile 已重命名为 ElectrodeElectricPotentialProfile,结果导致了宏代码的更改。
在宏代码的导入部分以及程序指令部分,出现的所有 SolidElectricPotentialProfile 必须相应地重命名。 例如:
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
smo.setActiveMechanism("SurfaceMechanism");
SolidElectricPotentialProfile spp = _metalBoundary.getValues()
.get(SolidElectricPotentialProfile.class);
|
smo.setActiveMechanism("SurfaceMechanism");
ElectrodeElectricPotentialProfile spp = _metalBoundary.getValues()
.get(ElectrodeElectricPotentialProfile.class);
|
电化学:导数分布重命名
导数分布 MolarConcentrationFluxDerivativeProfile 已重命名为 ConcentrationFluxDerivativeProfile,结果导致了宏代码的更改。
在宏代码的导入部分以及程序指令部分,出现的所有 MolarConcentrationFluxDerivativeProfile 必须相应地重命名。 例如:
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
chlorideAnionFluxProfile.getMethod(FunctionScalarProfileMethod.class
).setFieldFunction(BoundarySpecifiedFluxClMinusFF);
MolarConcentrationFluxDerivativeProfile mcfdP = fluxBoundary
.getValues()
.get(MolarConcentrationFluxDerivativeProfile.class);
|
chlorideAnionFluxProfile.getMethod(FunctionScalarProfileMethod.class)
.setFieldFunction(BoundarySpecifiedFluxClMinusFF);
ConcentrationFluxDerivativeProfile mcfdP = fluxBoundary
.getValues()
.get(ConcentrationFluxDerivativeProfile.class);
|
燃烧:转换为复杂化学
对涉及 DARS-CFD 和复杂化学的燃烧进行了大量更改。 因此,建议重新录制宏,或至少录制对模型和属性定义有影响的一部分宏。
以下是宏代码更改的通用示例:
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
physicsContinuum_0.enable(HomogeneousCombustionModel.class);
physicsContinuum_0.enable(OperatorSplittingGasModel.class);
OperatorSplittingGasModel operatorSplittingGasModel_0 =
physicsContinuum_0.getModelManager().getModel(OperatorSplittingGasModel.class);
operatorSplittingGasModel_0.setThreshold(50);
physicsContinuum_0.enable(DarsCfdGasReactionModel.class);
physicsContinuum_0.enable(DarsCfdIdealGasModel.class);
DarsCfdIdealGasModel darsCfdIdealGasModel_0 =
physicsContinuum_0.getModelManager().getModel(DarsCfdIdealGasModel.class);
darsCfdIdealGasModel_0.getIdealGasEquationOption().setSelected(IdealGasEquationOption.BUILTIN);
|
physicsContinuum_0.enable(ComplexChemistryCombustionModel.class);
physicsContinuum_0.enable(IdealGasModel.class);
ComplexChemistryCombustionModel complexChemistryCombustionModel_0 =
physicsContinuum_0.getModelManager().getModel(ComplexChemistryCombustionModel.class);
complexChemistryCombustionModel_0.setThreshold(50);
|
以下是针对燃烧建模特定实例的宏步骤示例:
激活化学 ADI 气相模型
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
physicsContinuum_0.enable(ReactingModel.class);
physicsContinuum_0.enable(NonPremixedCombustionFlameTypeModel.class);
physicsContinuum_0.enable(HomogeneousCombustionModel.class);
physicsContinuum_0.enable(ChemistryADIGasModel.class);
physicsContinuum_0.enable(DarsCfdGasReactionModel.class);
|
physicsContinuum_0.enable(ReactingModel.class);
physicsContinuum_0.enable(NonPremixedCombustionFlameTypeModel.class);
physicsContinuum_0.enable(ComplexChemistryCombustionModel.class);
ComplexChemistryCombustionModel complexChemistryCombustionModel_0 =
physicsContinuum_0.getModelManager().getModel(ComplexChemistryCombustionModel.class);
complexChemistryCombustionModel_0.getChemistrySolverOption().setSelected(ComplexChemistrySolverOption.Type.CADI);
|
激活算子分裂气相模型
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
physicsContinuum_0.enable(ReactingModel.class);
physicsContinuum_0.enable(NonPremixedCombustionFlameTypeModel.class);
physicsContinuum_0.enable(HomogeneousCombustionModel.class);
physicsContinuum_0.enable(OperatorSplittingGasModel.class);
physicsContinuum_0.enable(DarsCfdGasReactionModel.class);
|
physicsContinuum_0.enable(ReactingModel.class);
physicsContinuum_0.enable(NonPremixedCombustionFlameTypeModel.class);
physicsContinuum_0.enable(ComplexChemistryCombustionModel.class);
ComplexChemistryCombustionModel complexChemistryCombustionModel_0 =
physicsContinuum_0.getModelManager().getModel(ComplexChemistryCombustionModel.class);
complexChemistryCombustionModel_0.getComplexChemistryOdeSolverOption().setSelected(OdeSolverOption.Type.DARSCFD);
|
激活复杂化学的理想气体模型
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
physicsContinuum_0.enable(SegregatedSpeciesModel.class);
physicsContinuum_0.enable(DarsCfdIdealGasModel.class);
physicsContinuum_0.enable(SegregatedFluidEnthalpyModel.class);
physicsContinuum_0.enable(LaminarModel.class);
|
physicsContinuum_0.enable(SegregatedSpeciesModel.class);
physicsContinuum_0.enable(SegregatedFluidEnthalpyModel.class);
physicsContinuum_0.enable(IdealGasModel.class);
physicsContinuum_0.enable(LaminarModel.class);
|
激活化学 ADI 表面/气相模型
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
physicsContinuum_0.enable(NonPremixedCombustionFlameTypeModel.class);
physicsContinuum_0.enable(HomogeneousCombustionSurfaceChemistryModel.class);
physicsContinuum_0.enable(SurfaceChemistryModel.class);
physicsContinuum_0.enable(ChemistryADISurfaceGasModel.class);
physicsContinuum_0.enable(DarsCfdSurfaceGasReactionModel.class);
physicsContinuum_0.enable(SegregatedFlowModel.class);
|
physicsContinuum_0.enable(NonPremixedCombustionFlameTypeModel.class);
physicsContinuum_0.enable(ComplexChemistryCombustionModel.class);
physicsContinuum_0.enable(SegregatedFlowModel.class);
physicsContinuum_0.enable(SurfaceChemistryModel.class);
ComplexChemistryCombustionModel complexChemistryCombustionModel_0 =physicsContinuum_0.getModelManager().getModel(ComplexChemistryCombustionModel.class);
complexChemistryCombustionModel_0.getChemistrySolverOption().setSelected(ComplexChemistrySolverOption.Type.CADI);
|
激活算子分裂表面/气相模型
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
physicsContinuum_0.enable(NonPremixedCombustionFlameTypeModel.class);
physicsContinuum_0.enable(HomogeneousCombustionSurfaceChemistryModel.class);
physicsContinuum_0.enable(SurfaceChemistryModel.class);
physicsContinuum_0.enable(OperatorSplittingSurfaceGasModel.class);
physicsContinuum_0.enable(DarsCfdSurfaceGasReactionModel.class);
physicsContinuum_0.enable(SegregatedFlowModel.class);
|
physicsContinuum_0.enable(NonPremixedCombustionFlameTypeModel.class);
physicsContinuum_0.enable(ComplexChemistryCombustionModel.class);
physicsContinuum_0.enable(SegregatedFlowModel.class);
physicsContinuum_0.enable(SurfaceChemistryModel.class);
ComplexChemistryCombustionModel complexChemistryCombustionModel_0 =physicsContinuum_0.getModelManager().getModel(ComplexChemistryCombustionModel.class);
complexChemistryCombustionModel_0.getComplexChemistryOdeSolverOption().setSelected(OdeSolverOption.Type.DARSCFD);
|
设置复杂化学模型的运行触发
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
OperatorSplittingGasModel operatorSplittingGasModel_0 = physicsContinuum_0.getModelManager().getModel(OperatorSplittingGasModel.class);
operatorSplittingGasModel_0.getCombustionObjectEnabledOption().setSelected(CombustionObjectEnabledOption.Type.AFTER_ITERATION);
operatorSplittingGasModel_0.setThreshold(20);
|
ComplexChemistryCombustionModel complexChemistryCombustionModel_0 =physicsContinuum_0.getModelManager().getModel(ComplexChemistryCombustionModel.class);
complexChemistryCombustionModel_0.getCombustionObjectEnabledOption().setSelected(CombustionObjectEnabledOption.Type.AFTER_ITERATION);
complexChemistryCombustionModel_0.setThreshold(20);
|
OperatorSplittingSurfaceGasModel operatorSplittingSurfaceGasModel_0 = physicsContinuum_0.getModelManager().getModel(OperatorSplittingSurfaceGasModel.class);
operatorSplittingSurfaceGasModel_0.getCombustionObjectEnabledOption().setSelected(CombustionObjectEnabledOption.Type.AFTER_ITERATION);
operatorSplittingSurfaceGasModel_0.setThreshold(20);
|
ChemistryADIGasModel chemistryADIGasModel_0 = physicsContinuum_0.getModelManager().getModel(ChemistryADIGasModel.class);
chemistryADIGasModel_0.getCombustionObjectEnabledOption().setSelected(CombustionObjectEnabledOption.Type.AFTER_ITERATION);
chemistryADIGasModel_0.setThreshold(20);
|
ChemistryADISurfaceGasModel chemistryADISurfaceGasModel_0 = physicsContinuum_0.getModelManager().getModel(ChemistryADISurfaceGasModel.class);
chemistryADISurfaceGasModel_0.getCombustionObjectEnabledOption().setSelected(CombustionObjectEnabledOption.Type.AFTER_ITERATION);
chemistryADISurfaceGasModel_0.setThreshold(20);
|
Dars-CFD 属性
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
DarsCfdGasReactionModel darsCfdGasReactionModel_0 =physicsContinuum_0.getModelManager().getModel(DarsCfdGasReactionModel.class);
darsCfdGasReactionModel_0.setRunTimeCompile(false);
darsCfdGasReactionModel_0.setModuloProblemDescription(false);
DarsCfdProperties darsCfdProperties_0 =darsCfdGasReactionModel_0.getDarsCfdProperties();
darsCfdProperties_0.setUseReferenceValsTMinMax(false);
|
ComplexChemistryCombustionModel complexChemistryCombustionModel_0 =physicsContinuum_0.getModelManager().getModel(ComplexChemistryCombustionModel.class);
DarsCfdLibrary darsCfdLibrary_0 = complexChemistryCombustionModel_0.getDarsCfdLibrary();
DarsCfdBinaryRunOptions darsCfdBinaryRunOptions_0 =darsCfdLibrary_0.getDarsCfdBinaryRunOptions();
darsCfdBinaryRunOptions_0.setRunTimeCompile(false);
darsCfdLibrary_0.setModuloProblemDescription(false);
darsCfdLibrary_0.setUseReferenceValsTMinMax(false);
|
Dars-CFD 模型属性
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
DarsCfdGasReactionModel darsCfdGasReactionModel_0 =physicsContinuum_0.getModelManager().getModel(DarsCfdGasReactionModel.class);
darsCfdGasReactionModel_0.getColdFlowTempLimitScalar().setValue(400.0);
|
ComplexChemistryCombustionModel complexChemistryCombustionModel_0 =physicsContinuum_0.getModelManager().getModel(ComplexChemistryCombustionModel.class);
complexChemistryCombustionModel_0.getColdFlowTempLimitScalar().setValue(400.0);
|
DarsCfdSurfaceGasReactionModel darsCfdSurfaceGasReactionModel_0 =physicsContinuum_0.getModelManager().getModel(DarsCfdSurfaceGasReactionModel.class);
darsCfdSurfaceGasReactionModel_0.getColdFlowTempLimitScalar().setValue(400.0);
|
复杂化学的动态负载平衡
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
DarsCfdIsatApproximationMethod darsCfdIsatApproximationMethod_0 =((DarsCfdIsatApproximationMethod) darsCfdProperties_0.getDarsCfdApproximation().getMethod());
darsCfdIsatApproximationMethod_0.setParallelRandomization(false);
|
ComplexChemistryCombustionModel complexChemistryCombustionModel_0 =physicsContinuum_0.getModelManager().getModel(ComplexChemistryCombustionModel.class);
complexChemistryCombustionModel_0.setParallelRandomization(false);
|
DarsCfdEqTsmApproximationMethod darsCfdEqTsmApproximationMethod_0 =((DarsCfdEqTsmApproximationMethod) darsCfdProperties_0.getDarsCfdApproximation().getMethod());
darsCfdEqTsmApproximationMethod_0.setParallelRandomization(false);
|
DarsCfdNoneApproximationMethod darsCfdNoneApproximationMethod_0 =((DarsCfdNoneApproximationMethod) darsCfdProperties_0.getDarsCfdApproximation().getMethod());
darsCfdINoneApproximationMethod_0.setParallelRandomization(false);
|
删除复杂化学案例
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
DarsCfdGasReactionModel darsCfdGasReactionModel_0 = physicsContinuum_0.getModelManager().getModel(DarsCfdGasReactionModel.class);
darsCfdGasReactionModel_0.deleteCase(true);
|
ComplexChemistryCombustionModel complexChemistryCombustionModel_0 =physicsContinuum_0.getModelManager().getModel(ComplexChemistryCombustionModel.class);
complexChemistryCombustionModel_0.deleteCase(true);
|
DarsCfdSurfaceGasReactionModel darsCfdSurfaceGasReactionModel_0 = physicsContinuum_0.getModelManager().getModel(DarsCfdSurfaceGasReactionModel.class);
darsCfdSurfaceGasReactionModel_0.deleteCase(true);
|
导入复杂化学定义(Dars-CFD 格式)
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
DarsCfdGasReactionModel darsCfdGasReactionModel_0 =physicsContinuum_0.getModelManager().getModel(DarsCfdGasReactionModel.class);
darsCfdGasReactionModel_0.importCase("darscfdstarccm+", resolvePath("macroChanges/DarsAsciiInput"));
|
ComplexChemistryCombustionModel complexChemistryCombustionModel_0 =physicsContinuum_0.getModelManager().getModel(ComplexChemistryCombustionModel.class);
DarsCfdLibrary darsCfdLibrary_0 = complexChemistryCombustionModel_0.getDarsCfdLibrary();
darsCfdLibrary_0.importCase("darscfdstarccm+", resolvePath("macroChanges/DarsAsciiInput"));
|
导入复杂化学定义(Chemkin 格式),气相
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
DarsCfdGasReactionModel darsCfdGasReactionModel_0 =physicsContinuum_0.getModelManager().getModel(DarsCfdGasReactionModel.class);
darsCfdGasReactionModel_0.importCaseFromChemkin("chem.inp", "therm.dat", "tran.dat", "StarccmProject", true, "darscfdstarccm+");
|
ComplexChemistryCombustionModel complexChemistryCombustionModel_0 =physicsContinuum_0.getModelManager().getModel(ComplexChemistryCombustionModel.class);
complexChemistryCombustionModel_0.importCaseFromChemkin("chem.inp", "therm.dat", "tran.dat", "", "");
|
导入复杂化学定义(Chemkin 格式),表面/气相
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
DarsCfdSurfaceGasReactionModel darsCfdSurfaceGasReactionModel_0 =physicsContinuum_0.getModelManager().getModel(DarsCfdSurfaceGasReactionModel.class);
darsCfdSurfaceGasReactionModel_0.importCaseFromChemkin("chem.inp,surfChem.inp", "surfTherm.dat,therm.dat", "tran.dat", "StarccmProject", true, "darscfdstarccm+");
|
ComplexChemistryCombustionModel complexChemistryCombustionModel_0 =physicsContinuum_0.getModelManager().getModel(ComplexChemistryCombustionModel.class);
complexChemistryCombustionModel_0.importCaseFromChemkin("chem.inp", "therm.dat", "tran.dat", "surfChem.inp", "surfTherm.dat");
|
激活 ISAT 和 ISAT 参数
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
darsCfdProperties_0.getDarsCfdApproximation().setMethod(DarsCfdIsatApproximationMethod.class);
DarsCfdIsatApproximationMethod darsCfdIsatApproximationMethod_0 =((DarsCfdIsatApproximationMethod) darsCfdProperties_0.getDarsCfdApproximation().getMethod());
darsCfdIsatApproximationMethod_0.getDarsCfdPressureSpecificationOption().setSelected(DarsCfdPressureSpecificationOption.Type.CONST);
DarsCfdIsatTable darsCfdIsatTable_0 =((DarsCfdIsatTable) darsCfdIsatApproximationMethod_0.getDarsCfdIsatTableManager().getDarsCfdIsatTable("1"));
darsCfdIsatTable_0.getUpperTimeStep().setValue(1.0E-4);
|
complexChemistryCombustionModel_0.getIsatOption().setSelected(IsatOrEqTsmOption.Type.ISAT);
DarsCfdIsatCalculationMethod darsCfdIsatCalculationMethod_0 = complexChemistryCombustionModel_0.getDarsCfdIsatCalculationMethod();
darsCfdIsatCalculationMethod_0.getIsatPressureSpecificationOption().setSelected(IsatPressureSpecificationOption.Type.CONST);
DarsCfdIsatTable darsCfdIsatTable_0 =((DarsCfdIsatTable) darsCfdIsatCalculationMethod_0.getDarsCfdIsatTableManager().getDarsCfdIsatTable("1"));
darsCfdIsatTable_0.getUpperTimeStep().setValue(1.0E-4);
|
激活松弛至平衡法并设置属性
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
darsCfdProperties_0.getDarsCfdApproximation().setMethod(DarsCfdEqTsmApproximationMethod.class);
DarsCfdEqTsmApproximationMethod darsCfdEqTsmApproximationMethod_0 =((DarsCfdEqTsmApproximationMethod) darsCfdProperties_0.getDarsCfdApproximation().getMethod());
darsCfdEqTsmApproximationMethod_0.setIncludeChemTime(true);
|
complexChemistryCombustionModel_0.getIsatOption().setSelected(IsatOrEqTsmOption.Type.EQTSM);
DarsCfdEqTsmCalculationMethod darsCfdEqTsmCalculationMethod_0 =complexChemistryCombustionModel_0.getDarsCfdEqTsmCalculationMethod();
darsCfdEqTsmCalculationMethod_0.setIncludeChemTime(true);
|
燃烧:后处理名称更改
复杂化学的更改包括将各种项目从 DarsCfd 重命名为 ComplexChemistry。
以下示例显示了创建报告的宏代码更改:
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
DarsCfdSumQuantityReport darsCfdSumQuantityReport_0 =
simulation_0.getReportManager().createReport(DarsCfdSumQuantityReport.class);
darsCfdSumQuantityReport_0.getDarsCfdQuantityOption().setSelected(DarsCfdQuantityOption.Type.CPUTIME);
darsCfdSumQuantityReport_0.getDarsCfdQuantityAccumulationOption().setSelected(DarsCfdQuantityAccumulationOption.Type.PERITER);
|
ComplexChemistryMaxQuantityReport complexChemistryMaxQuantityReport_1 =
simulation_0.getReportManager().createReport(ComplexChemistryMaxQuantityReport.class);
complexChemistryMaxQuantityReport_1.getComplexChemistryReportQuantityOption().setSelected(ComplexChemistryReportQuantityOption.Type.CPUTIME);
complexChemistryMaxQuantityReport_1.getComplexChemistryReportQuantityAccumulationOption().setSelected(ComplexChemistryReportQuantityAccumulationOption.Type.PERITER);
|
燃烧:理想气体更改
燃烧时的理想气体选择范围已经简化。 因此,Java 宏类 IdealGasWithCombustionModel.class 和 DarsCfdIdealGasModel.class 已不存在。 根据使用的燃烧模型,按以下方式更新宏:
- 按下列方式替换 IdealGasWithCombustionModel.class:
- 对于涡破碎模型、增厚火焰模型、拟序火焰模型和湍流火焰速度封闭模型,可使用 IdealGasModel.class。
- 对于非预混 PPDF 平衡模型,可使用 PpdfIdealGasModel.class。
- 对于部分预混 CFM,可使用 PcfmIdealGasModel.class。
- 对于非绝热 PPDF 小火焰模型,可使用 IdealGasWithNonAdiabaticFlameletModel.class。
- 对于复杂化学模型,可使用 IdealGasModel.class 替换 DarsCfdIdealGasModel.class。
以下是涡破碎模型的宏示例:
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
(NonPremixedCombustionFlameTypeModel.class);
physicsContinuum_0.enable(EbuGasCombustionModel.class);
physicsContinuum_0.enable(SegregatedFlowModel.class);
physicsContinuum_0.enable(SegregatedSpeciesModel.class);
physicsContinuum_0.enable(IdealGasWithCombustionModel.class);
physicsContinuum_0.enable(SegregatedFluidEnthalpyModel.class);
|
(NonPremixedCombustionFlameTypeModel.class);
physicsContinuum_0.enable(EbuGasCombustionModel.class);
physicsContinuum_0.enable(SegregatedFlowModel.class);
physicsContinuum_0.enable(SegregatedSpeciesModel.class);
physicsContinuum_0.enable(SegregatedFluidEnthalpyModel.class);
physicsContinuum_0.enable(IdealGasModel.class);
|
燃烧:PPDF 表更改
Simcenter STAR-CCM+ 处理 PPDF 表的方式已经更改。 对现有的宏做出相应修改。
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
PpdfFlameletTable ppdfFlameletTable_0 =
((PpdfFlameletTable) ppdfNonAdiabaticFlameletModel_0.getPpdfFlameletTable());
NonPpdfVar nonPpdfVar_0 =
((NonPpdfVar) ((NonPpdfVarManager) ppdfFlameletTable_0.getNonPpdfVarManager()).getComponent("Scalar Dissipation Rate"));
nonPpdfVar_0.setDimensionSize(21);
PpdfTableAxis ppdfTableAxis_0 =
((PpdfTableAxis) ((PpdfTableAxisManager) ppdfFlameletTable_0.getPpdfTableAxisManager()).getComponent("Mixture Fraction"));
|
PpdfFlameletTable ppdfFlameletTable_0 =
((PpdfFlameletTable) ppdfNonAdiabaticFlameletModel_0.getPpdfFlameletTable());
PpdfTableAxis ppdfTableAxis_0 =
((PpdfTableAxis) ((PpdfTableAxisManager)ppdfFlameletTable_0.getPpdfTableAxisManager()).getComponent("Scalar Dissipation Rate"));
ppdfTableAxis_0.setDimensionSize(21);
PpdfTableAxis ppdfTableAxis_0 =
((PpdfTableAxis) ((PpdfTableAxisManager) ppdfFlameletTable_0.getPpdfTableAxisManager()).getComponent("Mixture Fraction"));
|
侵蚀模型更改
欧拉颗粒建模现在可使用侵蚀模型。 因此,侵蚀率标量分布已从 star.lagrangian.erosion.ErosionRatio 更改为 star.multiphase.erosion.ErosionRatio。 对现有的宏做出相应修改。
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
import star.common.*;
import star.lagrangian.*;
import star.lagrangian.erosion.ErosionRatio;
DefaultBoundaryConditions defaultBoundaryConditions =
(DefaultBoundaryConditions) getPhase().getDefaultBoundaryConditionsManager().getBoundaryConditions(WallBoundary.class);
ErosionRatio erosionRatio =
defaultBoundaryConditions.getValues().get(ErosionRatio.class);
erosionRatio.setMethod(AhlertCorrelation.class);
|
import star.common.*;
import star.lagrangian.*;
import star.multiphase.erosion.ErosionRatio;
DefaultBoundaryConditions defaultBoundaryConditions =
(DefaultBoundaryConditions) getPhase().getDefaultBoundaryConditionsManager().getBoundaryConditions(WallBoundary.class);
ErosionRatio erosionRatio =
defaultBoundaryConditions.getValues().get(ErosionRatio.class);
erosionRatio.setMethod(AhlertCorrelation.class);
|
GT-SUITE 协同仿真:重构导致更改
为提高操作简便性和可维护性,GT-SUITE 1D 协同仿真已重构。 对此协同仿真的宏进行了大量更改,因此建议重新录制这些宏。
数据映射:现在将 2D 区域作为表面处理
数据映射器现在将 2D 区域作为表面而非体积处理,因此更改了宏代码。
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
VolumeDataMapper vdm =
sim.get(DataMapperManager.class)
.createMapper(
VolumeDataMapper.class, "Volume Data Mapper"
);
vdm.setSourceStencil(2);
vdm.getSourceParts().setObjects(source2Dregion_0, source2Dregion_1);
vdm.setUpdateAvailableFields(true);
vdm.setScalarFieldFunctions(
new NeoObjectVector(new Object[] { getScFieldFunction(sim,"SCLR0001")})
);
VolumeTargetSpecification vts =
((VolumeTargetSpecification) vdm.getTargetSpecificationManager().getObject("Volume 1"));
vts.setInterpolationMethod(1);
vts.setTargetStencil(2);
vts.getTargetParts().setObjects(target2Dregion_0, target2Dregion_1);
vdm.mapData();
|
SurfaceDataMapper sdm = sim.get(DataMapperManager.class)
.createMapper(
SurfaceDataMapper.class, "Surface Data Mapper"
);
sdm.setSourceStencil(1);
sdm.getSourceParts().setObjects(
source2Dregion_0, source2Dregion_1);
sdm.setUpdateAvailableFields(true);
sdm.setScalarFieldFunctions(
new NeoObjectVector(new Object[] { getScFieldFunction(sim,"SCLR0001")})
);
SurfaceTargetSpecification sts = (
(SurfaceTargetSpecification) sdm.getTargetSpecificationManager().getObject("Surface 1")
);
sts.setInterpolationMethod(1);
sts.setTargetStencil(1);
sts.getTargetParts().setObjects(target2Dregion_0, target2Dregion_1);
sdm.mapData();
|
虚拟盘体:体积力螺旋桨法和 1D 动量法更改
已为“体积力螺旋桨”和“1D 动量”法增加选项,因此更改了宏代码。
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
PropellerInflowVelocityPlane inflowPlane = disk.getComponentsManager().get(PropellerInflowVelocityPlane.class);
inflowPlane.getRadius().setValue(0.6);
inflowPlane.getOffset().setValue(0.22);
|
VdmInflowSpecification inflowSpec = disk.getComponentsManager().get(VdmInflowSpecification.class);
inflowSpec.setActiveInflowMethod(VdmAverageInflowPlaneMethod.class);
VdmAverageInflowPlaneMethod velPlane = (VdmAverageInflowPlaneMethod) inflowSpec.getActiveInflowMethod();
velPlane.getRadius().setValue(0.6);
velPlane.getOffset().setValue(0.22);
|
与创建模拟过程对象相关的方法更改
与创建服务器、打开模拟和连接到正在运行的服务器相关的 API 已更改。 SimulationProcessObject 不再使用其构造函数直接创建,而是通过 ApplicationManager 和 SimulationApplicaton 管理对象来创建。 如果直接创建 SimulationProcessObject,将无法正确使用 ApplicationManager 进行注册,行为未定义。
以下是针对创建模拟过程对象的特定实例的建议宏更改:
要使用默认服务器连接创建模拟过程对象和模拟:
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
SimulationProcessObject spo = new SimulationProcessObject()
|
SimulationProcessObject spo = (SimulationProcessObject)ApplicationManager.getSingleton().getApplication(SimulationApplication.APPLICATION_TYPE).createRoot()
|
要创建给定文件的模拟过程对象和模拟:
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
SimulationProcessObject spo = new SimulationProcessObject(filename)
|
SimulationProcessObject spo = (SimulationProcessObject)ApplicationManager.getSingleton().getApplication(SimulationApplication.APPLICATION_TYPE).createRoot(filename)
|
要通过在指定的主机和端口处连接到服务器进程来创建模拟过程对象:
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
SimulationProcessObject spo = new SimulationProcessObject(host, port)
|
SimulationProcessObject spo = (SimulationProcessObject)ApplicationManager.getSingleton().getApplication(SimulationApplication.APPLICATION_TYPE).connect(host, port)
|
要在指定的主机和端口处通过 SSH 隧道连接到服务器进程来创建模拟过程对象:
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
SimulationProcessObject spo = new SimulationProcessObject(host, port, sshHost, sshUserName)
|
SimulationProcessObject spo = (SimulationProcessObject)ApplicationManager.getSingleton().getApplication(SimulationApplication.APPLICATION_TYPE).connect(host, port, sshHost, sshUserName)
|
已打开模拟的管理更改
已弃用通过 SimulationManager 类来管理打开的模拟。 类仍然存在,其所有方法都有效,但管理打开的模拟的首选方法是通过新的 ApplicationManager 和 SimulationApplication 类。
以下是针对管理已打开模拟的特定实例的建议宏更改:
要获取客户端中所有打开的模拟:
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
Collection<Simulation> sl = SimulationManager.getSingleton().simulations();
|
Set<Simulation> sl = ApplicationManager.getSingleton().getApplicationAs(SimulationApplication.class, SimulationApplication.APPLICATION_TYPE).getRootObjects()
|
要获取现有客户端服务器对象的模拟:
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
Simulation s = SimulationManager.getSingleton().getSimulation(cso)
|
Simulation s = Simulation.getInstance(cso)
|
要检查应用程序是否正在退出:
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
SimulationManager.getSingleton().isExiting()
|
ApplicationManager.getSingleton().isExiting()
|
要添加新模拟出现时收到通知的观察者:
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
SimulationManager.getSingleton().addSimulationObserver(observer)
|
ApplicationManager.getSingleton().addRootObjectsChangedObserver(observer)
注 | 要确保仅对模拟的添加项或移除项做出响应,需要检查处理程序中对象的类型。 例如: |
// Watch for new root objects
private static class RootObjectObserver extends RootObjectsChangedNotifier.NotifierReceiver {
@Override
protected void rootObjectAdded(RootObject root) {
if (root instanceof Simulation) {
// handle the new simulation added
}
}
}
|
模拟过程列表访问更改
与活动模拟过程对象和修改的注册表列表相关的功能已移到新的 ApplicationManager 类。
为确保兼容,以前发行版本的方法仍然可用,但标记为失效。 建议利用最新版本的方法升级宏,以确保长期可靠性。
以下是针对访问模拟过程的特定实例的建议宏更改:
要获取活动模拟过程对象的列表:
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
SimulationProcessObject[] list = SimulationProcessObject.activeSimulationProcessObjects()
|
Set<RootProcessObject> set = ApplicationManager.getSingleton().getApplication(SimulationApplication.APPLICATION_TYPE).getActiveRootProcessObjects();
注 | 目前,集合包含所有活动的 SimulationProcessObjects(指定为 RootProcessObject 基类)。 |
|
要获取已修改模拟过程对象的列表:
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
Set<SimulationProcessObject> set = SimulationProcessObject.getModifiedRegistry().getModifiedSet()
|
Set<RootProcessObject> set = ApplicationManager.getSingleton().getApplication(SimulationApplication.APPLICATION_TYPE).getModifiedRootProcessObjects()
|
要添加已修改模拟过程对象列表中的更改的观察者:
以前发行版本 |
Simcenter STAR-CCM+ v11.02 |
SimulationProcessObject.getModifiedRegistry().addChangeListener(changeListener)
|
ApplicationManager.getSingleton().addModifiedRootProcessObjectsChangedListener(observer)
注 | 要确保仅响应这些更改,选中传递给观察者的 RootProcessObject 的类型。 |
|