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 in UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 7, 2015, 03:53
Default Parse error in UDF
  #1
New Member
 
Anvesh
Join Date: Jan 2014
Posts: 25
Rep Power: 12
Agad15 is on a distinguished road
Hello,

I am trying to implement following UDF at a air-water boundary. While interpreting it is giving " line 3: parse error"

I have even tried copying both case and UDF into C:\Fluent.Inc\ntbin\ntx86, but of no use. Please try to help me what went wrong

#include "udf.h"
static real mu = 1.7894e-05 /*** viscosity of gas (in this case air) ***/
DEFINE_PROFILE(liquid, t, i)
{
face_t f;
cell_t c;
Thread *gaswall, *cellthread;
Domain *d;
int zone_ID = 1;
d = Get_Domain(1); /*** returns fluid domain pointer ***/
airwall = Lookup_Thread(d,zone_ID);
begin_f_loop(f, t)
{
c = F_C0(f,gaswall);
cellthread = THREAD_T0(gaswall);
F_PROFILE(f, t, i) = -mu*C_U_G(c,cellthread)[1];
}
end_f_loop(f, t)
}
DEFINE_PROFILE(gas, t, i)
{
face_t f;
Thread *liquidwall;
Domain *d;
int zone_ID = 2;
d = Get_Domain(1); /* returns fluid domain pointer */
waterwall = Lookup_Thread(d,zone_ID);
begin_f_loop(f, t)
{
F_PROFILE(f, t, i) = F_U(f,waterwall);
}
end_f_loop(f, t)
}
Agad15 is offline   Reply With Quote

Old   April 7, 2015, 04:08
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
You're missing a semicolon on your static variable initialisation, your code should be:

Code:
static real mu = 1.7894e-05;
Instead of declaring a static variable, you could use a material property macro C_MU_L or C_MU_T for laminar or turbulent viscosity, respectively.
`e` is offline   Reply With Quote

Old   April 7, 2015, 04:16
Default
  #3
New Member
 
Anvesh
Join Date: Jan 2014
Posts: 25
Rep Power: 12
Agad15 is on a distinguished road
Thanks for your quick reply.

Though I have inserted ; as you said, I am still getting the parse error message. Any other suggestions?

Is there anything wrong with "line 3" ?
Agad15 is offline   Reply With Quote

Reply

Tags
parse error, udf


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
parse error while interpreting udf Kristin Fluent UDF and Scheme Programming 3 March 15, 2012 07:43
parse error in transient udf spring FLUENT 1 July 6, 2010 07:26
UDF parse error at profile function line Wiggy Fluent UDF and Scheme Programming 1 July 27, 2009 16:59
Parse Error Message While interpreting UDF in FLUENT dhimans Fluent UDF and Scheme Programming 1 July 10, 2009 07:29
UDF parse error on line 1 ..... (Unusual) Amit Maha FLUENT 4 June 30, 2006 13:15


All times are GMT -4. The time now is 22:49.