CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   user defined function (http://www.cfd-online.com/Forums/fluent/44455-user-defined-function.html)

Thomas Lescot April 17, 2007 06:06

user defined function
 
Hello!

I have to modify the heat transfer coefficient function but I don't understand how to do that.

You will find here below what I have to program in C.

My questions are : 1. How can I get the variables used in Fluent ? The variables I need are defined here below in VARIABLES FROM FLUENT.

2. How must I define my new heat transfer coefficient function in my program ?

3. How can I use my program in Fluent?

Thanks for your help, Thomas Lescot

double H; /*Heat transfer coefficient in Fluent*/

/*------------------- VARIABLES FROM FLUENT -------------*/

u_g /* gas velocity - vector [m/s] */ u_m /* solid velocity - vector [m/s] */ double dp ;/* particle diameter [m] */ double epsilon_g ; /* void fraction [-] */ double rho_g ; /* gas density [kg/mg] */ double rho_m ; /* solid density [kg/ms] */ double cp_g ; /* specific heat of fluid [kJ/kg*K] */ double mu_g ; /* dynamic viscosity of the gas [kg/m*s] */ double k_g ; /* thermal conductivity [kJ/m*s*K] */

/*-------------------------------------------------------*/

/*-------------------- NEW VARIABLES --------------------*/

double PI = 3.1415926 ;/* pi */ double g = 9.81 ; /* gavity */ double w_g ; /* norme de u_g */ double w_m ; /* norme de u_m */ double a_m ; /* external surface of a particle */ double G ; /* superficial mass flow velocity */ double j_h ; /* Jh factor */ double hf ; /* heat transfer coefficient for film surrounding a particle */ double pr_g ; /* Prandtl number */

/*-------------------------------------------------------*/

/*-------------------------- PROGRAM --------------------*/

/*external surface of a particle*/ a_m = 4*PI*pow(dp/2,2);

/*superficial mass flow velocity*/ w_g = sqrt(pow(u_g[0],2)+pow(u_g[1],2)+pow(u_g[2],2)); w_m = sqrt(pow(u_m[0],2)+pow(u_m[1],2)+pow(u_m[2],2));

G = epsilon_g*rho_g*(w_g-w_m) ;

/*Jh factor*/ j_h = 0.0043*pow((dp*g*(rho_m-rho_g)*pow((1-epsilon_g),2)/(pow((epsilon_g*w_g),2)*rho_g)),0.25);

/* heat transfer coefficent for film surrounding a particle */ pr_g = mu_g*cp_g/k_g;

h = j_h*cp_g*G/pow(pr_g,2/3);

/*heat transfer coefficient*/ H = h*a_m;


Srisudha busi May 4, 2007 10:13

user defined function
 
hello, i want to write a UDF for CG motion in dynamic mesh so that my mesh moves with the oscillation of the body that means remeshing.please help me in writing UDF thank you


All times are GMT -4. The time now is 22:18.