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

Define_Source UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 17, 2011, 06:37
Default Define_Source UDF
  #1
Member
 
Stephan Langenberg
Join Date: Sep 2011
Location: Germany
Posts: 73
Rep Power: 14
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


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
Dynamic Mesh UDF Qureshi FLUENT 7 March 23, 2017 07:37
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 21:38
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 04:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 04:01


All times are GMT -4. The time now is 01:30.