Fluids

Fluids

Number of faces given by the GUI and obtained using UDF are different (Fluent)

    • KeFon
      Subscriber

      Good morning, 


      I am trying to export data to compute a local property.


      I want to retrieve data on faces that are on two opposite sides of a same wall. 
      Because of the mesh construction, I expected the number of faces on both threads to be the same which I could confirm using the GUI:


      Zone sizes on domain 1:


      ...


      1089 quadrilateral wall faces, zone 4.


      1089 quadrilateral wall faces, zone 7.


      1089 quadrilateral wall faces, zone 5.


      1089 quadrilateral wall faces, zone 18.


      ...


       


      84124 nodes.


       


      I am interested in faces in zone 4 and 5. 


       


      Using a UDF to write on two files the data from these two zones, I get a different number of data for each zone. 


       


      Here is a portion of the UDF to show how I defined the domain and threads and how I computed the number of elements :


       


      DEFINE_EXECUTE_AT_END(export)


      {


      ...


      #if !RP_HOST


      Domain *mix_domain=Get_Domain(1);


      Thread *wall_thread_NH3=Lookup_Thread(mix_domain,5); 


      Thread *wall_thread_water=Lookup_Thread(mix_domain,4); 


      ...


      #endif


      #if RP_NODE


      size_water = THREAD_N_ELEMENTS_INT(wall_thread_water);


      size_NH3 = THREAD_N_ELEMENTS_INT(wall_thread_NH3);


      ...


      #endif


      ...


      }


       


      Which gives a total of 1725 faces for zone 5 and 1623 faces for zone 4.  


       


      Could someone explain where the differences are coming from? 


       


      Thank you.

    • Rob
      Ansys Employee

      If you try the UDF in serial what do you get? 

    • KeFon
      Subscriber

      Thank you very much for your fast answer. We had an issue with the license server and I could not try it until today.


      Using Fluent in serial mode, I get the same number of faces from the macro THREAD_N_ELEMENTS_INT and from the GUI for both sides (1089).


      Seeing this result, I tried to include a loop on the faces to count them in parallel mode using if (PRINCIPAL_FACE_P(f,*corresponding thread*)) first. The sum of the counted cells gave 1089 for both sides.  


      I could use a first loop to get the number of faces and then a second one to get the properties but I would rather avoid that solution if possible. 


      Thank you.

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