CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Heat generation is depend on x value and time. (http://www.cfd-online.com/Forums/fluent-udf/79820-heat-generation-depend-x-value-time.html)

omurakbayir September 5, 2010 13:17

Heat generation is depend on x value and time.
 
Hi,

Heat generation is depend on x value and time in my simulation.
How to add x variation below code?

#include "udf.h"
DEFINE_SOURCE(heat_gen_time,cell,thread,dS,eqn)
{
real source;
real time;
time = CURRENT_TIME;
source = 86.44*pow(time,-.3);
dS[eqn] = -25.932*pow(time,-1.3);
return source;
}

behzadniknam September 20, 2010 07:08

how i can solve this error in fluent heat vulometric source
 
#include "udf.h"
#include "defines.h"
#define Q 20000000
#define H 5// flame hight above floor
#define D .5//cell size
#define DX D
#define DY D
#define DZ D
DEFINE_SOURCE(heat_source, c, t, dS, eqn)
{
real x[ND_ND];
real V=DX*DY*DZ;
C_CENTROID(x,c,t);
if (fabs(x[0])<DX/2 && fabs(x[2])<DZ/2 && fabs(x[1]+DY)<H){
return Q/V;
}
else {
return 0.0;
}
}
************************************************** **
*************************************************
error how i can solve this error
************************************************** *******
chip-exec: heat_source: wrong return type: void udf function expected
Error:
FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
Error Object: ()

omurakbayir October 26, 2010 15:46

Hi,

Heat generation is depend on x value in my simulation.


What is problem in my udf?

#include "udf.h"
#define pi 3.141592653589793238462643383279502884197169399375 10
DEFINE_SOURCE(heat_gen_x,cell,thread,dS,eqn)
{
real source;
real x [ND_ND];
real a;
face_t f;
begin_f_loop(f,thread)
{
F_CENTROID(x, f, thread);
a=x[0];
source = 6500000*1.2*cos(pi*(1.0267*((2*(a-1.189)/0.793)-1)));
}
end_f_loop(f,thread)
}


All times are GMT -4. The time now is 04:09.