CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF for thermal conductivity (https://www.cfd-online.com/Forums/fluent-udf/133268-udf-thermal-conductivity.html)

aghamohammad April 12, 2014 14:49

UDF for thermal conductivity
 
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;
}

ghost82 April 13, 2014 04:03

Try to change double to real.


All times are GMT -4. The time now is 15:37.