CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

UDF for heat flux in a wall

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By AlexanderZ
  • 1 Post By AlexanderZ
  • 1 Post By pakk

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 30, 2020, 12:59
Default UDF for heat flux in a wall
  #1
Member
 
Francesco
Join Date: Apr 2020
Posts: 56
Rep Power: 6
franc1 is on a distinguished road
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?
franc1 is offline   Reply With Quote

Old   November 1, 2020, 23:22
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Ansys FLuent Customization manual, look for DEFINE_PROFILE macro
franc1 likes this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   November 2, 2020, 04:58
Default
  #3
Member
 
Francesco
Join Date: Apr 2020
Posts: 56
Rep Power: 6
franc1 is on a distinguished road
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)
}
It is just a first attempt udf, in which i have variable negative heat flux with the threshold temperature of 373K.
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?
franc1 is offline   Reply With Quote

Old   November 2, 2020, 05:14
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
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?
pakk is offline   Reply With Quote

Old   November 2, 2020, 05:57
Default
  #5
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
I agree here with Pakk, you do better try to run it next time

but this code is correct
franc1 likes this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   November 2, 2020, 10:05
Default
  #6
Member
 
Francesco
Join Date: Apr 2020
Posts: 56
Rep Power: 6
franc1 is on a distinguished road
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
franc1 is offline   Reply With Quote

Old   November 2, 2020, 13:29
Default
  #7
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Quote:
Originally Posted by franc1 View Post
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
I was not concerned with you wasting our time, but with you wasting your own time.

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.
franc1 likes this.
pakk is offline   Reply With Quote

Old   November 2, 2020, 14:38
Default
  #8
Member
 
Francesco
Join Date: Apr 2020
Posts: 56
Rep Power: 6
franc1 is on a distinguished road
next time i'll do it, thank for suggestions Pakk
franc1 is offline   Reply With Quote

Reply


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Natural convection in a closed domain STILL NEEDING help! Yr0gErG FLUENT 4 December 2, 2019 00:04
UDF to Access Wall Normal Concentration Gradient Daniel Tanner Fluent UDF and Scheme Programming 4 February 18, 2015 14:35
Heat Flux Wall Boundary Confusion. Joee FLUENT 1 August 21, 2010 12:20
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug unoder OpenFOAM Installation 11 January 30, 2008 20:30
wall conduction, UDF sudh FLUENT 0 June 28, 2004 08:09


All times are GMT -4. The time now is 20:31.