CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

How To write a Correct UDF (FLUENT) for Specific heat as Function of Temperature for

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 4, 2019, 21:37
Default How To write a Correct UDF (FLUENT) for Specific heat as Function of Temperature for
  #1
New Member
 
ATUL S B
Join Date: Sep 2019
Posts: 7
Rep Power: 7
atulsbhat is on a distinguished road
This UDF didnt Get Any Error message but its not running, Can someone correct the UDF BELOW? {Suggest Changes Required}

Should I add anything Related To Enthalpy or Some UDM MACRO like C_UDMI(c,t,0) = cp

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

{

real T = C_T(c, t);

real cp;

if (500< T <550)

{

cp = (0.63464529*pow(T,2))-(356.13993666*T)+(61767.53243895);

}

else if (550< T <600.10)

{

cp = (0.23484528*pow(T,2))-(250.13953470*T)+(71466.09249852);

}

else if (600.10< T < 625.15)

{

cp = (1.58260392*pow(T,2))-(1873.17493506*T)+(560143.47661247);

}

else if (625.15< T <640)

{

cp = (16.13751699*pow(T,2))-(20137.03882161*T)+(6289718.12316515);

}

else

{

cp = 13000;

}

*h = cp*(T-Tref);

return cp;

}

Regards

Last edited by atulsbhat; December 5, 2019 at 15:29.
atulsbhat is offline   Reply With Quote

Old   December 6, 2019, 07:10
Default
  #2
Member
 
Join Date: Mar 2016
Posts: 73
Rep Power: 10
sufjanst is on a distinguished road
Did you hook the UDF and set it up as your material properties?
sufjanst is offline   Reply With Quote

Old   December 6, 2019, 16:26
Default How To Set Tref And What Should be my Tref for The Above UDF?
  #3
New Member
 
ATUL S B
Join Date: Sep 2019
Posts: 7
Rep Power: 7
atulsbhat is on a distinguished road
Quote:
Originally Posted by sufjanst View Post
Did you hook the UDF and set it up as your material properties?
Yes I Did That..
I am Not Sure Where to Set Tref For Cp in the Material Section
What Should be my Tref for The Above UDF?
atulsbhat is offline   Reply With Quote

Old   December 9, 2019, 01:07
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
COMPILE your code and READ error log file,
you've defined T twice

remove real T = C_T(c, t);
atulsbhat likes this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   December 10, 2019, 11:57
Default
  #5
New Member
 
ATUL S B
Join Date: Sep 2019
Posts: 7
Rep Power: 7
atulsbhat is on a distinguished road
I am Not Sure Where to Set Tref For Cp in the Materials Panel

Where Can I set Tref for UDF?
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..
{Only for multiphase there is an option because of latent heat}
What Is Tref, will it effect my Cp or its only for sensible enthalpy calculation??

Last edited by atulsbhat; December 10, 2019 at 19:41.
atulsbhat is offline   Reply With Quote

Reply

Tags
ansys fluent 18.0, ansys fluent 19.0, cfd - post, fluent - udf, udf and programming


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF for specific heat as function of pressure ghobold Fluent UDF and Scheme Programming 20 August 22, 2019 09:19
Linking initial data and source terms from UDF to Fluent in simulating heat pipe say2017 Fluent UDF and Scheme Programming 0 October 20, 2017 13:35
Ansys CFX problem: unexpected very high temperatures in premix laminar combustion faizan_habib7 CFX 4 February 1, 2016 18:00
Difficulty In Setting Boundary Conditions Moinul Haque CFX 4 November 25, 2014 18:30
The fluent stopped and errors with "Emergency: received SIGHUP signal" yuyuxuan FLUENT 0 December 3, 2013 23:56


All times are GMT -4. The time now is 17:42.