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/)
-   -   syntax error while interpreting the UDF (https://www.cfd-online.com/Forums/fluent-udf/120729-syntax-error-while-interpreting-udf.html)

rohit chothave July 13, 2013 06:00

syntax error while interpreting the UDF
 
Hi all.
I am trying to interpret this UDF for density, given below, in ansys 12, linux OS. I am getting syntax error. Can anybody tell me what is the error. Or what is correct program
/************************************************** *******************
UDF for specifying a temperature-dependent density property
************************************************** ********************/
#include "udf.h"

DEFINE_PROPERTY(rho, cell, thread )

{
real rho1;
real t = C_T(cell, thread);

rho1 = 17.836 + 4444.25 * exp(-t/93.77);


return rho1;
}

/************************************************** *******************
UDF for specifying a temperature-dependent specific heat property
************************************************** ********************/
#include "udf.h"

DEFINE_SPECIFIC_HEAT(specificheat,T,Tref,h,yi)

{
real sp1;

sp1 = 2533.8 + ((5.7266 * pow(9,10)) * (exp(-T/37.137)));

*h = sp1 * (T-Tref);


return sp1;
}

blackmask July 13, 2013 06:21

It is not a real syntax error except that
Code:

DEFINE_SPECIFIC_HEAT
is used by compiled udf only.

yashganatra July 13, 2013 11:09

Just use #include "udf.h" once at the top. Refer to other threads in UDF section.

Yash


All times are GMT -4. The time now is 19:34.