FLUENT - How to model viscosity (or other material property) as a function of the fluid residence time


It is sometimes desireable to have a material property such as viscosity which varies as a known function of residence time of the fluid in the system.

A user-defined scalar (UDS) is used to compute the fluid residence time. The UDS value is substituted for time in the material property equation. The steps are as follows:

1. Edit and compile the material property 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 appropriate fluid zones
6. Hook the UDF for viscosity (or other property) in the material properties panel
7. Iterate.

-------------- UDFs follow --------------------------------------

#include "udf.h"

/*
* UDF to compute fluid residence time
*/


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

/*
* UDF to calculate the material property value. The example shown here sets the
* material property value equal to the residence time, please edit as appropriate.
*/

DEFINE_PROPERTY(mat_prop,c,t)
{

real res_time, mat_prop;
Thread *st = THREAD_SUPER_THREAD(t);

res_time = C_UDSI(c,st,0);
mat_prop = res_time;

return mat_prop;

}





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