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

UDF for thermal conductivity

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

Reply
 
LinkBack Thread Tools Display Modes
Old   April 12, 2014, 14:49
Default UDF for thermal conductivity
  #1
New Member
 
mohammad
Join Date: Apr 2014
Posts: 1
Rep Power: 0
aghamohammad is on a distinguished road
Dear Freinds...
i want to define thermal conductivity of nanofluid , I wrote UDF but when i interpreted to fluent, it show me a message " line : 24 function returning float returns double . please help me . thanks.
#include "udf.h"
#include "math.h"
DEFINE_PROPERTY(nanofluid_Conductivity,c,t)
{
double Temp , K , T0 , B , Fi_ = 0.04 , k_bf , C_ronf , RoC_pbf , Ro_bf , f , k_nf , k_np = 40 , T , Ro_np = 3970 , d_np = 0.00000003;
T = C_T(c,t);
Temp = pow(T, 2);
Temp *= -0.0036;
Temp += ((1.9159 * T)+748.19);
Ro_bf = Temp;
K = 1.381 * (pow(10.0, -23));
T0 = 273;
B = 8.4407 * pow((100 * Fi_), -1.07304);
k_bf = (-0.000008 * pow(T, 2)) + (0.0062 * T) - 0.5388;
C_ronf = (-0.0001 * (pow(T, 3))) + (0.1155 * pow(T, 2)) + (-41.296 * T) + 9017.8;
RoC_pbf = C_ronf * Ro_bf;
f = (((2.8217 * (0.01 * Fi_)) + 0.003917) * (T / T0)) + ((-3.0669 * (0.01 * Fi_)) - 0.00391123);
k_nf = ((k_np + (2 * k_bf) - (2 * (k_bf - k_np) * Fi_)) / (k_np + (2 * k_bf) + ((k_bf - k_np) * Fi_)) * k_bf) + (5 * 10000 * B * Fi_ * RoC_pbf * sqrt((K * T) / (Ro_np * d_np)) * f);
return k_nf;
}
aghamohammad is offline   Reply With Quote

Old   April 13, 2014, 04:03
Default
  #2
Senior Member
 
ghost82's Avatar
 
Daniele
Join Date: Oct 2010
Location: Italy
Posts: 993
Rep Power: 17
ghost82 will become famous soon enough
Try to change double to real.
ghost82 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF for thermal conductivity ayoub1989 Fluent UDF and Scheme Programming 5 August 18, 2014 05:15
UDF for effective thermal conductivity in porous media dotapro Fluent UDF and Scheme Programming 17 February 24, 2014 11:56
Thermal conductivity UDF jack.s Fluent UDF and Scheme Programming 4 February 29, 2012 12:57
UDF for effective thermal conductivity Rashmi FLUENT 1 November 6, 2007 21:08
Can wemodify effective thermal conductivity by UDF FengYun FLUENT 2 October 27, 2005 05:28


All times are GMT -4. The time now is 07:56.