CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   User defined scalars!! (

Mischelle June 11, 2008 22:42

User defined scalars!!
Hi all,

If some one has worked on user defined scalars can you please share me your experience on that please.

I need to find out the age of air. how long it takes to reach the outlet.

If there is another way around please let me know.

Thanks Kind regards Mischelle

red lemon June 12, 2008 17:31

Re: User defined scalars!!
hi yes you can use a UDS for mean age of air which seeds the domain with time and needs a few more iterations to solve only. It is implemented the same in Airpak that uses Fluent but in a more automatic fashion. I can provide this but need time to gather info.

red lemon June 17, 2008 18:27

Re: User defined scalars!!
Instructions for mean age of air UDS:

Convert this text to a *.c file then compile as usual and follow notes to hook in. Then solve for scalar only and post process UDS displayed as mean age in seconds.

/* Diffusivity for mean age of air

is solved using a user-defined scalar. This

calculation can be performed after the normal

problem has already been solved ... just turn off

all of the previous equations being solved for

and activate solution of the user-defined scalar-0

equation. Make sure to select

- mean_age_diff as the uds diffusivity in the materials panel

- mass flow rate as the uds flux function

- mean_age_source as the uds volumetric source term in

all fluid regions

Use a journal like this to do that in F63 :

def bc fluid fluid-1 n y 0 0 0 0 0 0 0 1 n y "mean_age_source" n y 0 0 0 0 0 0 n n n

def bc fluid fluid-2 n y 0 0 0 0 0 0 0 1 n y "mean_age_source" n y 0 0 0 0 0 0 n n n

def bc fluid fluid-3 n y 0 0 0 0 0 0 0 1 n y "mean_age_source" n y 0 0 0 0 0 0 n n n


- set uds-0 scalar values = 0.0 at all inlets and outlets

mean age of air calculations do not require

any energy, radiation, or species transport

calculations to have been performed


/************************************************** *****/

#include "udf.h"

#include "prop.h"

DEFINE_DIFFUSIVITY(mean_age_diff, c, t, i)


return C_R(c,t)*2.88e-05+C_MU_EFF(c,t)/0.7;


DEFINE_SOURCE(mean_age_source, c, t, dS, eqn)



return C_R(c,t);


mradili July 4, 2013 10:04

Hi red lemon,

thanks for the post. I just did not get the part regarding the "mean_age_source" and the journal. whats the function of the mean_age_source in conjunction with the mean_age_diff and what is the meaning and application of the journal text you mentioned?


All times are GMT -4. The time now is 14:43.