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

time dependent source using DEFINE_SOURCE

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 16, 2009, 07:22
Default time dependent source using DEFINE_SOURCE
  #1
T81
New Member
 
Join Date: Mar 2009
Posts: 15
Rep Power: 17
T81 is on a distinguished road
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;
}
T81 is offline   Reply With Quote

Old   March 16, 2009, 07:55
Default
  #2
Member
 
Henrik Ström
Join Date: Mar 2009
Posts: 33
Rep Power: 17
HenrikS is on a distinguished road
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
HenrikS is offline   Reply With Quote

Old   March 16, 2009, 08:38
Default
  #3
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20
dmoroian is on a distinguished road
Hi T81,
Did you try to use DEFINE_HEAT_FLUX or DEFINE_PROFILE macros?

Dragos
dmoroian is offline   Reply With Quote

Old   March 16, 2009, 08:42
Default
  #4
T81
New Member
 
Join Date: Mar 2009
Posts: 15
Rep Power: 17
T81 is on a distinguished road
Now I'm trying the DEFINE_PROFILE macro and its seems to work.

Thanks both of you for the replies.
T81 is offline   Reply With Quote

Old   February 28, 2011, 14:16
Default
  #5
New Member
 
lyes
Join Date: Feb 2011
Posts: 24
Rep Power: 15
lyes43 is on a distinguished road
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
lyes43 is offline   Reply With Quote

Old   February 28, 2011, 18:23
Default
  #6
T81
New Member
 
Join Date: Mar 2009
Posts: 15
Rep Power: 17
T81 is on a distinguished road
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
T81 is offline   Reply With Quote

Reply

Tags
define_source, time dependent


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
Time Dependent Temperature Dependent BC Analysis RP Main CFD Forum 1 March 28, 2008 02:22
Linearization of time dependent source variable CFDtoy Main CFD Forum 0 June 1, 2007 15:05
Time dependent Energy source Nitesh Main CFD Forum 0 July 17, 2006 14:19
time dependent energy source Nitesh FLUENT 0 July 17, 2006 14:14
time dependent source gbj FLUENT 1 April 9, 2005 09:06


All times are GMT -4. The time now is 15:02.