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

Define_Source UDF

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

Reply
 
LinkBack Thread Tools Display Modes
Old   December 17, 2011, 07:37
Default Define_Source UDF
  #1
Member
 
Stephan Langenberg
Join Date: Sep 2011
Location: Germany
Posts: 73
Rep Power: 5
Jim87 is on a distinguished road
Hi there,
I'm trying to write a UDF for an periodic heat source. The UDF should look like a saw tooth thread design.

I'm very new to UDF, but In my opinion the errors are in the first lines (in the "initialization")

- It should be a transient funcion (heat source depends on time)
- Heat is generated in an Interior (3D)

Maybe someone of you see the mistake(s) in this UDF

include "udf.h"

Define_Source(heat_function, c, t, dS, eqn)

{
real t = CURRENT_TIME;
{
if (CURRENT_TIME > 151.76)
heat_flux = 0.1;

else if (CURRENT_TIME >= 2.24 && CURRENT_TIME <= 2.96)
heat_flux = 200000;

else if (CURRENT_TIME >= 27.04 && CURRENT_TIME <= 27.76)
heat_flux = 200000;

else if CURRENT_TIME >= 51.84 && CURRENT_TIME <= 52.56)
heat_flux = 200000;

else if (CURRENT_TIME >= 76.64 && CURRENT_TIME <= 77.36)
heat_flux = 200000;

else if (current_time >= 101.44 && CURRENT_TIME <= 102.16)
heat_flux = 200000;

else if (CURRENT_TIME >= 126.24 && CURRENT_TIME <= 126.96)
heat_flux = 200000;

else if (CURRENT_TIME >= 151.04 && CURRENT_TIME <= 151.76)
heat_flux = 200000;

else
heat_flux = 0.0;
}
}
return heat_flux;
Jim87 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
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 21:38
Dynamic Mesh UDF Qureshi FLUENT 1 December 2, 2009 01:27
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 05:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01


All times are GMT -4. The time now is 19:14.