Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.

Ansys Learning Forum Forums Discuss Simulation Fluids use of temperature and mass fraction gradients in UDF Reply To: use of temperature and mass fraction gradients in UDF

Ramesh Chandra Mishra
Subscriber

Hi

i am solving an equation which requires concentration gradient as a term. So i write concentration as mass fraction*density to a C_UDSI and then use C_UDSI_G to solve the equation. But I am getting zero everytime. Please note that i don't disable solving the equation for UDS. Is it because of that or there is something to be done in my case file?

A snippet of code is as follows:

thread_loop_f(t, d)
{
    begin_f_loop(f,t)
    {
        F_CENTROID(x, f, t);
if (x[0] >= 108  && x[0] <=  126 &&  x[1] == 18 && x[2] >= 90  && x[2] <= 126 )
{
                    F_AREA(A,f,t);
co = F_C0(f, t);              
to = THREAD_T0(t);      //obtaining corresponding thread of adjacent cell
real integrand;
real conc_grad_roof;
real mu_t_roof = C_MU_T(co,to);        //turbulent viscosity 
C_UDSI(co,to,0)= C_YI(co,to,0) * RHO_1;   //storing concentration of CO as user defined scalar(UDS)
conc_grad_roof=(C_UDSI_G(co,to,0)[1]);       //concentration gradient of CO
 
integrand = (mu_t_roof /0.7)*conc_grad_roof;     //TURBULENT POLLUTANT FLUX
PCH_turb_roof -= integrand*NV_MAG(A);            //Overall value of PCH integral
                }
            }
                          
        end_f_loop(f,t)
}
[bingo_chatbox]