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:
- Set up all your necessary models, boundary conditions, and initial conditions.
- Activate the Passive Scalar model.
- Create a passive scalar and rename it ResidenceTimeAir.
- For all wall boundaries, set the Physics Conditions > Wall Passive Scalar option to Zero Flux.
- Create a field function and rename it ResidenceTimeAirSource.
-
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.
-
Select the Mass flux for Source
Definition. (See Passive Scalar Properties.)
node and select
-
Open the
node and select the Passive Scalar Source node.
- In the Method property, select Composite.
- Open the Composite node and select the ResidenceTimeAir node.
- In the Method property of the ResidenceTimeAir node, select Field Function.
-
Select the Field Function node and set its Scalar
Function property to ResidenceTimeAirSource,
which is the field function that you defined.
- Create a scalar scene to display ResidenceTimeAir.
The simulation is ready to run.
A similar approach can be used for unsteady simulations.