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

UDF 2D inlet profile

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 16, 2013, 07:40
Default UDF 2D inlet profile
  #1
Member
 
Thomas Hoffmann
Join Date: Oct 2012
Posts: 67
Rep Power: 14
Thomashoffmann is on a distinguished road
Hi all.

I'm up to write a UDF inlet profile. The inlet profile should be given by:
v=0.001474*(1-(r/R)^3).

By studying other examples I've come to the code shown here below. But I get an error in line 11 'no function prototype', when I try to interpret it. Can anybody help?
Thanks

__________________
#include "udf.h"
DEFINE_PROFILE(inlet_velocity_x, t, i)
{
real x[ND_ND]; /* this will hold the position vector*/
real y;
face_t f;
begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
y=x[1]
F_PROFILE(f,t,i) = 0.001474*(1-((0.024-y)/0.024)^3)
}
end_f_loop(f,t)
}
Thomashoffmann is offline   Reply With Quote

Old   January 16, 2013, 09:40
Default
  #2
Member
 
Thomas Hoffmann
Join Date: Oct 2012
Posts: 67
Rep Power: 14
Thomashoffmann is on a distinguished road
Ok, I figured it out... I forgot the semicolons in line 10 and 11, and for some reason it is not allowed to use '^3', so I just wrote: ((0.024-y)/0.024)*((0.024-y)/0.024)*((0.024-y)/0.024)...
Thomashoffmann is offline   Reply With Quote

Old   January 17, 2013, 03:47
Default
  #3
Senior Member
 
Max
Join Date: Mar 2009
Posts: 133
Rep Power: 17
coglione is on a distinguished road
a more elegant way for x^y: pow(x,y)

cheers
coglione is offline   Reply With Quote

Old   January 17, 2013, 04:38
Default
  #4
Member
 
Thomas Hoffmann
Join Date: Oct 2012
Posts: 67
Rep Power: 14
Thomashoffmann is on a distinguished road
I have never worked with C code before, but thanks for the input
Thomashoffmann 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
(ask) how to create UDF for inlet velocity profile sincity Fluent UDF and Scheme Programming 83 May 16, 2022 14:04
Please Help! Temperature profile UDF for 3D geometry subhankar_bhandari FLUENT 2 April 16, 2011 06:30
Help please! UDF for Temperature profile in 3D subhankar_bhandari Fluent UDF and Scheme Programming 2 August 16, 2010 09:37
UDF parse error at profile function line Wiggy Fluent UDF and Scheme Programming 1 July 27, 2009 16:59
Urgent! Help on UDF to set inlet velocity Ray Hong FLUENT 4 December 30, 2005 13:32


All times are GMT -4. The time now is 07:03.