Problem
Residence time is a useful scalar transport output for identifying regions where fluid remains trapped for long periods, especially in recirculation zones. svMultiPhysics currently supports scalar transport, but residence time is not computed directly. Users therefore need particle tracking or external post-processing, which can be sensitive to particle seeding, time step, mesh resolution, and repeated runs for pulsatile flows.
Solution
Add an optional residence-time computation to the scalar transport equation using the non-discrete Eulerian method described in the attached paper.
The residence-time field, tau, can be solved with an advection-diffusion equation using the same velocity field and scalar transport discretization:
d(tau)/dt + u · grad(tau) - div(kappa grad(tau)) = H
where H = 1 inside the selected residence-time region of interest and H = 0 outside it. For the whole-domain residence time case, H = 1 throughout the domain.
Implementation details to consider:
- Add an input option to enable residence-time computation for scalar transport.
- Reuse the existing scalar transport assembly where possible.
- Support
H = 1 for whole-domain residence time, and ideally allow a tagged region of interest later.
- Use
tau = 0 on inflow boundaries and outlets with backflow, following the paper.
- Use zero-flux Neumann conditions on walls.
- Output
tau together with the scalar transport results.
- Preserve existing scalar transport behavior when residence time is disabled.
Suggested validation
Start with a simple analytic transport case: steady plug flow in a straight channel with constant velocity U and residence time initialized to zero at the inlet. The expected solution is:
This should verify the source term, advection, inlet boundary condition, and output field.
A second validation case can follow the paper's 2D cavity example: cross-flow over a cavity with a recirculation region. The expected qualitative result is low residence time in the main duct and much higher residence time inside the cavity, especially near the center and lower corners. This would test whether the method captures trapped or slowly recirculating fluid without particle tracking.
Additional context
Reference: A non-discrete method for computation of residence time in fluid mechanics simulations
Problem
Residence time is a useful scalar transport output for identifying regions where fluid remains trapped for long periods, especially in recirculation zones. svMultiPhysics currently supports scalar transport, but residence time is not computed directly. Users therefore need particle tracking or external post-processing, which can be sensitive to particle seeding, time step, mesh resolution, and repeated runs for pulsatile flows.
Solution
Add an optional residence-time computation to the scalar transport equation using the non-discrete Eulerian method described in the attached paper.
The residence-time field,
tau, can be solved with an advection-diffusion equation using the same velocity field and scalar transport discretization:where
H = 1inside the selected residence-time region of interest andH = 0outside it. For the whole-domain residence time case,H = 1throughout the domain.Implementation details to consider:
H = 1for whole-domain residence time, and ideally allow a tagged region of interest later.tau = 0on inflow boundaries and outlets with backflow, following the paper.tautogether with the scalar transport results.Suggested validation
Start with a simple analytic transport case: steady plug flow in a straight channel with constant velocity
Uand residence time initialized to zero at the inlet. The expected solution is:This should verify the source term, advection, inlet boundary condition, and output field.
A second validation case can follow the paper's 2D cavity example: cross-flow over a cavity with a recirculation region. The expected qualitative result is low residence time in the main duct and much higher residence time inside the cavity, especially near the center and lower corners. This would test whether the method captures trapped or slowly recirculating fluid without particle tracking.
Additional context
Reference: A non-discrete method for computation of residence time in fluid mechanics simulations