|
[Sponsors] |
November 18, 2011, 15:00 |
Help with UDF
|
#1 |
Member
Billy
Join Date: Jan 2011
Posts: 31
Rep Power: 15 |
Hi
This is my first UDF and I keep getting a undeclared variable on line 13. Any help would be appreciated. Thanks Will #include "udf.h" DEFINE_PROFILE(inlet_y_velocity, thread, index) { real x[ND_ND], y; real t = CURRENT_TIME; face_t f; begin_f_loop(f, thread); { F_CENTROID(x, f, thread); y = x[1]; F_PROFILE(f, thread, position) = 10*(1+0.3.0*sin(2.0*3.141592654*(20.0*t)); } end_f_loop(f, thread); } |
|
November 19, 2011, 12:44 |
|
#3 |
Senior Member
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 27 |
F_PROFILE(f, thread, position) = 10*(1+0.3.0*sin(2.0*3.141592654*(20.0*t)));
...is this an error? I'm not an expert but you can try this: F_PROFILE(f, thread, position) = 10.*(1.+0.3*sin(2.0*3.141592654*(20.0*t))); Last edited by ghost82; November 19, 2011 at 18:27. |
|
November 19, 2011, 13:11 |
|
#4 |
Member
Billy
Join Date: Jan 2011
Posts: 31
Rep Power: 15 |
Hi
Yea that was a typo. Changing it to index gives a parse error. Thanks Will |
|
November 19, 2011, 18:29 |
|
#5 |
Senior Member
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 27 |
Edited message above: also a parenthesis was missing..
|
|
November 19, 2011, 20:56 |
|
#6 |
Member
Billy
Join Date: Jan 2011
Posts: 31
Rep Power: 15 |
That sorted it, well it got it loaded into Fluent!
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dynamic Mesh UDF | Qureshi | FLUENT | 7 | March 23, 2017 08:37 |
UDF parallel error: chip-exec: function not found????? | shankara.2 | Fluent UDF and Scheme Programming | 1 | January 16, 2012 23:14 |
How to add a UDF to a compiled UDF library | kim | FLUENT | 3 | October 26, 2011 22:38 |
UDF...UDF...UDF...UDF | Luc SEMINEL | FLUENT | 0 | November 25, 2002 05:03 |
UDF, UDF, UDF, UDF | Luc SEMINEL | Main CFD Forum | 0 | November 25, 2002 05:01 |