|
[Sponsors] |
August 1, 2006, 03:46 |
energy source UDF
|
#1 |
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; } |
|
August 1, 2006, 05:43 |
Re: energy source UDF
|
#2 |
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.
|
|
August 2, 2006, 03:35 |
Re: energy source UDF
|
#3 |
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; } |
|
August 2, 2006, 15:30 |
Re: energy source UDF
|
#4 |
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.
|
|
|
|
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 |