CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Parse Error when Interpreted UDFs (https://www.cfd-online.com/Forums/fluent-udf/120727-parse-error-when-interpreted-udfs.html)

bulbee July 13, 2013 02:51

Parse Error when Interpreted UDFs
 
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.

blackmask July 13, 2013 06:27

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 (Post 439487)
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.


bulbee July 13, 2013 14:03

Thank you so much blackmask!


All times are GMT -4. The time now is 09:29.