CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   how to define and initialize a one dimensional array in fluent UDF? (https://www.cfd-online.com/Forums/fluent/218097-how-define-initialize-one-dimensional-array-fluent-udf.html)

Weiqiang Liu June 7, 2019 21:05

how to define and initialize a one dimensional array in fluent UDF?
 
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.

AlexanderZ June 9, 2019 22:43

Code:

real mw[16]={1 2 3 .....16};
best regards

Weiqiang Liu June 9, 2019 22:52

Quote:

Originally Posted by AlexanderZ (Post 735802)
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


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