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

use of pointers in specific heat udf

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

Like Tree1Likes
  • 1 Post By mdakbari

Reply
 
LinkBack Thread Tools Display Modes
Old   April 18, 2014, 11:37
Default use of pointers in specific heat udf
  #1
New Member
 
mdakbari's Avatar
 
m.akbari
Join Date: Apr 2014
Posts: 14
Rep Power: 3
mdakbari is on a distinguished road
hello there, i have a question about making the specific heat udf code.
is there any necessity to use pointers and enthalpy term, in the specific heat udf code and so is my code right especially about the T variable (at specific heat part) which i replaced it with temp in the rho_w function?

with best regards


/************************************************** *******************
Fluent UDF
Author: Milan
all calculations for al2o3 nanoparticles
************************************************** ********************/
#include "udf.h"
#define FI 0.01
#define RHO_np 3600
#define SI_1 0.9830
#define SI_2 12.959
#define KTC_np 36
#define TI 5.E4
#define BETA_1 8.4407
#define BETA_2 -1.07304
#define CP_w 4200
#define KA 1.383E-23
#define SIi_1 2.8217E-2
#define SIi_2 3.917E-3
#define SIi_3 -3.0669E-2
#define SIi_4 -3.91123E-3
#define T_0 298.15
#define D_np 59.E-9
#define CP_np 765
DEFINE_PROPERTY(cell_conductivity,cell,thread)
{
real ktc,ktc_w,temp,f,beta,rho_w;
temp = C_T(cell,thread);
f = ((SIi_1*FI+SIi_2*temp)/T_0)+(SIi_3*FI+SIi_4);
beta = BETA_1*(pow(100*FI,BETA_2));
rho_w = (-3.570*(pow(10,-3))*(pow(temp,2))+(1.88*temp+753.2));
ktc_w = (-8.354*0.000001*(pow(temp,2)))+((6.53*0.001*temp)-0.5981);
ktc = ((KTC_np+(2*ktc_w)-2*(ktc_w-KTC_np)*FI)/(KTC_np+(2*ktc_w)+(ktc_w-KTC_np)*FI))+(TI*beta*FI*rho_w*CP_w*(pow(((KA*temp )/(RHO_np*D_np)),0.5))*f);
return ktc;
}

DEFINE_PROPERTY(cell_density,cell,thread)
{
real temp,rho_w,rho;
temp = C_T(cell,thread);
rho_w = (-3.570*(pow(10,-3))*(pow(temp,2))+(1.88*temp+753.2));
rho = (FI*RHO_np)+((1-FI)*rho_w);
return rho;
}

DEFINE_PROPERTY(cell_viscosity,cell,thread)
{
real mu,mu_w,temp;
temp = C_T(cell,thread);
mu_w = (2.591*(pow(10,-5))*(pow(10,(238.3/(temp-143.2)))));
mu = (SI_1*exp(SI_2*FI)*mu_w);
return mu;
}

DEFINE_SPECIFIC_HEAT(specificheat, T, Tref, h, yi)
{
real cp,rho_w,rho;
rho_w = (-3.570*(pow(10,-3))*(pow(T,2))+(1.88*T+753.2));
rho = (FI*RHO_np)+((1-FI)*rho_w);
cp = (FI*RHO_np*CP_np)+(((1-FI)*rho_w*CP_w)/rho);
return cp;
}
YASSER1990 likes this.

Last edited by mdakbari; April 18, 2014 at 13:20.
mdakbari 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 specific heat - error tarui23 Fluent UDF and Scheme Programming 0 October 13, 2013 06:30
having problem in writing a UDF for specific heat in fluent 14.0 nands_bullwalker Fluent UDF and Scheme Programming 1 June 29, 2013 10:32
error message cuteapathy CFX 14 March 20, 2012 07:45
How to write udf for specific heat nanoraja ANSYS Meshing & Geometry 1 September 14, 2011 11:34
Constant velocity of the material Sas CFX 15 July 13, 2010 08:56


All times are GMT -4. The time now is 00:12.