|
[Sponsors] |
March 11, 2020, 11:25 |
the variable heat flux using UDF
|
#1 |
New Member
Tunisia
Join Date: Mar 2020
Posts: 2
Rep Power: 0 |
someone can help me please
How do I create the variable heat flux with time in axisymmetric two-dimensional model using UDF. thanks |
|
March 11, 2020, 11:32 |
Variation with Time
|
#2 |
Senior Member
|
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. |
|
March 11, 2020, 15:33 |
|
#3 |
New Member
Tunisia
Join Date: Mar 2020
Posts: 2
Rep Power: 0 |
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) } |
|
March 11, 2020, 17:02 |
UDF Code
|
#4 |
Senior Member
|
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. |
|
January 31, 2022, 19:59 |
|
#5 |
New Member
mahdif
Join Date: Jan 2022
Posts: 2
Rep Power: 0 |
thanks a lot
|
|
|
|
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 |