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

UDF compiled and loaded but not available

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 24, 2018, 12:35
Default UDF compiled and loaded but not available
  #1
New Member
 
Grigory
Join Date: Apr 2018
Posts: 10
Rep Power: 8
Easyeight is on a distinguished road
Good time of day everyone!
My case is an inside circular domain containing an airfoil inside of another domain. My strategy is to apply UDF to the inside domain to make it rotate according to the UDF equation, so the airfoil would perform a pitching maneuver.
I have a problem using a DEFINE_ZONE_MOTION UDF which was successfully compiled and loaded into Fluent (as far as I know). I launch fluent from the Visual Studio command prompt, all of the environment variables are there, udflib builds and the UDF loads (see pic1).
But when I go to Setup-Dynamic Mesh section to set the dynamic zone as a rigid body and select the UDF is just not there (see pic2).
Am I doing something wrong or missing some steps to see my UDF there?
If you can give me some advice on improving my UDF, please do, I'll be glad to hear.

Thanks in advance, Greg.
Attached Images
File Type: jpg 1.jpg (90.7 KB, 33 views)
File Type: jpg 2.jpg (96.9 KB, 27 views)
Attached Files
File Type: c wing_motio2.c (274 Bytes, 17 views)
Easyeight is offline   Reply With Quote

Old   June 24, 2018, 18:39
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
Try my compiling process for Fluent UDFs with an existing library loaded. Otherwise, have you tried running the example UDF in the manual?
`e` is offline   Reply With Quote

Old   June 25, 2018, 00:49
Default
  #3
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 your first screen we may clearly see, that your UDF was not compiled. Source files up to date.
Try to make any change in source file and recompile, read carefully console output.

best regards
AlexanderZ is offline   Reply With Quote

Old   June 25, 2018, 04:02
Default
  #4
New Member
 
Grigory
Join Date: Apr 2018
Posts: 10
Rep Power: 8
Easyeight is on a distinguished road
' e', tried your manual, same output.
What confuses me a lot is that I can see and choose my UDF in the Cell zone conditions menu, but can't in the Dynamic mesh menu.
AlexanderZ, I've built the libudf, which was successfully built, saved the case, re-read it and the console said:

"Opening library "D:\CFD\2d-fluent\libudf"...
Library "D:\CFD\2d-fluent\libudf\win64\2d\libudf.dll" opened
overset
Done."

Doesn't it mean that the libudf is loaded and the UDF is compiled (it is in the src folder)?
Attached Images
File Type: jpg 3.jpg (84.2 KB, 9 views)
Easyeight is offline   Reply With Quote

Old   June 25, 2018, 06:00
Default
  #5
Senior Member
 
Join Date: Sep 2017
Posts: 246
Rep Power: 11
obscureed is on a distinguished road
Hi Greg,

From memory, this was a bug in many versions of Fluent, where a Moving/Deforming Mesh setup would not survive saving the .cas and reopening the .cas. You had to hook the UDF back in every time. Actually, I think it applied to any MDM setup, whether or not it used UDF. In the (slightly esoteric) MDM cases without UDFs, you needed to edit some part of the MDM setup to get Fluent to remember/activate it.

UDFs are not normally like this -- this was specific to MDM. I think it was fixed about a year ago, maybe release 19.0. So, either update Fluent or tweak the MDM setup every time you reopen a case -- or (if you're paranoid like me) do both.

Good luck!
Ed
obscureed is offline   Reply With Quote

Old   June 28, 2018, 05:17
Default
  #6
New Member
 
Grigory
Join Date: Apr 2018
Posts: 10
Rep Power: 8
Easyeight is on a distinguished road
Quote:
Originally Posted by obscureed View Post
Hi Greg,

From memory, this was a bug in many versions of Fluent, where a Moving/Deforming Mesh setup would not survive saving the .cas and reopening the .cas. You had to hook the UDF back in every time. Actually, I think it applied to any MDM setup, whether or not it used UDF. In the (slightly esoteric) MDM cases without UDFs, you needed to edit some part of the MDM setup to get Fluent to remember/activate it.

UDFs are not normally like this -- this was specific to MDM. I think it was fixed about a year ago, maybe release 19.0. So, either update Fluent or tweak the MDM setup every time you reopen a case -- or (if you're paranoid like me) do both.

Good luck!
Ed
I installed ANSYS 19.1, but have the same issue. UDF is available in Cell zone -> Frame motion, but not in the Dynamic zone menu. Any more suggestions?
Easyeight is offline   Reply With Quote

Old   June 28, 2018, 05:36
Default
  #7
New Member
 
Grigory
Join Date: Apr 2018
Posts: 10
Rep Power: 8
Easyeight is on a distinguished road
Quote:
Originally Posted by `e` View Post
Try my compiling process for Fluent UDFs with an existing library loaded. Otherwise, have you tried running the example UDF in the manual?
Yes, I've tried loading the UDF from the manual it doesn't work as well.
Easyeight is offline   Reply With Quote

Old   June 28, 2018, 11:54
Default
  #8
Senior Member
 
Join Date: Sep 2017
Posts: 246
Rep Power: 11
obscureed is on a distinguished road
Hi Easyeight,
This is all quite confusing.

Apologies for sending you down the wrong path earlier -- I was answering a different question from the one you asked. Updating to 19.1 is the right thing to do, anyway -- not least because of the bug I mentioned.

I am not sure what AlexanderZ spotted that was wrong with the text output in your screenshots. (AlexanderZ: please can you elaborate?) Blah blah "up to date" sounds like a good thing to me. However, there is a line of gobbledegook symbols in that text output, which is worrying.

Here are some things to try -- some of them might be pointless and paranoid, but some of them are definitely really important. Unfortunately I'm not sure which.
(1) Remove the space before "DEFINE_ZONE_MOTION" in the source file. Yes, really.

(2) Your screengrabs show Fluent 2D, but your source file can only be 3D: it defines origin[2] and axis[2], and it defines the axis to be the z-axis, which does not exist in a 2D simulation. This is pretty bad -- but I would not expect Fluent to have spotted that in advance; I would expect it to explode later. Fix this.

(2a) While you're there, get rid of pi as a variable and use the built-in constant M_PI. Also, put parenthesis around pi/3, so that nobody can think that pi/3*pi == 1./3.. (These are not the issue, but they distract me.)

(3) Close down Fluent. Delete the entire libudf directory (if necessary using a Command prompt). Open Fluent and recompile the libudf before you open the .cas file.

(4) I am not familiar with using Mesh Motion in a cell zone as well as Dynamic Mesh. In fact, the combination confuses me. So try setting up Dynamic Mesh without that setting in any cell zones. For full paranoia, unhook the UDF before you turn off the setting -- or, even better, go back to a version where you never turned it on.

(5) Set up some Dynamic Mesh methods (smoothing/layering/remeshing) *before* you set up any Dynamic Mesh zones. Your first screenshot shows all options blank there. Your later screenshot shows some settings in place, but it is tainted by point (4).

Please tell us how it goes. Good luck!
Ed
obscureed is offline   Reply With Quote

Reply

Tags
define_zone_motion, fluent, 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
compiling my Udf noa Fluent UDF and Scheme Programming 8 November 7, 2018 20:08
An error occurs after initialized FLuent loaded UDF. wpdeng Fluent UDF and Scheme Programming 6 April 6, 2017 21:41
UDF compiled successfully but not all UDF's loaded yashganatra Fluent UDF and Scheme Programming 0 May 21, 2014 09:19
ERROR in compiling UDF stefanos Fluent UDF and Scheme Programming 1 April 25, 2012 07:37
What's a UDF? Farooq FLUENT 5 December 9, 2003 06:52


All times are GMT -4. The time now is 01:34.