-
-
August 17, 2018 at 11:05 pm
Fuad87
SubscriberI have written this code for the "flux" term of my UDS. I have copied it from the UDF manual and edited a bit, since I am working in multiphase. This code has some issue with the line of "if (BOUNDARY_FACE_THREAD_P(t))". I checked without this line, it is interpreted without any error. But when I am using this line it is giving parse error.
DEFINE_UDS_FLUX(uds_flux,f,t,i)
{
#if !RP_HOST
real rho, flux;
cell_t c0, c1 = -1;
Thread *t0, *t1 = NULL;
c0 = F_C0(f,t);
t0 = THREAD_T0(t);
if (BOUNDARY_FACE_THREAD_P(t))
{
if (NNULLP(THREAD_STORAGE(t,SV_DENSITY)) &&ULLP(THREAD_STORAGE(t,SV_VOF)))
{
rho = F_VOF(f,t)*F_R(f,t);
}
else
{
rho = C_VOF(c0,t0)*C_R(c0,t0);
}
flux = F_FLUX(f,t) / rho;
}
else
{
c1 = F_C1(f,t);
t1 = THREAD_T1(t);
rho = (C_VOF(c0,t0)*C_R(c0,t0)+C_VOF(c1,t1)*C_R(c1,t1))/2.0;
flux = F_FLUX(f,t) / rho;
}
return flux;
#endif
}
-
August 18, 2018 at 6:23 am
DrAmine
Ansys EmployeeCan you compile?
-
August 18, 2018 at 6:31 am
Fuad87
Subscriberit doesn't compile instead gives parse error for line "if(BOUNDARY_FACE_THREAD_P(t))"
-
August 18, 2018 at 6:40 am
DrAmine
Ansys EmployeeYou said you interpreted that is why I asked if you can compile instead of interpetreting
-
August 18, 2018 at 6:42 am
Fuad87
SubscriberIt can’t be “compiled” as well as “interpreted” -
August 18, 2018 at 6:46 am
Fuad87
SubscriberActually the example given for DEFINE_UDS_FLUX is faulty itself. I fixed 4-5 errors, now it seems even the BOUNDARY_FACE_THREAD is also corrupted in “threads.h” -
August 18, 2018 at 6:57 am
DrAmine
Ansys EmployeeThat is why I wanted to know. I can compile the UDF and use it. To be safe for usage I recommend to check if the UDS has been defined for the mixture or for the phase. This would affect the threads you want to check.
-
August 20, 2018 at 6:04 pm
Fuad87
SubscriberIt might be the reason. Since I am working in multiphase flow, my UDS is hooked at one of the phases. I think BOUNDARY_FACE_THREAD_P(t) can't access thread in phase, it might be allowed in mixture phase. Thats why I used,
int ID
ID = THREAD_ID(t)
to get index of the thread and used if condition for face thread and internal thread. Now its working. Thanks.
-
August 20, 2018 at 7:36 pm
DrAmine
Ansys EmployeeOr to check via THREAD_SUPER_THREAD to check the mixture thread
-
- The topic ‘Issue with the BOUNDARY_FACE_THREAD_P(t)’ is closed to new replies.
-
3727
-
1328
-
1163
-
1090
-
1014
© 2025 Copyright ANSYS, Inc. All rights reserved.