Ansys Products

Ansys Products

Paralleliztion of UDF

    • mehdi Abbas
      Subscriber

      I am trying to calculate the total volume of a cell zone or thread of cells to use in my DEFINE_SOURCE udf however after i got my volume values to print I am getting 5 to 6 different answers for the value of this one cell zone volume . i feel its because I didnt convert my udf to parallel properly. Can anyone help me convert this cell loop into parallel so that I get only one value for volume. Also can anyone guide me as to how to use DEFINE_SOURCE macro in parallel ?

      DEFINE_SOURCE(...)

      {

      .....

          #if !RP_HOST
        
              begin_c_loop_int(c,t)
              {
                   Vtotal += C_VOLUME(c,t);
               }  
              end_c_loop_int(c,t)
       
          #endif

      }

       

    • Rob
      Ansys Employee

      DEFINE_SOURCE and parallelisation are covered in the UDF manual. Unless the source volume is changing it's usually easier to hard code the values into the source equations. 

Viewing 1 reply thread
  • You must be logged in to reply to this topic.