Fluids

Fluids

Pointing a mistake in this UDF

    • zakmt293
      Subscriber

      Greetings


      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"


       


      DEFINE_ADJUST(my_adjust,domain)


      {


       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;


      d=Get_Domain(1);


      if (FLUID_THREAD_P(t)) return;


      begin_f_loop(f,t)


      {


       


       INTERIOR_FACE_GEOMETRY(f,t,A,ds,es,A_by_es,dr0,dr1)


       t1=THREAD_T1(t);


       c0=F_C0(f,t);


       t0=THREAD_T0(t);


       c1=F_C1(f,t);


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


      {


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


      }


      end_f_loop(f,t)


      }


      }


       


      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
      Subscriber

      Greetings


       


      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 


      Ahmad 

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