UDF : heat source located in a solid
Hello,
I am an user of FINE/Open. I would like to make a comparison with Fluent. Therefore, I need a little help in Fluent. In my domain, I have a fluid part and a solid part. In the solid, I'd like inserting a localized heat source in function of x, y and z. Is it possible? (and in the definition of the coordinates, it slightly exceeds? eg, due to an imprecise geometry, my xcoordinate exceeds of 1 mm, how Fluent work?) You can help me to construct the udf ? if I have this coordonates for the heat source :  x : x=0 to 0.001  y : y=0 to 0.0015  z : z=0.001 to 0.00012 vol=0.001*0.0015*0.0002; HS=10/vol; thanks a lot ! 
Yes, defining a local heat source via UDF is possible. Here is part of a UDF I used for a similar purpose:
Code:
#include "udf.h" The DEFINE_SOURCE macro used here loops automatically over all cells in the domain. Consequently, the source term is applied cellwise which means it has a conatant value in a cell. I am sure you can work out the exact function using a few ifstatements. x[0] holds the xcoordinate, x[1] the ycoordinate and x[2] the zcoordinate of the cell centroid. Edit: Quote:

Thank you ! The code is correct like this? (indeed, I made little mistake for the z coordinate)
#include "udf.h" DEFINE_SOURCE(sourceterm,c,t,dS,eqn) { real x[ND_ND]; real source; real vol; C_CENTROID(x,c,t); if(x[0]=>0 && x[0]<=0.001 && x[1]=>0 && x[1]<=0.0015 && x[2]=>0.001 && x[2]<=0.0012) { vol=0.001*0.0015*0.0002; source=10/vol; } else { source=0; } return source; } 
Looks fine.

It's strange, I have no warning in the compilation, but the temperature in the solid doesn't increase. An idea?

1 Attachment(s)
Quote:
Simply interpreting the UDF does not acrivate any source terms. Attachment 23889 
Yes yes, I find the error. I was stupid, I made a mistake in one of the coordinates. Thank you for your help !

Quote:

All times are GMT 4. The time now is 11:01. 