|
[Sponsors] |
Parse Error Message While interpreting UDF in FLUENT |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 24, 2009, 13:57 |
Parse Error Message While interpreting UDF in FLUENT
|
#1 |
New Member
Dhiman
Join Date: May 2009
Posts: 4
Rep Power: 17 |
Hi friends,
(Also posted in FLUENT thread ) ***************************************** I am repeatedly getting a PARSE ERROR message when I try to interpret my source file(named HTCOi.c) containing UDFs ************************************************* This is what I intend to do with the UDF :- 1. Obtain Heat transfer Coef using a function DEFINE_ON_DEMAND(HTcoef1) modify(using a Correction factor) and store it in UDMI after solving for convection (GAS.msh) over a plate 2. Read another case (SOLID.msh which is a plate) and impose the HT coef stored in UDMI through function DEFINE_PROFILE(HTcoef2,t,pos) ************************************************** ******* However, when I interpret HTCOi.c i get the following error 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\Sushant Dhiman\Desktop\AUTOMATION_CODES\U Fs\HTCOi.c" Error: C:\Users\Sushant Dhiman\Desktop\AUTOMATION_CODES\UDFs\HTCOi.c: line 28: parse error. Error: C:\Users\Sushant Dhiman\Desktop\AUTOMATION_CODES\UDFs\HTCOi.c: line 29: parse error. Error: C:\Users\Sushant Dhiman\Desktop\AUTOMATION_CODES\UDFs\HTCOi.c: line 33: f: undeclared variable ************************************************** ********** The HTCOi.c UDF that I use is as Follows #include "udf.h" #include "math.h" /* ##Definition of global variables and constants ########## */ #define tinf 400 #define CF 1 /* Correction factor */ #define ID 0 /* Domain ID to be used in ON DEMAND UDF(default interior ID=0) */ #define ZID 3 /* ID of the Zone of which HT coeff has to be used (plate_top ID=3)*/ int i; /* ###### OBTAINS THE HT_Coeff from plate_top in GAS.msh#####*/ DEFINE_ON_DEMAND(HTcoef1) { Thread *t; Domain *d; d=Get_Domain(ID); t=Lookup_Thread(d,ZID); real temp,q; face_t f; begin_f_loop(f,t) { temp=F_T(f,t); /* Obtains the Temp at the surface */ q=BOUNDARY_HEAT_FLUX(f, t); /* gets the TOTAL Heat flux vector at the surface */ F_UDMI(f,t,0)=CF*fabs(q/(temp-tinf)); /* Calculates the HT coefficient and stores in user defined memory */ } end_f_loop(f,t) } /* ### IMPOSES THE HT_Coeff PROFILE ON the face in SOLID.msh ## */ DEFINE_PROFILE(HTcoef2,t,pos) { Thread *t; face_t f; begin_f_loop(f,t) { F_PROFILE(f,t,pos) = F_UDMI(f,t,0); } end_f_loop(f,t) } ***************************************** I would really appreciate some help on this Regards Dhiman |
|
July 10, 2009, 06:29 |
|
#2 |
New Member
Dr. Dipankar Chatterjee
Join Date: Jul 2009
Posts: 2
Rep Power: 0 |
Dear Dhiman,
Try this, best wishes, Dipankar #include "udf.h" #include "math.h" /* ##Definition of global variables and constants ########## */ #define tinf 400 #define CF 1 /* Correction factor */ #define ID 0 /* Domain ID to be used in ON DEMAND UDF(default interior ID=0) */ #define ZID 3 /* ID of the Zone of which HT coeff has to be used (plate_top ID=3)*/ int i; /* ###### OBTAINS THE HT_Coeff from plate_top in GAS.msh#####*/ DEFINE_ON_DEMAND(HTcoef1) { Thread *t; Domain *d; face_t f; real temp; real q; d=Get_Domain(ID); t=Lookup_Thread(d,ZID); begin_f_loop(f,t) { temp=F_T(f,t); /* Obtains the Temp at the surface */ q=BOUNDARY_HEAT_FLUX(f, t); /* gets the TOTAL Heat flux vector at the surface */ F_UDMI(f,t,0)=CF*fabs(q/(temp-tinf)); /* Calculates the HT coefficient and stores in user defined memory */ } end_f_loop(f,t) } /* ### IMPOSES THE HT_Coeff PROFILE ON the face in SOLID.msh ## */ DEFINE_PROFILE(HTcoef2,t,pos) { Thread *t; face_t f; begin_f_loop(f,t) { F_PROFILE(f,t,pos) = F_UDMI(f,t,0); } end_f_loop(f,t) } |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
need some basic help with fluent udf | aarti sekaran | FLUENT | 8 | February 12, 2008 00:57 |
compiling my UDF | Seyed Farid Hosseinizadeh | FLUENT | 22 | February 14, 2006 10:19 |
Fluent 6.1/6.2 UDF compatability | Allan Walsh | FLUENT | 1 | April 29, 2005 11:49 |
UDF of Zimont model in fluent | Z | Main CFD Forum | 0 | February 17, 2005 03:07 |
UDF in Fluent to Match Mass Flow at Pressure Outlet | Jonas Larsson | Main CFD Forum | 1 | April 29, 1999 10:44 |