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

Udf --define_profile

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 22, 2012, 05:19
Default Udf --define_profile
  #1
Member
 
sagila
Join Date: May 2012
Posts: 39
Rep Power: 13
sagila is on a distinguished road
Dear all,
I want to define these F_PROFILEs for different Zs.

Z
F_PROFILE
0.0000 <= z < 0.0755
(z - 63.9902)/(-0.2162)
0.0755 <= z < 0.7327
(z + 195.4362)/(0.6614)
0.7327 <= z < 1.3900
(z + 333.8888)/(1.1283)
1.3900 <= z < 2.0382
(z + 377.9390)/(1.2765)
2.0382 <= z < 2.6775
(z - 2114.1705)/(-7.0954)
2.6775 <= z <= 2.7500
(z + 10.9611)/(0.0458)


And, I have writen the UDF file as follows. But, when I check it in FLUENT, it does not work correctly. Could you please help me?


#include "udf.h"
DEFINE_PROFILE(temp_profile,t,i)
{
real x[ND_ND];
face_t f;
begin_f_loop (f,t)
{
F_CENTROID(x,f,t);
if (0.0000 <= x[2] < 0.0755)
F_PROFILE(f,t,i) = (x[2] - 63.9902)/(-0.2162);
else if (0.0755 <= x[2] < 0.7327)
F_PROFILE(f,t,i) = (x[2] + 195.4362)/(0.6614);
else if (0.7327 <= x[2] < 1.3900)
F_PROFILE(f,t,i) = (x[2] + 333.8888)/(1.1283);
else if (1.3900 <= x[2] < 2.0382)
F_PROFILE(f,t,i) = (x[2] + 377.9390)/(1.2765);
else if (2.0382 <= x[2] < 2.6775)
F_PROFILE(f,t,i) = (x[2] - 2114.1705)/(-7.0954);
else
F_PROFILE(f,t,i) = (x[2] + 10.9611)/(0.0458);
}
end_f_loop(f,t)
}



Thanks in advance.
Best,
sagila is offline   Reply With Quote

Old   July 22, 2012, 08:29
Default
  #2
Member
 
sagila
Join Date: May 2012
Posts: 39
Rep Power: 13
sagila is on a distinguished road
Hi all,
I would appreciate if anyone could help me.
Thanks.
sagila is offline   Reply With Quote

Old   July 22, 2012, 08:48
Default
  #3
New Member
 
Patrick
Join Date: Apr 2012
Posts: 28
Rep Power: 14
Patrick1 is on a distinguished road
Quote:
Originally Posted by sagila View Post
Dear all,
I want to define these F_PROFILEs for different Zs. And, I have writen the UDF file as follows. But, when I check it in FLUENT, it does not work correctly. Could you please help me?


#include "udf.h"
DEFINE_PROFILE(temp_profile,t,i)
{
real x[ND_ND];
face_t f;
begin_f_loop (f,t)
{
F_CENTROID(x,f,t);
if (0.0000 <= x[2] < 0.0755)
F_PROFILE(f,t,i) = (x[2] - 63.9902)/(-0.2162);
else if (0.0755 <= x[2] < 0.7327)
..........
F_PROFILE(f,t,i) = (x[2] + 10.9611)/(0.0458);
}
end_f_loop(f,t)
}



Thanks in advance.
Best,
OnE problem is that you haven't properly defined the conditional AND statement, I think it should be:

else if (0.0755 <= x[2] && x[2]< 0.7327)
Patrick1 is offline   Reply With Quote

Old   July 22, 2012, 11:41
Default
  #4
Member
 
sagila
Join Date: May 2012
Posts: 39
Rep Power: 13
sagila is on a distinguished road
Hi Patrick,
Thank you very much for your help. I corrected my UDF file as you told me and it works now
sagila is offline   Reply With Quote

Reply


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
Dynamic Mesh UDF Qureshi FLUENT 7 March 23, 2017 07:37
Source Term UDF VS Porous Media Model pchoopanya Fluent UDF and Scheme Programming 1 August 28, 2013 06:12
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 21:38
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 04:01


All times are GMT -4. The time now is 20:37.