|
[Sponsors] |
October 30, 2020, 13:59 |
UDF for heat flux in a wall
|
#1 |
Member
Francesco
Join Date: Apr 2020
Posts: 56
Rep Power: 6 |
Hi everybody,
i have a cubic solid element in Fluent. This element is at an initial temperature of 600K. In one of the 6 face of the cube i have to apply a UDF which withdraw heat time by time, depending on the temperature of the face of the cube itself. Is there a way to write that kind of UDF? If yes, how can i do it? |
|
November 2, 2020, 00:22 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
Ansys FLuent Customization manual, look for DEFINE_PROFILE macro
__________________
best regards ****************************** press LIKE if this message was helpful |
|
November 2, 2020, 05:58 |
|
#3 |
Member
Francesco
Join Date: Apr 2020
Posts: 56
Rep Power: 6 |
Thank you AlexanderZ for the fast reply.
I would appreciate if you post here an example of heat flux UDF. I didn't find in the customization manual any specific example for heat flux. I tried to do that by the following UDF: Code:
#include "udf.h" DEFINE_PROFILE(wallheatflux, t, i) { real ctime = CURRENT_TIME; face_t f; real hflux = 0.; begin_f_loop(f, t) { if (F_T(f, t) > 373.) hflux = -10000; else hflux = -5000; F_PROFILE(f, t, i) = hflux; } end_f_loop(f, t) } Since i don't have yet the real dimensions of the problem i just write a random value for the heat flux. My question is: if i would have the real values for the heat flux, will it run? |
|
November 2, 2020, 06:14 |
|
#4 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Why don't you just test it??? It takes one minute to test it... Why would you put it here and make other people think about whether it would run or not, when you can just put it in your computer and make sure if it runs?
|
|
November 2, 2020, 06:57 |
|
#5 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
I agree here with Pakk, you do better try to run it next time
but this code is correct
__________________
best regards ****************************** press LIKE if this message was helpful |
|
November 2, 2020, 11:05 |
|
#6 |
Member
Francesco
Join Date: Apr 2020
Posts: 56
Rep Power: 6 |
I'm sorry, it was not my intention to be a loss of time.
I tried the code before asking the question and it gave me bad results, so i just wanted to understand whether the problem is about either the dimension of the HF or the code for the udf. AlexanderZ answered to my question. Anyway thank you both |
|
November 2, 2020, 14:29 |
|
#7 | |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Quote:
Anyway: the fact that you had already tried your code and got bad results is very relevant information, that you probably should have added when you asked the question. |
||
November 2, 2020, 15:38 |
|
#8 |
Member
Francesco
Join Date: Apr 2020
Posts: 56
Rep Power: 6 |
next time i'll do it, thank for suggestions Pakk
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Natural convection in a closed domain STILL NEEDING help! | Yr0gErG | FLUENT | 4 | December 2, 2019 01:04 |
UDF to Access Wall Normal Concentration Gradient | Daniel Tanner | Fluent UDF and Scheme Programming | 4 | February 18, 2015 15:35 |
Heat Flux Wall Boundary Confusion. | Joee | FLUENT | 1 | August 21, 2010 13:20 |
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug | unoder | OpenFOAM Installation | 11 | January 30, 2008 21:30 |
wall conduction, UDF | sudh | FLUENT | 0 | June 28, 2004 09:09 |