CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   UDF for inlet velocity alongwith UDF for properties (https://www.cfd-online.com/Forums/fluent/198281-udf-inlet-velocity-alongwith-udf-properties.html)

akshayy224 February 1, 2018 09:17

UDF for inlet velocity alongwith UDF for properties
 
Hello,
I want to use velocity UDF alongwith UDF for temperature dependent thermal conductivity and viscosity. For that I've created following UDF:

/* UDF for specifying inlet velocity , nanofluid thermal conductivity and viscosity */

#include "udf.h"
#define Br 0.1
DEFINE_PROPERTY(cell_conductivity,cell,thread)
{
real ktc;
real temp = C_T(cell,thread);
ktc=0.6+38.82*(pow(temp,1.2321));
return ktc;
}

DEFINE_PROPERTY(cell_viscosity,cell,thread)
{
real mu;
real temp = C_T(cell,thread);
mu=-0.155-2.1754*0.01*(pow(temp,-2));
return mu;
}

DEFINE_PROFILE(inlet_x_velocity,thread,position)
{
face_t f;
real temp = C_T(cell,thread);

begin_f_loop(f,thread)
{
F_PROFILE(f,thread,position) = pow(0.5035*Br*(pow(-0.155-2.1754*0.01*(pow(temp,-2)),-1)),0.5);
}
end_f_loop(f,thread)
}

It is showing an Error: line 24:cell: undeclared variable i.e. in real temp = C_T(cell,thread);
I'm new in writing UDF and so I can't understand what FLUENT is indicating.
I'd be grateful if someone help me by rectifying it.
Thanks


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