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/)
-   -   problem with UDF for a pressure BC (https://www.cfd-online.com/Forums/fluent-udf/91237-problem-udf-pressure-bc.html)

sarnaud42 August 4, 2011 05:41

problem with UDF for a pressure BC
 
Hi

I have created a file for pressure BC at the outlet depending on mass flow rate. The UDF.c is as shown below. During intepreting by Fluent 6.3, it has a syntax error at line 2. However, I don't find anything wrong with line 2. Anyone out there see the source of this syntax error, please help thanks

#include "udf.h"
DEFINE_PROFILE(pressure-chem1, thread, position) /*line2*/
{
float pressure1;
float debit;
face_t f;
pressure1 = 0.000001;
begin_f_loop(f,thread);
{
debit=debit+F_FLUX(f,thread);
}
end_f_loop(f,thread);
pressure1 = debit*6.25-5.0;
begin_f_loop(f,thread);
{
F_PROFILE(f, thread, position)=pressure1;
}
end_f_loop(f,thread);
}

gearboy August 5, 2011 01:16

Quote:

Originally Posted by sarnaud42 (Post 318836)
Hi

I have created a file for pressure BC at the outlet depending on mass flow rate. The UDF.c is as shown below. During intepreting by Fluent 6.3, it has a syntax error at line 2. However, I don't find anything wrong with line 2. Anyone out there see the source of this syntax error, please help thanks

#include "udf.h"
DEFINE_PROFILE(pressure-chem1, thread, position) /*line2*/
{
float pressure1;
float debit;
face_t f;
pressure1 = 0.000001;
begin_f_loop(f,thread);
{
debit=debit+F_FLUX(f,thread);
}
end_f_loop(f,thread);
pressure1 = debit*6.25-5.0;
begin_f_loop(f,thread);
{
F_PROFILE(f, thread, position)=pressure1;
}
end_f_loop(f,thread);
}

try changing pressure-chem1 to pressure_chem1

sarnaud42 August 8, 2011 03:25

Thanks a lot Gearboy !
 
I thought it was only a problem with my text editor encoding.

pranab_jha August 9, 2011 10:47

Quote:

Originally Posted by sarnaud42 (Post 319250)
I thought it was only a problem with my text editor encoding.

Did that solve your problem?
Sometimes, unix platforms do not accept files built in editors like wordpad (windows). Try a unix based editor.


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