CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   CFX (http://www.cfd-online.com/Forums/cfx/)
-   -   CCL Timestep Lists (http://www.cfd-online.com/Forums/cfx/90043-ccl-timestep-lists.html)

max3.2 June 29, 2011 06:41

CCL Timestep Lists
 
Hi,

I've got finished transient Analysis with several timesteps, and i need to run a CCL for every step to extract specified data. Here is a snippet of the problem

Code:

! $ts =350,627,903,1180,1456,1732,2009,2285,2661,2836,3111,3386,3662,3938,4213;

! for($index=1; $cnt<=(15); $cnt++){
> load timestep=$ts[$index]

##Working CCL for one timestep with using the timestep number one time for naming a file like

! open(OFH,">HoeheMassFlowAves $ts[$index].dat");
}

Now im getting an error at the closing bracket position of the 1st for-loop. Im not that good at CCL, nor i can find any libraries, so there are maybe some syntax-erros while using the list. Can someone help? doing this manually would take a lot of time, since playing the CCL for one step is about 15minutes and the list above isnt complete ;)

Regards
Max

Lance June 29, 2011 07:32

I think you need a ! before the last }, like:
Code:

!}
and not
Code:

}

max3.2 June 29, 2011 08:47

Hi Lance,

thanks, would have searched ages for this.

Now, there isn't any error. Session gets loaded, but then nothing happens. Is there a mistake in calling the timesteps from the list? I havent found any examples for lists so i just did it like its used in other languages...

Lance June 29, 2011 09:01

Quote:

Originally Posted by max3.2 (Post 314054)
Now, there isn't any error. Session gets loaded, but then nothing happens. Is there a mistake in calling the timesteps from the list?

I think your for loop definition is wrong, you mix $index with $cnt. Try:

Code:

! for($index=1; $index<=(15); $index++){
Also, indices in arrays are zero-based. Example:
@array=(2,4,8,10);
$var = $array[0]; # gives $var == 2
($var1,$var2) = $array[2,3]; # gives $var1 == 8, $var2 == 10

max3.2 June 29, 2011 10:13

Yeah...sorry for this stupidity, heat around here seems to get in my head :rolleyes:
Its working now, thanks for the great help :)


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