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

UDF after compilation does not show up

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 26, 2019, 18:11
Exclamation UDF after compilation does not show up
  #1
New Member
 
Łukasz
Join Date: May 2019
Posts: 5
Rep Power: 7
lukaszrze is on a distinguished road
Hello,

I have a problem with my UDF because I cannot see it when I click on the arrow on the right of the textbox - where you can see options: constant, expression, parameters, (here should be the possibility to click on the loaded UDF).

I have even instaled Visual studio for the compilation of the UDF because before that i had an error
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64)"
that problem is gone now, I get a nice answer in the console ofter clicking "BUILD" and "LOAD" that fluent is opening the library. When I click User Defined -> Functions -> Manage I can see the UDF is loaded.

I will be very gratefull for your help. thank you
lukaszrze is offline   Reply With Quote

Old   May 26, 2019, 23:48
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
most macros should be hooked in User-defined -> function hook
profiles should be hooked as boundary conditions
sources -> as sources in cell zone conditions

show you UDF if this not helps

best regards
AlexanderZ is offline   Reply With Quote

Old   May 27, 2019, 08:44
Default
  #3
New Member
 
Łukasz
Join Date: May 2019
Posts: 5
Rep Power: 7
lukaszrze is on a distinguished road
Thank you for your answer!

Unfortunately when when I click on the user-defined->function hooks nothing is active there (I have my UDF loaded)

For now I have a UDF written to control the velocity of the profile in 2D cycloturbine (I plan to change it to control the position - but I do not know how yet) and it is written using DEFINE_CG_MOTION - as I have read it should be loaded as a compiled function.

I would be very gratefull if you could tell me what to do step by step so it will finally work. Thank you


#include "udf.h"

DEFINE_CG_MOTION(turbine_omega, dt, vel, omega, time, dtime)
{
real a, w, pi;

pi = 3.1415;
a = 0.007;
w = 2 * pi * 30;

vel[0] = 0;
vel[1] = a * w * sin(w*time);
vel[2] = 0;
}
lukaszrze is offline   Reply With Quote

Old   May 27, 2019, 23:13
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
from Ansys Fluent Customization manual

Quote:
After the UDF that you have defined using DEFINE_CG_MOTION is compiled (Compiling UDFs),
the name of the argument that you supplied as the first DEFINE macro argument will become visible
in the Dynamic Mesh Zones dialog box in ANSYS Fluent. See Hooking DEFINE_CG_MOTION UDFs for details on how to hook your DEFINE_CG_MOTION UDF to ANSYS Fluent
best regards
lukaszrze likes this.
AlexanderZ is offline   Reply With Quote

Old   May 30, 2019, 16:47
Default
  #5
New Member
 
Łukasz
Join Date: May 2019
Posts: 5
Rep Power: 7
lukaszrze is on a distinguished road
Thank you, it works!
lukaszrze is offline   Reply With Quote

Reply

Tags
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
UDF compilation through nmake yorelchr Fluent UDF and Scheme Programming 4 March 26, 2013 09:52
UDF compilation vismayie Fluent UDF and Scheme Programming 5 March 20, 2013 03:54
Ansys Fluent 13.0 UDF compilation problem in Window XP (32 bit) Yogini Fluent UDF and Scheme Programming 7 October 3, 2012 08:24
problem with compilation udf about droplet collision (DPM) Jaskull Fluent UDF and Scheme Programming 0 November 7, 2011 15:09
udf compilation error sdp FLUENT 0 February 5, 2009 03:58


All times are GMT -4. The time now is 15:55.