|
[Sponsors] |
Hard problem in simple a rectangle: UDF not optimal? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 17, 2011, 08:09 |
Hard problem in simple a rectangle: UDF not optimal?
|
#1 |
New Member
Join Date: Nov 2011
Posts: 5
Rep Power: 14 |
Hi everybody,
Im facing a hard problem which seemed really easy at first sight. My case here is 2D, steady and purely thermal. It's a rectangle representing 3 layers: n°1: steel with a thermal conductivity depending on the temperature (~200W/m/K defined in "materials" with piecewise-linear) n°2: a first insulation layer also depending on the temperature (~0.02W/m/K and also defined with piecewise-linear) n°3: another insulation layer, here again depending on T and defined the same way (~0.01W/m/K) The two sides are defined as Symetries and the bottom wall is defined with a 20K temperature. I apply a convection flux on the top wall with an UDF, which defines a flux depending on the temperature: phi=f(T) Here is my UDF: #include "udf.h" DEFINE_PROFILE(name,thread,i) { real T_p; /* T_p is the top wall temperature*/ face_t f; begin_f_loop(f,thread) { T_p=F_T(f,thread); if((T_p>=1)&&(T_p<306)) {F_PROFILE(f,thread,i)=-128*T_p+39168;} if((T_p>=306)&&(T_p<310)) {F_PROFILE(f,thread,i)=-2.075*T_p+634.9;} if((T_p>=310)&&(T_p<320)) {F_PROFILE(f,thread,i)=-3.57*T_p+1098;} if((T_p>=320)&&(T_p<1320)) {F_PROFILE(f,thread,i)=-4.6*T_p+1428;} } end_f_loop(f,thread) } My problem is that this calculation leads to asymetric solutions in temperature (isolated hot cells for instance) which is not physical! Since I applied a single definition on a perfectly straight wall (im considering rectangle, remember?), i'm expecting a perfectly symetrical solution. Even worse, if you only consider the first equation, the calulation diverges and fails! #include "udf.h" DEFINE_PROFILE(name,thread,i) { real T_p; face_t f; begin_f_loop(f,thread) { T_p=F_T(f,thread); F_PROFILE(f,thread,i)=-128*T_p+39168; } end_f_loop(f,thread) } I literaly tried a million things to have it run propely and nothing worked, no collegue found a solution and even the Fluent Support Line could not help me... The only I could do was reducing the under-relaxation factor for energy down to 0.3 which is too low to be used later on in my model! I would highly appreciate any help, any idea, any thought which would lead to the very beginning of a solution. Dont hesitate of you have any question to ask or to contact me! Thanks everybody, Nano |
|
November 21, 2011, 08:17 |
|
#2 |
New Member
Join Date: Nov 2011
Posts: 5
Rep Power: 14 |
No idea? I'd really appreciate some help!
Has nobody experienced problem in a thermal case (no fluid) involving a profile defined through an UDF? |
|
November 21, 2011, 14:28 |
|
#3 |
New Member
PS
Join Date: Aug 2011
Posts: 13
Rep Power: 14 |
Have you tried running the simulation with a constant heat flux applied rather than using a UDF to try and isolate your problem (pin down whether it's a issue with the model vs. the UDF)?
|
|
November 22, 2011, 05:23 |
|
#4 |
New Member
Join Date: Nov 2011
Posts: 5
Rep Power: 14 |
First of all: thx for your answer!
Yes I did and it worked! Which is why Im confused... I tried udf removing my first linear equation (and leting my materials defined as function of temperature) and it worked perfectly, leading me to the conclusion that the problem was due to that particular equation being too... something ^^ Then I tried my UDF (with the first equation) but replacing each material by regular Aluminim from Fluent database: no problem, everything worked fine, leading to a second conclusion: my first equation can be supported by Fluent in that case. It also meant that maybe the problem was due to the duo fluxe(T) vs lambdaS(T) --> I insist on the "S" since i have 3 different material function of the temperature. I tried then to define my materials with a common but fixed lambda, which is an approximative value within them: 0.02. I used my regular UDF (with the first equation). Boom! Fluent cant have it work propely. Conclusion: No problem with my UDF but with the lambda. Summing up: -UDF minus 1st equation + my materials: OK -UDF + Aluminum: OK -UDF + my materials: pb -UDF + fixed value (0.02): pb Any ideas??? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF Problem | ozgur | Fluent UDF and Scheme Programming | 18 | January 17, 2016 14:40 |
Pb with simple Fluent UDF example for inlet | francois | FLUENT | 0 | October 9, 2008 10:34 |
problem in compoile UDF | h.daniyel | FLUENT | 5 | June 12, 2008 05:06 |
fluent UDF external library lapack problem | Rick | FLUENT | 0 | May 7, 2008 10:16 |
extremely simple problem... can you solve it properly? | Mikhail | Main CFD Forum | 40 | September 9, 1999 09:11 |