在 Simcenter STAR-CCM+ 2019.1 中,对网格化、衍生单位、有限元模型、气动声学、反应流体、拉格朗日多相、欧拉多相、电磁学、统计报告、协同仿真和 STAR-ICE 进行了宏观 API 更改。
网格化:插值选项属性转换
插值选项属性(选择用于将求解从现有体网格映射到新生成的体网格的方法)已从网格连续体移动到接近插值模型(Simcenter STAR-CCM+ 2019.1 中的一个新特性)的物理连续体。
此项传输导致宏代码更改。预计现有的宏将继续正常工作,但为获得最大可靠性,建议更新宏代码,如以下示例所示:
以前发行版本 |
Simcenter STAR-CCM+ 2019.1 |
Simulation simulation_0 = getActiveSimulation();
PartsMeshContinuum partsMeshContinuum_0 =
((PartsMeshContinuum) simulation_0.getContinuumManager().getContinuum("Parts Meshes"));
partsMeshContinuum_0.getSolutionInterpolationOption().setSelected(SolutionInterpolationOption.Type.MAPPER);
|
Simulation simulation_0 = getActiveSimulation();
PhysicsContinuum physicsContinuum_0 =
((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Fluid"));
physicsContinuum_0.enable(ProximityInterpolationModel.class);
ProximityInterpolationModel proximityInterpolationModel_1 =
physicsContinuum_0.getModelManager().getModel(ProximityInterpolationModel.class);
proximityInterpolationModel_1.getSolutionInterpolationMethod().setSelected(SolutionInterpolationMethod.Type.MAPPER);
|
标量和矢量:简化衍生单位方法
简化了在宏中设置衍生单位的方法(对应于 UI 中标量或矢量的尺寸属性)。在以前发行版本中,类 IntVector
需要在一系列数值输入项内指定指数。在 Simcenter STAR-CCM+ 2019.1 中,替换生成器
类可用于指定已命名的每个维度的指数。
例如,当为宏中的加速度设置衍生单位时:
- 在以前发行版本中,您会编写:
(new IntVector(new int[] {0, 1, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}));
- 在 Simcenter STAR-CCM+ 2019.1 中,您将写入:
(Dimensions.Builder().length(1).time(-2).build());
预计现有的宏将继续正常工作,但为获得最大可靠性,建议更新宏代码,如以下示例所示:
以前发行版本 |
Simcenter STAR-CCM+ 2019.1 |
public void execute() {
execute0();
}
private void execute0() {
Simulation simulation_0 =
getActiveSimulation();
UserUnits userUnits_0 =
simulation_0.getUnitsManager().createUnits("Units");
userUnits_0.setDimensionsVector(new IntVector(new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0}));
}
|
public void execute() {
execute0();
}
private void execute0() {
Simulation simulation_0 =
getActiveSimulation();
UserUnits userUnits_0 =
simulation_0.getUnitsManager().createUnits("Units");
userUnits_0.setDimensions(Dimensions.Builder().volume(1).build());
}
|
有限元模型:设置直接求解器属性
在提供用于某些有限元方法的迭代求解器的情况下,访问和设置直接求解器属性的方式已更改,导致宏代码发生更改。
受影响的求解器如下:
ExcitationCoilLumpedParameterSolver
FeSolidEnergySolver
FiniteElementStressSolver
ViscousSolver
FiniteElementMagneticVectorPotentialSolver
以下示例显示了 ViscousSolver
的宏更改:
以前发行版本 |
Simcenter STAR-CCM+ 2019.1 |
Simulation simulation_0 = getActiveSimulation();
ViscousSolver viscousSolver = ((ViscousSolver) simulation_0.getSolverManager().getSolver(ViscousSolver.class));
SparseSolverProperties sparseSolverProperties_0 = viscousSolver.getSparseSolverProperties();
sparseSolverProperties_0.setVerbosity(Verbosity.HIGH);
|
Simulation simulation_0 = getActiveSimulation();
ViscousSolver viscousSolver_0 = ((ViscousSolver) simulation_0.getSolverManager().getSolver(ViscousSolver.class));
ViscousSolverMethods viscousSolverMethods = viscousSolver_0.getSolverMethods();
MumpsPardisoDirectSolver mumpsPardisoDirectSolver_0 =
viscousSolverMethods.getMethod(MumpsPardisoDirectSolver.class);
SparseSolverProperties sparseSolverProperties_0 = mumpsPardisoDirectSolver_0.getSparseSolverProperties();
sparseSolverProperties_0.setVerbosity(Verbosity.HIGH);
|
对于 FiniteElementStressSolver
和 ViscousSolver
,当前 API 方法 getSparseSolverProperties()
仍然可用。
气动声学:飞行中的 FW-H 模型和后 FW-H 模型的更改
由于除了声学数据源属性的新声扰动方程 (APE) 选项,预先存在的 APE 选项已重命名为 Flow + APE。
对于宏代码,AcousticDataSourceOption.Type.APE
现在为 AcousticDataSourceOption.Type.FLOW_APE
。对现有的宏做出相应修改。
以前发行版本 |
Simcenter STAR-CCM+ 2019.1 |
simulation_0.get(ReceiverManager.class).getAcousticDataSourceOption().setSelected(AcousticDataSourceOption.Type.APE);
|
simulation_0.get(ReceiverManager.class).getAcousticDataSourceOption().setSelected(AcousticDataSourceOption.Type.FLOW_APE);
|
pointFwhPostProcessingReceiver_0.getAcousticDataSourceOption().setSelected(AcousticDataSourceOption.Type.APE);
|
pointFwhPostProcessingReceiver_0.getAcousticDataSourceOption().setSelected(AcousticDataSourceOption.Type.FLOW_APE);
|
反应流体
各相热和交界面分布的变化
相
除液相之外,来自表面化学的热现在分布到固相,导致宏代码更改。要更新宏,使用 physicsContinuum_0.enable(SurfaceChemistryFluidModel.class);
替换所有 physicsContinuum_0.enable(SurfaceChemistryModel.class);
实例。
交界面
在以前的版本中,需要选择要应用表面化学的区域的交界面边界。在当前版本中,将其应用于交界面本身。因此,宏代码已更改。
以前发行版本 |
Simcenter STAR-CCM+ 2019.1 |
Simulation simulation_0 =
getActiveSimulation();
Region region_0 =
simulation_0.getRegionManager().getRegion("Fluid");
InterfaceBoundary interfaceBoundary_0 =
((InterfaceBoundary) region_0.getBoundaryManager().getBoundary("fluidSphere [Interface]"));
SurfaceMechanismOption surfaceMechanismOption_0 =
interfaceBoundary_0.getConditions().get(SurfaceMechanismOption.class);
surfaceMechanismOption_0.setActiveMechanism("CATALYST");
BulkSurfaceFractionProfile bulkSurfaceFractionProfile_0 =
((BulkSurfaceFractionProfile) interfaceBoundary_0.getValues().get(BulkSurfaceFractionProfileManager.class).getProfile(0));
bulkSurfaceFractionProfile_0.getMethod(ConstantArrayProfileMethod.class).getQuantity().setArray(new DoubleVector(new double[] {1.0}));
SiteSurfaceFractionProfile siteSurfaceFractionProfile_0 =
((SiteSurfaceFractionProfile) interfaceBoundary_0.getValues().get(SiteSurfaceFractionProfileManager.class).getProfile(0));
siteSurfaceFractionProfile_0.getMethod(ConstantArrayProfileMethod.class).getQuantity().setArray(new DoubleVector(new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0}));
|
Simulation simulation_0 =
getActiveSimulation();
BoundaryInterface boundaryInterface_0 =
((BoundaryInterface) simulation_0.getInterfaceManager().getInterface("Interface"));
SurfaceMechanismOption surfaceMechanismOption_0 =
boundaryInterface_0.getConditions().get(SurfaceMechanismOption.class);
surfaceMechanismOption_0.setActiveMechanism("CATALYST");
BulkSurfaceFractionProfile bulkSurfaceFractionProfile_0 =
((BulkSurfaceFractionProfile) boundaryInterface_0.getValues().get(BulkSurfaceFractionProfileManager.class).getProfile(0));
bulkSurfaceFractionProfile_0.getMethod(ConstantArrayProfileMethod.class).getQuantity().setArray(new DoubleVector(new double[] {1.0}));
SiteSurfaceFractionProfile siteSurfaceFractionProfile_0 =
((SiteSurfaceFractionProfile) boundaryInterface_0.getValues().get(SiteSurfaceFractionProfileManager.class).getProfile(0));
siteSurfaceFractionProfile_0.getMethod(ConstantArrayProfileMethod.class).getQuantity().setArray(new DoubleVector(new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0}));
|
相间反应延伸
在拉格朗日多相流建模中,多组分液滴现在可经历化学反应,导致宏代码更改。要更新宏,使用 ParticleReactionComponent particleReactionComponent_0 = particleReaction_0.getParticleReactants().addLagrangianReactant(solidComponent_1);
替换所有 ParticleReactionComponent particleReactionComponent_0 = particleReaction_0.getParticleReactants().addSolidReactant(solidComponent_1);
实例。
拉格朗日多相:碰撞动力学设置更改
在 Simcenter STAR-CCM+ 2019.1 中,碰撞动力学模拟有两种方法可供选择:奥罗克和阿什格里兹。此延伸导致宏代码更改。
因为在以前的 Simcenter STAR-CCM+ 版本中,已使用奥罗克方法,现有的宏将继续正常工作。但是,为获得最大可靠性,建议更新宏代码,如以下示例所示:
以前发行版本 |
Simcenter STAR-CCM+ 2019.1 |
Simulation simulation_0 =
getActiveSimulation();
PhysicsContinuum physicsContinuum_0 =
((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1"));
LagrangianMultiphaseModel lagrangianMultiphaseModel_0 =
physicsContinuum_0.getModelManager().getModel(LagrangianMultiphaseModel.class);
LagrangianPhase lagrangianPhase_0 =
((LagrangianPhase) lagrangianMultiphaseModel_0.getPhaseManager().getPhase("Droplets"));
lagrangianPhase_0.enable(NtcModel.class);
|
Simulation simulation_0 =
getActiveSimulation();
PhysicsContinuum physicsContinuum_0 =
((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics 1"));
LagrangianMultiphaseModel lagrangianMultiphaseModel_0 =
physicsContinuum_0.getModelManager().getModel(LagrangianMultiphaseModel.class);
LagrangianPhase lagrangianPhase_0 =
((LagrangianPhase) lagrangianMultiphaseModel_0.getPhaseManager().getPhase("Droplets"));
lagrangianPhase_0.enable(NtcModel.class);
NtcModel ntcModel_0 =
lagrangianPhase_0.getModelManager().getModel(NtcModel.class);
ntcModel_0.getCollisionDynamics().setMethod(ORourkeCollisionDynamicsMethod.class);
|
欧拉多相流
多孔粘性和惯性阻力指定更改
现在可以按相指定 N 相混合物、两相热力学平衡和 VOF 设置中的多孔粘性和惯性阻力。在这些情况下,不再在连续体的物理值下指定阻力,但必须指定每相阻力。这允许每相的阻力值不同。
更新宏,如以下示例所示,名为液体
和气体
的两相,以及各向同性阻力张量。
多孔粘性阻力
以前发行版本 |
Simcenter STAR-CCM+ 2019.1 |
Simulation simulation_0 = getActiveSimulation();
Region region_0 = simulation.getRegionManager.getRegion("Region");
PorousViscousResistance porousViscousResistance_0 = region_0.getValues().get(PorousViscousResistance.class);
porousViscousResistance_0.setMethod(IsotropicTensorProfileMethod.class);
ScalarProfile scalarProfile_0 = porousViscousResistance_0.getMethod(IsotropicTensorProfileMethod.class).getIsotropicProfile();
scalarProfile_0.getMethod(ConstantScalarProfileMethod.class).getQuantity().setValue(1e8);
|
Simulation simulation_0 = getActiveSimulation();
Region region_0 = simulation.getRegionManager.getRegion("Region");
PhaseConditions phaseConditions_0 = ((PhaseConditions) region_0.get(PhaseConditionsManager.class).getPhaseConditions("Liquid"));
PorousViscousResistance porousViscousResistance_0 = phaseConditions_0.getPhaseValueManager().get(PorousViscousResistance.class);
porousViscousResistance_0.setMethod(IsotropicTensorProfileMethod.class);
ScalarProfile scalarProfile_0 = porousViscousResistance_0.getMethod(IsotropicTensorProfileMethod.class).getIsotropicProfile();
scalarProfile_0.getMethod(ConstantScalarProfileMethod.class).getQuantity().setValue(1e8);
PhaseConditions phaseConditions_1 = ((PhaseConditions) region_0.get(PhaseConditionsManager.class).getPhaseConditions("Gas"));
PorousViscousResistance porousViscousResistance_1 = phaseConditions_1.getPhaseValueManager().get(PorousViscousResistance.class);
porousViscousResistance_1.setMethod(IsotropicTensorProfileMethod.class);
ScalarProfile scalarProfile_1 = porousViscousResistance_1.getMethod(IsotropicTensorProfileMethod.class).getIsotropicProfile();
scalarProfile_1.getMethod(ConstantScalarProfileMethod.class).getQuantity().setValue(1e7);
|
多孔惯性阻力
以前发行版本 |
Simcenter STAR-CCM+ 2019.1 |
Simulation simulation_0 = getActiveSimulation();
Region region_0 = simulation.getRegionManager.getRegion("Region");
PorousInertialResistance porousInertialResistance_0 = region_0.getValues().get(PorousInertialResistance.class);
porousInertialResistance_0.setMethod(IsotropicTensorProfileMethod.class);
ScalarProfile scalarProfile_0 = porousInertialResistance_0.getMethod(IsotropicTensorProfileMethod.class).getIsotropicProfile();
scalarProfile_0.getMethod(ConstantScalarProfileMethod.class).getQuantity().setValue(1e8);
|
Simulation simulation_0 = getActiveSimulation();
Region region_0 = simulation.getRegionManager.getRegion("Region");
PhaseConditions phaseConditions_0 = ((PhaseConditions) region_0.get(PhaseConditionsManager.class).getPhaseConditions("Liquid"));
PorousInertialResistance porousInertialResistance_0 = phaseConditions_0.getPhaseValueManager().get(PorousInertialResistance.class);
porousInertialResistance_0.setMethod(IsotropicTensorProfileMethod.class);
ScalarProfile scalarProfile_0 = porousInertialResistance_0.getMethod(IsotropicTensorProfileMethod.class).getIsotropicProfile();
scalarProfile_0.getMethod(ConstantScalarProfileMethod.class).getQuantity().setValue(1e8);
PhaseConditions phaseConditions_1 = ((PhaseConditions) region_0.get(PhaseConditionsManager.class).getPhaseConditions("Gas"));
PorousInertialResistance porousInertialResistance_1 = phaseConditions_1.getPhaseValueManager().get(PorousInertialResistance.class);
porousInertialResistance_1.setMethod(IsotropicTensorProfileMethod.class);
ScalarProfile scalarProfile_1 = porousInertialResistance_1.getMethod(IsotropicTensorProfileMethod.class).getIsotropicProfile();
scalarProfile_1.getMethod(ConstantScalarProfileMethod.class).getQuantity().setValue(1e7);
|
滑移模型选择更改
从 Simcenter STAR-CCM+ 2019.1 开始,可以按区域选择相滑移速度,例如允许在流体区域和多孔区域中具有不同的滑移速度模型。
更新宏如以下示例所示:
用户自定义的滑移速度
以前发行版本 |
Simcenter STAR-CCM+ 2019.1 |
MultiPhaseInteractionModel multiPhaseInteractionModel_0 = physicsContinuum_0.getModelManager().getModel(MultiPhaseInteractionModel.class);
PhaseInteraction phaseInteraction_0 = multiPhaseInteractionModel_0.createPhaseInteraction();
phaseInteraction_0.enable(MmpMmpPhaseInteractionModel.class);
phaseInteraction_0.enable(MmpUserSlipVelocityModel.class);
MmpUserSlipVelocityModel mmpUserSlipVelocityModel_0 = phaseInteraction_0.getModelManager().getModel(MmpUserSlipVelocityModel.class);
MmpUserSlipVelocityProfile mmpUserSlipVelocityProfile_0 = mmpUserSlipVelocityModel_0.getUserSlipVelocityProfile();
mmpUserSlipVelocityProfile_0.getMethod(ConstantVectorProfileMethod.class).getQuantity().setComponents(0.0, 0.0, -1.0);
|
MultiPhaseInteractionModel multiPhaseInteractionModel_0 = physicsContinuum_0.getModelManager().getModel(MultiPhaseInteractionModel.class);
PhaseInteraction phaseInteraction_0 = multiPhaseInteractionModel_0.createPhaseInteraction();
phaseInteraction_0.enable(MmpMmpPhaseInteractionModel.class);
phaseInteraction_0.enable(MmpSlipVelocityModel.class);
PhaseConditions phaseConditions_0 = ((PhaseConditions) region.get(PhaseConditionsManager.class).getPhaseConditions("Phase Interaction 1"));
phaseConditions_0.getPhaseConditionManager().get(SlipVelocityMethodOption.class).setSelected(SlipVelocityMethodOption.Type.USER_SLIP);
MmpUserSlipVelocityProfile mmpUserSlipVelocityProfile_0 = phaseConditions.getPhaseValueManager().get(MmpUserSlipVelocityProfile.class);
mmpUserSlipVelocityProfile_0.getMethod(ConstantVectorProfileMethod.class).getQuantity().setComponents(0.0, 0.0, -1.0);
|
基于拖曳滑移速度
以前发行版本 |
Simcenter STAR-CCM+ 2019.1 |
MultiPhaseInteractionModel multiPhaseInteractionModel_0 = physicsContinuum_0.getModelManager().getModel(MultiPhaseInteractionModel.class);
PhaseInteraction phaseInteraction_0 = multiPhaseInteractionModel_0.createPhaseInteraction();
phaseInteraction_0.enable(MmpMmpPhaseInteractionModel.class);
phaseInteraction_0.enable(MmpDragBasedSlipVelocityModel.class);
phaseInteraction_0.enable(MmpInteractionLengthScaleModel.class);
|
MultiPhaseInteractionModel multiPhaseInteractionModel_0 = physicsContinuum_0.getModelManager().getModel(MultiPhaseInteractionModel.class);
PhaseInteraction phaseInteraction_0 = multiPhaseInteractionModel_0.createPhaseInteraction();
phaseInteraction_0.enable(MmpMmpPhaseInteractionModel.class);
phaseInteraction_0.enable(MmpSlipVelocityModel.class);
phaseInteraction_0.enable(MmpInteractionLengthScaleModel.class);
PhaseConditions phaseConditions_0 = ((PhaseConditions) region_0.get(PhaseConditionsManager.class).getPhaseConditions("Phase Interaction 1"));
phaseConditions_0.getPhaseConditionManager().get(SlipVelocityMethodOption.class).setSelected(SlipVelocityMethodOption.Type.DRAG_BASED);
|
电磁:磁力报告更改
电磁建模中的扩展功能报告已导致重构,进而导致宏代码更改。要更新宏,用 magneticpotential.MagneticForceReport
替换所有 magneticpotential.fem.MagneticForceReport
实例。
以前发行版本 |
Simcenter STAR-CCM+ 2019.1 |
import star.electromagnetism.magneticpotential.fem.MagneticForceReport;
|
import star.electromagnetism.magneticpotential.MagneticForceReport;
|
统计数据报告:样本收集策略更改
通过在 Simcenter STAR-CCM+ 2019.1 中引入协同时间监视器,宏代码已重构,有助于确保向后兼容性。预计现有的宏将继续正常工作,但为获得最大可靠性,建议更新宏代码,如以下示例所示:
以前发行版本 |
Simcenter STAR-CCM+ 2019.1 |
statisticsReport_0.getSampleFilterManager().getSampleFilterOption()
.setSelected(SampleFilterOption.Type.LAST_N_SAMPLES);
|
statisticsReport_0.setSampleFilterOption(SampleFilterOption.LastNSamples);
|
如果已经通过声明变量并向其分配一个或多个中间返回值,改变在宏中自动生成的代码,则它可能无法按预期编译,并且需要按上述建议修改代码。考虑以下示例:
SampleFilterManager manager = statisticsReport_0.getSampleFilterManager();
EnumeratedOption option = manager.getSampleFilterOption();
SampleFilterOption.Type value = SampleFilterOption.Type.LAST_N_SAMPLES;
option.setSelected(value);
此代码将无法编译,因为 getSampleFilterOption()
现在返回枚举类型值,而不是 EnumeratedOption
实例。
协同仿真:重构 FieldSpecification 类
由于类 FieldSpecification
和 FieldSpecificationManager
重构,宏代码已发生更改。
类导入
以前发行版本 |
Simcenter STAR-CCM+ 2019.1 |
import star.cosimulation.common.ExportSpecificationManager;
import star.cosimulation.common.ImportSpecificationManager;
|
import star.cosimulation.common.ExportFieldSpecificationManager;
import star.cosimulation.common.ImportFieldSpecificationManager;
|
获取导入/导出场指定管理器,添加/移除场指定
以前发行版本 |
Simcenter STAR-CCM+ 2019.1 |
ReferenceTemperatureExportSpecification referenceTemperatureExportSpecification_0 =
(ReferenceTemperatureExportSpecification) coSimulationZone_0.getCoSimulationZoneConditions().get(ExportSpecificationManager.class).addFieldSpecification("Thermal", "ReferenceTemperature");
coSimulationZone_0.getCoSimulationZoneConditions().get(ExportSpecificationManager.class).removeFieldSpecifications(new NeoObjectVector(new Object[] {referenceTemperatureExportSpecification_0}));
TemperatureImportSpecification temperatureImportSpecification_0 =
(TemperatureImportSpecification) coSimulationZone_0.getCoSimulationZoneConditions().get(ImportSpecificationManager.class).addFieldSpecification("Thermal", "Temperature");
coSimulationZone_0.getCoSimulationZoneConditions().get(ImportSpecificationManager.class).removeFieldSpecifications(new NeoObjectVector(new Object[] {temperatureImportSpecification_0}));
|
ReferenceTemperatureExportSpecification referenceTemperatureExportSpecification_0 =
(ReferenceTemperatureExportSpecification) coSimulationZone_0.getCoSimulationZoneConditions().get(ExportFieldSpecificationManager.class).addSpecification("Thermal", "ReferenceTemperature");
coSimulationZone_0.getCoSimulationZoneConditions().get(ExportFieldSpecificationManager.class).removeSpecifications(new NeoObjectVector(new Object[] {referenceTemperatureExportSpecification_0}));
TemperatureImportSpecification temperatureImportSpecification_0 =
(TemperatureImportSpecification) coSimulationZone_0.getCoSimulationZoneConditions().get(ImportFieldSpecificationManager.class).addSpecification("Thermal", "Temperature");
coSimulationZone_0.getCoSimulationZoneConditions().get(ImportFieldSpecificationManager.class).removeSpecifications(new NeoObjectVector(new Object[] {temperatureImportSpecification_0}));
|
设置场指定初始化值
以前发行版本 |
Simcenter STAR-CCM+ 2019.1 |
coSimScalarInitializationValue_0.getValue().setValue(3.0);
coSimVectorInitializationValue_0.getValue().setComponents(0.0, 3.0, 0.0);
|
coSimScalarInitializationValue_0.getInitializationValue().setValue(3.0);
coSimVectorInitializationValue_0.getInitializationValue().setComponents(0.0, 3.0, 0.0);
|
STAR-ICE
宏启动例程更改
已合并 STAR-ICE 宏记录过程,这样,启动期间仅记录基本设置。此修改可防止 STAR-ICE 对设置进行任何不必要的更改。
以前发行版本 |
Simcenter STAR-CCM+ 2019.1 |
Simulation simulation_0 =
getActiveSimulation();
simulation_0.loadStarIce("StarIce");
Units units_0 =
((Units) simulation_0.getUnitsManager().getObject("deg"));
units_0.setPreferred(true);
AutoSave autoSave_0 =
simulation_0.getSimulationIterator().getAutoSave();
autoSave_0.setMaxAutosavedFiles(2);
StarUpdate starUpdate_0 =
autoSave_0.getStarUpdate();
starUpdate_0.setEnabled(true);
starUpdate_0.getUpdateModeOption().setSelected(StarUpdateModeOption.Type.TIMESTEP);
TimeStepUpdateFrequency timeStepUpdateFrequency_0 =
starUpdate_0.getTimeStepUpdateFrequency();
timeStepUpdateFrequency_0.setTimeSteps(100);
Scene scene_0 =
simulation_0.getSceneManager().getScene("STAR-ICE 1");
scene_0.initializeAndWait();
StarIceEngine starIceEngine_0 =
simulation_0.get(StarIceEngine.class);
starIceEngine_0.startStarIce();
scene_0.setAdvancedRenderingEnabled(false);
SceneUpdate sceneUpdate_0 =
scene_0.getSceneUpdate();
HardcopyProperties hardcopyProperties_0 =
sceneUpdate_0.getHardcopyProperties();
hardcopyProperties_0.setCurrentResolutionWidth(923);
hardcopyProperties_0.setCurrentResolutionHeight(517);
scene_0.resetCamera();
|
Simulation simulation_0 =
getActiveSimulation();
simulation_0.loadStarIce("StarIce");
Scene scene_0 =
simulation_0.getSceneManager().getScene("STAR-ICE 1");
scene_0.initializeAndWait();
StarIceEngine starIceEngine_0 =
simulation_0.get(StarIceEngine.class);
starIceEngine_0.startStarIce();
scene_0.setAdvancedRenderingEnabled(false);
SceneUpdate sceneUpdate_0 =
scene_0.getSceneUpdate();
HardcopyProperties hardcopyProperties_0 =
sceneUpdate_0.getHardcopyProperties();
hardcopyProperties_0.setCurrentResolutionWidth(872);
hardcopyProperties_0.setCurrentResolutionHeight(517);
scene_0.resetCamera();
|
模型选择更改
在
Simcenter STAR-CCM+ 2019.1 中,STAR-ICE 建模包含了以下更改:
- 打开时,模型选择器现在没有已激活模型。
- 无需再显式选择动力化模型。
- 单燃料模型已重命名为燃料。
因此,在宏中 StarIceFuelCountNoneModel
不再运行。删除激活或停用此模型的宏代码行。对宏代码的其他更改如以下注释示例所示:
以前发行版本 |
Simcenter STAR-CCM+ 2019.1 |
simulation_0.loadStarIce("StarIce");
StarIcePhysicsContinuum starIcePhysicsContinuum_0 =
starIceEngine_0.getStarIcePhysicsContinuum();
//From within the UI, deactivate "Motor" and then activate "Single Fuel".
StarIceFuelCountNoneModel starIceFuelCountNoneModel_0 =
starIcePhysicsContinuum_0.getModelManager().getModel(StarIceFuelCountNoneModel.class);
starIcePhysicsContinuum_0.disableModel(starIceFuelCountNoneModel_0);
starIcePhysicsContinuum_0.enable(StarIceFuelCountSingleModel.class);
//--end--
//From within the UI, deactivate "Single Fuel" and then activate "Motored"
StarIceFuelCountSingleModel starIceFuelCountSingleModel_0 =
starIcePhysicsContinuum_0.getModelManager().getModel(StarIceFuelCountSingleModel.class);
starIcePhysicsContinuum_0.disableModel(starIceFuelCountSingleModel_0);
starIcePhysicsContinuum_0.enable(StarIceFuelCountNoneModel.class);
//--end--
|
simulation_0.loadStarIce("StarIce");
StarIcePhysicsContinuum starIcePhysicsContinuum_0 =
starIceEngine_0.getStarIcePhysicsContinuum();
//From within the UI, activate "Fuel"
starIcePhysicsContinuum_0.enable(StarIceFuelCountSingleModel.class);
//--end--
//From within the UI, deactivate "Fuel"
StarIceFuelCountSingleModel starIceFuelCountSingleModel_0 =
starIcePhysicsContinuum_0.getModelManager().getModel(StarIceFuelCountSingleModel.class);
starIcePhysicsContinuum_0.disableModel(starIceFuelCountSingleModel_0);
//--end--
|