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 when Interpreted UDFs

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 13, 2013, 02:51
Default Parse Error when Interpreted UDFs
  #1
New Member
 
Join Date: Jul 2013
Posts: 2
Rep Power: 0
bulbee is on a distinguished road
Hello,

I'm having trouble "Interpreted" a udf.c file. I'm applying the udf.c to an energy source, to be modeled as a flame/combustion.

Currently, my code is:

#include "udf.h"
DEFINE_SOURCE(energy_source, c, t, dS, eqn)
{
real source, Qdot, r, length, Vavg, rho;
Qdot = 460;
r = 0.010;
length = 0.001;
Vavg = 1.0;
rho = 1.25
source = (Qdot/(3.1415*r*r*length))*C_U(c,t)*C_R(c,t)/(rho*Vin);
dS[eqn] = 0;
return source;
}

I'm getting an parse error on line 10. I've defined all the variables.

Can anyone shed some light on this question?
Thank you.
bulbee is offline   Reply With Quote

Old   July 13, 2013, 06:27
Default
  #2
Senior Member
 
Join Date: Aug 2011
Posts: 421
Blog Entries: 1
Rep Power: 21
blackmask will become famous soon enough
You are not so innocent as you might think.
1) you have missed a semi-colon;
2) you did not declare the variable "Vin".
See the highlighted part.

Quote:
Originally Posted by bulbee View Post
Hello,

I'm having trouble "Interpreted" a udf.c file. I'm applying the udf.c to an energy source, to be modeled as a flame/combustion.

Currently, my code is:

#include "udf.h"
DEFINE_SOURCE(energy_source, c, t, dS, eqn)
{
real source, Qdot, r, length, Vavg, rho;
real Vin; /*set a value for it yourself*/
Qdot = 460;
r = 0.010;
length = 0.001;
Vavg = 1.0;
rho = 1.25;
source = (Qdot/(3.1415*r*r*length))*C_U(c,t)*C_R(c,t)/(rho*Vin);
dS[eqn] = 0;
return source;
}

I'm getting an parse error on line 10. I've defined all the variables.

Can anyone shed some light on this question?
Thank you.
blackmask is offline   Reply With Quote

Old   July 13, 2013, 14:03
Default
  #3
New Member
 
Join Date: Jul 2013
Posts: 2
Rep Power: 0
bulbee is on a distinguished road
Thank you so much blackmask!
bulbee 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
A Problem of Fluent Interpreted UDF: parse error knight Fluent UDF and Scheme Programming 25 August 16, 2018 10:26
use several interpreted UDFs eddiegolpesar FLUENT 2 October 16, 2010 03:29
Unsteady and Flux UDFs for UDSs tom FLUENT 0 February 13, 2009 10:27
error in interpreted udf's for two macro Asghari FLUENT 0 August 7, 2006 02:10
Experimental Repository for UDFs, Journal Files and Scheme Scripts Jonas Larsson FLUENT 0 March 5, 2000 15:36


All times are GMT -4. The time now is 19:28.