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

ACCESS_VIOLATION DEFINE_ADJUST and DEFINE_EXECUTE_AT_END

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 30, 2010, 11:39
Default ACCESS_VIOLATION DEFINE_ADJUST and DEFINE_EXECUTE_AT_END
  #1
New Member
 
sm
Join Date: Jun 2009
Posts: 14
Rep Power: 8
swati_mohanty is on a distinguished road
Hello,

I have been using the same code for both 2D and Axis-symmetry. while it does not give any error when using with 2D, I get ACCESS_VIOLATION when I use it with Axis symmetry. I have two faces (one solid and the other fluid in the case of axis symmetry since there is a small solid cylinder at the center of the big cylinder). I have tried hooking after few iterations, but it does not work. The code is as given below

DEFINE_ADJUST(adjust_conc,domain)
{
Domain *d;
Thread *t;
cell_t c;

if (! Data_Valid_P())
return;

thread_loop_c (t,domain)
{
begin_c_loop (c,t)
{
if (C_UDSI(c,t,1) < 0)

{C_UDSI(c,t,1) = 0.0;

}
else
{C_UDSI(c,t,1)= C_UDSI(c,t,1);
}

if (C_UDSI(c,t,2) < 0)

{C_UDSI(c,t,2) = 0.0;

}
else
{C_UDSI(c,t,2)=C_UDSI(c,t,2);
}
}
end_c_loop (c,t)
}

}
DEFINE_EXECUTE_AT_END(execute_at_end)
{
Domain *d;
Thread *t;
cell_t c;
d = Get_Domain(1);
thread_loop_c (t,d)
{
begin_c_loop (c,t)
{
C_UDSI(c,t,4)=C_UDSI(c,t,0)+ C_UDSI(c,t,3);
if (C_UDSI(c,t,1) <0.)
{C_UDSI(c,t,1)=0.;}
if (C_UDSI(c,t,2)<0.)
{C_UDSI(c,t,2)=0.;}
}
end_c_loop (c,t)
}
}

Thanx

SM
swati_mohanty is offline   Reply With Quote

Old   August 3, 2010, 09:16
Default
  #2
Member
 
Akour
Join Date: May 2009
Posts: 79
Rep Power: 8
ak6g08 is on a distinguished road
make sure you use the horizontal x-axis as the axis of symmetry...have you done that?
__________________
akour
ak6g08 is offline   Reply With Quote

Old   August 3, 2010, 09:31
Default
  #3
New Member
 
sm
Join Date: Jun 2009
Posts: 14
Rep Power: 8
swati_mohanty is on a distinguished road
Thanx, yes I already have done that. I have now changed the geometry and eliminated the solid face ( I do not deal with heat transfer) and the UDF works fine.

sm
swati_mohanty is offline   Reply With Quote

Reply

Tags
access_violation, axis_symmetry, define_adjust

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



All times are GMT -4. The time now is 16:50.