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 Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 7, 2019, 21:05
Default how to define and initialize a one dimensional array in fluent UDF?
  #1
Senior Member
 
Weiqiang Liu
Join Date: Feb 2018
Posts: 278
Rep Power: 9
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, 22:43
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ 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, 22:52
Default
  #3
Senior Member
 
Weiqiang Liu
Join Date: Feb 2018
Posts: 278
Rep Power: 9
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


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
HELP----Surface Reaction UDF Ashi Fluent UDF and Scheme Programming 1 May 19, 2020 21:13
Fluent Radiation/porous media Schmitt pierre-Louis FLUENT 26 September 1, 2016 10:29
How to initialize a case file with udf? sima FLUENT 2 August 3, 2010 01:44
Pb with simple Fluent UDF example for inlet francois FLUENT 0 October 9, 2008 10:34
REAL GAS UDF brian FLUENT 6 September 11, 2006 08:23


All times are GMT -4. The time now is 04:52.