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

load moving heat flux by using DEFINE_SOURCE UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 7, 2020, 09:24
Default load moving heat flux by using DEFINE_SOURCE UDF
  #1
New Member
 
qujiaqi
Join Date: Jul 2020
Posts: 2
Rep Power: 0
qujiaqi is on a distinguished road
hey guys,i am trying to define source term of energy eqution,like using DEFINE_SOURCE to define moving heat flux,it can be interpreted but there is nothing change with temperature.my UDF is:
#include "udf.h"

DEFINE_SOURCE(flux_profile,c,t,ds,eqn)
{
real d[ND_ND];
real x;
real y;
real z;
real flow_time = RP_Get_Real("flow-time");
real source;
C_CENTROID(d,c,t);
x = d[0];
y = d[1];
z = d[2];
source = 7e18* exp(-3 * (pow((x- 0.03 * flow_time),2)+pow((y-0.003),2)+(pow((z-0.0015),2)))/0.0003/0.0003);
ds[eqn] = 0.0;
return source;
}

i hope you can help me ,thank you so much~~
qujiaqi is offline   Reply With Quote

Old   July 8, 2020, 04:35
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Code:
#include "udf.h"

DEFINE_SOURCE(flux_profile,c,t,ds,eqn)
{
real d[ND_ND];
real x;
real y;
real z;
real flow_time;
real source;
C_CENTROID(d,c,t);
flow_time = RP_Get_Real("flow-time")
x = d[0];
y = d[1];
z = d[2];
source = 7e18* exp(-3 * (pow((x- 0.03 * flow_time),2)+pow((y-0.003),2)+(pow((z-0.0015),2)))/0.0003/0.0003);
ds[eqn] = 0.0;
return source;
}
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ 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
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 07:00
Space- and time-dependant heat flux via UDF flotus1 Fluent UDF and Scheme Programming 4 September 10, 2012 08:00
UDF to calculate average heat flux dynamics Fluent UDF and Scheme Programming 0 July 21, 2012 18:54
Laser Heat Flux & UDF Dominick FLUENT 3 February 12, 2004 15:46
Heat flux UDF problem Paul FLUENT 1 September 11, 2003 06:13


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