Register Blogs Members List Search Today's Posts Mark Forums Read

May 10, 2017, 13:05
#1
Member

sebastian bergman
Join Date: Mar 2017
Location: seattle
Posts: 52
Rep Power: 2
I wanted to calculate temperature gradient. It can be obtained by macro C_T_G(c,t). I wrote a simple udf to save the Gradient magnitude in UDM.

include "udf.h"

{
Domain *d;

cell_t c;

d = Get_Domain(1);

{
begin_c_loop(c,t)
{
C_UDMI(c,t,0) = (C_T_G(c,t)[0]);

C_UDMI(c,t,1) = (C_T(c,t)-C_T(c-1,t))/0.00025;
}
end_c_loop(c,t)
}

}

But I do not know the gradient value is correct. The regions where temperature is constant should have zero gradient value but in result there is some finite value. Attached herewith the images. Can someone take a look at them and comment?

Thanking you in anticipation.
Attached Images
 temperature.jpg (137.3 KB, 34 views) temperature gradient.jpg (132.5 KB, 35 views)

 May 10, 2017, 13:26 #2 New Member   Swapnil Chavanda Join Date: Jan 2017 Posts: 19 Rep Power: 2 Hello Tushar_Telmasre You use command define on DEFINE_ON_DEMAND First define Temperature gradient by real value Define definition Temperature_gradient=C_T_G(c,t) C_UDMI(c,t,1)=C_T_G(c,t) Sent from my Moto G (4) using CFD Online Forum mobile app

 May 10, 2017, 13:28 #3 New Member   Swapnil Chavanda Join Date: Jan 2017 Posts: 19 Rep Power: 2 I am facing the same Sent from my Moto G (4) using CFD Online Forum mobile app

 May 10, 2017, 13:29 #4 New Member   Swapnil Chavanda Join Date: Jan 2017 Posts: 19 Rep Power: 2 If you have any idea rather than this please send me Sent from my Moto G (4) using CFD Online Forum mobile app

 May 11, 2017, 05:54 #5 Member   sebastian bergman Join Date: Mar 2017 Location: seattle Posts: 52 Rep Power: 2 hi swapnil, I use EXECUTE_AT_END macro so that solver automatically calculates the gradient value at the end of the time step. Further I formulated a similar problem in comsol and calculated the gradient. As expected the gradient value was zero where there was no change in temperature. now I am thinking about calculating the gradient value myself using C_T(c,t) macro but for gradient I would need the values OF TEMPERATURE at surrounding nodes and I don't know how to do that. have you any idea?

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post azizi0407 FLUENT 2 December 13, 2016 04:18 qwerty753 Fluent UDF and Scheme Programming 6 July 31, 2016 11:13 Catherine FLUENT 1 August 24, 2012 09:10 ameyadurve FLUENT 0 October 3, 2009 08:46 J.W.Ryu FLUENT 5 December 27, 2001 07:39

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