CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   UDF for energy source term (http://www.cfd-online.com/Forums/fluent/45488-udf-energy-source-term.html)

Muhammad Aamir Khan July 24, 2007 02:08

UDF for energy source term
 
hello,

i am doing my M.S thesis and i came through the problem that my energy source is function of distance.I wrote a UDF that got compiled and loaded, but it does not give correct results.I think there is some problem with my program.Will any of u please help me handling this problem.Iwill be thankful. The program is given below.

#include "udf.h" DEFINE_SOURCE(energy_source,cell,thread,dS,eqn) { real source; real x[ND_ND]; cell_t c;

C_CENTROID(x,cell,thread)

if (x[0]<= 2.9)

{ source=2012389286.84188+16292985208.2144*x[0]+5818669134.05074*x[0]*x[0]-9845482131.38002*x[0]*x[0]*x[0]; }

else

source =0;

return source;

}

waiting for ur suggestions.


msureshkumar July 25, 2007 02:08

Re: UDF for energy source term
 
you have to include mass source terms in UDF.


All times are GMT -4. The time now is 05:09.