CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Temperature calcul in UDF (https://www.cfd-online.com/Forums/fluent/48157-temperature-calcul-udf.html)

DEPRET May 7, 2008 04:27

Temperature calcul in UDF
 
Hi,

I am using a VOF model and I would like to know the average temperature of each phases. My problem is that I can't acces to one phase. My calcul is all over my volume. How can I proceed ?

I have tried this udf :

#include "udf.h"

DEFINE_EXECUTE_AT_END(calcul_temp) { Domain *d; real tavg = 0.; real volume,vol_tot,temp; Thread *t; cell_t;

d = Get_Domain(3) /* Phase Id I want is 3 */

thread_loop_c(t,d) { begin_c_loop(c,t)

{

volume=C_VOLUME(c,t);

temp=C_T(c,t);

vol_tot+=volume;

tavg+=temp*volume;

} end_c_loop(c,t) } tavg=tavg/vol_tot

printf("\n Temp = %g\n",tavg);

}

Thanks !!!


bohis May 7, 2008 04:34

Re: Temperature calcul in UDF
 
you could use if-statement with density. Check it


All times are GMT -4. The time now is 01:46.