CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   UDS for residnce time calculation (

Vidya August 5, 2006 09:36

UDS for residnce time calculation

I want to find the residence time of the fluid in my geometry. I'm not modeling particle tracking nor injecting anything into my flow. How do I find the residence time for such a situation? I got an article from the Fluent manual which talks about the Residence Time Distribution (RTD) in chemical stirred tank reactors. In that it's said that you have to hook a UDS (User Defined Scalar) to Fluent before the simulation. Wjen I went to the Define- User Defined- Scalars panel, it asked me the number of UDS, then there was a mass flow rate option, and something else too (I can't exactly remember).

I don't understand how exactly to use this. Should we include the UDS as a separate program written in C (the same way one would hook an unsteady velocity) and then hook it to Fluent? Or include the UDS function in the UDF code itself? If so, how exactly is this done? Are there any Help solutions or somewhere in the manual that we can refer to?

Thanks, Vidya

Venkatesh August 5, 2006 18:50

Re: UDS for residnce time calculation
UDS - User Defined Scalar.

Like fluent stores the velocities and pressure, it also provides a way for user to create one or more scalars and manipulate for their convineance.

No coming to calculate the resident time ... after completion of simulation .. u can inject particles(no physical meaning only for post procesing purpose) .. to fine the resident time..

IF your are not comfortable with the idea of using particles for calculate the resident time, You can get a udf from Fluent to do this ( it is availabe in ) that case yoy may need to run the analysis one more time.

Vidya August 7, 2006 19:28

Re: UDS for residnce time calculation
Hi Venkatesh,

I found an exmple of the UDF for calculating the residence time in the Fluent manual (Solution ID = 619). I have a couple questions regarding that:

1. I'm already using a UDF for defining my pulsatile velocity. Should I write up and hook a second UDF to compute the residence time? And then follow the same procedure that was followed to hook the unsteady velocity? I mean, compile it, read the header file, cpp file etc?

2. Can the residence time be computed for steady flow too? In this case, there is no need to change the solver settings, right?

3. In the macro for defining this UDF, what equation is to be given in the DEFINE_SOURCE(rt_source,c,t,dS,eqn) what do dS and eqn stand for? What equation is to be given for the "eqn" term? All that I know is that the residence time is to be computed. So what do I specify for the dS and eqn terms?

Thanks, Vidya

All times are GMT -4. The time now is 13:42.