CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

user defined function

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 17, 2007, 07:06
Default user defined function
  #1
Thomas Lescot
Guest
 
Posts: n/a
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/m³g] */ double rho_m ; /* solid density [kg/m³s] */ 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;

  Reply With Quote

Old   May 4, 2007, 11:13
Default user defined function
  #2
Srisudha busi
Guest
 
Posts: n/a
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
  Reply With Quote

Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
LiencubiclowRemodel nzy102 OpenFOAM Bugs 14 January 10, 2012 09:53
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 13:21
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 07:42
User defined function - CO level hari FLUENT 0 October 24, 2007 01:11
Help: user defined function alice FLUENT 3 December 13, 2000 01:10


All times are GMT -4. The time now is 03:29.