Recording the Actions for Step 3

Record the actions for Step 3.

The third step sets the initial conditions, defines the boundary types, and sets the velocity value on the Inlet boundary. The macro code for this step is provided for you:
  1. Copy the following code into the initialConditionsAndBoundarySettings() function:
    Simulation simulation_0 =
        getActiveSimulation();
    PhysicsContinuum physicsContinuum_0 =
        ((PhysicsContinuum) simulation_0.getContinuumManager().getContinuum("Physics"));
    VelocityProfile velocityProfile_0 =
        physicsContinuum_0.getInitialConditions().get(VelocityProfile.class);
    velocityProfile_0.getMethod(ConstantVectorProfileMethod.class).getQuantity().setComponents(0.429, 0.0, 0.0);
    Region region_0 =
        simulation_0.getRegionManager().getRegion("Fluid");
    Boundary boundary_0 =
        region_0.getBoundaryManager().getBoundary("Inlet");
    boundary_0.setBoundaryType(InletBoundary.class);
    VelocityMagnitudeProfile velocityMagnitudeProfile_0 =
        boundary_0.getValues().get(VelocityMagnitudeProfile.class);
    velocityMagnitudeProfile_0.getMethod(ConstantScalarProfileMethod.class).getQuantity().setValue(0.429);
    Boundary boundary_1 =
        region_0.getBoundaryManager().getBoundary("Outlet");
    boundary_1.setBoundaryType(PressureBoundary.class);
  2. Reformat the code in NetBeans.
  3. Select Source > Fix Imports.
  4. In the Fix All Imports dialog, click OK.