November 19, 2023 at 4:46 pm
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)
}