CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   UDF Viscosity Depending on Shear Rate (http://www.cfd-online.com/Forums/fluent/75381-udf-viscosity-depending-shear-rate.html)

 mannobot April 23, 2010 10:46

UDF Viscosity Depending on Shear Rate

Hi,

I found a UDF which allows to define viscosity in terms of shear rate and temperature but I am not able to compile.

The UDF:

#include "udf.h"
DEFINE_PROPERTY(cell_viscosity,c,t)
{
real mu_lam;
real shear_rate;
real T = C_T(c,t);
shear_rate = sqrt(0.5*ND_SUM(ND_DOT((C_DUDX(c,t) + C_DUDX(c,t)), (C_DUDY(c,t) + C_DVDX(c,t)), (C_DUDZ(c,t) + C_DWDX(c,t)),\
(C_DUDX(c,t) + C_DUDX(c,t)),\
(C_DUDY(c,t) + C_DVDX(c,t)),\
(C_DUDZ(c,t) + C_DWDX(c,t))),\
ND_DOT((C_DVDX(c,t) + C_DUDY(c,t)), (C_DVDY(c,t) + C_DVDY(c,t)), (C_DVDZ(c,t) + C_DWDY(c,t)),\
(C_DVDX(c,t) + C_DUDY(c,t)),\
(C_DVDY(c,t) + C_DVDY(c,t)),\
(C_DVDZ(c,t) + C_DWDY(c,t))),\
ND_DOT((C_DWDX(c,t) + C_DUDZ(c,t)), (C_DWDY(c,t) + C_DVDZ(c,t)), (C_DWDZ(c,t) + C_DWDZ(c,t)),\
(C_DWDX(c,t) + C_DUDZ(c,t)),\
(C_DWDY(c,t) + C_DVDZ(c,t)),\
(C_DWDZ(c,t) + C_DWDZ(c,t)))));
mu_lam = T+shear_rate;
return mu_lam;
}

I do get the error:

udfname.c(18) : error C2017: Ungltige Escapesequenz