Hallo Everyone,

I am trying to plot a Integral length scale contour of an RANS simulation in Ansys fluent. I have tried to plot I just just find Sub grid scale length for LES but nothing for RANS, but I am looking for integral scale using k and epsilon.

I have written an UDF function as follows:

#include “udf.h”

DEFINE_ON_DEMAND(integral_length_scale)

{

Domain *domain;

real k, epsilon, L;

Thread *t;

cell_t c;

domain = Get_Domain(1);

/* Loop through all cells in all threads */

thread_loop_c(t, domain)

{

begin_c_loop(c, t)

k = C_K_L(c, t);

epsilon = C_R_G(c, t)[1];

L = pow(k, 1.5) / epsilon;

/* Store the calculated value of L in C_LENGTH_SCALE */

C_LENGTH_SCALE(c, t) = L;

end_c_loop(c, t)

}

Message(“Integral length scale calculated successfully!\n”);

}

But I am getting an error as C_LENGTH_SCALE: undefined variable. I dont understant why am I getting the error and how can i solve it.

Thanks in advance.