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

creating csv files

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 1, 2009, 09:14
Default creating csv files
  #1
New Member
 
Christopher Barry
Join Date: Aug 2009
Location: Switzerland
Posts: 18
Rep Power: 16
cbarry is on a distinguished road
Hi everyone,

this may sound very simple, but I am new to OpenFOAM and am struggling a little.
I am trying to get OpenFOAM to write out the wall shear stress into a simple csv file. For this I was going to modify the wallShearStress.C postprocessing application. However, I have not managed to get OpenFOAM to write the data out as a list in the following format:

x, y, z, wall shear stress in x, directionm wall shear stress in y direction, wall shear stress in z direction

I have tried using the following line:

Info << mesh.Cf().boundaryField()[patchi] << wallShearStress.boundaryField()[patchi] << endl

This however only resulted in a list of the coordinates written in brackets, followed by a seperate list underneath, which showd the wall shear stress vectors in brackets. There was also a bunch of information inbetween that I don't need.

Does anyone have any ideas how I could do this?

Best regards,

Chris
cbarry is offline   Reply With Quote

Old   October 1, 2009, 18:22
Default
  #2
Senior Member
 
N/A
Join Date: Mar 2009
Posts: 189
Rep Power: 17
harishg is on a distinguished road
You could use the sample postprocessing tool to write out the data in the format you required. I have used it for writing slices and I guess you can define cutting planes too. I am not sure if it has the capability to write a whole volume.
harishg is offline   Reply With Quote

Old   October 2, 2009, 03:37
Default
  #3
New Member
 
Christopher Barry
Join Date: Aug 2009
Location: Switzerland
Posts: 18
Rep Power: 16
cbarry is on a distinguished road
thank you for your reply. The problem with the sample tool is that, as I see it, you need to define a plane each time in the sampleDict, which is a bit tedious. Ideally I would like to just be able to select a wall and then get the coordinates of the points and the wall shear stresses written out into a nice csv list.

Do you reckon that's possible somehow by modifying the sample tool source code? It's a thought I've been playing with, but I can't see how to do it.

Best regards,

Chris
cbarry is offline   Reply With Quote

Old   October 2, 2009, 05:24
Default
  #4
New Member
 
Christopher Barry
Join Date: Aug 2009
Location: Switzerland
Posts: 18
Rep Power: 16
cbarry is on a distinguished road
Never mind, problem solved. I just had to define a vector within the vectorField mesh.Gf().boundaryField() and then create a forAll loop, in which OpenFOAM writes each component of the new vector for each iteration of the forAll loop.

Thanks for the help though.
cbarry is offline   Reply With Quote

Reply

Tags
csv, export, list, wallshearstress

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Problems in compiling paraview in Suse 10.3 platform chiven OpenFOAM Installation 3 December 1, 2009 07:21
OpenFOAM15 paraFoam bug koen OpenFOAM Bugs 19 June 30, 2009 10:46
[Technical] Creating your own mesh files doug OpenFOAM Meshing & Mesh Conversion 28 April 9, 2009 07:36
creating geometry using "Script files" in ICEMCFD jaber Main CFD Forum 1 November 11, 2007 09:28
Results saving in CFD hawk Main CFD Forum 16 July 21, 2005 20:51


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