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

access violation error in vof,please help me ?!

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

Reply
 
LinkBack Thread Tools Display Modes
Old   August 25, 2006, 03:57
Default access violation error in vof,please help me ?!
  #1
Asghari
Guest
 
Posts: n/a
I use from following udf for definition heat and mass source terms in vof model. then i hook this source terms to fluent .

But as soon as i start run,i face with access violation error in relation with hooking macro of energy source define in mixture level phase.

/********Defining mass source term for secondary phase*****/

DEFINE_SOURCE(source_mass,cell,cell_thread,ds,eqn)

{

real T_SAT= a value;

real Source ;

Thread *tm=THREAD_SUPER_THREAD(cell_thread);

Thread **pt=THREAD_SUB_THREADS(tm);

Source=0.0;

if(C_T(cell,pt[1])>=T_SAT)

{ Source=-0.1*C_VOF(cell,pt[1])*C_R(cell,pt[1])*fabs(C_T(cell,pt[1]-T_SAT)/T_SAT); }

if((Source=0.0)&&(C_T(cell,pt[1])<=T_SAT))

{ Source=0.1*C_VOF(cell,pt[0])*C_R(cell,pt[0])*fabs(C_T(cell,pt[0]-T_SAT)/T_SAT); }

ds[eqn]=0.0; return Source;

}

ERROR HAPPENED IN FOLLOWING DEFINE_SOURCE MACRO for energy source!!!

/********Defining enthalpy source term for mixture*****/

DEFINE_SOURCE(source_mass,cell,cell_thread,ds,eqn)

{

real T_SAT= a value;

real Source ;

Thread *tm=THREAD_SUPER_THREAD(cell_thread);

Thread **pt=THREAD_SUB_THREADS(tm);

Source=0.0;

if(C_T(cell,pt[1])>=T_SAT)

{ Source=-0.1*C_VOF(cell,pt[1])*C_R(cell,pt[1])*fabs(C_T(cell,pt[1]-T_SAT)/T_SAT); }

if((Source=0.0)&&(C_T(cell,pt[1])<=T_SAT))

{ Source=0.1*C_VOF(cell,pt[0])*C_R(cell,pt[0])*fabs(C_T(cell,pt[0]-T_SAT)/T_SAT); }

ds[eqn]=0.0;

SOURCE_ENERGY=Source*2443000

return SOURCE_ENERGY;

}

Can everybody explain why this access violation error happen in hooking energy define_source in mixture phase?

Best regards;

  Reply With Quote

Old   August 28, 2006, 06:52
Default Re: access violation error in vof,please help me ?
  #2
RoM
Guest
 
Posts: n/a
If you hook the energy source to the mixture then cell_thread will be the mixture thread.

Thread *tm=THREAD_SUPER_THREAD(cell_thread);

will probably cause the crash because cell_thread already refers to the mixture. Delete this line and change the following

Thread **pt=THREAD_SUB_THREADS(tm);

to

Thread **pt=THREAD_SUB_THREADS(cell_thread);

RoM
  Reply With Quote

Reply

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
specified shear at wall - temperature gradient - UDF - access violation error senD Fluent UDF and Scheme Programming 9 September 18, 2014 07:29
UDF Access violation therandomestname FLUENT 0 April 15, 2011 17:31
"Fluent received fatal signal" (access violation) kluni FLUENT 0 April 29, 2010 13:16
Access violation - Help please AlwaysLearning FLUENT 3 August 22, 2006 12:21
Urgent! Access violation of UDF using VOF Rucy FLUENT 0 January 9, 2006 05:01


All times are GMT -4. The time now is 13:56.