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/)
-   -   Please check out my UDF code (https://www.cfd-online.com/Forums/fluent-udf/99250-please-check-out-my-udf-code.html)

tahmineh March 29, 2012 11:38

Please check out my UDF code
 
hi,
I want to model nanofluid (thermal oil/AL2O3)in single phase.
please check out my code.

/************************************************** *********************/
/* UDF that defines the some properties of the fluid such as vicosity*/
/*(as a function of temperature) */
/************************************************** *********************/
#include"udf.h"


DEFINE_PROPERTY(viscosity, c, t)
{

real mu_f,fi,mu_eff,tt;
tt=C_T(c,t);

fi=0.03; /*volume fraction of the nano particles */

mu_f=0.000001*((6.672*0.0000001*tt*tt*tt*tt)-(1.566*0.001*tt*tt*tt)+(1.388*tt*tt)-(5.541*100*tt)+(8.487*10000));
mu_eff =(1+2.5*fi)*mu_f;

return mu_eff;
}



DEFINE_PROPERTY(conductivity,c,t)
{

real k_eff,ks,kf,fi,tt;
tt=C_T(c,t);
fi=0.03;
kf=(-5.753496)*0.0000000001*tt*tt-(1.875266*0.0001*tt)+(1.900210*0.1);
ks= 5.5+34.5*(exp((-0.0033)*(tt-273)));

k_eff=(kf*(ks+2*kf-2*fi*(kf-ks)))/(ks+2*kf+fi*(kf-ks));

return k_eff;

}


DEFINE_PROPERTY(density, c, t)
{

real ro_nf,fi,ro_f,ro_s,tt;

tt=C_T(c,t);
fi=0.03;
ro_f=(-4.153495*0.1*tt)+1.105702*1000;
ro_s=3850;
ro_nf=((1-fi)*(ro_f))+(fi*(ro_s));

return ro_nf;

}



Regards,
tahmineh.

mvee September 14, 2012 00:50

Hi tahmineh

You might already had solved the problem.
I feel this UDF should work properly.

If you have any query you can please ask.

Best wishes
Mvee

amirokhovat December 26, 2013 13:14

Dear Tahmine, It's correct
afarin


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