|
[Sponsors] |
February 26, 2021, 04:19 |
Fluent UDF - polynomial profile description
|
#1 |
New Member
Mihnea Costin
Join Date: Oct 2019
Posts: 1
Rep Power: 0 |
Good morning everyone. Young and inexperienced Fluent user here.
I am trying to describe a temperature profile for my boundary condition. Please see Image1. Image1.PNG My domain is formed of a nozzle which injects fuel in a coflow domain. Both jet and coflow have their velocities, temperatures, compositions. I want to mention the domain is 3D as I aim to use LES in a later phase. I want to describe a profile for the coflow based on a polynomial. For this I have taken some available experimental data points and have used Matlab to fit a 4th degree polynomial. The function reads: p1t=-4.941e+09; p2t=-4.007e+08; p3t=-1.272e+07; p4t=-1.884e+05; p5t=398.6; yt=p1t*r_exp_T.^4 + p2t*r_exp_T.^3 + p3t*r_exp_T.^2 + p4t*r_exp_T + p5t; Matlab implementation to check the polynomial behaviour on the Fluent extracted coordinates Image4.jpg I have tried implementing the same function in a UDF for Fluent. Image2 shows the UDF function for the coflow. Image2.jpg I have plotted the temperature vs radial coordinate. The profile obtained is flat. I then extracted my radial coordinates and put them in Matlab. The polynomial works fine and gives a good profile for my coordinates. My UDF for describing the profile reads: DEFINE_PROFILE(coflow_T_profile, thread, position) { real xt[ND_ND]; real yt; real zt; real rt; face_t ft; #define p1t -4.941e+09 #define p2t -4.007e+08 #define p3t -1.272e+07 #define p4t -1.884e+05 #define p5t 398.6 begin_f_loop(ft, thread) { F_CENTROID(xt,ft,thread); yt = xt[1]; zt= xt[2]; rt=sqrt(zt*zt+yt*yt); F_PROFILE(ft, thread, position)=p1t*pow(rt,4.)+p2t*pow(rt,3.)+p3t*pow(rt ,2.)+p4t*pow(rt,1.)+p5t; } end_f_loop(ft, thread) } I have tried using pow(rt,4.), pow(rt,4), rt*rt*rt*rt. The polynomial seems unresponsive. I came with the idea to check if it is working at all. So I used an if statement to set a fixed value along the coordinate. It seems to work. but the polynomial is still flat. Image3.jpg Would you be so kind to indicate what I might be doing wrong in my profile definition. Thank you in advance! |
|
Tags |
profile boundary cond., udf code |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Running Fluent from Python: UDF Compilation problems | Ames | Fluent UDF and Scheme Programming | 5 | November 16, 2020 07:12 |
UDF - Inlet Velocity Profile (Ansys Fluent) | vinayak4399 | Fluent UDF and Scheme Programming | 3 | August 25, 2020 15:15 |
Passing udf value to fluent | durg | Fluent UDF and Scheme Programming | 2 | February 11, 2019 13:55 |
Fluent do not use my velocity field(by UDF) to solve energy equation | tangleiplus | Fluent UDF and Scheme Programming | 6 | January 21, 2019 22:28 |
3D UDF Paraboilc Velocity Profile (Can't Maintain) | Sing | FLUENT | 12 | August 7, 2017 07:25 |