Fluids

Fluids

Specific Heat UDF

    • rjoshi
      Subscriber

      How is temperature calculated in DEFINE_SPECIFIC_HEAT for a material in UDF.


      DEFINE_SPECIFIC_HEAT(xxx,T,Tref,h,yi) 


      {


        real cp2 = 2000;


        *h=cp2*(T-Tref); // How is T called here as we don't define cell and thread inside the macro // 


        return cp2; 


      }


      Also since *h is calculated why do i return cp ?


       


      Regards,


      Rahul 

    • DrAmine
      Ansys Employee
      The second why is what Fluent internally wants to know. The first part of the question the actual cell temperature is passed from Fluent to the macro and ready to use.
    • rjoshi
      Subscriber

      Hi abenhadj,


      So if Cp function of temperature I can just directly write the equation under DEFINE_SPECIFIC_HEAT and use it for calculation of Cp without assigning a constant value to it ? 


      Regards,


      Rahul

    • Rob
      Ansys Employee

      Why not use a piecewise linear or polynomial over the UDF? 

    • DrAmine
      Ansys Employee
      Stick to what rwoolhou suggested. If the function is very complex then udf.
    • rjoshi
      Subscriber

      HI rwoolhou,


      Will try to implement your suggestion.


      Regards,


      Rahul 

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