CFD Online Logo CFD Online URL
Home > Forums > Fluent UDF and Scheme Programming

UDF for a velocity profile: some errors/doubts

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   September 13, 2013, 04:59
Default UDF for a velocity profile: some errors/doubts
Join Date: Jul 2013
Posts: 58
Rep Power: 6
HHOS is on a distinguished road

I am running a case in fluent with a UDF defining the Velocity_inlet profile and I have some problems with it.

First of all, it took me some time to compile the C file in W7-64bits, but thanks to this forum I managed to do it

I am able to run the case and I even get good results, but if I save case and data, close Fluent and open it again to continue with the same case, it gives me the error:
Divergence detected in AMG solver. Error object: #f
I have checked the forums and change the solution methods to the simplest ones, but I get a similar error like:
Divergence detected in AMG x-momentum.
So I wonder if the problem is related to the .c file. I have no idea about programming, but when I saw that I achieved the velocity profile, I let it be as it was.

UDF for specifying steady-state velocity profile boundary condition
#include "udf.h"
DEFINE_PROFILE(wind_velocity_inlet, thread, position)
face_t f;
real x[ND_ND];
real z;

F_PROFILE(f, thread, position) = 5*log(z/0.2)/log(50);
end_f_loop(f, thread)
I read that when I hook the profile to Fluent and save the case, it keep the information about it; but I am not so sure about it because I tried to read another mesh in a loaded case and it didn't work.

Should I always keep the folder "libudf" that is created next to the case file when I compile the velocity_profile or I can embed it somehow in the case file??

I am really confused about the way the UDFs work... So, any help would be great!

Thank you very much!
HHOS is offline   Reply With Quote

Old   September 16, 2013, 17:39
New Member
kornetka's Avatar
Join Date: Jun 2013
Posts: 15
Rep Power: 6
kornetka is on a distinguished road
From my (very little) experience with Fluent and UDF:
Doubt no 2: I did replaced meshes in a case with hooked functions and it all went smoothly - all hooks were saved. I have no idea why it doesn't work for you, but I didn't have any similar problem.
Doubt no 3: As far as I'm concerned you have to keep whole libudf. It has to be compiled and present for every calculations you are performing.
Doubt no 1: Absolutely no reasonable idea what is happening. Since nobody has responded yet I'll try to write some ideas, but don't rely on them too much. 1. Wild guess: Are the results from reloaded case identical to the results you saved? 2. As far as I'm concerned you can also try lowering Under-relaxation factors for momentum (Solution/Solution Controls).
kornetka is offline   Reply With Quote

Old   September 19, 2013, 07:07
Join Date: Jul 2013
Posts: 58
Rep Power: 6
HHOS is on a distinguished road
Hey Kornetka;

Thank you for the reply.

Trying different things I have realized that the UDF libraries make trouble if I create them in a parallel case and load the case later in serial (or in the other way around)...

So, what I do always now if I need to use a UDF function, is to run always in parallel, even if I choose just one core.
HHOS is offline   Reply With Quote


case, libudf, udf

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF problems - velocity profile Oli Fluent UDF and Scheme Programming 6 October 24, 2016 10:38
UDF for inlet velocity profile Bollonga Fluent UDF and Scheme Programming 1 October 6, 2015 12:53
UDF Unsteady velocity profile Rashad FLUENT 0 February 27, 2008 15:57
How to specify the Velocity profile (eqn) by UDF Anant FLUENT 1 February 27, 2008 15:54
Multi step transient UDF velocity profile problem William177 FLUENT 1 February 3, 2008 07:47

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