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

Declation of a vector in a UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 16, 2013, 05:02
Default Declation of a vector in a UDF
  #1
New Member
 
Join Date: Nov 2012
Location: Paris
Posts: 1
Rep Power: 0
Amelia2 is on a distinguished road
Hello,

I am having some troubles with the declaration of a vector in a UDF. The UDF is used for varying the time step. The vector is using for describing this variation.

In this exemple, I want a first time step of 1, then of 5, then of 2 and finally of 4 for having successively a flow time of 1, 6, 8, 12.

So, I declare the vector by this way :

V[3]=(1, 5, 2, 4);

And then I use a for loop by this way where dt is the time step:

for(i=0; i<=3; i++)

{dt=V[i];}

The problem is that I didn't have the except result. I have successively a flow time of 4, 8, 12, 16.

I think that only the last coordinate of the vector is taken into account. The resulting flow time is the last coordinate, two time the last coordinate, ect.

So, I suppose that I incorrectly declare the vector. In the bracket, I define the vector dimension and in the parenthesis I define the coordinates of the vector.

Can someone explain me how to declare a vector for my purpose ?

Thanks in advance.
Amelia2 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
Dynamic Mesh UDF Qureshi FLUENT 7 March 23, 2017 08:37
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 22:38
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 05:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01


All times are GMT -4. The time now is 20:51.