Fluids

Fluids

Surface Intergal in UDF

    • mohanpannirselvam08
      Subscriber

      I would like to write the following Suface intergation formula in a UDF. But i am not sure am i writing it properly. The formula does the following:



      • Get the (v^2+w^2) velocty component value at each face value of the intersection surface within my flow domain (treftz-Plane).

      • Then multiplied it with density and 1/2

      • Then multiplied it with the respective surface area of the face

      • finaly sum all the product value for each face on the the intersection face.


      I have done this with a custom field function dialog box (Image). However as i try to run it in a UDF fromat, i get a totaly different values. Why is this? Am i doing something wrong in the UDF? What macros should i use?


      Surface integration formulaTrfetz Planetrefttz plane in the flow domain at back of the wing


       


      #include "udf.h"
      enum {     w4 };
      DEFINE_ADJUST(my_adjust,d)


      {     


      Thread *t;     cell_t c;     int n;     Node *node;     face_t f;     


         thread_loop_f(t,d)     


          {     begin_f_loop(f,t)    {  


                 C_UDSI(f,t,w4) = 0.5*C_R(f,t)*((C_V(f,t)* C_V(f,t))+(C_W(f,t)*C_W(f,t)));  


             }         


               end_f_loop(f,t)    


        }    
      }



    • Rob
      Ansys Employee

      You want to have a look at custom field functions: that may be a better solution. 

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