## Fluids

#### Calculating OSI

• Jhash
Subscriber

Hello Everyone,

I tried to solve OSI using the UDF as follow:

/******************************************************

Oscillatory shear index

******************************************************/

#include "udf.h"

#include "math.h"

#include "storage.h"

#include "sg_udms.h"

#define domain_ID 1

#define zone_ID 7

/* Define Names for the WSS UDMI and its components */

{

Set_User_Memory_Name(0, "uWSS");

Set_User_Memory_Name(1, "uWSSx");

Set_User_Memory_Name(2, "uWSSy");

Set_User_Memory_Name(3, "uWSSz");

Set_User_Memory_Name(4, "OSI");

}

/* Initialize the UDM value to zero in complete domain */

DEFINE_INIT(meminit,domain)

{

cell_t c;

{

{

}

}

}

/* Calculate wall shear stress and store them in UDM */

DEFINE_EXECUTE_AT_END(OSI)

{

Domain *domain;

real area;

face_t f;

real A[ND_ND];

cell_t c, c0;

real wallshear [ND_ND];

domain = Get_Domain(domain_ID);

begin_f_loop(f, t)

{

F_AREA(A,f,t);

area = NV_MAG(A);

NV_V(wallshear,=,F_STORAGE_R_N3V(f,t, SV_WALL_SHEAR));

c0 = F_C0(f,t);

C_UDMI(c0,t0,0) += NV_MAG(wallshear)/area;

C_UDMI(c0,t0,1) += -wallshear[0]/area;

C_UDMI(c0,t0,2) += -wallshear[1]/area;

C_UDMI(c0,t0,3) += -wallshear[2]/area;

C_UDMI(c0,t0,4) = (1.-sqrt(C_UDMI(c0,t0,1)*C_UDMI(c0,t0,1) + C_UDMI(c0,t0,2)*C_UDMI(c0,t0,2) + C_UDMI(c0,t0,3)*C_UDMI(c0,t0,3))/C_UDMI(c0,t0,0))/2;

}

end_f_loop(f,t)

}

But, I have faced a problem after starting calculation. I checked the results in report but FLUENT show just 0 as result for all parameters which defined in UDM. Would you please help me for fixing the problem?

Thanks.