/***********************************************************************/
/* viscosity.c */
/* UDF for specifying a temperature-dependent viscosity property */
/***********************************************************************/
#include "udf.h"
#include "math.h"
DEFINE_PROPERTY(cell_viscosity, cell, thread)
{
real mu;
real temp;
temp= C_T(cell, thread);
if (temp >=540 && temp<670)
mu=-6.26542E-13*pow(temp,4)+1.37963E-9*pow(temp,3)-1.12934E-6*pow(temp,2)+4.
0331E-4*temp-0.05139;
else if (temp >=670 && temp<=720)
mu=-8.9484E-11*pow(temp,4)+2.49246E-7*pow(temp,3)-2.60191E-4*pow(temp,2)+0.
12064*temp-20.96297;
else
mu=3.05888E-14*pow(temp,4)-1.11035E-10*pow(temp,3)+1.50831E-7*pow(temp,
2)-9.0531E-5*temp+0.02054;
return mu;
}
DEFINE_PROPERTY(cell_ktc, cell, thread)
{
real ktc;
real temp;
temp= C_T(cell, thread);
if (temp >=540 && temp<650)
ktc=-2.27855E-10*pow(temp,4)+5.12332E-7*pow(temp,3)-4.37236E-4*pow(temp,2)+0.
16643*temp-23.04113;
else if (temp >=650 && temp<700)
ktc=5.60049E-8*pow(temp,4)-1.51738E-4*pow(temp,3)+0.15408*pow(temp,2)-69.5027
4*temp+11751.89412;
else if (temp >=700 && temp<850)
ktc=1.01777E-9*pow(temp,4)-3.24317E-6*pow(temp,3)+0.00387*pow(temp,2)-2.05748
*temp+409.82069;
else
ktc=3.53259E-12*pow(temp,4)-1.42586E-8*pow(temp,3)+2.17375E-5*pow(temp,
2)-0.01474*temp+3.85046;
return ktc;
}
DEFINE_PROPERTY(cell_density, cell, thread)
{
real rho;
评论5