CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   Can not to interpret UDF (http://www.cfd-online.com/Forums/fluent/65436-can-not-interpret-udf.html)

AlexanderSventitskiy June 15, 2009 06:06

Can not to interpret UDF
 
Hallo,

I have a problem with interpreting my UDF. The UDF defunes unsteady boundary conditions and looks as

#include "udf.h"

DEFINE_PROFILE(unsteady_mass_flow, thread, position)
{
double fact=1.E-06;
double S=1.5E-03;
double t, mass_flow;
face_t f;

t=RP_Get_Real("flow-time");
mass_flow=fact*57.6975*sin(6.2832*t);
begin_f_loop(f, thread)
{
F_PROFILE(f, thread, position)=mass_flow;
}
end_f_loop(f, thread)
}

Fluent reports 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>" "D:\Fluent data\Mask_test\Simulation\mfsin.c"
Error: D:\Fluent data\Mask_test\Simulation\mfsin.c: line 1: parse error.

What can it be??

Thank you.

duaiduaihu June 15, 2009 21:52

Quote:

Originally Posted by AlexanderSventitskiy (Post 219318)
Hallo,

I have a problem with interpreting my UDF. The UDF defunes unsteady boundary conditions and looks as

#include "udf.h"

DEFINE_PROFILE(unsteady_mass_flow, thread, position)
{
double fact=1.E-06;
double S=1.5E-03;
double t, mass_flow;
face_t f;

t=RP_Get_Real("flow-time");
mass_flow=fact*57.6975*sin(6.2832*t);
begin_f_loop(f, thread)
{
F_PROFILE(f, thread, position)=mass_flow;
}
end_f_loop(f, thread)
}

Fluent reports 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>" "D:\Fluent data\Mask_test\Simulation\mfsin.c"
Error: D:\Fluent data\Mask_test\Simulation\mfsin.c: line 1: parse error.

What can it be??

Thank you.


i have interpreted it in my computer,no error。。。。。。。。。

vinerm June 16, 2009 11:13

First thing, it is better to compile it.
Second thing, use real in place of float and double.

There is no error with your UDF. Just use compiled one and it will work

AlexanderSventitskiy June 17, 2009 07:07

What is an advantage to use real instead of double?

The problem with the UDF was that FLUENT could not read file from WordPad. After I had used Notepad++ everything was ok.

Thank you for your replies.

shaoda169 August 18, 2011 08:10

Quote:

Originally Posted by AlexanderSventitskiy (Post 219318)
Hallo,

I have a problem with interpreting my UDF. The UDF defunes unsteady boundary conditions and looks as

#include "udf.h"

DEFINE_PROFILE(unsteady_mass_flow, thread, position)
{
double fact=1.E-06;
double S=1.5E-03;
double t, mass_flow;
face_t f;

t=RP_Get_Real("flow-time");
mass_flow=fact*57.6975*sin(6.2832*t);
begin_f_loop(f, thread)
{
F_PROFILE(f, thread, position)=mass_flow;
}
end_f_loop(f, thread)
}

Fluent reports 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>" "D:\Fluent data\Mask_test\Simulation\mfsin.c"
Error: D:\Fluent data\Mask_test\Simulation\mfsin.c: line 1: parse error.

What can it be??

Thank you.

you should add the udfconfig.h in your working directory. The header file can be downloaded from internet.
Hope this helps you!


All times are GMT -4. The time now is 03:54.