CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Problem with compiled UDFs

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 28, 2014, 07:18
Default Problem with compiled UDFs
  #1
New Member
 
Join Date: Jul 2014
Posts: 7
Rep Power: 12
nilsstudent is on a distinguished road
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
nilsstudent is offline   Reply With Quote

Old   July 28, 2014, 10:46
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
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?
pakk is offline   Reply With Quote

Old   July 30, 2014, 04:18
Default
  #3
New Member
 
Join Date: Jul 2014
Posts: 7
Rep Power: 12
nilsstudent is on a distinguished road
Hello,

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

Regards
Nils
nilsstudent is offline   Reply With Quote

Old   July 30, 2014, 05:15
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Quote:
Originally Posted by nilsstudent View Post
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?
pakk is offline   Reply With Quote

Old   July 30, 2014, 05:30
Default
  #5
New Member
 
Join Date: Jul 2014
Posts: 7
Rep Power: 12
nilsstudent is on a distinguished road
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 is offline   Reply With Quote

Old   July 30, 2014, 05:44
Default
  #6
New Member
 
Join Date: Jul 2014
Posts: 7
Rep Power: 12
nilsstudent is on a distinguished road
And

test::libudf

is visible at the "execute on demand"-window, but nothing happens after clicking.
nilsstudent is offline   Reply With Quote

Old   July 30, 2014, 06:05
Default
  #7
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Strange: for me it also does not show on the screen.

However, when I replace it by
Code:
Message("test%d\n",0);
something shows...
pakk is offline   Reply With Quote

Old   August 4, 2014, 04:46
Default
  #8
New Member
 
Join Date: Jul 2014
Posts: 7
Rep Power: 12
nilsstudent is on a distinguished road
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 is offline   Reply With Quote

Old   August 6, 2014, 10:35
Default
  #9
New Member
 
Join Date: Jul 2014
Posts: 7
Rep Power: 12
nilsstudent is on a distinguished road
Does somebody know, why there are 5 "test"-outputs although I executed the UDF only once?
nilsstudent is offline   Reply With Quote

Old   August 6, 2014, 10:43
Default
  #10
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
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".
pakk is offline   Reply With Quote

Old   August 6, 2014, 10:45
Default
  #11
New Member
 
Join Date: Jul 2014
Posts: 7
Rep Power: 12
nilsstudent is on a distinguished road
Oh, thank you
nilsstudent is offline   Reply With Quote

Reply

Tags
compiler, error, problem, udf


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
Interepreted Vs. Compiled UDFs Antonis Fluent UDF and Scheme Programming 10 March 22, 2018 12:15
problem using property udfs in parallel mode EllenW FLUENT 0 June 23, 2009 18:18
URGENT UDF's erosion_macro problem alex FLUENT 7 October 18, 2005 19:18
problem in compiled UDF kumar FLUENT 1 October 5, 2005 19:40
UDFs' problem Benny FLUENT 14 June 13, 2005 12:05


All times are GMT -4. The time now is 20:56.