CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   UDF DEFINE_ON_DEMAND set uds value to zero (https://www.cfd-online.com/Forums/fluent/126057-udf-define_on_demand-set-uds-value-zero.html)

gfy_mythical November 7, 2013 04:04

UDF DEFINE_ON_DEMAND set uds value to zero
 
Hello, everyone. I use an UDF to set the Ultraviolet fluence rate (Concentration) to zero at selected region. But it didn't work at the region near the wall. (The middle of the region is zero, but the near wall region is not zero). Here is the code:
DEFINE_ON_DEMAND(set_UV)
{
Domain *d ;
Thread *t ;
cell_t c ;
real coord[ND_ND], Z_low = 1.8, Z_high = 2.6 ;

{
d=Get_Domain(1);
thread_loop_c(t,d)
{
begin_c_loop(c,t)
{

/* restrict the Fluence rate to zero outside the irradiation zone */
C_CENTROID(coord,c,t) ;
if ( (coord[2] < Z_low) || (coord[2] > Z_high) )
C_UDSI(c,t,0) = 0 ;
}
end_c_loop(c,t);
}
}
}


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