|
[Sponsors] |
July 20, 2012, 02:07 |
UDF Error
|
#1 |
New Member
Amir sadeghi pour marvi
Join Date: Dec 2011
Posts: 25
Rep Power: 14 |
Hi,
I'm trying to create a tranverse velocity profile UDF to use it as velocity inlet boundary condition to simulate flow in a water tank. The UDF is as follows: #include "udf.h" DEFINE_PROFILE(inlet_x_velocity,thread,index) { real x[ND_ND]; /* this will hold the position vector*/ real z; face_t f; begin_f_loop(f,thread) { F_CENTROID(x,f,thread); z=x[2]; if (0.1<z<0.4) F_PROFILE(f,thread,index) =0.063*pow((z/(0.1)),0.21) else F_PROFILE(f,theard,index)=log((z/(0.8))*0.15/0.41 } end_f_loop(f,thread) } i got the following error when trying to interpret my Velocity2.c file in fluent: cpp -I"C:\Fluent.Inc\fluent6.3.26/src" -I"C:\Fluent.Inc\fluent6.3.26/cortex/src" -I"C:\Fluent.Inc\fluent6.3.26/client/src" -I"C:\Fluent.Inc\fluent6.3.26/multiport/src" -I. -DUDFCONFIG_H="<udfconfig.h>" "C:\Users\amir\Desktop\Velocity2.c" Error: C:\Users\amir\Desktop\Velocity2.c: line 13: parse error. Thanks in advance! |
|
July 20, 2012, 02:42 |
|
#2 |
Super Moderator
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,399
Rep Power: 46 |
Typo...
F_PROFILE(f,theard,index)=log((z/(0.8))*0.15/0.41 |
|
July 20, 2012, 03:18 |
|
#3 |
New Member
Amir sadeghi pour marvi
Join Date: Dec 2011
Posts: 25
Rep Power: 14 |
thanks my friend...
my problem is not solved yet!!!!!!!!! |
|
July 20, 2012, 03:31 |
|
#4 |
Super Moderator
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,399
Rep Power: 46 |
Try using some ";" at the end of lines
|
|
July 20, 2012, 03:56 |
|
#5 |
New Member
Amir sadeghi pour marvi
Join Date: Dec 2011
Posts: 25
Rep Power: 14 |
it doesn't work!!!
#include "udf.h" DEFINE_PROFILE(inlet_x_velocity,thread,index) { real x[ND_ND]; /* this will hold the position vector*/ real z; face_t f; begin_f_loop(f,thread) { F_CENTROID(x,f,thread) z=x[2]; if (0.1<z<0.4) F_PROFILE(f,thread,index) =0.063*pow((z/(0.1)),0.21); else F_PROFILE(f,thread,index)=log((z./(0.8)).*(0.15./0.41); } end_f_loop(f,thread) } |
|
July 20, 2012, 07:52 |
|
#6 |
Super Moderator
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,399
Rep Power: 46 |
Did you copy parts of the UDF from the manual?
Then it contains "invisible" signs which prevent the UDF from being interpreted properly. |
|
July 23, 2012, 13:49 |
|
#7 |
New Member
Join Date: Jan 2010
Location: Netherlands
Posts: 28
Rep Power: 16 |
if (z > 0.1 && z < 0.4) ...
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Undeclared Identifier Errof UDF | SteveGoat | Fluent UDF and Scheme Programming | 7 | October 15, 2014 07:11 |
Problem with UDF compiling for kTkLW model | Wantami | FLUENT | 0 | July 18, 2011 05:11 |
ParaView for OF-1.6-ext | Chrisi1984 | OpenFOAM Installation | 0 | December 31, 2010 06:42 |
Installation OF1.5-dev | ttdtud | OpenFOAM Installation | 46 | May 5, 2009 02:32 |
Problem with compile the setParabolicInlet | ivanyao | OpenFOAM Running, Solving & CFD | 6 | September 5, 2008 20:50 |