Pointing a mistake in this UDF

    • zakmt293


      Respected experts I hope this post finds you fine. I have this UDF and have been working on it from the last week but I am unable to get my way out. If you people can go through it and just point out where the mistake is. I do know that in UDF no help is allowed on this forum but I have no other place. It gives  an error like this "Received signal SIGSEGV."



      # include "udf.h"

      # include "mem.h"

      # include "sg.h"




       Domain *d;

       Thread *t,*t0,*t1=NULL;

       cell_t c,c0,c1=-1;

       face_t f;

      int phase_domain_index_p=0;

      int phase_domain_index_s=1;

      Thread *tp=THREAD_SUB_THREAD(t,phase_domain_index_p=0);

      Thread *ts=THREAD_SUB_THREAD(t,phase_domain_index_s=1);

      real xc[ND_ND];

      real A[ND_ND],dr0[ND_ND],dr1[ND_ND], es[ND_ND],ds,A_by_es;


      if (FLUID_THREAD_P(t)) return;









       if (C_VOF(c0,tp)>0 && C_VOF(c0,tp)<1)


      Message("We have reached to desire objectiven");






      Also my major aim is to loop over all the faces in my domain. And then retrieve information of both adjacent cell c0 and c1 if a face is in fluid domain. Else if face is on boundary then only info about c0 would be retrieved.The above mentioned UDF is a progress toward the objective in aforementioned line.

      Can you recommend me a very good and effective strategy that could solve my problem. I can add up more details if required. I would be thankful if guided as it is very necessary for me to move forward.

      Thank You

    • DrAmine
      Ansys Employee

      I recommend having a look into the customization manual. 

      What I understand here is that the the UDF has to be applied on non Fluid thread? Is this expected?

      You forgot a thread loop of all threads in the domain if you are not focusing on certain thread ID.

    • zakmt293



      Respected Sir Amine I am going through Manual as well. I am working on it. I will again post my progress with detailed steps. I am very thankful for your value able suggestion and expect that I would be helped if there was an issue. Let me comeback with more knowledge and more preparation.

      Thank You

      Best Regards 


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