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/)
-   -   use of pointers in specific heat udf (https://www.cfd-online.com/Forums/fluent-udf/133678-use-pointers-specific-heat-udf.html)

mdakbari April 18, 2014 11:37

use of pointers in specific heat udf
 
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;
}


All times are GMT -4. The time now is 05:32.