Using a Passive Scalar for Residence Time

You can use the Passive Scalar model to simulate residence time (the mean age of air) for a single phase.

Consider a chamber with air flowing in at one opening and flowing out at another, modeled as a steady-state Eulerian flow. A passive scalar is defined on the air, increasing steadily over time in value. In effect, defining the passive scalar attaches a clock to each volume element of air. These virtual clocks can be used to measure the residence time of the air in different parts of the chamber.

Example procedure:

  1. Set up all your necessary models, boundary conditions, and initial conditions.
  2. Activate the Passive Scalar model.
  3. Create a passive scalar and rename it ResidenceTimeAir.
  4. For all wall boundaries, set the Physics Conditions > Wall Passive Scalar option to Zero Flux.
  5. Create a field function and rename it ResidenceTimeAirSource.
  6. In the definition of the field function, supply this syntax:
    ($ResidenceTimeAir >1000)?0:$Density

    The value of 1000 represents a maximum time, which is necessary if the flow field has a vortex or recirculation. Otherwise, time would grow to infinity.

    The $Density value is present to scale the source term in the passive scalar transport equation.

  7. Select the Regions > Fluid > Physics Conditions > Passive Scalar Source Option node and select Mass flux for Source Definition. (See Passive Scalar Properties.)


  8. Open the Regions > [Region] > Physics Values node and select the Passive Scalar Source node.


  9. In the Method property, select Composite.
  10. Open the Composite node and select the ResidenceTimeAir node.
  11. In the Method property of the ResidenceTimeAir node, select Field Function.
  12. Select the Field Function node and set its Scalar Function property to ResidenceTimeAirSource, which is the field function that you defined.


  13. Create a scalar scene to display ResidenceTimeAir.

The simulation is ready to run.

A similar approach can be used for unsteady simulations.