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

exponential UDF for specific heat.

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By obscureed
  • 1 Post By obscureed

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 21, 2018, 05:03
Lightbulb exponential UDF for specific heat.
  #1
New Member
 
Rajasthan
Join Date: Feb 2018
Posts: 2
Rep Power: 0
Vikas gaur is on a distinguished road
I have created a UDF of specific heat with temperature dependent exponential function as follows:

#include "udf.h"
DEFINE_SPECIFIC_HEAT(my_user_cp, T, Tref, h, yi)
{
real cp = 2180;
real exponent=(-2*(T -316.65));
real denominator=(1+exp(exponent));
real numerator=(2390-2180);
real second_part=numerator/denominator;
cp=cp+second_part;
*h = cp*(T-Tref);
return cp;
}

above code has worked well but being new user to fluent I want to ensure whether this code is correct and I also want to create a similar function for thermal conductivity using property macro.
Vikas gaur is offline   Reply With Quote

Old   March 21, 2018, 09:32
Default
  #2
Senior Member
 
Join Date: Sep 2017
Posts: 246
Rep Power: 12
obscureed is on a distinguished road
Hi Vikas gaur,

The value of h is not correct, and this could lead to (probably small) heat-balance issues. The Customization manual states: "the enthalpy function should be the temperature integral of the specific heat function". The example given in the manual is for the very easy case of integrating constant Cp. WolframAlpha is your friend: see for example http://www.wolframalpha.com/input/?i...(-k+x+%2B+d)))

Obviously we cannot tell you whether there are typing errors in your specific values. You seem to have a transition from constant value 2180 to constant value 2390 (in J/kg/K), with the transition occurring smoothly and sigmoidally between about 312K and 322K. You have got this far with the UDF (well done!), so I can imagine you will be tempted to keep going, but a piecewise-linear description would be an option worth considering. A handful of points (10 or fewer) would be enough for most purposes here.

The DEFINE_PROPERTY UDF for thermal conductivity is easier, but again piecewise-linear is easy for users to verify and maintain.

Good luck!
Ed
Vikas gaur likes this.
obscureed is offline   Reply With Quote

Old   March 21, 2018, 11:30
Default
  #3
New Member
 
Rajasthan
Join Date: Feb 2018
Posts: 2
Rep Power: 0
Vikas gaur is on a distinguished road
Thanks Obscureed,

I really appreciate you for giving time to my problem.
Earlier I was using piece-wise function and obtained correct results to my problem. But when I change boundary conditions (for same material properties) I am getting somewhat deviated results. that's why I tried UDF but I don't find significant changes in result.

Is it possible that particular problem can only be solved for certain set of boundary conditions?
Vikas gaur is offline   Reply With Quote

Old   March 22, 2018, 11:12
Default
  #4
Senior Member
 
Join Date: Sep 2017
Posts: 246
Rep Power: 12
obscureed is on a distinguished road
Hi there.

It would take some ingenuity to think of cases that change from "easy answer" to "no possible answer", just by changing boundary conditions. But it is relatively common to find cases that change from "easy answer" to "difficult answer" to "no answer found in the time available". At the very least, you may need to experiment with solver settings such as under-relaxation factors.

Best regards,
Ed
Vikas gaur likes this.
obscureed is offline   Reply With Quote

Reply

Tags
conductivity, melting, specific heat, udf code


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
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
UDF for heat convection coefficient with fixed surface temperature Boo85 Fluent UDF and Scheme Programming 2 July 10, 2012 19:43
Enforce bounds error with heat loss boundary condition at solid walls Chander CFX 2 May 1, 2012 21:11
UDF for Heat Exchanger model francois louw FLUENT 2 July 16, 2010 03:21
How to Include Exponential in UDF RL FLUENT 5 September 11, 2008 18:51


All times are GMT -4. The time now is 04:43.