CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

Fluent UDF - polynomial profile description

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 26, 2021, 03:19
Question Fluent UDF - polynomial profile description
  #1
New Member
 
Mihnea Costin
Join Date: Oct 2019
Posts: 1
Rep Power: 0
mihnea333 is on a distinguished road
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!
mihnea333 is offline   Reply With Quote

Reply

Tags
profile boundary cond., udf code

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
Running Fluent from Python: UDF Compilation problems Ames Fluent UDF and Scheme Programming 5 November 16, 2020 06:12
UDF - Inlet Velocity Profile (Ansys Fluent) vinayak4399 Fluent UDF and Scheme Programming 3 August 25, 2020 14:15
Passing udf value to fluent durg Fluent UDF and Scheme Programming 2 February 11, 2019 12:55
Fluent do not use my velocity field(by UDF) to solve energy equation tangleiplus Fluent UDF and Scheme Programming 6 January 21, 2019 21:28
3D UDF Paraboilc Velocity Profile (Can't Maintain) Sing FLUENT 12 August 7, 2017 06:25


All times are GMT -4. The time now is 10:35.