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 Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 11, 2020, 10: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, 10:32
Default Variation with Time
  #2
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 1,305
Blog Entries: 1
Rep Power: 21
vinerm is on a distinguished road
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 on the Forum
vinerm is offline   Reply With Quote

Old   March 11, 2020, 14: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, 16:02
Default UDF Code
  #4
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 1,305
Blog Entries: 1
Rep Power: 21
vinerm is on a distinguished road
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 on the Forum
vinerm is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 21:55
variable heat flux as boundary conditions at a trapezoidal receiver in a CSP plant Louiza RBH Main CFD Forum 2 September 29, 2016 07:43
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 06:28
UDF for Heat Exchanger model francois louw FLUENT 2 July 16, 2010 02:21
Heat flux UDF problem Paul FLUENT 1 September 11, 2003 06:13


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