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

error C2107: illegal index, indirection not allowed

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 19, 2013, 05:26
Default error C2107: illegal index, indirection not allowed
  #1
Member
 
Join Date: Feb 2012
Posts: 57
Rep Power: 5
Raymond.Leoi is on a distinguished road
An udf is to specify heat flux by means of the secondary gradient source of temperature, C_T_G(c0,t0). The error, error C2107: illegal index, indirection not allowed, occured when executing the following udf. Any suggestion for this problem?

DEFINE_PROFILE(heat_flux_bc, thread, position)
{
face_t face;
Thread *t0;
cell_t c0;
real xf[ND_ND], xf_shdw[ND_ND];
real T0_shdw, Tf_shdw;
real A[ND_ND],At;
real dT[ND_ND],dr0[ND_ND],es[ND_ND],ds,A_by_es;
real gamma0,alpha0,aterm,Tcross,Tprim;

begin_f_loop (face,thread)
{
c0 = F_C0(face,thread);
t0 = THREAD_T0(thread);

BOUNDARY_FACE_GEOMETRY(face,thread,A,ds,es,A_by_es ,dr0);
At = NV_MAG(A);

if (NULLP(T_STORAGE_R_NV(t0,C_T_G(c0,t0))))
Tcross = 0.;
else
BOUNDARY_SECONDARY_GRADIENT_SOURCE(Tcross,C_T_G(c0 ,t0),dT,es,A_by_es,1.);


F_PROFILE(face,thread,position) = 20000.; /* just for udf testing*/
}
end_f_loop (face,thread)
}
Raymond.Leoi is offline   Reply With Quote

Old   March 19, 2013, 07:49
Default
  #2
Senior Member
 
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 545
Rep Power: 12
vasava will become famous soon enough
I think you must point properly the name of the boundary or cell where you want to apply these conditions. Your code has several flaws which are causing the errors.

1. DEFINE_PROFILE(heat_flux_bc, thread, position). I think 'thread' is a keyword and you can not use it to for a boundary name.

2. You must point the face or cell where the condition is applied. e.g.
DEFINE_PROFILE(pressure_profile,t,i)
{
face_t*f;
.....
begin_f_loop(f,t)


Also 'face_t face;' and 'cell_t c0;' together are wrong. You could have either of them. In addition you also have 'Thread *t0;' which is again bit strange.

As far as I know face_, cell_ and Thread *t0 are pointers which point to the surface or cell where the profile is to be applied.

You have declared 'real gamma0,alpha0,aterm,Tcross,Tprim;'. However many of these variables have not be used in the code.

Other Readers: If any of my comments are wrong please correct me.
vasava is offline   Reply With Quote

Old   March 19, 2013, 08:21
Default
  #3
Member
 
Join Date: Feb 2012
Posts: 57
Rep Power: 5
Raymond.Leoi is on a distinguished road
Thanks a lot for your reply, Vasava. It should be fine to declare face, cell and thread in that way. c0 and t0 are for the adjacent cell index and thread respectively. I just demonstrated small part of my udf and those variables including Tcross are used indeed. Anyway, that would not be a problem.


Quote:
Originally Posted by vasava View Post
I think you must point properly the name of the boundary or cell where you want to apply these conditions. Your code has several flaws which are causing the errors.

1. DEFINE_PROFILE(heat_flux_bc, thread, position). I think 'thread' is a keyword and you can not use it to for a boundary name.

2. You must point the face or cell where the condition is applied. e.g.
DEFINE_PROFILE(pressure_profile,t,i)
{
face_t*f;
.....
begin_f_loop(f,t)


Also 'face_t face;' and 'cell_t c0;' together are wrong. You could have either of them. In addition you also have 'Thread *t0;' which is again bit strange.

As far as I know face_, cell_ and Thread *t0 are pointers which point to the surface or cell where the profile is to be applied.

You have declared 'real gamma0,alpha0,aterm,Tcross,Tprim;'. However many of these variables have not be used in the code.

Other Readers: If any of my comments are wrong please correct me.
Raymond.Leoi is offline   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
Ansys Fluent 13.0 UDF compilation problem in Window XP (32 bit) Yogini Fluent UDF and Scheme Programming 7 October 3, 2012 07:24
CFX problem in ubuntu (linux) Vigneshramaero CFX 0 July 13, 2012 10:22
CFX-Pre problem, pls help!!! cth_yao CFX 0 February 17, 2012 01:52
Doxygen documentation Tanay OpenFOAM Installation 9 September 23, 2011 11:40
OpenFOAM install on Ubuntu Natty 11.04 bkubicek OpenFOAM 13 May 26, 2011 05:48


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