# Thermal conductivity UDF

 Register Blogs Members List Search Today's Posts Mark Forums Read

 February 25, 2012, 16:28 Thermal conductivity UDF #1 New Member   jack Join Date: Aug 2011 Posts: 3 Rep Power: 5 Hi friends... i want to define thermal conductivity of fluid that varies with temperature and position. in other words i want to use this formula: k= 3*T^2+6*y that T is temperature and y is position in y-direction. I wrote the following UDF and run the case but when i compared this result with constant thermal conductivity it has no effect in my results. #include "udf.h" DEFINE_PROPERTY(knew,c,t) { real ktc; real y; real temp = C_T(c,t); ktc = (3. * pow (temp,2.)) + (6. *y); return ktc; } can any body help me???

 February 26, 2012, 04:41 #2 Member   Join Date: Nov 2011 Location: Czech Republic Posts: 95 Rep Power: 5 Well in your code variable "y" isn't initialized, so I guess that is the problem. Here is an quick fix: PHP Code: DEFINE_PROPERTY(knew,c,t) {   real ktc;   real pos[ND_ND];   real y;      C_CENTROID(pos,c,t);   y = pos[1];   real temp = C_T(c,t);   ktc = (3. * pow (temp,2.)) + (6. * y);   return ktc; }

February 26, 2012, 14:58
#3
New Member

jack
Join Date: Aug 2011
Posts: 3
Rep Power: 5
Quote:
 Originally Posted by Sixkillers Well in your code variable "y" isn't initialized, so I guess that is the problem. Here is an quick fix: PHP Code: DEFINE_PROPERTY(knew,c,t){  real ktc;  real pos[ND_ND];  real y;   C_CENTROID(pos,c,t);  y = pos[1];  real temp = C_T(c,t);  ktc = (3. * pow (temp,2.)) + (6. * y);  return ktc;}
i use this UDF and my results changed!!! But my result is not satisfactory.
i have some other question:
i want to use this UDF in 2d modeling of pipe, and use this UDF to change thermal conductivity of fluid in each section of pipe from inlet to outlet with temperature and position of each point in every section.
can i use this UDF in axisemmetric model with y or i should replace y with r???
if yes, can i replace y with r in the previous UDF???

And if i want to use this formula :
k=3*T+
how can i change previous UDF ???

Last edited by jack.s; February 27, 2012 at 07:02.

 February 28, 2012, 17:08 #4 Member   Join Date: Nov 2011 Location: Czech Republic Posts: 95 Rep Power: 5 I think that you can use this code without any modification for an axisymmetric problem, if a symmetry axis is parallel with x axis. If it is parallel with y axis than you will have to change PHP Code: y = pos[1];  to PHP Code: y = pos[0];  To obtain a derivation of velocity according to spatial variable, you can use methods: C_U_G, C_V_G (take a look to this chapter). Once again it depends, which spatial variable represents radius. Finally I would like to say, that I haven't test it and UDF manual isn't much speaking about axisymmetric problems in general. However, this is the way how I expect it should work

February 29, 2012, 12:57
#5
New Member

jack
Join Date: Aug 2011
Posts: 3
Rep Power: 5
Quote:
 Originally Posted by Sixkillers I think that you can use this code without any modification for an axisymmetric problem, if a symmetry axis is parallel with x axis. If it is parallel with y axis than you will have to change PHP Code: y = pos[1];  to PHP Code: y = pos[0];  To obtain a derivation of velocity according to spatial variable, you can use methods: C_U_G, C_V_G (take a look to this chapter). Once again it depends, which spatial variable represents radius. Finally I would like to say, that I haven't test it and UDF manual isn't much speaking about axisymmetric problems in general. However, this is the way how I expect it should work
Thank you very much...

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post mvf Fluent UDF and Scheme Programming 0 July 11, 2010 09:23 Rashmi FLUENT 1 November 6, 2007 21:08 Mona FLUENT 2 January 16, 2006 14:36 FengYun FLUENT 2 October 27, 2005 05:28 Craig FLUENT 4 February 11, 2004 15:02

All times are GMT -4. The time now is 21:54.