|
[Sponsors] |
September 19, 2015, 10:12 |
udf fluent
|
#1 |
New Member
golriz
Join Date: Sep 2015
Posts: 11
Rep Power: 11 |
dear all
I have written a program and compile it in fluent but getting the errors while building in fluent. the program looks like this. please help me. /* UDF for determination of inlet and outlet */ #include "udf.h" #include "sg.h" DEFINE_EXECUTE_AT_END(determination_boun) { Domain *d; face_t f; Thread *t; real velocity_vector[2], mag_velocity, normal_vec, mag_normal_vec; real A[ND_ND], ds, es[ND_ND], A_by_es, dr0[ND_ND]; real X_component,Y_component, Guage_Pressure; d=Get_Domain(1); int ID=12; /*Zone ID for farfield zone from boundary condition task page*/ t=Lookup_Thread(d,ID); begin_f_loop(f,t) { /* find velocities*/ velocity_vector[0]=F_U(f,t); velocity_vector[1]=F_V(f,t); /* magnitude of velocity vector*/ mag_velocity=NV_MAG(velocity_vector); /* magnitude of normal vector*/ BOUNDARY_FACE_GEOMETRY(f,t,A,ds,es,A_by_es,dr0); mag_normal_vec=NV_MAG(A); /* attack angle*/ double teta=0; if((mag_velocity* mag_normal_vec*cos(teta))<0) { /*inlet boundary*/ X_component=F_U(f,t); Y_component=F_V(f,t); } else Guage_Pressure=F_P(f,t); /*outlet boundary*/ } end_f_loop(f,t) } 1 file(s) copied. 1 file(s) copied. (system "copy "c:\PROGRA~1\ANSYSI~1\v121\fluent"\fluent12.1.2\sr c\makefile_nt.udf libudf\win64\2ddp\makefile") 1 file(s) copied. (chdir "libudf")() (chdir "win64\2ddp")() # Generating ud_io1.h determination_boun.c c:\program files\ansys inc\v121\fluent\fluent12.1.2\src\config.h(110) : error C2143: syntax error : missing '{' before ':' c:\program files\ansys inc\v121\fluent\fluent12.1.2\src\config.h(110) : error C2059: syntax error : ':' Done. |
|
September 19, 2015, 16:14 |
|
#2 |
Senior Member
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13 |
can you highlight which lines belongs these errors?
|
|
September 20, 2015, 05:08 |
|
#3 |
New Member
golriz
Join Date: Sep 2015
Posts: 11
Rep Power: 11 |
there isn't this number line in my code
|
|
September 20, 2015, 07:23 |
|
#4 |
Senior Member
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13 |
||
September 22, 2015, 05:50 |
|
#5 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
The compiler complains about line 110 of a different file, not the file that gzamiri is showing.
In my copy of Fluent 12.1.4, lines 109-111 of config.h are: Code:
#if !(RP_2D || RP_3D) Error: both RP_2D and RP_3D are undefined #endif The problem is probably not in your UDF code, but in your system settings. Are you able to compile other UDFs? (From the manual?) |
|
September 22, 2015, 12:25 |
|
#6 |
New Member
golriz
Join Date: Sep 2015
Posts: 11
Rep Power: 11 |
dear pakk
do you think that this error is for version of fluent? |
|
September 23, 2015, 14:26 |
|
#7 |
New Member
golriz
Join Date: Sep 2015
Posts: 11
Rep Power: 11 |
I want to do my udf in 2D dimention.how can i specify it in my udf.
|
|
September 23, 2015, 22:12 |
|
#8 |
New Member
Meng Liu
Join Date: Sep 2015
Posts: 14
Rep Power: 11 |
1.add the path of “config.h” to the system environment “include”.
2.you need declare the variable before you use it. Code:
/* UDF for determination of inlet and outlet */ #include "udf.h" #include "sg.h" DEFINE_EXECUTE_AT_END(determination_boun) { Domain *d; face_t f; Thread *t; real velocity_vector[2], mag_velocity, normal_vec, mag_normal_vec; real A[ND_ND], ds, es[ND_ND], A_by_es, dr0[ND_ND]; real X_component,Y_component, Guage_Pressure; int ID; double teta; d=Get_Domain(1); ID=12; /*Zone ID for farfield zone from boundary condition task page*/ t=Lookup_Thread(d,ID); begin_f_loop(f,t) { /* find velocities*/ velocity_vector[0]=F_U(f,t); velocity_vector[1]=F_V(f,t); /* magnitude of velocity vector*/ mag_velocity=NV_MAG(velocity_vector); /* magnitude of normal vector*/ BOUNDARY_FACE_GEOMETRY(f,t,A,ds,es,A_by_es,dr0); mag_normal_vec=NV_MAG(A); /* attack angle*/ teta=0; if((mag_velocity* mag_normal_vec*cos(teta))<0) { /*inlet boundary*/ X_component=F_U(f,t); Y_component=F_V(f,t); } else Guage_Pressure=F_P(f,t); /*outlet boundary*/ } end_f_loop(f,t) } |
|
September 24, 2015, 02:54 |
|
#9 |
New Member
golriz
Join Date: Sep 2015
Posts: 11
Rep Power: 11 |
dear sola
shoud I add config.h in my udf as follow? #include "config.h" |
|
September 24, 2015, 03:37 |
|
#10 |
New Member
Meng Liu
Join Date: Sep 2015
Posts: 14
Rep Power: 11 |
||
September 24, 2015, 06:36 |
|
#11 |
New Member
golriz
Join Date: Sep 2015
Posts: 11
Rep Power: 11 |
dear sola
I don't know how can i add the path to the system environment "include" please help me |
|
September 27, 2015, 21:53 |
|
#12 |
New Member
Meng Liu
Join Date: Sep 2015
Posts: 14
Rep Power: 11 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
looking for a smart interface matlab fluent | chary | FLUENT | 24 | June 18, 2021 10:07 |
Wind turbine rotation through UDF in FLUENT | Shamoon Jamshed | Fluent UDF and Scheme Programming | 10 | June 25, 2018 13:58 |
fluent udf, saving data in udf | mohsen zendehbad | Fluent UDF and Scheme Programming | 15 | June 14, 2017 00:23 |
Making wave udf in fluent | sunggun1212 | Fluent UDF and Scheme Programming | 7 | October 27, 2015 11:52 |
UDF problem caused by various version of Fluent | Yurong | FLUENT | 3 | January 15, 2006 11:57 |