Creating the Third Task: Continuum Physics

Create the third task for the project.

The third task contains three steps:
  • The first step creates a physics continuum and populates it with physics models that are appropriate for the simulation.
  • The second step modifies the material properties of the air.
  • The third step sets up initial and boundary conditions, including the boundary types.

For this task, you record a Java macro and perform the desired actions in the Simcenter STAR-CCM+ user interface. You then copy and paste the code for each step into your class, under the relevant function. As the task has three steps, the class will have three functions.

First, create the class for Task 3:

  1. Add a new java class to the Assistant package and name it Task03Physics.


  2. Copy and paste the following code into the class:
    package Assistant;
    
    import star.assistant.annotation.StarAssistantTask;
    import star.assistant.Task;
    import star.assistant.ui.FunctionTaskController;
    
    @StarAssistantTask(display = "Create Physics",
        contentPath = "XHTML/03_Physics.xhtml",
        controller = Task03Physics.PhysicsTaskController.class)
    public class Task03Physics extends Task {
    
        public class PhysicsTaskController extends FunctionTaskController {
    
            public void createPhysicsContinuum() {
                // code for Step 1: creating and defining the physics continuum.
            }
    
            public void materialProperties() {
                // code for Step 2: modifying the material properties of air.
            }
    
            public void initialConditionsAndBoundarySettings() {
                // code for Step 3: defining the initial conditions, boundary type, and boundary conditions.
            }
        }
    }
    This code contains three functions, one function for each step:
    • createPhysicsContinuum()
    • materialProperties()
    • initialConditionsAndBoundarySettings()