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

UDF for a velocity profile: some errors/doubts

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 13, 2013, 05:59
Default UDF for a velocity profile: some errors/doubts
  #1
Member
 
Join Date: Jul 2013
Posts: 98
Rep Power: 13
HHOS is on a distinguished road
Hello!

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

FIRST DOUBT
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:
Code:
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:
Code:
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.


Code:
/***********************************************************************
v_profile.c
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;

begin_f_loop(f,thread)
{
F_CENTROID(x,f,thread);
z=x[2];
F_PROFILE(f, thread, position) = 5*log(z/0.2)/log(50);
}
end_f_loop(f, thread)
}
SECOND DOUBT
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.

THIRD DOUBT
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, 18:39
Default
  #2
New Member
 
kornetka's Avatar
 
Join Date: Jun 2013
Posts: 15
Rep Power: 13
kornetka is on a distinguished road
Hi
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
kornetka is offline   Reply With Quote

Old   September 19, 2013, 08:07
Default
  #3
Member
 
Join Date: Jul 2013
Posts: 98
Rep Power: 13
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

Reply

Tags
case, libudf, 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 for inlet velocity profile Bollonga Fluent UDF and Scheme Programming 4 June 29, 2021 05:40
UDF problems - velocity profile Oli Fluent UDF and Scheme Programming 6 October 24, 2016 11:38
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 02:45.