|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
Jahangir
Join Date: Aug 2017
Posts: 13
Rep Power: 9 ![]() |
I am simulating a 2D axisymetrical combustor. I have a boundary condition on the wall of the combustor for temperature, which is varying with length . the length (Y) of the combustor wall is 2.4 metres and temperature is in K.
please see the temperature variation in the attachment. Can someone help me define these boundary conditions in ANSYS Fluent, either through GUI or through UDF. Thanks |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Member
annan
Join Date: Nov 2016
Posts: 72
Rep Power: 9 ![]() |
Hello
You can try to compile the following udf, I wrote quickly and didn't have time to verify it works. But basically, your UDF should look like this one. Once you compiled it in Fluent, go to your boundary conditions panel, select the velocity inlet boundary you want to change, and set the velocity (x,y or z depending on your case) to udf inlet_velocity. Hope this will help. Good luck #include "udf.h" DEFINE_PROFILE(inlet_velocity, thread, position) { real x[ND_ND]; /* this will hold the position vector */ real y; face_t f; begin_f_loop(f, thread) { F_CENTROID(x,f,thread); y = x[1]; if (y>0 & y<=0.046) { F_PROFILE(f, thread, position) = 925; } else if (y>0.046 & y<=0.553) { F_PROFILE(f, thread, position) = 358.88*y^2-54.615*y+925.6; } else if (y>0.553 & y<=1.4) { F_PROFILE(f, thread, position) = -567.89*y^2+1115.1*y+564.02; } else { F_PROFILE(f, thread, position) = 953; } } end_f_loop(f, thread) } |
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
Jahangir
Join Date: Aug 2017
Posts: 13
Rep Power: 9 ![]() |
Thanks Annan for your help. I just want to clarify one thing, in your post you suggested to select inlet velocity.
Since I want to vary the wall temperature, should I go in the boundary condition panel and select wall and set the temperature in the thermal setting using new input parameter. Your input will be highly appreciated. |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Member
annan
Join Date: Nov 2016
Posts: 72
Rep Power: 9 ![]() |
My bad sorry, I thought it was a velocity inlet condition. In your case, you should implement it in "Boundary conditions => select your boundary => wall => thermal => select temperature" and then try to specify it as the UDF.
|
|
![]() |
![]() |
![]() |
![]() |
#5 |
New Member
Jahangir
Join Date: Aug 2017
Posts: 13
Rep Power: 9 ![]() |
Thank for your help. Just a quick question, in the UDF, what should i replace inlet_velocity with in the DEFINE_PROFILE(inlet_velocity, thread, position)
Should it be temperature or wall_temperature Your input will be highly appreciated. |
|
![]() |
![]() |
![]() |
![]() |
#6 |
Member
annan
Join Date: Nov 2016
Posts: 72
Rep Power: 9 ![]() |
That is just the name of the udf so that you can recognize it in Fluent GUI. You can put whatever you want, it doesn’t really matter. Therefore, you may put temperature or wall_temperature, it’s really just a name.
|
|
![]() |
![]() |
![]() |
![]() |
#7 |
New Member
Jahangir
Join Date: Aug 2017
Posts: 13
Rep Power: 9 ![]() |
I have interpreted the file and i get the following error
line 16: invalid type for integral binary expression: double ^ double. Line 16 in this case is { F_PROFILE(f, thread, position) = 358.88*y^2-54.615*y+925.6; } Any suggestions how I can fix the error. Should I replace y^2 with y*y ? |
|
![]() |
![]() |
![]() |
![]() |
#8 |
Member
annan
Join Date: Nov 2016
Posts: 72
Rep Power: 9 ![]() |
Yes either put y*y or replace y^2 by pow(y,2)
|
|
![]() |
![]() |
![]() |
![]() |
#9 |
New Member
Jahangir
Join Date: Aug 2017
Posts: 13
Rep Power: 9 ![]() |
Now, I want to apply the same boundary condition for a horizontal combustor, where the wall boundary condition changes in the x-axis instead of y.
Should I swap the x and y in the udf ? Or do i need some additional changes ? Please, see the attachment for more clarity. |
|
![]() |
![]() |
![]() |
![]() |
#10 |
Member
annan
Join Date: Nov 2016
Posts: 72
Rep Power: 9 ![]() |
In the udf I’ve written, x[ND_ND] is your domain. x[0] is the x-axis and x[1] is the y-axis. If you want to apply the same udf on a horizontal boundary, you just need to set y=x[0], which means that your condition statements will be set for x values.
Hope I was clear and that it will help Let me know if you need more details |
|
![]() |
![]() |
![]() |
![]() |
#11 |
New Member
Jahangir
Join Date: Aug 2017
Posts: 13
Rep Power: 9 ![]() |
Thanks alot. I really appreciate your help. it worked without any problem
|
|
![]() |
![]() |
![]() |
![]() |
#12 |
Member
annan
Join Date: Nov 2016
Posts: 72
Rep Power: 9 ![]() |
My pleasure
Good luck |
|
![]() |
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Radiation in semi-transparent media with surface-to-surface model? | mpeppels | CFX | 11 | August 22, 2019 07:30 |
Basic Nozzle-Expander Design | karmavatar | CFX | 20 | March 20, 2016 08:44 |
Low torque values on Screw Turbine | Shaun Waters | CFX | 34 | July 23, 2015 08:16 |
natural convection | mehrdadeng | CFX | 10 | February 25, 2011 05:25 |
Variable temperature wall boundary condition | Virginie | FLUENT | 2 | October 2, 2007 09:23 |