CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   Temperature gradient: Does the C_T_G macro work ? (http://www.cfd-online.com/Forums/fluent/88682-temperature-gradient-does-c_t_g-macro-work.html)

tumbao May 23, 2011 15:59

Temperature gradient: Does the C_T_G macro work ?
 
Hi CFD mates,

I want to compute the temperature gradient in different solid zones of the domain. I found that the macro C_T_G can perform this task but I did not manage to get it working. Fluent always gives the same error: "Segmentation Violation"

Why ? How to solve this issue ?

I have looked here and there on the internet and I found many people who have the same problem, but I couldnt find any solution. Is it possible that there is a problem with the macro C_T_G itselft ?

Here is my code (which is basically the same as in the UDF guide of Fluent):


DEFINE_ON_DEMAND(Temp_grad_ondemand)
{
Domain *d;
cell_t c;
Thread *t;
d = Get_Domain(1);

thread_loop_c(t,d)
{
begin_c_loop(c,t)
{

C_UDMI(c,t,1) = NV_MAG(C_T_G(c,t));

}
end_c_loop(c,t)
}

}

Thanks mates !

johnwinter December 21, 2011 05:55

Hi tumbao,

Did you add header file mem.h in your udf?? and also did you run the text command solve/set/expert??

This will Keep temporary solver memory from being freed?.
Note that when you do this, all of the gradient data is retained, but the calculation requires more memory to run


All times are GMT -4. The time now is 04:25.