Fluids

Fluids

Check if the structure of UDF is right for Parallel Use

    • zakmt293
      Subscriber

      Greetings,


      Respected experts I am working on a single Bubble growth in a super heated Domain. To incorporate mass and energy transfer at interface from phase change I have written a UDF. This UDF has the following steps


      (1)  This UDF utilizes Look-up-thread and track the interface based upon volume fraction through cell looping in Define-Adjust Macro.


      (2) The mass transfer is calculated from Lees Model  and it is stored in UDM at interface cells.


      (3) Then this mass is transferred to vapor through Define-Source Macros.


      (4) It is not calculating any kind of values over faces such as flux that may lead to take into account boundary zone or partition boundary zone faces.


       


      My specify question is about paralleling as I am looping through cells and not faces do I need a parallel UDF???


       


      if I need it then what I have learnt to my knowledge the structure should look like


      DEFINE_ADJUST(Parallel_UDF,domain)


      {


      #if !RP_HOST                                  /* node or serial */


                    {


                         My Program


                                }


      #endif


      }


       


      Is the above mentioned approach right??


      I do know about the principle face as well and I can utilize it to avoid counting of one face for many nodes. If you can go through it and just guide with you value able knowledge. I would be thankful.


      Thank You


      Zeeshan Ahmad Khan

    • Rob
      Ansys Employee

      Have a look in the documentation: which macros/loops need to be parallelised are covered in the section you found the parallel settings.  What happens when you try the code? 


      If you are looping over cells and then changing cells you'll probably need to set parallel functions: otherwise you may alter a cell twice. 

    • zakmt293
      Subscriber

      Greetings


      The code runs fine. It is not giving any kind of errors. I am unable to get a very clear idea from the document that is why I pasted my question here.


      Yes I am looping over cells but not changing them though I add mass of liquid in the form of source when there is an interface in cell with me. Would it alter the end results??


      Thank You


      Zeeshan Ahmad Khan

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