CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   UDS for positive scalar (

Jun August 18, 2003 16:53

UDS for positive scalar
I would like to use UDS to calculate the concentration field. But the results are negative (small) in some parts of the domain. Would it affect a lot on the solution? and if that's true, how can I solve a positive scalar by uds? Can I just set the negative values to zero using udf?

Thanks a lot for your advising.

Jun Li

Greg Perkins August 19, 2003 02:38

Re: UDS for positive scalar
There are couple of things to do.

Generally I check for small negative values and set them to zero inside a DEFINE_ADJUST routine. Scalars should never be negative (see Patankar).

The other option, which you should also consider is to add or modify your source term - Patankar also describes this - so that it is linearised with respect to the scalar being solved and forces the solution to zero as zero is approached.

In practice even with some sort of source term linearisation I find that I still need to reset small negatives to zero. gnerally we are talking about numbers of order 1.0e-4 to 1.0e-6 in magnitude so they don't effect the solution if reset to zero. However it you leave them they may grow exponentially and interact with your other equations in an adverse way, so its best to reset them to zero.

Hope it helps


ps Patankar - Numerical heat Transfer 1980 - the first book to read if you're new to CFD and finite volume methods.

Jun August 19, 2003 13:40

Re: UDS for positive scalar
I appreciate it, Greg. I am doing it now and will let people here know what will happen when setting the negatives to zero.


Jun August 26, 2003 17:26

Re: UDS for positive scalar
No much change happens in my case if resetting the negatives to zero. Jun

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