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

how to define and initialize a one dimensional array in fluent UDF?

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 7, 2019, 22:05
Default how to define and initialize a one dimensional array in fluent UDF?
  #1
Senior Member
 
Weiqiang Liu
Join Date: Feb 2018
Posts: 170
Rep Power: 3
Weiqiang Liu is on a distinguished road
Hi all,

I met an error while debugging my code. I need to store the species molar weight in the system in an one dimensional array. I define and initialize the array in the following way:
mw[16]={1 2 3 .....16}
However, fluent always give me error for this one dimensional array. I wonder what is the right way to define and initialize an one dimensional array.
Best regards.
Weiqiang.
Weiqiang Liu is offline   Reply With Quote

Old   June 9, 2019, 23:43
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 1,001
Rep Power: 17
AlexanderZ will become famous soon enough
Code:
real mw[16]={1 2 3 .....16};
best regards
AlexanderZ is offline   Reply With Quote

Old   June 9, 2019, 23:52
Default
  #3
Senior Member
 
Weiqiang Liu
Join Date: Feb 2018
Posts: 170
Rep Power: 3
Weiqiang Liu is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
Code:
real mw[16]={1 2 3 .....16};
best regards
Hi Alexander,
Thanks for your concern. Seems like there should have some commas between array elements.
Best
Weiqiang Liu is offline   Reply With Quote

Reply

Tags
array, initialization, one dimensional, udf

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fluent Radiation/porous media Schmitt pierre-Louis FLUENT 26 September 1, 2016 11:29
How to initialize a case file with udf? sima FLUENT 2 August 3, 2010 02:44
HELP----Surface Reaction UDF Ashi Fluent UDF and Scheme Programming 0 May 25, 2009 10:39
Pb with simple Fluent UDF example for inlet francois FLUENT 0 October 9, 2008 11:34
REAL GAS UDF brian FLUENT 6 September 11, 2006 09:23


All times are GMT -4. The time now is 22:54.