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

energy source UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 1, 2006, 03:46
Default energy source UDF
  #1
Jason
Guest
 
Posts: n/a
Hi,

I have a trouble about UDF. The energy produced by the chip is varied with time. Anyone can help me modify the UDF? Thanks~~

/* Heat Generation Rate UDF */

#include "udf.h"

DEFINE_SOURCE(source, cell, thread) {

real T = CURRENT_TIME ; real source ; real s1, s2, s3, s4 ; s1=10E+5 ; s2=5*10E+5 ; s3=2*10E+6 ;

if (T <= 0.05)

source = s1;

else if (0.05< T <= 0.15)

source = s2;

else if (0.15 < T)

source = s3;

return source; }
  Reply With Quote

Old   August 1, 2006, 05:43
Default Re: energy source UDF
  #2
Anon
Guest
 
Posts: n/a
A source term also needs its derivative. that is missing in all the conditions. Derivative term here is zero since your source is a constant. Units are: W/m3. Please check an example UDF in the manual.
  Reply With Quote

Old   August 2, 2006, 03:35
Default Re: energy source UDF
  #3
Jason
Guest
 
Posts: n/a
Hi Anon,

I changed my UDF as following but the result is incorrect. Could you tell me where is the error? Thanks!

* Heat Generation Rate UDF */

#include "udf.h" DEFINE_SOURCE(heat_source, cell, thread, dS, eqn)

{

real T = CURRENT_TIME ; real source ; real s1, s2, s3, s4 ; s1=5*10E+7 ; s2=10E+5 ; s3=2*10E+7 ;

if (T <= 1.5)

source = s1;

else if (1.5 < T <= 2)

source = s2;

else if (2 < T)

source = s3;

return source; }

  Reply With Quote

Old   August 2, 2006, 15:30
Default Re: energy source UDF
  #4
summer
Guest
 
Posts: n/a
You need add the derivative as ds[eqn]=0 since it seems that s1 et.al are constant. Hope it helps.
  Reply With Quote

Reply


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
Mass and energy source - evaporation neilduffy1024 ANSYS 4 July 17, 2013 00:50
Writing UDF energy source file JoFFe FLUENT 0 October 4, 2010 17:48
Momentum source UDF Matthew Brannock FLUENT 5 May 3, 2001 22:18
UDFs for Scalar Eqn - Fluid/Solid HT Greg Perkins FLUENT 0 October 14, 2000 00:03
UDFs for Scalar Eqn - Fluid/Solid HT Greg Perkins FLUENT 0 October 11, 2000 04:43


All times are GMT -4. The time now is 02:52.