|
[Sponsors] |
UDF for a velocity profile: some errors/doubts |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 13, 2013, 05:59 |
UDF for a velocity profile: some errors/doubts
|
#1 |
Member
Join Date: Jul 2013
Posts: 98
Rep Power: 13 |
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 Code:
Divergence detected in AMG x-momentum. 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) } 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! |
|
September 16, 2013, 18:39 |
|
#2 |
New Member
Join Date: Jun 2013
Posts: 15
Rep Power: 13 |
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 |
|
September 19, 2013, 08:07 |
|
#3 |
Member
Join Date: Jul 2013
Posts: 98
Rep Power: 13 |
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. |
|
Tags |
case, libudf, udf |
|
|
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 |