CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Problem with cell macros (https://www.cfd-online.com/Forums/fluent-udf/221310-problem-cell-macros.html)

Abhinand October 11, 2019 15:24

Problem with cell macros
 
Hello CFD ppl,

I came across an issue with cell macros.
I have a density based solver setting and
here is my UDF

DEFINE_ADJUST(myadj,d)
{
int notime1;
cell_t ci,cr;
real CCI[2],CCR[2];
Thread *i_thread1;
Thread *r_thread1;
face_t f;
real gradv;

notime1 = 0;
gradv = 0;
i_thread1 = Lookup_Thread(d,ID_iplane);
r_thread1 = Lookup_Thread(d,ID_rplane);
ci = F_C1(f,i_thread1);

begin_c_loop(ci,i_thread1)
{
if (notime1==30)
{
printf("\nCELL DATA\n");
C_CENTROID(CCI,ci,i_thread1);
printf("Inlet x-coor %f y-coor %f\n",CCI[0],CCI[1]);
printf("Inlet x-vel %f\n",C_U(ci,i_thread1));
printf("Inlet y-vel %f\n",C_V(ci,i_thread1));
printf("Inlet temp %f\n",C_T(ci,i_thread1));
printf("Inlet pressure %f\n",C_P(ci,i_thread1));
printf("Inlet TKE %f\n",C_K(ci,i_thread1));
printf("Inlet Diss %f\n",C_D(ci,i_thread1));
gradv = C_V_G(ci,i_thread1) [1];
printf("Inlet vgrad %f\n",gradv);
}
notime1++;
}
}

When i add cell macros like C_V_G(c,t) or C_R(d,t) for density,
the fluent process stops and it exits.
When I remove these statements the udf works just fine.
I also tried /solve/set/experts and yes to dont delete gradients

I dont know what is causing this issue. Please help me understand this problem. Any help is greatly appreciated.

Thanks


All times are GMT -4. The time now is 04:10.