CFD Online Logo CFD Online URL
Home > Forums > FLUENT

Change the energy Eq.

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

LinkBack Thread Tools Display Modes
Old   May 4, 2011, 03:53
Default Change the energy Eq.
New Member
Join Date: Apr 2011
Posts: 18
Rep Power: 8
m.reza is on a distinguished road
I write this udf and when I run it in fluent I have this error:
" 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: ()
and my udf is:
#include "udf.h"
#define C_teta 0.3
#define P_t 0.85


DEFINE_SOURCE(source_energy , cell, thread, dS, eqn)
real coord[ND_ND];
real source,y,T,nu_t,S11,S12,S22;

C_CENTROID(coord,cell, thread);
y = coord[1];

nu_t = C_MU_T(cell,thread)/C_R(cell,thread);
T = C_K(cell, thread)/C_D(cell, thread);

S11 = 0.5*(C_DUDX(cell,thread)+C_DUDX(cell,thread));
S12 = 0.5*(C_DUDY(cell,thread)+C_DVDX(cell,thread));
S22 = 0.5*(C_DVDY(cell,thread)+C_DVDY(cell,thread));

C_UDSI(cell, thread,source1) = T*(2*C_K(cell, thread)/3-2*nu_t*S11)*C_T_G(cell,thread)[0]+T*(-2*nu_t*S12)*C_T_G(cell,thread)[1];
C_UDSI(cell, thread,source2) = T*(-2*nu_t*S11)*C_T_G(cell,thread)[0]+T*(2*C_K(cell, thread)/3-2*nu_t*S22)*C_T_G(cell,thread)[1];
C_UDSI(cell, thread,source3) = nu_t*C_T_G(cell,thread)[0]/P_t;
C_UDSI(cell, thread,source4) = nu_t*C_T_G(cell,thread)[1]/P_t;

source = 0.4*C_teta*C_R(cell,thread)*C_CP(cell,thread)*((C_ UDSI_G(cell, thread,source1)[0])+(C_UDSI_G(cell, thread,source2)[1])-(C_UDSI_G(cell, thread,source3)[0])-(C_UDSI_G(cell, thread,source4)[1]));

dS[eqn] = 0.0;

return source;

plz help me.
m.reza is offline   Reply With Quote


Thread Tools
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
energy in sonicFoam joern OpenFOAM Running, Solving & CFD 0 June 16, 2009 15:53
Incompressible flow: mechanical energy terms Pinaki Bhattacharya FLUENT 0 January 29, 2009 13:33
SIMPLE and energy equation convergence Fabio Main CFD Forum 0 June 1, 2007 06:06
Multicomponent fluid Andrea CFX 2 October 11, 2004 05:12
The energy conservation in a case of phase change robin Phoenics 2 April 6, 2002 00:09

All times are GMT -4. The time now is 19:43.