CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Subscripted value is neither array nor pointer

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 19, 2018, 06:42
Default Subscripted value is neither array nor pointer
  #1
New Member
 
Enrique Pérez Heredia
Join Date: May 2018
Location: Madrid, Spain.
Posts: 16
Rep Power: 8
EnriqueP is on a distinguished road
Im having some trouble trying to impose the movement in two directions.
My UDF is the following:

DEFINE_CG_MOTION(OW_fall, dt, vel, omega, time, dtime)
{
/* reset velocities */
NV_S(vel[0], =, 40.0);
NV_S(vel[1], =, -1.5);
NV_S(omega, =, 0.0);
if (!Data_Valid_P())
return;

}

I get an error of the type "error: subscripted value is neither array nor pointer". Apparently it is related with the definition of the array vel which I think is defined by default as a 3-d array.

Any suggestions?
Thnaks.
__________________
Loading signature...
EnriqueP is offline   Reply With Quote

Old   June 19, 2018, 09:42
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
The NV_S macro is for operating on a vector with a scalar. For example in 2-D, NV_S(vel,=,0.0) is the same as applying vel[0]=0.0 and vel[1]=0.0.

For your case, the non-uniform velocity components could be applied with:

Code:
vel[0] = 40.0;
vel[1] = -1.5;
`e` is offline   Reply With Quote

Old   June 19, 2018, 10:01
Default
  #3
New Member
 
Enrique Pérez Heredia
Join Date: May 2018
Location: Madrid, Spain.
Posts: 16
Rep Power: 8
EnriqueP is on a distinguished road
Thank you 'e'. I tried your way and it worked.

It is quite strange because after this case I was doing a 2-D simulation using this UDF
DEFINE_CG_MOTION(OW_fall, dt, vel, omega, time, dtime)
{
/* reset velocities */
NV_S(vel[1], =, -5.0);
NV_S(omega, =, 0.0);
if (!Data_Valid_P())
return;

}

Thank you againand see you around.
__________________
Loading signature...
EnriqueP is offline   Reply With Quote

Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to define the two-dimensional array in OpenFOAM use List SH_Zhong OpenFOAM 2 December 29, 2016 01:20
[General] Contour plot: celldata2pointdata dmaz ParaView 1 April 28, 2014 17:05
multi-dimensional dynamic array allocation for multi-block solver using fortran mano Main CFD Forum 4 June 25, 2012 22:01
An unknown array definition in fortran morteza08 Main CFD Forum 0 June 20, 2011 05:32
ODETest.C Compiling failed in version 1.6 sxhdhi OpenFOAM Bugs 4 April 27, 2010 06:36


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