|
[Sponsors] |
January 16, 2013, 07:40 |
UDF 2D inlet profile
|
#1 |
Member
Thomas Hoffmann
Join Date: Oct 2012
Posts: 67
Rep Power: 14 |
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) } |
|
January 16, 2013, 09:40 |
|
#2 |
Member
Thomas Hoffmann
Join Date: Oct 2012
Posts: 67
Rep Power: 14 |
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)...
|
|
January 17, 2013, 03:47 |
|
#3 |
Senior Member
Max
Join Date: Mar 2009
Posts: 133
Rep Power: 17 |
a more elegant way for x^y: pow(x,y)
cheers |
|
January 17, 2013, 04:38 |
|
#4 |
Member
Thomas Hoffmann
Join Date: Oct 2012
Posts: 67
Rep Power: 14 |
I have never worked with C code before, but thanks for the input
|
|
|
|
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 |