|
[Sponsors] |
March 21, 2018, 05:03 |
exponential UDF for specific heat.
|
#1 |
New Member
Rajasthan
Join Date: Feb 2018
Posts: 2
Rep Power: 0 |
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. |
|
March 21, 2018, 09:32 |
|
#2 |
Senior Member
Join Date: Sep 2017
Posts: 246
Rep Power: 12 |
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 |
|
March 21, 2018, 11:30 |
|
#3 |
New Member
Rajasthan
Join Date: Feb 2018
Posts: 2
Rep Power: 0 |
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? |
|
March 22, 2018, 11:12 |
|
#4 |
Senior Member
Join Date: Sep 2017
Posts: 246
Rep Power: 12 |
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 |
|
Tags |
conductivity, melting, specific heat, udf code |
|
|
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 |