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

CCL code Row to Column

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 2, 2012, 12:39
Default CCL code Row to Column
  #1
Member
 
Join Date: Oct 2011
Posts: 32
Rep Power: 14
Cluain is on a distinguished road
This CCL calculates wave height in Post and outputs it to a .csv excel file.
It places the data in a row, how can I change the code so that the data appears in a column?



LIBRARY:
CEL:
EXPRESSIONS:
WaveHeight=lengthInt(Water.Volume Fraction)@Line 1
END
END
END

# Header
! open(OFH,">H3T6.1DATA10.csv");
! print OFH "Time s,";
! print OFH "Wave Height @ 150m, ";
#================================================= ==================
! $numStart = 5;
! $numEnd = 20;
! for (my $i=$numStart; $i<=$numEnd; $i=$i+5) {
> load timestep = $i
> load
! $jjpt1 = getExprVal('WaveHeight');
# Print the lines
! print OFH "$jjpt1, ";
# repeat around loop
! }
!close(OFH);
# ================================================== =================
# end
Cluain is offline   Reply With Quote

Old   October 8, 2012, 07:26
Default
  #2
Member
 
Join Date: Oct 2011
Posts: 32
Rep Power: 14
Cluain is on a distinguished road
Is this possible?
Cluain is offline   Reply With Quote

Old   October 8, 2012, 07:57
Default
  #3
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,700
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
How about load the file in Excel, Copy/Paste special/Transpose and save it again? If you need to script it then a simple perl/python/batch/anything script can do it.

Also try the "\n" string to signify new line in the perl script.
ghorrocks is offline   Reply With Quote

Reply


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
The FOAM Documentation Project - SHUT-DOWN holger_marschall OpenFOAM 242 March 7, 2013 12:30
How to make code run in parallel? cwang5 OpenFOAM Programming & Development 1 May 30, 2011 04:47
Open Source Vs Commercial Software MechE OpenFOAM 28 May 16, 2011 11:02
Small 3-D code Zdravko Stojanovic Main CFD Forum 2 July 19, 2010 10:11
Adding Custom Tab in FLUENT using Scheme Code dhimans Fluent UDF and Scheme Programming 0 September 14, 2009 15:10


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