CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Parse Error Message While interpreting UDF in FLUENT

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 24, 2009, 14:57
Default Parse Error Message While interpreting UDF in FLUENT
  #1
New Member
 
Dhiman
Join Date: May 2009
Posts: 4
Rep Power: 16
dhimans is on a distinguished road
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
dhimans is offline   Reply With Quote

Old   July 10, 2009, 07:29
Default
  #2
New Member
 
Dr. Dipankar Chatterjee
Join Date: Jul 2009
Posts: 2
Rep Power: 0
rsdchat is on a distinguished road
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)
}
rsdchat is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
need some basic help with fluent udf aarti sekaran FLUENT 8 February 12, 2008 01:57
compiling my UDF Seyed Farid Hosseinizadeh FLUENT 22 February 14, 2006 11:19
Fluent 6.1/6.2 UDF compatability Allan Walsh FLUENT 1 April 29, 2005 12:49
UDF of Zimont model in fluent Z Main CFD Forum 0 February 17, 2005 04:07
UDF in Fluent to Match Mass Flow at Pressure Outlet Jonas Larsson Main CFD Forum 1 April 29, 1999 11:44


All times are GMT -4. The time now is 13:32.