Problem In Specific heat UDF in eulerian multiphase flow

    • cmiucbs

      Hi I'm having problem writing a temperature dependent specific heat macro for my eulerian two phase boiling flow simulation.

      I want to get the primary phase temperature from the cell and use it in the code but having problem to do so; I already did the other properties like density using DEFINE PROPERTY macro but since specific heat is kinda different I'm getting odd answers.

      So here is my code and I narrow the problem down to the bold words:

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


      real cpf;

      Domain *mixture_domain = Get_Domain(1);

      Thread *mixture_thread = Lookup_Thread(mixture_domain,8);

      Thread *t_wa = THREAD_SUB_THREAD(mixture_thread,0);

      Thread *t_va = THREAD_SUB_THREAD(mixture_thread,1);

      cell_t c;

      real Tw = C_T(c,t_wa);


      *h = cpf*(T-Tref);

      return cpf;


      Using the above code lead to wrong values for cp; what can i do to calculate the cp only with my primary phase temp? Can anybody help me on this?

    • Surya Deb
      Ansys Employee
      The thread allocations look fine to me.
      I would recommend you to print out the primary phase temperature inside the UDF and then compare that to the Fluent GUI to check if everything is consistent or not.
      I would also suggest you to use a simpler Cp value (say a linear function or even a constant) for testing if the code is doing what its supposed to do.
      Regards SD
Viewing 1 reply thread
  • You must be logged in to reply to this topic.