CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Strange foamToVTK problem

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

Reply
 
LinkBack Thread Tools Display Modes
Old   December 28, 2007, 14:49
Default Hi, OpenFOAMers: After comp
  #1
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 317
Rep Power: 9
hsieh is on a distinguished road
Hi, OpenFOAMers:

After completing a OF run. I ran foamToVTK to convert the transient data (time 0, 0.01, 0.02, 0.03,...) to VTK. In VTK folder, I saw something like:

casename_0.vtk
casename_1.vtk
casename_108.vtk
casename_209.vtk
casename_310.vtk
casename_411.vtk
casename_512.vtk

Why the numbers jumpped by 101 starting from 108?
How can I output the file with continuous number?

Thanks!

Pei
hsieh is offline   Reply With Quote

Old   December 28, 2007, 16:25
Default Pei, The reason for this is
  #2
New Member
 
Shivasubramanian Gopalakrishnan
Join Date: Mar 2009
Location: Amherst, Massachusetts, USA
Posts: 15
Rep Power: 8
shivasub is on a distinguished road
Pei,

The reason for this is that while outputting the vtk files, the function runTime.timeIndex() is used for obtaining the filename. here is the snippet of code from foamToVTK

// Create file and write header
//
fileName vtkFileName
(
fvPath/vtkName
+ "_"
+ name(runTime.timeIndex())
+ ".vtk"
);


you can write a small bash/tcsh script to rename the files to get continuous numbers. here is a sample script.



#!/bin/bash
#enumerates and renumbers files

num=0

for file in $1_?.vtk;do let num++;name=$1_`echo $num`.vtk; mv $file $name;done
for file in $1_??.vtk;do let num++;name=$1_`echo $num`.vtk; mv $file $name;done
for file in $1_???.vtk;do let num++;name=$1_`echo $num`.vtk; mv $file $name;done
for file in $1_????.vtk;do let num++;name=$1_`echo $num`.vtk; mv $file $name;done
for file in $1_?????.vtk;do let num++;name=$1_`echo $num`.vtk; mv $file $name;done


Cheers
Shiva
shivasub is offline   Reply With Quote

Old   December 28, 2007, 21:53
Default Thanks a lot Shiva! Your sc
  #3
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 317
Rep Power: 9
hsieh is on a distinguished road
Thanks a lot Shiva!

Your script works great!

Pei
hsieh is offline   Reply With Quote

Old   December 29, 2007, 09:41
Default The 1.4.1 foamToVTK still crea
  #4
Super Moderator
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 16
mattijs is on a distinguished road
The 1.4.1 foamToVTK still creates files from time index. The advantage is that there is a one-to-one correspondence to the absolute time. Disadvantage is that the non-consecutive filenames aren't recognized by Paraview as a time series.

The 1.4.2 instead outputs consecutively numbered files.
mattijs is offline   Reply With Quote

Old   January 4, 2009, 01:03
Default Anybody knows why there is
  #5
Member
 
Heng Xiao
Join Date: Mar 2009
Location: Zurich, Switzerland
Posts: 58
Rep Power: 8
xiao is on a distinguished road
Anybody knows why there is

casename_0.vtk
casename_1.vtk

in the folder? I am using OF 1.4.1, In my case, casename_0.vtk is very short with no field information at all. This causes paraview 3.4 to ignore all the fields in vtk files which are not present in casename_0.vtk.

----------------
time cases: 0, 0.2, 0.4, 0.6, 0.8

VTK names:

meshPar2_0.vtk ***
meshPar2_1.vtk ***
meshPar2_20.vtk
meshPar2_40.vtk
meshPar2_60.vtk
meshPar2_80.vtk
xiao is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with channeloodles and foamToVTK farbfilm OpenFOAM Running, Solving & CFD 0 October 31, 2008 06:28
FoamToVTK problem oevermann OpenFOAM Paraview & paraFoam 6 July 11, 2006 15:10
Please help see this strange problem liugx212 OpenFOAM Running, Solving & CFD 3 February 23, 2006 19:03
CHT strange problem MatejK CFX 3 September 1, 2005 05:32
A strange problem Lee CD-adapco 0 April 3, 2005 12:33


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