CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF for Back-flow Temperature (http://www.cfd-online.com/Forums/fluent-udf/122465-udf-back-flow-temperature.html)

G340 August 20, 2013 11:40

UDF for Back-flow Temperature
 
1 Attachment(s)
UDF for Back-flow Temperature
hi
I'm working on a fluent project and I wrote a UDF and after some iterations it have below error :

"temperature limited to 1.000000e+000 in 2203 cells on zone 2 in domain 1

absolute pressure limited to 1.000000e+000 in 659 cells on zone 2

turbulent viscosity limited to viscosity ratio of 1.000000e+005 in 30 cells
663 2.9455e+02 6.5109e-02 1.5233e-01 2.6984e-02 1.8058e-01 7.9374e-01 3.3443e-01 12:18:57 99916

reversed flow in 20 faces on pressure-outlet 7.

reversed flow in 2 faces on pressure-outlet 8.
temperature limited to 1.000000e+000 in 2871 cells on zone 2 in domain 1
temperature limited to 5.000000e+003 in 321 cells on zone 2 in domain 1

absolute pressure limited to 1.000000e+000 in 563 cells on zone 2

turbulent viscosity limited to viscosity ratio of 1.000000e+005 in 209 cells
664 1.0579e+04 1.2639e-01 2.4408e-01 4.8204e-02 7.2285e+01 9.1977e-01 1.0723e+03 15:24:12 99915

reversed flow in 20 faces on pressure-outlet 7.

reversed flow in 7 faces on pressure-outlet 8.
temperature limited to 1.000000e+000 in 3562 cells on zone 2 in domain 1
temperature limited to 5.000000e+003 in 537 cells on zone 2 in domain 1

absolute pressure limited to 1.000000e+000 in 589 cells on zone 2

turbulent viscosity limited to viscosity ratio of 1.000000e+005 in 287 cells
665 1.6978e+04 1.1723e-01 1.2709e-01 6.4955e-02 1.2789e+01 7.9988e-01 1.1797e+00 12:19:21 99914

reversed flow in 20 faces on pressure-outlet 7.

reversed flow in 9 faces on pressure-outlet 8.
temperature limited to 1.000000e+000 in 7932 cells on zone 2 in domain 1
temperature limited to 5.000000e+003 in 13 cells on zone 2 in domain 1

absolute pressure limited to 1.000000e+000 in 231 cells on zone 2

turbulent viscosity limited to viscosity ratio of 1.000000e+005 in 2432 cells
666 3.7511e+04 5.1764e-02 1.3114e-01 1.1729e-01 1.0764e+01 7.9948e-01 3.9790e-01 9:51:28 99913

reversed flow in 20 faces on pressure-outlet 7.

reversed flow in 9 faces on pressure-outlet 8.

Error: divergence detected in AMG solver: temperature
Error Object: ()
"

and that is my udf(Attachment 24613)...i used swirl component in it for total temperature
i don't know how solve this error
anybody can help me??:(

vasava August 21, 2013 03:22

These errors indicate that you have poor mesh quality in some regions. Try refining your mesh and give it a try. Also play little bit with the relaxation factors. Either or both of these tricks could help.

mojtaba7192 August 21, 2013 04:37

i think my udf also is false:

#include"udf.h"
realX; realY;
DEFINE_ADJUST(XY,domain,t)
{
real w=0.0004975;
face_t f; Domain*domain;
Thread*t; cell_tc; intID=20;
thread_loop_f(t,domain)
{
begin_c_loop(c,t) X+=C_R(c,t)*C_U(c,t)*C_VOLUME_2D(c,t)*(C_T(c,t)+w*(C_U(c,t)*C_U(c,t)+C_V(c,t)*C_V(c,t)+C_WSWIRL(c,t)*C_WSWIRL(c,t)));
Y+=C_U(c,t)*C_VOLUME_2D(c,t)*C_R(c,t);
end_c_loop(c,t)
}
}


DEFINE_PROFILE(BackflowTemp,thread,i)
{
real s=0.00000001;
face_tf;
begin_f_loop(f,thread)
{
F_PROFILE(f,thread,i)=(X)/((Y)+s);
}
end_f_loop(f,thread)
}

vasava August 21, 2013 04:56

DEFINE_ADJUST macro has only two arguments and you have three. Also avoid using names such as X, Y as macro names.

Reading this (http://aerojet.engr.ucdavis.edu/flue...udf/node20.htm) might help.


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