CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   viscosity in UDF! (http://www.cfd-online.com/Forums/fluent/44366-viscosity-udf.html)

denhan April 6, 2007 01:12

viscosity in UDF!
 
Recently i have been modelling a stir model, but the material viscosity was related strain rate and temperature, so i use UDF in fluent. i select standard K-E model, but when i start compute ,the fluent will send wrong message: "floating point error", the behaid is my program: #include "udf.h"

#define Q 183890 #define R 8.314 #define RFA 0.0108E-6 #define N 7.7563 #define AA 1.44E+14

DEFINE_PROPERTY(cell_viscosity,cell,thread) {

real e_s;

real z_h;

real stress;

real viscosity;

real mm;

temp = C_T( cell, thread );

e_s = C_STRAIN_RATE_MAG( cell, thread );

z_h = e_s * exp( Q / ( R * TT ) );

mm = pow( z_h/AA, 1/N ) + sqrt( pow( z_h/AA, 2/N) + 1 );

stress = log( mm );

viscosity = stress / ( 3 * e_s * RFA);

return viscosity; }

please help me! thanks



All times are GMT -4. The time now is 13:53.