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

Hard problem in simple a rectangle: UDF not optimal?

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

Reply
 
LinkBack Thread Tools Display Modes
Old   November 17, 2011, 09:09
Default Hard problem in simple a rectangle: UDF not optimal?
  #1
New Member
 
Join Date: Nov 2011
Posts: 5
Rep Power: 5
Nano_Cryo is on a distinguished road
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:
n1: steel with a thermal conductivity depending on the temperature (~200W/m/K defined in "materials" with piecewise-linear)
n2: a first insulation layer also depending on the temperature (~0.02W/m/K and also defined with piecewise-linear)
n3: 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
Nano_Cryo is offline   Reply With Quote

Old   November 21, 2011, 09:17
Default
  #2
New Member
 
Join Date: Nov 2011
Posts: 5
Rep Power: 5
Nano_Cryo is on a distinguished road
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?
Nano_Cryo is offline   Reply With Quote

Old   November 21, 2011, 15:28
Default
  #3
New Member
 
PS
Join Date: Aug 2011
Posts: 13
Rep Power: 6
pstreufert is on a distinguished road
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)?
pstreufert is offline   Reply With Quote

Old   November 22, 2011, 06:23
Default
  #4
New Member
 
Join Date: Nov 2011
Posts: 5
Rep Power: 5
Nano_Cryo is on a distinguished road
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???
Nano_Cryo is offline   Reply With Quote

Reply

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
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
UDF Problem ozgur FLUENT 15 March 11, 2004 13:52
extremely simple problem... can you solve it properly? Mikhail Main CFD Forum 40 September 9, 1999 09:11


All times are GMT -4. The time now is 17:35.