# time dependent source using DEFINE_SOURCE

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

 March 16, 2009, 06:22 time dependent source using DEFINE_SOURCE #1 New Member   Join Date: Mar 2009 Posts: 15 Rep Power: 17 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, 06:55 #2 Member   Henrik Ström Join Date: Mar 2009 Posts: 33 Rep Power: 17 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, 07:38 #3 Senior Member     Dragos Join Date: Mar 2009 Posts: 648 Rep Power: 20 Hi T81, Did you try to use DEFINE_HEAT_FLUX or DEFINE_PROFILE macros? Dragos

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

 February 28, 2011, 13:16 #5 New Member   lyes Join Date: Feb 2011 Posts: 24 Rep Power: 15 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, 17:23 #6 New Member   Join Date: Mar 2009 Posts: 15 Rep Power: 17 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