|
[Sponsors] |
May 10, 2017, 14:05 |
Temperature gradient macro
|
#1 |
Member
sebastian bergman
Join Date: Mar 2017
Location: seattle
Posts: 52
Rep Power: 9 |
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" DEFINE_EXECUTE_AT_END(temp_gradient) { Domain *d; Thread *t; cell_t c; d = Get_Domain(1); thread_loop_c(t,d) { 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. |
|
May 10, 2017, 14:26 |
|
#2 |
New Member
Swapnil Chavanda
Join Date: Jan 2017
Location: Pune
Posts: 19
Rep Power: 9 |
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, 14:28 |
|
#3 |
New Member
Swapnil Chavanda
Join Date: Jan 2017
Location: Pune
Posts: 19
Rep Power: 9 |
||
May 10, 2017, 14:29 |
|
#4 |
New Member
Swapnil Chavanda
Join Date: Jan 2017
Location: Pune
Posts: 19
Rep Power: 9 |
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, 06:54 |
|
#5 |
Member
sebastian bergman
Join Date: Mar 2017
Location: seattle
Posts: 52
Rep Power: 9 |
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? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Boussinesq approximation (temperature gradient range) | azizi0407 | FLUENT | 3 | December 11, 2023 13:05 |
Temperature gradient macros on face | qwerty753 | Fluent UDF and Scheme Programming | 6 | July 31, 2016 12:13 |
temperature gradient for use in surface monitor | Catherine | FLUENT | 1 | August 24, 2012 10:10 |
Temperature gradient macro | ameyadurve | FLUENT | 0 | October 3, 2009 09:46 |
Direct calculation of temperature gradient | J.W.Ryu | FLUENT | 5 | December 27, 2001 07:39 |