Multi-Component Fluid: Time-Varying Boundary Conditions in a Dilution Pipe

Some analyses require that you set time-varying conditions on boundaries. User-defined field functions provide a method whereby you can do so.

This tutorial resumes from the results that were obtained in the previous tutorial, "Multi-Component Fluid: Steady Flow in a Dilution Pipe." It solves the same problem except that, in this case, the velocities at the two inlet boundaries vary with time over a period of two seconds.

The velocity-time profiles at the inlets are shown below.



  1. Launch Simcenter STAR-CCM+ and load foundationTutorial_dilutionPipe_Steady.sim.
    You can either use the sim file that you saved from the previous tutorial, or load foundationTutorial_dilutionPipe_Steady.sim from the foundationTutorials folder.
  2. Save the simulation as foundationTutorial_dilutionPipe_Unsteady.sim

Most of the models have already been selected in the tutorial Multi-Component Fluid: Steady Flow in a Dilution Pipe. However, you must change the analysis type to unsteady:

  1. Right-click the Continua > Physics 1 node and choose Select models...
  2. In the Physics Model Selection dialog:
    1. From the Enabled Models group box, deselect Steady.
    2. From the Time group box, select Implicit Unsteady.
    3. Click Close.
To define the inlet velocity profiles as linear functions of time, you create user-defined field functions that can be assigned to the velocity inlet boundary conditions. The required functions are:
  • Inner Inlet: v=104t
  • Outer Inlet: v=5+2t
  1. Right-click the Automation > Field Functions node and select New > Scalar.
    The Properties window for the new function opens.
  2. Rename the field function node User Field Function 1 to Inner Inlet Velocity.
  3. Select the Inner Inlet Velocity node and set:
    1. Definition to 10-4*$Time
    2. Function Name to Inner Inlet Velocity
  4. Create another scalar field function and rename its node to Outer Inlet Velocity.
  5. Select the Outer Inlet Velocity node and set:
    1. Definition to 5+2*$Time
    2. Function Name to Outer Inlet Velocity
To specify the inlet velocity boundary conditions using these field functions:
  1. Select the Regions > Dilution Pipe > Boundaries > Inlet Inner > Physics Values > Velocity Magnitude node and set Method to Field Function.
  2. Click the right side of the Scalar Function property.
  3. In the dialog that appears, select the Inner Inlet Velocity field function node, then click OK.
  4. Open the Boundaries > Inlet Outer node. Following the same procedure as described above, define the velocity magnitude at the outer inlet by the Outer Inlet Velocity field function.
  5. Save the simulation.
Set the time-step length and the run time. The simulation is to restart from the steady-state result that was obtained previously and then run for 2 seconds of physical time. As a time-step of 0.002 seconds is used, the analysis requires 1000 steps.
  1. Select the Solvers > Implicit Unsteady node and set Time-Step to 0.002 s.
  2. Select the Stopping Criteria > Maximum Physical Time node and set Maximum Physical Time to 2.0 s.
  3. Select the Stopping Criteria > Maximum Steps node and deselect Enabled.
  4. Select Plots > Residuals and set the X-Axis Monitor property to Physical Time.
  5. Save the simulation.
  6. To run the simulation, click (Run) in the top toolbar.

    If necessary, click the Residuals tab to bring the Residuals plot into view. The tabs at the top of the Graphics window make it possible to select any of the active displays for viewing.

    During the run, it is possible to stop the process by clicking (Stop) in the toolbar. If you do halt the simulation, it can be continued later by clicking (Run). If left alone, the simulation runs for 2.0 s of physical time.

  7. Save the simulation.