Fluid residence time

Compute fluid residence time.

Problem solved via UDF using user-defined scalars. Source code for UDF is below.

1. Compile udf
2. Read case.... set # UDS > 0
3. At inlet, set UDS (value) = 0
4. Set diffusivity of UDS to a small value
5. Set source term of UDS to "rt_source" in the appropriat fluid zones
6. Iterate.

Values of UDS represent the length of time fluid has been in the domain since it entered the inlet (in seconds).

#include "udf.h"

* UDF to compute fluid residence time
* by William Wangard, Ph.D.
* Fluent, Inc.

* This UDF requires at least 1 UDS to be defined
* At inlet, define UDS (value) = 0
* UDS will have units of time and represent approximate residence time
* of fluid in domain
* Diffusivity of scalar should be small to reduce diffusion i.e. 1E-5

real source = C_R(c,t);
dS[eqn] = 0.0;
return source;

Show Form
No comments yet. Be the first to add a comment!