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 compiled UDFs (https://www.cfd-online.com/Forums/fluent-udf/139619-problem-compiled-udfs.html)

nilsstudent July 28, 2014 06:18

Problem with compiled UDFs
 
Hello guys,

I'm using Fluent 15.0 on Windows XP 64 Bit with MS Visual Studio C++ 2008 Express and MS .net Framework 2.0 (64 Bit).

My problem is, that fluent can compile my UDFs without errors, but it seems to me that fluent doesn't execute them, it does not make a difference whether I start my simulation after compiling or without.
But if I try to compile a UDF with errors (e.g. forgot a semicolon), an error message is displayed in the console. Therefore I think the compiler works. I changed the system-variable "path" how it is explained in

http://www.cfd-online.com/Wiki/Fluen...with_Fluent_13

Subsection: "How can I manage to compile my UDF with Windows 7 64bit?"

If I just write a little UDF to print something on console, nothing will be displayed. My code:

#include "udf.h"

DEFINE_ADJUST(ausgabe,d)
{
Message("test");
}

I hope somebody can help me. :)

Regards
Nils

pakk July 28, 2014 09:46

Can you compile the code
Code:

DEFINE_ON_DEMAND(test)
{
    Message("test");
}

And then select in the menu Define->User-Defined->Execute On Demand, select "test" and see if something comes up on the screen?

nilsstudent July 30, 2014 03:18

Hello,

I just tested it and nothing comes up on the screen. :(

Regards
Nils

pakk July 30, 2014 04:15

Quote:

Originally Posted by nilsstudent (Post 503681)
Hello,

I just tested it and nothing comes up on the screen. :(

Regards
Nils

Surely something must have shown up on the screen when you compiled it???

My screen shows:
Quote:

Copied D:\test/test.c to test\src
udf_names.c and user_nt.udf files in 3d are upto date.
(system "copy "c:\PROGRA~1\ANSYSI~1\v150\fluent"\fluent15.0.7\sr c\makefile_nt.udf "test\win64\3d\makefile" ")
1 file(s) copied.
(chdir "test")(chdir "win64\3d")
Done.
Don't you see something like that?

nilsstudent July 30, 2014 04:30

Yes,

after Building:

Setting Post Processing and Surfaces information ... Done.
Copied E:\Documents and Settings\Student\Desktop\Simulation\Shell\particle Tracking_files\dp0\FFF\Fluent/E:\Documents and Settings\Student\Desktop\Simulation\Shell\particle Tracking_files\dp0\FFF\Fluent est.c to libudf\src
udf_names.c and user_nt.udf files in 3ddp_host are upto date.
(system "copy "E:\PROGRA~1\ANSYSI~1\v150\fluent"\fluent15.0.0\sr c\makefile_nt.udf "libudf\win64\3ddp_host\makefile" ")
1 file(s) copied.
(chdir "libudf")(chdir "win64\3ddp_host")udf_names.c and user_nt.udf files in 3ddp_node are upto date.
(system "copy "E:\PROGRA~1\ANSYSI~1\v150\fluent"\fluent15.0.0\sr c\makefile_nt.udf "libudf\win64\3ddp_node\makefile" ")
1 file(s) copied.
(chdir "libudf")(chdir "win64\3ddp_node")
Done.

After Loading:

Opening library "E:\Documents and Settings\Student\Desktop\Simulation\Shell\particle Tracking_files\dp0\FFF\Fluent\libudf"...
Library "E:\Documents and Settings\Student\Desktop\Simulation\Shell\particle Tracking_files\dp0\FFF\Fluent\libudf\win64\3ddp_ho st\libudf.dll" opened
Opening library "E:\Documents and Settings\Student\Desktop\Simulation\Shell\particle Tracking_files\dp0\FFF\Fluent\libudf"...
Library "E:\Documents and Settings\Student\Desktop\Simulation\Shell\particle Tracking_files\dp0\FFF\Fluent\libudf\win64\3ddp_no de\libudf.dll" opened
Opening library "E:\Documents and Settings\Student\Desktop\Simulation\Shell\particle Tracking_files\dp0\FFF\Fluent\libudf"...
Library "E:\Documents and Settings\Student\Desktop\Simulation\Shell\particle Tracking_files\dp0\FFF\Fluent\libudf\win64\3ddp_no de\libudf.dll" opened
Opening library "E:\Documents and Settings\Student\Desktop\Simulation\Shell\particle Tracking_files\dp0\FFF\Fluent\libudf"...
Library "E:\Documents and Settings\Student\Desktop\Simulation\Shell\particle Tracking_files\dp0\FFF\Fluent\libudf\win64\3ddp_no de\libudf.dll" opened
Opening library "E:\Documents and Settings\Student\Desktop\Simulation\Shell\particle Tracking_files\dp0\FFF\Fluent\libudf"...
Library "E:\Documents and Settings\Student\Desktop\Simulation\Shell\particle Tracking_files\dp0\FFF\Fluent\libudf\win64\3ddp_no de\libudf.dll" opened
test
Done.

Did you mean this?

nilsstudent July 30, 2014 04:44

And

test::libudf

is visible at the "execute on demand"-window, but nothing happens after clicking.

pakk July 30, 2014 05:05

Strange: for me it also does not show on the screen. :confused:

However, when I replace it by
Code:

Message("test%d\n",0);
something shows...

nilsstudent August 4, 2014 03:46

Hi,

now this shows up:

test0
test0
test0
test0
test0

So obviously the compiler works.

But when I change it to:

#include "udf.h"

DEFINE_EXECUTE_AT_END(test)
{
Message("test%d\n",0);
}

There's not the output on the console.

nilsstudent August 6, 2014 09:35

Does somebody know, why there are 5 "test"-outputs although I executed the UDF only once? :)

pakk August 6, 2014 09:43

That is because you are running in parallel, so 5 instances of your udf are loaded (one for the host, and 4 for the nodes if I am correct). If you want to see it only once, replace "Message" by "Message0".

nilsstudent August 6, 2014 09:45

Oh, thank you :)


All times are GMT -4. The time now is 18:27.