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

Fluent (ANSYS12) UDF Help, PLEASE! Urgent!

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 17, 2010, 13:19
Default Fluent (ANSYS12) UDF Help, PLEASE! Urgent!
  #1
New Member
 
Antonis
Join Date: Oct 2010
Posts: 13
Rep Power: 16
ANITIX87 is on a distinguished road
Hi, all. First-time poster, and very, very frustrated.

I have to analyze the flow around a wind turbine, and have set up my model and mesh in Gambit. I can read the mesh just find in Fluent (I am using ANSYS 12) and can do everything except compile UDFs.

I need to write a UDF that simulated unsteady wind flow (in any way, as long as it's unsteady) and I need a second UDF that analyzes the flow around the windmill and animates its rotation using a dynamic mesh. I have the code written, but it's full of errors, so if someone wants to help me with that, I'd greatly appreciate it.

However, the biggest problem is when I try to compile my UDFs. I get the following error: Opening library "libudf"...
Error: open_udf_library: The system cannot find the file specified.

I have searched online and found several solutions, but none seem to work. I don't know how to fix my environment variables with ANSYS 12, because I can't find anything in START -> ANSYS 12 ...

Can someone PLEASE help me? It's very urgent, and I'm very frustrated. I've been working on this project for months, and have made no progress once I got to the UDF part of it.

I'm desperate!

TIS
ANITIX87 is offline   Reply With Quote

Old   October 17, 2010, 17:52
Default
  #2
Member
 
lehoang_mai's Avatar
 
User_CFD
Join Date: Mar 2010
Posts: 48
Rep Power: 16
lehoang_mai is on a distinguished road
This error occur when U tried compile UDF while libudf do not "Build" correctly. Make sure that, Visual C ++ correctly installed on your computer(later than install Fluent, Register environment variables is checked when installs Visual C++...). I not work in fluent 12.1, but hope this help!
lehoang_mai is offline   Reply With Quote

Old   October 17, 2010, 17:54
Default
  #3
New Member
 
Antonis
Join Date: Oct 2010
Posts: 13
Rep Power: 16
ANITIX87 is on a distinguished road
Quote:
Originally Posted by lehoang_mai View Post
This error occur when U tried compile UDF while libudf do not "Build" correctly. Make sure that, Visual C ++ correctly installed on your computer(later than install Fluent, Register environment variables is checked when installs Visual C++...). I not work in fluent 12.1, but hope this help!
Thanks. Visual C++ was already installed on my computer when I got it, so I didn't do anything to it. How can I modify the Environment Variables for C++? UDFs can be interpreted just fine, but I require compiling for my second UDF file.

Can anyone shed some more light? And can anyone take a look at my UDF to see what I'm doing wrong in the code?

TIS
ANITIX87 is offline   Reply With Quote

Old   October 18, 2010, 05:09
Default
  #4
Member
 
lehoang_mai's Avatar
 
User_CFD
Join Date: Mar 2010
Posts: 48
Rep Power: 16
lehoang_mai is on a distinguished road
Environment Variables were automatically installed when you installed Visual C++ if you check box "Register Environment Variables". What was error when you click "Build" UDF? I think you need read more information about this problem here:
http://www.cfd-online.com/Wiki/Fluen...tch_file.22.3F
Best wish for you!
lehoang_mai is offline   Reply With Quote

Old   October 18, 2010, 13:51
Default
  #5
New Member
 
Antonis
Join Date: Oct 2010
Posts: 13
Rep Power: 16
ANITIX87 is on a distinguished road
Quote:
Originally Posted by lehoang_mai View Post
Environment Variables were automatically installed when you installed Visual C++ if you check box "Register Environment Variables". What was error when you click "Build" UDF? I think you need read more information about this problem here:
http://www.cfd-online.com/Wiki/Fluen...tch_file.22.3F
Best wish for you!
I've checked out this website. Some good information, but I'm still unable to make the error go away, even after re-installing Visual Studio and making sure my environmental variables are set.

Anyone else have some input?

I'm going to post my code here later as well, if someone wants to take a look, because I don't have any idea how to write a good UDF.

TIS
ANITIX87 is offline   Reply With Quote

Old   October 20, 2010, 11:45
Default
  #6
Member
 
Akour
Join Date: May 2009
Posts: 79
Rep Power: 17
ak6g08 is on a distinguished road
the fact that its saying it cant find a libudf file, means that at the moment you shouldnt be worrying about errors in your source code...because now it is even compiling your source code to begin with...so dont bother posting your source code until you figure out why it isnt compiling.

1. make *SURE* you launch fluent from within the visual studio command prompt...otherwise fluent wont link to the appropriate compiler...

2. make sure you enter the full directory where it asks you what the name of the library file is...or, when you launch from the vis studio command prompt, launch fluent from the appropriate directory...

3. check your environment variables...

have you done all of that?

good luck
__________________
akour
ak6g08 is offline   Reply With Quote

Old   October 20, 2010, 11:46
Default
  #7
New Member
 
Antonis
Join Date: Oct 2010
Posts: 13
Rep Power: 16
ANITIX87 is on a distinguished road
Quote:
Originally Posted by ak6g08 View Post

3. check your environment variables...
That's the only thing I don't know how to do. My Start menu looks different than the examples I've seen elsewhere, and there's no Environment Variables option in the ANSYS 12 directory, or the Visual Studio directory. How should I check them??

Thanks.

TIS
ANITIX87 is offline   Reply With Quote

Old   October 20, 2010, 12:19
Default
  #8
Member
 
Akour
Join Date: May 2009
Posts: 79
Rep Power: 17
ak6g08 is on a distinguished road
unfortunately I dont use Fluent 12...so I cant be certain for you, but in fluent 6 you dont have to set anything within fluent...but i remember i had this problem, and re-installed visual directly onto the c: directory...and my environment variable for fluent 6.3.26 is:

Variable: FLUENT_INC
Value: c:\fluent.inc

...incase you dont know where to find all your user variables (system and environment)...go to your start menu, right click on my computer, then click on properties...advanced, and then environment variables. (in xp thats what you do)...

also, something major i forgot, your fluent.inc directory and your visual studio directories must be shared, otherwise fluent wont find the udf.h file which contains everything fluent needs to compile through visual studio...hope that works.
__________________
akour
ak6g08 is offline   Reply With Quote

Old   October 20, 2010, 12:21
Default
  #9
New Member
 
Antonis
Join Date: Oct 2010
Posts: 13
Rep Power: 16
ANITIX87 is on a distinguished road
Quote:
Originally Posted by ak6g08 View Post
unfortunately I dont use Fluent 12...so I cant be certain for you, but in fluent 6 you dont have to set anything within fluent...but i remember i had this problem, and re-installed visual directly onto the c: directory...and my environment variable for fluent 6.3.26 is:

Variable: FLUENT_INC
Value: c:\fluent.inc

...incase you dont know where to find all your user variables (system and environment)...go to your start menu, right click on my computer, then click on properties...advanced, and then environment variables. (in xp thats what you do)...

also, something major i forgot, your fluent.inc directory and your visual studio directories must be shared, otherwise fluent wont find the udf.h file which contains everything fluent needs to compile through visual studio...hope that works.
Thanks, I'll explore the environmental variables next time I'm using Windows (I dual boot Mac and Windows, and use Mac as my primary).

Fluent definitely finds and copies nmake and udf.h correctly when trying to compile. It builds the libudf directory in my project folder correctly, it just won't load it when I want to.

TIS
ANITIX87 is offline   Reply With Quote

Old   October 20, 2010, 15:49
Default
  #10
Member
 
lehoang_mai's Avatar
 
User_CFD
Join Date: Mar 2010
Posts: 48
Rep Power: 16
lehoang_mai is on a distinguished road
ur problem is set environment Variables, and ak6g08 helped. Best wish for you! Can I see ur code and mesh file?
lehoang_mai is offline   Reply With Quote

Old   October 26, 2010, 19:48
Default Files
  #11
New Member
 
Antonis
Join Date: Oct 2010
Posts: 13
Rep Power: 16
ANITIX87 is on a distinguished road
Here is the link to the relevant files: http://www.yousendit.com/download/ZG...TStsUjgwTVE9PQ

HELP PLEASE! I still have the same "Opening library "libudf"...
Error: open_udf_library: The system cannot find the file specified." error despite everything I have tried.

TIS
ANITIX87 is offline   Reply With Quote

Old   October 27, 2010, 07:15
Default
  #12
Member
 
lehoang_mai's Avatar
 
User_CFD
Join Date: Mar 2010
Posts: 48
Rep Power: 16
lehoang_mai is on a distinguished road
Quote:
Originally Posted by ANITIX87 View Post
Here is the link to the relevant files: http://www.yousendit.com/download/ZG...TStsUjgwTVE9PQ

HELP PLEASE! I still have the same "Opening library "libudf"...
Error: open_udf_library: The system cannot find the file specified." error despite everything I have tried.

TIS
Problem is in your source code apmotion.c. It's not correctly. I corrected it. It works on my mechanic. I hope it work on your too. Can you describe me task of problem?
Best wish for you!
Attached Files
File Type: c apmotion.c (956 Bytes, 115 views)
lehoang_mai is offline   Reply With Quote

Old   October 27, 2010, 09:25
Default
  #13
New Member
 
Antonis
Join Date: Oct 2010
Posts: 13
Rep Power: 16
ANITIX87 is on a distinguished road
I have designed and meshed an industrial windmill in GAMBIT. I now need to analyze its response to flow through the control volume. I need to determine the Coefficients of Lift, Drag, and Moment, and animate its angular motion based on the wind moving past it.

Does the UDF you wrote have to be compiled, or can it be interpreted?

Thank you so much, I will try running the UDF later today and let you know how it goes.

TIS
ANITIX87 is offline   Reply With Quote

Old   October 27, 2010, 11:57
Default
  #14
Member
 
lehoang_mai's Avatar
 
User_CFD
Join Date: Mar 2010
Posts: 48
Rep Power: 16
lehoang_mai is on a distinguished road
Yes, it compiled well on my mechanic. I haven't iterated mesh file, because i didn't know task of problem. What did you write in apflow.c? It's angular motion of windmill, isn't it?
Tell me if you have done!
Regards!
lehoang_mai is offline   Reply With Quote

Old   October 27, 2010, 17:01
Default
  #15
New Member
 
Antonis
Join Date: Oct 2010
Posts: 13
Rep Power: 16
ANITIX87 is on a distinguished road
Thank you so much! Both UDF files compiled perfectly (I finally fixed my environment variables).

The UDF "apflow.c" should create a parabolic flow through the control volume, so that the air does not move in a constant velocity. The other one ("apmotion.c") should calculate the windmill's angular momentum based on the lift forces acting on it, and then send that back to Fluent's dynamic mesh to move the windmill and re-calculate everything.

Now, I have a new problem. I don't know how to make the animation show the windmill's motion. I have run the calculation, and my residuals converge to the values I expect. However, I cannot get the animation to show a moving windmill. Anybody have any feedback??

Thanks again.

TIS
ANITIX87 is offline   Reply With Quote

Old   October 27, 2010, 18:05
Default
  #16
Member
 
lehoang_mai's Avatar
 
User_CFD
Join Date: Mar 2010
Posts: 48
Rep Power: 16
lehoang_mai is on a distinguished road
Congratulations!
Your UDF apflow.c describes sinusoidal velocity from INLET, I'm right?
In order to create animation, go to online help
http://my.fit.edu/itresources/manual...g/node1157.htm
I hope this help.
If you want to create motion of windmill, then to do this: Solve>animate>define>....
On this window, increase "animation sequences" to 1, and define it. Set its name, every, when(iteration or time), define>.....
Regards!
lehoang_mai is offline   Reply With Quote

Old   October 27, 2010, 19:07
Default
  #17
Member
 
Arash
Join Date: Dec 2009
Location: Denmark
Posts: 37
Rep Power: 16
arash_7444 is on a distinguished road
Dear Antonis,

I have not work with UDF too but I just saw your mesh and your geometry and i think you want to analyze Horizontal Wind turbine, am i right?
I think you need to pitch your blades 90 degree because your turbine is rotating. if you don't rotate it 90 degree, then the flow will separate and you will not get proper result for your simulation.

Also about UDF, why dont you use Sliding mesh method to give rotation to your blades? so that you do not need to write any UDF file!

feel free to correct me if I am wrong or I misunderstood something. (i meant everyone )
Good luck
arash_7444 is offline   Reply With Quote

Old   October 27, 2010, 19:44
Default
  #18
New Member
 
Antonis
Join Date: Oct 2010
Posts: 13
Rep Power: 16
ANITIX87 is on a distinguished road
Hi. I have pitched my blades to an angle of attack of 8 degrees, because that is the most commonly used angle for industrial windmills. The windmill is vertical, with flow through its operating diameter wing horizontal. I don't know if you misunderstood that or not. Again, to clarify, I am analyzing axial flow through the turbine's operating circle.

As for the sliding mesh, I don't have any experience with this, so I wouldn't know how to apply it. Will it analyze the forces on the windmill and iterate it for each step to show the acceleration of the windmill, as my UDF is supposed to do?

TIS

Last edited by ANITIX87; October 27, 2010 at 19:54. Reason: clarification of information
ANITIX87 is offline   Reply With Quote

Old   October 27, 2010, 20:32
Default
  #19
Member
 
Arash
Join Date: Dec 2009
Location: Denmark
Posts: 37
Rep Power: 16
arash_7444 is on a distinguished road
Quote:
Originally Posted by ANITIX87 View Post
Hi. I have pitched my blades to an angle of attack of 8 degrees, because that is the most commonly used angle for industrial windmills. The windmill is vertical, with flow through its operating diameter wing horizontal. I don't know if you misunderstood that or not. Again, to clarify, I am analyzing axial flow through the turbine's operating circle.

As for the sliding mesh, I don't have any experience with this, so I wouldn't know how to apply it. Will it analyze the forces on the windmill and iterate it for each step to show the acceleration of the windmill, as my UDF is supposed to do?

TIS

Hi again,

I am sorry, again I think i cannot get what you mean by " the windmill is vertical".
I attach a photo of both "Horizontal axis wind turbine" and "vertical axis wind turbine".
I emphasis again if you analyze "HAWT", pitching your bladed 8 degrees is not correct specially for the tip of your blades.

Concerning Sliding meshes, I suggest you to read Tutorial number 12 of Fluent. it's about Sliding meshes.

About Loads, the answer is i dont know. but if you define your "reference value" then you can get your "CL" and "CD" per iteration or per time step.

good luck
Attached Images
File Type: jpg hawt-vawt.jpg (27.1 KB, 58 views)
arash_7444 is offline   Reply With Quote

Old   October 27, 2010, 23:23
Default
  #20
New Member
 
Antonis
Join Date: Oct 2010
Posts: 13
Rep Power: 16
ANITIX87 is on a distinguished road
Quote:
Originally Posted by arash_7444 View Post
I emphasis again if you analyze "HAWT", pitching your bladed 8 degrees is not correct specially for the tip of your blades.
Yes, I am analyzing a HAWT. I read some literature that listed an angle of attack of 8 degrees as being most common, but I just looked up some pictures and realize that your point is correct. Most windmills have a far greater pitch angle. Unfortunately, it's too late to change this now, as GAMBIT is no longer supported by new versions of FLUENT, apparently.

Thanks again to everyone for the help. I will run my simulation again tomorrow with the UDFs active, and let you all know how it goes!

TIS
ANITIX87 is offline   Reply With Quote

Reply


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 for Viscoelastic Fow in Fluent skris2009 FLUENT 2 September 20, 2011 00:59
Urgent Help Needed!!! (regarding FLUENT UDF) dsen FLUENT 2 May 28, 2010 14:36
need some basic help with fluent udf aarti sekaran FLUENT 8 February 12, 2008 01:57
UDF in parallel version of fluent yobee FLUENT 2 August 5, 2004 01:36
URGENT ! UDF ERROR! Prateep Chatterjee FLUENT 6 October 16, 2001 20:20


All times are GMT -4. The time now is 22:33.