Fluids

Fluids

Issue with the BOUNDARY_FACE_THREAD_P(t)

    • fuad87
      Subscriber

      I 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



       


       


       

    • DrAmine
      Ansys Employee

      Can you compile?

    • fuad87
      Subscriber

      it doesn't compile instead gives parse error for line "if(BOUNDARY_FACE_THREAD_P(t))"


       

    • DrAmine
      Ansys Employee

      You said you interpreted that is why  I asked if you can compile instead of interpetreting 

    • fuad87
      Subscriber
      It can’t be “compiled” as well as “interpreted”
    • fuad87
      Subscriber
      Actually 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”
    • DrAmine
      Ansys Employee

      That 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. 

    • fuad87
      Subscriber

      It 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.

    • DrAmine
      Ansys Employee

      Or to check via THREAD_SUPER_THREAD to check the mixture thread

Viewing 8 reply threads
  • You must be logged in to reply to this topic.