CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   The function of UDSI (https://www.cfd-online.com/Forums/fluent/236225-function-udsi.html)

3014214149 May 20, 2021 02:59

The function of UDSI
 
Hi, guys,

I met a strange problem.

I wrote a udf and used UDSI to store variable C_K and C_DUDX

CODE:

DEFINE_ADJUST(NNtraining, d)
{
Thread *t;
cell_t c;
real k;
real epsilon;
real C_mu;
C_mu=0.09;

thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
k=C_K(c,t);
epsilon=C_D(c,t);
C_UDSI(c,t,0)=k;
C_UDSI(c,t,1)=C_DUDX(c,t);
}
end_c_loop(c,t)
}
}

In theory, when I look up contours. The results of Scalar-0 and turbulent kinetic energy should be the same. And the results of Scalar-1 and dX-velocity/dx should be the same. But in fact, they are different.

That's why? Could anybody help me?

AlexanderZ May 20, 2021 18:49

to monitor variable you do probably want to use C_UDMI instead of C_UDSI (which is scalar)

if the difference still is here I can't predict

3014214149 May 20, 2021 21:51

Sad.

The difference is still here.

pakk May 23, 2021 10:56

How big is the difference that we are talking about? Orders of magnitude, or after the sixth decimal?


All times are GMT -4. The time now is 06:21.