Recording the Actions for Step 2
Record the actions for Step 2.
- Return to Simcenter STAR-CCM+ and record a macro named ModifyMaterialProperties.java.
-
Navigate to
and set the following properties:
Node Property Setting Density Value 1.0 kg/m^3 Dynamic Viscosity Value 1.716E-5 Pa-s -
Stop recording the macro.
The macro code for these actions is displayed below:
// begin macro: ModifyMaterialProperties Simulation simulation_0 = getSimulation(); PhysicsContinuum physicsContinuum_0 = ((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics")); SingleComponentGasModel singleComponentGasModel_0 = physicsContinuum_0.getModelManager().getModel(SingleComponentGasModel.class); Gas gas_0 = ((Gas) singleComponentGasModel_0.getMaterial()); ConstantMaterialPropertyMethod constantMaterialPropertyMethod_0 = ((ConstantMaterialPropertyMethod) gas_0.getMaterialProperties() .getMaterialProperty(ConstantDensityProperty.class).getMethod()); constantMaterialPropertyMethod_0.getQuantity().setValue(1.0); ConstantMaterialPropertyMethod constantMaterialPropertyMethod_1 = ((ConstantMaterialPropertyMethod) gas_0.getMaterialProperties() .getMaterialProperty(DynamicViscosityProperty.class).getMethod()); constantMaterialPropertyMethod_1.getQuantity().setValue(1.716E-5); // end macro: ModifyMaterialProperties
-
Copy and paste the code into the
materialProperties()
function. - Reformat the code in NetBeans.
- Select .