Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.
Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Some questions about user defined specific heat

    • Sky0101
      Subscriber

      Hello, everyone. I have some questions about DEFINE_SPECIFIC_HEAT(my_user_cp, T, Tref, h, yi)


      i get an example in udf manual, as follow:



      In my case, all thermal properties,such as rho, lambda, mu, are variables about temperature.


      i tested some cases, and found *h plays an key role in energy equation.


      i want to know how does the pointer *h work in fluent.


      thanks 

    • Amine Ben Hadj Ali
      Ansys Employee
      Can you reformulate your question?
    • Sky0101
      Subscriber

      When l compile this udf into my case, my case becomes unstable and difficult to converge . So i want to know what the code ,*h = cp*(T-Tref), means and how to get a reasonable Tref. Thanks 



       

    • Rob
      Forum Moderator

      Read the example code in the manual: the code calculates cp and sets "the sensible enthalpy to the referenced value". You've set *h=0 which may mess with some of the maths in Fluent: to understand which parts read the Theory guide (energy equation) and any references used in those sections. Re the approach to define cp, I don't understand what you're trying to do: if you wanted a piecewise profile use a table. 

    • Amine Ben Hadj Ali
      Ansys Employee
      Fluent requires to know how to get the sensible enthalpy out of the user defined heat capacity.
    • atulsbhat
      Subscriber

      I am Not Sure Where to Set Tref For Cp in the Materials Panel


      Where Can I set Tref for UDF?


    • Amine Ben Hadj Ali
      Ansys Employee
      Is hard coded.
    • atulsbhat
      Subscriber

      Should I Define  it in My UDF ?


      Like real Tref=600;


      or its Not Possible to Alter it (by default its 298K) ?


      In the Manual There is No Mention of how to add it..

    • atulsbhat
      Subscriber
      How to Add Tref as 600K? , For Cp UDF..
    • rachels1001
      Subscriber


      I believe that you should be able to set the reference temperature for materials within the materials dialog box.


       

    • Amine Ben Hadj Ali
      Ansys Employee
      No that is wrong. Only for multiphase there is an option because of latent heat.
    • atulsbhat
      Subscriber
      Yes You are Right, There is No Option for Single Phase Flow, So We Cannot Change Tref for Single Phase , Is That what you Mean? Or is There a Option to define it Within The Code?
    • Amine Ben Hadj Ali
      Ansys Employee

      Try to incorporate the changes of Tref in the way *h should be calculated.

    • ahmad91
      Subscriber

      Read the example code in the manual: the code calculates cp and sets "the sensible enthalpy to the referenced value". You've set *h=0 which may mess with some of the maths in Fluent: to understand which parts read the Theory guide (energy equation) and any references used in those sections. Re the approach to define cp, I don't understand what you're trying to do: if you wanted a piecewise profile use a table.



      Hello rwoolhou,


      how can I use a table to get piecewise profile?

    • Rob
      Forum Moderator

      If you have  cp V T data why not use a profile? Saves writing the UDF. 

    • atulsbhat
      Subscriber

      Sir, So I should Change My *h Expression in my UDF with all The Required Changes ?


      Regards

    • Amine Ben Hadj Ali
      Ansys Employee
      Which function for Cp you want to incorporate?
    • atulsbhat
      Subscriber

      /forum/forums/topic/how-to-write-a-correct-udf-fluent-for-specific-heat-as-function-of-temperature-for-polynomials/


      Cp As A Function of Temperature, In Terms of Rational Polynomials, 


      If (T<=450K)


      {Cp= polynomial 1;}


      Else if () 


      ....


      So can I Change the expression for *h for Tref =600K (Default Tref 298K)


      *h= cp (T-(Tref+302)); 


      ???


      Will Tref effect my Cp or its only for sensible enthalpy calculation??

    • Amine Ben Hadj Ali
      Ansys Employee
      I still not understand: rational or not rational use the inbuilt function in Fluent.
    • atulsbhat
      Subscriber



      I have Checked My Polynomials, I had 4 polynomials for Cp, Exactly, they were Correct, But I got this Error


       

    • Amine Ben Hadj Ali
      Ansys Employee
      You might need to limit temperature bounds at the beginning. Try that and report
    • atulsbhat
      Subscriber

      I tried That in solution control limits, It Didnt work


       


      /forum/forums/topic/invalid-cp-error-after-running-program-with-udf/

    • Amine Ben Hadj Ali
      Ansys Employee
      What are you using now? Udf or inbuilt?
    • Amine Ben Hadj Ali
      Ansys Employee
      As you created another thread I am lo king this one.
Viewing 23 reply threads
  • The topic ‘Some questions about user defined specific heat’ is closed to new replies.