|
[Sponsors] |
How to define a wall heat flux changing with flow time in udf? Such as: t<0.3, heat f |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 12, 2020, 01:06 |
How to define a wall heat flux changing with flow time in udf? Such as: t<0.3, heat f
|
#1 |
Senior Member
Join Date: Dec 2017
Posts: 388
Rep Power: 9 |
How to define a wall heat flux changing with flow time in udf? Such as:
t<0.3, heat flux =10w/m^2; t>=0.3,heat flux =1000w/m^2; Other than udf, could we use an expression to solve this problem in fluent? |
|
July 13, 2020, 02:18 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
you can use profile or expression.
look for profile on this forum
__________________
best regards ****************************** press LIKE if this message was helpful |
|
July 13, 2020, 12:05 |
Would you please share me the codes for me? Thank you so much.
|
#3 |
Senior Member
Join Date: Dec 2017
Posts: 388
Rep Power: 9 |
||
July 13, 2020, 20:11 |
|
#4 | |
New Member
Siddharth
Join Date: Nov 2016
Posts: 11
Rep Power: 10 |
Quote:
Code:
#include "udf.h" DEFINE_PROFILE(hf_change,thread,position) { face_t f; real time,heat_flux1,heat_flux2; heat_flux1 = 10; heat_flux2 = 100; time=CURRENT_TIME; begin_f_loop(f,thread) { if (time<0.3) { F_PROFILE(f,thread,position)=heat_flux1; } else if (time>=0.3) { F_PROFILE(f,thread,position)=heat_flux2; } } end_f_loop(f,thread) } |
||
July 14, 2020, 19:39 |
Is this code right? If yes, what is the difference?
|
#5 |
Senior Member
Join Date: Dec 2017
Posts: 388
Rep Power: 9 |
Is this code right? If yes, what is the difference?
#include "udf.h" DEFINE_PROFILE(wall_heatflux, thread, position) { real t,q; face_t f; begin_f_loop(f, thread) { t=RP_Get_Real("flow-time"); { if (t>0 && t<=0.50) { q=0; } else if (t>=0.5) { q=47300; } } F_PROFILE(f,thread,position)=q; } end_f_loop(f,thread) } |
|
July 14, 2020, 20:25 |
|
#6 | |
New Member
Siddharth
Join Date: Nov 2016
Posts: 11
Rep Power: 10 |
Quote:
Code:
#include "udf.h" DEFINE_PROFILE(wall_heatflux,thread,position) { real t,q; face_t f; t=RP_Get_Real("flow-time"); /* CURRENT_TIME & RP_Get_Real("flow-time") both return same value*/ if ((t>0) && (t<=0.50)) /* both condition must closed with parentheses ((condition1) && (condition1) && ..... && (conditionN)) */ { q=0; } else if (t>=0.5) { q=47300; } begin_f_loop(f,thread) { F_PROFILE(f,thread,position) = q; } end_f_loop(f,thread) } |
||
July 15, 2020, 02:42 |
|
#7 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
codes are almost same
but in your last code Code:
t=RP_Get_Real("flow-time"); usually, you want to get time value from outside of the loop.
__________________
best regards ****************************** press LIKE if this message was helpful |
|
July 16, 2020, 22:09 |
|
#8 | |
New Member
Siddharth
Join Date: Nov 2016
Posts: 11
Rep Power: 10 |
Quote:
t=RP_Get_Real("flow-time"); each time the flow time will be updated even though the "t" outside of the loop. |
||
July 17, 2020, 00:37 |
In your giving code, you do not have the "begin loop"
|
#9 | |
Senior Member
Join Date: Dec 2017
Posts: 388
Rep Power: 9 |
Quote:
#include "udf.h" DEFINE_PROFILE(wall_heatflux,thread,position) { real t,q; face_t f; t=RP_Get_Real("flow-time"); /* CURRENT_TIME & RP_Get_Real("flow-time") both return same value*/ if ((t>0) && (t<=0.50)) /* both condition must closed with parentheses ((condition1) && (condition1) && ..... && (conditionN)) */ { q=0; } else if (t>=0.5) { q=47300; } begin_f_loop(f,thread) { F_PROFILE(f,thread,position) = q; } end_f_loop(f,thread) } |
||
July 17, 2020, 00:41 |
You mean the “time=CURRENT_TIME;” and “t=RP_Get_Real("flow-time")” have the same func
|
#10 |
Senior Member
Join Date: Dec 2017
Posts: 388
Rep Power: 9 |
You mean the “time=CURRENT_TIME;” and “t=RP_Get_Real("flow-time")” have the same function?
|
|
July 17, 2020, 01:33 |
|
#11 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
read Ansys Fluent Customization manual carefully,
it has good examples inside all your questions as of now are covered there
__________________
best regards ****************************** press LIKE if this message was helpful |
|
July 17, 2020, 10:23 |
|
#12 | |
New Member
Siddharth
Join Date: Nov 2016
Posts: 11
Rep Power: 10 |
Quote:
Refer the link below. For more detail. https://www.afs.enea.it/project/nept...df/node112.htm |
||
July 17, 2020, 14:28 |
Hi, because I am not familar with C language,it is hard for me to understand, do you
|
#13 |
Senior Member
Join Date: Dec 2017
Posts: 388
Rep Power: 9 |
Hi, because I am not familar with C language,it is hard for me to understand, do you have any better material (such as vedio)to learn it , thank you.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Changing Wall Heat Flux in CFX-Pre Doesn't Change Wall Heat Transfer Coef in CFD-Post | Shomaz ul Haq | CFX | 26 | October 16, 2019 18:59 |
Centrifugal fan-reverse flow in outlet lesds to a mass in flow field | xiexing | CFX | 3 | March 29, 2017 11:00 |
Error - Solar absorber - Solar Thermal Radiation | MichaelK | CFX | 12 | September 1, 2016 06:15 |
Basic Nozzle-Expander Design | karmavatar | CFX | 20 | March 20, 2016 09:44 |
Micro Scale Pore, icoFoam | gooya_kabir | OpenFOAM Running, Solving & CFD | 2 | November 2, 2013 14:58 |