CFD Online Discussion Forums

CFD Online Discussion Forums (
-   STAR-CD (
-   -   Star-cd Macro Loop Results (

SMM April 25, 2011 20:33

Star-cd Macro Loop Results
Hi every one,

I am a new user of star-cd (v-3.14) and need some help regarding the loop defined in Macro file. The loop itterate for 1000 times and calculate two user defined parameters for each cell set through *GET command. This loop is working well but the problem is that I need to copy the values of parameters into excel for further calculations and I cannot find a way to achieve this. There are 1000 values in total and copy/paste option is not feasible for this kind of an issue, I believe there must be some way to list all the values of the parameters in a column (like a text file) so that they can be easily pasted in excel. If some one has any clue over this issue kindly reply soon.

Thanks a lot

Pauli April 26, 2011 10:36

The command sdata will write your graph register information to a text file. You can then import that file into Excel.

At the command line enter "help sdata" to see command options & required inputs..

SMM April 26, 2011 23:11

Reply to Pauli by SMM
Hi Pauli,

Thanks for replying. Actually the problem is that I have already tried to use a command in my loop that saves the post registers (all) in a .usr file but I cannot get the data for every itteration i.e. it only stores the information regarding to the last itteration of the loop and thus only creates one such file (logically If a command is used within a loop it should function every time it is executed and must therefore create many files with .usr extension, but I think it is not possible in STAR-CD to generate as many files as one wants with the same extension but each time with a different name. Secondly the data of the loop cannot be saved in a graph register so I need to print all the values of my parameter on the screen in form of a column vector or a row vector I have found out that *list command can do this but it cannot print it in a column vector or a row vector form. If you have any idea about this issue kindly share it with me.

Thanks a Lot.

Pauli April 27, 2011 10:23

Sorry, but I do not understand exactly what you are trying to achieve.

It sounds like you are computing some parameter. You can use the gparam command to push those values into graph registers (row & column).

After the loop finishes, use sdata to write the entire graph registers to disk.

SMM April 28, 2011 05:28

Hi Pauli,

Yes u r absolutely right I have been trying to calculate a user defined parameter for every cell set in my domain (A pipe that consist of 1000 cell sets in axial direction). The loop updates the cell set each time it is called and than the parameter is calculated again. So now your suggestion is to save 1000 values of this parameter into a graph register using a gparam command o.k I will definitely try this and share with you the result. Another problem is that the loop calculates the parameter acurately but if I use the *set command to define a new numeric parameter that is a ratio of the old parameter defined by the *get command (the one that is being calculated by the loop) and a constant (*set,TB,PARAMETER/CONSTANT) the loop is not calculating the parameter TB at all?. I have seen that *set command is used for these kinds of issues in the post manuals but surprisingly it is not working in the loop.

Pauli April 28, 2011 10:41

You need to put a space between the variables/constants & the operators:
And all terms are evaluated strictly from left to right!

Documentation for this can be found by entering the command "help program"

SMM May 2, 2011 20:27

Hi Pauli,

Thanks a lot for your valuable guidance and suggestions that came at the right time. I implemented the GPARAM command within the loop and also corrected the *SET command format. Finally now the parameter (bulk temperature TB) can be easily saved into a graph register (which can be thought as an array to store vector data in STAR-CD) and I can easily convert it in a text file to calculate the local Nusselt number variation at the wall in Excel.

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