在 Simcenter STAR-CCM+ 10.04 中,针对电池建模、气动声学、有限体积固体应力、颗粒相、运动、压力边界和网格化进行了宏 API 的更改。
电池建模:多个电路的电路求解器更新
已对电路求解器进行了更新,现可以支持多个电路。 此新增功能引入了新的宏代码。
以前发行版本 |
Simcenter STAR-CCM+ v10.04 |
protected void setCircuit(Simulation sim)
{
CircuitTool circuitTool = sim.get(CircuitTool.class);
CircuitSolver circuitSolver = circuitTool.getCircuitSolver();
ScalarCircuitElement circuitElementR =
circuitSolver.getElements().createCircuitElement(ScalarCircuitElement.class);
circuitElementR.getLoadOption().setSelected(LoadOption.RESISTANCE);
|
protected void setCircuit(Simulation sim)
{
CircuitManager cMgr = sim.get(CircuitManager.class);
Circuit circuit = cMgr.getObject("Circuit 1");
ScalarCircuitElement circuitElementR =
circuit.getElements().createCircuitElement(ScalarCircuitElement.class);
circuitElementR.getLoadOption().setSelected(LoadOption.RESISTANCE);
|
气动声学建模:Curle 和 Proudman 模型更改
现在可以同时选择 Curle 和 Proudman 气动声学模型。 此新增功能引入了新的宏代码。
以前发行版本 |
Simcenter STAR-CCM+ v10.04 |
continuum.enable(CurleModel.class);
continuum.enable(ProudmanModel.class);
|
continuum.enable(BroadbandNoiseModel.class);
continuum.enable(CurleModel.class);
continuum.enable(BroadbandNoiseModel.class);
continuum.enable(ProudmanModel.class);
|
有限体积固体应力:场函数名称更改
对某些与有限体积固体应力有关的场函数进行了重命名。 在宏中使用新的场函数名称。
以前发行版本 |
Simcenter STAR-CCM+ v10.04 |
PrimitiveFieldFunction primitiveFieldFunction_1 =
((PrimitiveFieldFunction) simulation_0.getFieldFunctionManager().getFunction("Solid Stress Displacement"));
PrimitiveFieldFunction primitiveFieldFunction_1 =
((PrimitiveFieldFunction) simulation_0.getFieldFunctionManager().getFunction("Solid Stress Velocity"));
PrimitiveFieldFunction primitiveFieldFunction_1 =
((PrimitiveFieldFunction) simulation_0.getFieldFunctionManager().getFunction("Solid Stress Acceleration"));
|
PrimitiveFieldFunction primitiveFieldFunction_1 =
((PrimitiveFieldFunction) simulation_0.getFieldFunctionManager().getFunction("Displacement"));
PrimitiveFieldFunction primitiveFieldFunction_1 =
((PrimitiveFieldFunction) simulation_0.getFieldFunctionManager().getFunction("Solid Velocity"));
PrimitiveFieldFunction primitiveFieldFunction_1 =
((PrimitiveFieldFunction) simulation_0.getFieldFunctionManager().getFunction("Acceleration"));
|
颗粒相:可用的湍流
现在提供具有颗粒相的标准 K-Epsilon 两层相模型。 设置颗粒相时,在层流和湍流粘滞态之间明确选择。
以前发行版本 |
Simcenter STAR-CCM+ v10.04 |
EulerianPhase eulerianPhase_1 =
eulerianMultiPhaseModel_1.createPhase();
eulerianPhase_1.setPresentationName("Particle");
eulerianPhase_1.enable(SinglePhaseParticleModel.class);
eulerianPhase_1.enable(EulerianPhaseLaminarModel.class);
eulerianPhase_1.enable(ConstantDensityModel.class);
|
EulerianPhase eulerianPhase_1 =
eulerianMultiPhaseModel_1.createPhase();
eulerianPhase_1.setPresentationName("Particle");
eulerianPhase_1.enable(SinglePhaseParticleModel.class);
EulerianPhaseTurbulentModel eulerianPhaseTurbulentModel_0 =
eulerianPhase_1.getModelManager().getModel(EulerianPhaseTurbulentModel.class);
eulerianPhase_1.disableModel(eulerianPhaseTurbulentModel_0);
eulerianPhase_1.enable(EulerianPhaseLaminarModel.class);
eulerianPhase_1.enable(ConstantDensityModel.class);
|
运动:变形位移的指定更改
对于具有变形运动的情况,现在可在边界“物理条件”管理器节点的属性中选择变形位移选项。 用户界面的这一更改产生了新的宏代码。
以前发行版本 |
Simcenter STAR-CCM+ v10.04 |
package macro;
import java.util.*;
import star.morpher.*;
import star.common.*;
import star.base.neo.*;
public class make_total_old extends StarMacro {
public void execute() {
execute0();
}
private void execute0() {
Simulation simulation_0 =
getActiveSimulation();
Region region_0 =
simulation_0.getRegionManager().getRegion("Block");
Boundary boundary_0 =
region_0.getBoundaryManager().getBoundary("Block Surface");
boundary_0.getConditions().get(MovingMeshOption.class).setSelected(MovingMeshOption.TOTAL_DISPLACEMENT);
TotalDisplacementProfile totalDisplacementProfile_0 =
boundary_0.getValues().get(TotalDisplacementProfile.class);
// Set total
totalDisplacementProfile_0.setTotalDisplacement(true);
// Set incremental
totalDisplacementProfile_0.setTotalDisplacement(false);
}
}
|
package macro;
import java.util.*;
import star.morpher.*;
import star.common.*;
import star.base.neo.*;
public class make_total_new extends StarMacro {
public void execute() {
execute0();
}
private void execute0() {
Simulation simulation_0 =
getActiveSimulation();
Region region_0 =
simulation_0.getRegionManager().getRegion("Block");
Boundary boundary_0 =
region_0.getBoundaryManager().getBoundary("Block Surface");
boundary_0.getConditions().get(MovingMeshOption.class).setSelected(MovingMeshOption.DISPLACEMENT);
// Set total
boundary_0.getConditions().get(DisplacementOption.class).setSelected(DisplacementOption.TOTAL);
// Set incremental
boundary_0.getConditions().get(DisplacementOption.class).setSelected(DisplacementOption.INCREMENTAL);
}
}
|
压力边界:选项重新设计
改进了压力边界指定的交界面,从而导致宏代码的更改。
以前发行版本 |
Simcenter STAR-CCM+ v10.04 |
boundary_1.getConditions().get(ReversedFlowPressureOption.class).setSelected(ReversedFlowPressureOption.STATIC);
boundary_0.getConditions().get(InletBoundaryPressureJumpOption.class).setSelected(InletBoundaryPressureJumpOption.FAN);
|
boundary_1.getConditions().get(BackflowSpecification.class).getReversedFlowPressureOption().setSelected(ReversedFlowPressureOption.STATIC);
boundary_0.getConditions().get(PressureBoundaryOption.class).setSelected(PressureBoundaryOption.PRESSURE_JUMP);
boundary_0.getConditions().get(InletBoundaryPressureJumpOption.class).setSelected(InletBoundaryPressureJumpOption.FAN);
|
网格化:表面重构中的面网格增长率
如果自定义表面重构的面网格增长率,则更新宏代码。 但是,仍可将旧的宏用于切割体网格生成器的面网格增长率。
以前发行版本 |
Simcenter STAR-CCM+ v10.04 |
SurfaceCustomMeshControl surfaceCustomMeshControl_0 = autoMeshOperation_0.getCustomMeshControls().createSurfaceControl();
surfaceCustomMeshControl_0.getCustomConditions().get(PartsSurfaceGrowthRateOption.class).setSelected(PartsSurfaceGrowthRateOption.CUSTOM_VALUES);
|
SurfaceCustomMeshControl surfaceCustomMeshControl_0 = autoMeshOperation_0.getCustomMeshControls().createSurfaceControl();
surfaceCustomMeshControl_0.getCustomConditions().get(PartsResurfacerSurfaceGrowthRateOption.class).setSelected(PartsResurfacerSurfaceGrowthRateOption.CUSTOM_VALUES);
|
衍生零部件:显示器方法更改
方法 partDisplayer_0.getParts().addParts(planeSection_1) 已更改为 partDisplayer_0.getInputParts().add(planeSection_1)。 对现有的宏做出相应修改。