# time dependent source using DEFINE_SOURCE

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

 March 16, 2009, 07:22 time dependent source using DEFINE_SOURCE #1 New Member   Join Date: Mar 2009 Posts: 15 Rep Power: 9 Hi! I'm doing a transient analysis is a 2D channel: ..............____________________________ heat --> |............................................ | flux ---> |____________________________| fluid ---> ----------------axis-------------------- ..............____________________________ heat --> |............................................ | flux ---> |____________________________| I want to have a time dependent heat flux for the side walls (shown above). I'm using the following code but I get the following error: "chip-exec: qmax_source: wrong return type: void udf function expected" I'm hooking the udf under Boundary Conditions --> Wall --> Heat Flux What's wrong? Thank you in advance. Code: ```/**************************************/ /* UDF for specifying time dependent heat source */ /**************************************/ #include "udf.h" #define QMAX 156589 DEFINE_SOURCE(qmax_source,c,t,dS,eqn) { real source; real time = CURRENT_TIME; if (time <= 100) /* time 0-100 q = QMAX */ { /* source term */ source = QMAX; /* derivative of source term. */ dS[eqn] = 0.; } if (time > 100 && time < 200) /* time 100-200 q = 0 */ { source = dS[eqn] = 0.; } if (time >= 200 && time < 300) /* time 200-300 q = QMAX */ { source = QMAX; dS[eqn] = 0.; } if (time >= 300 && time <400) /* time 300 -400 q = 0 */ { source = dS[eqn] = 0.; } else if (time >= 400)/* time 400- q = QMAX */ { source = QMAX; dS[eqn] = 0.; } return source; }```

 March 16, 2009, 07:55 #2 Member   Henrik Ström Join Date: Mar 2009 Posts: 32 Rep Power: 9 This is not my area of expertise, but anyway... What the error message is saying is that you are using the wrong type of macro. It seems you cannot hook a DEFINE_SOURCE-macro to the BC->Wall->Heat Flux panel. I suggest you try writing a DEFINE_HEAT_FLUX-macro instead (see UDF manual chapter 2.3.8)? Hope this helps! /Henrik

 March 16, 2009, 08:38 #3 Senior Member     Dragos Join Date: Mar 2009 Posts: 648 Rep Power: 12 Hi T81, Did you try to use DEFINE_HEAT_FLUX or DEFINE_PROFILE macros? Dragos

 March 16, 2009, 08:42 #4 New Member   Join Date: Mar 2009 Posts: 15 Rep Power: 9 Now I'm trying the DEFINE_PROFILE macro and its seems to work. Thanks both of you for the replies.

 February 28, 2011, 14:16 #5 New Member   lyes Join Date: Feb 2011 Posts: 24 Rep Power: 7 Hello T 81 i'm a student I 'm working on simulate a turbulent flow in a rectangular channel were heat blocks are amounted using Fluent i had some problems need a help if u can hlp me write to me lyes43@yahoo.com

 February 28, 2011, 18:23 #6 New Member   Join Date: Mar 2009 Posts: 15 Rep Power: 9 Hi lyes43, I would be glad to help you (if I'm able to...) if you could describe your problem more specifically. You can start a new thread for that, if this is not the appropriate thread. Regards, t81

 Tags define_source, time dependent

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post RP Main CFD Forum 1 March 28, 2008 02:22 CFDtoy Main CFD Forum 0 June 1, 2007 14:05 Nitesh Main CFD Forum 0 July 17, 2006 13:19 Nitesh FLUENT 0 July 17, 2006 13:14 gbj FLUENT 1 April 9, 2005 08:06

All times are GMT -4. The time now is 20:38.