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

the variable heat flux using UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 11, 2020, 11:25
Unhappy the variable heat flux using UDF
  #1
New Member
 
Tunisia
Join Date: Mar 2020
Posts: 2
Rep Power: 0
Sarra is on a distinguished road
someone can help me please
How do I create the variable heat flux with time in axisymmetric two-dimensional model using UDF.
thanks
Sarra is offline   Reply With Quote

Old   March 11, 2020, 11:32
Default Variation with Time
  #2
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
If the variation is only with time, you do not require a UDF. You can use a profile as follows

((varHeatFlux transient 3 0)
(time
0
1
2.2
)
(hf
234.23
21.34
893.2
))

varHeatFlux and hf are variable names and you can use whatever names you want. transient is a keyword and should be used as it is. 3 is number of points. 0 refers to periodicity. For a time periodic profile, use 1. Rest are data points in SI. Save this with an extension .prof and then read using File > Read > Profile. Hook it on any boundary or cell zone for anything. Fluent will use the numbers as the field where the hooking is done, i.e., if hooked to heat flux then the numbers represent W/sq.m., if hooked at temperature, then numbers represent K, etc. Do note that time should be in ascending order. For time values in between given time values, Fluent uses linear interpolation.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   March 11, 2020, 15:33
Unhappy
  #3
New Member
 
Tunisia
Join Date: Mar 2020
Posts: 2
Rep Power: 0
Sarra is on a distinguished road
Someone can help me please
How to create the variable heat flux using UDF in axisymmetric two-dimensional model

Q(t)=-0.003∙t^3+0.2245∙t^2-22.138∙t+5000

#include "udf.h"

DEFINE_PROFILE(ramp_heat,thread,position)

{

float t,heat;

face_t f;

t=RP_Get_Real("flow-time");

heat=(((-0.003)*(t*t*t))+((0.2245)*(t*t))-22.138*(t)+5000);

begin_f_loop(f,thread)

{

F_PROFILE(f,thread,position) =heat;

}

end_f_loop(f,thread)

}
Sarra is offline   Reply With Quote

Old   March 11, 2020, 17:02
Default UDF Code
  #4
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
As you might observe, same value is being applied on each face. Therefore, a UDF is an overkill for this work. Yet, the code you have written is alright and should work.

For power, C provides a function called pow and it is used with two arguments, e.g., pow(t,3) implies (t*t*t). Secondly, Fluent provides C variable CURRENT_TIME that provides value of current simulation time. So, no need to use RP call. RP call is much more time consuming than a C based call.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   January 31, 2022, 19:59
Default
  #5
New Member
 
mahdif
Join Date: Jan 2022
Posts: 2
Rep Power: 0
mahdi fa is on a distinguished road
thanks a lot
mahdi fa 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
Define_profile UDF for Transient Heat flux boundary condition Amoljoshi Fluent UDF and Scheme Programming 2 June 20, 2018 22:55
variable heat flux as boundary conditions at a trapezoidal receiver in a CSP plant Louiza RBH COMSOL 2 September 29, 2016 08:43
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 07:28
UDF for Heat Exchanger model francois louw FLUENT 2 July 16, 2010 03:21
Heat flux UDF problem Paul FLUENT 1 September 11, 2003 07:13


All times are GMT -4. The time now is 19:58.