Hi guys, it’s my first time posting on this forum so please excuse any faults I might make.
I’m currently working on implementing a “flow-induced” fluid-structure interaction model using the immersed boundary method in foam-extend 4.0. Work is going well however, my simulations are producing far too much data, specifically stl files of the immersed boundary.
From what I’ve been told, the function which writes these files out (writeVTK) needs to be updated and this is where you guys can help me.
I need to gain a better understanding of the VTK format from Paraview and would appreciate any resources you can point me too so that I may do this.
Specifically I need to know
Can the VTK reader in Paraview take a floating point argument to the file name
Can the VTK format from Paraview read multiple (point or face?) data, and MAY in fact have the possibility of specifying a time index.
I’m confused by this question. Can you elaborate ?
The VTK format supports multiples point and cell data arrays.
The VTK format does not support timesteps within. However, time series (multiple VTK files) are supported.
Thanks for the very quick response, I’ll try to clarify my first question.
My understanding is that Paraview will only accept an int in the file name and not a floating point value. This is to say that option 1. below is currently acceptable while option 2. is not.
filename_1.stl, filename_2.stl, etc… (int in the filename (time index))
filename_0.1.stl, filename_0.2.stl, etc… (floating point in the filename (time value))
This is with the legacy VTK format which FOAM currently uses. Unfortunately this is leading to a sync issue but perhaps it is possible with the “newer” VTK format?
So ultimately I need to know if there is a way to encode the time-step value (not the time index value) into a VTK file.
This would resolve a lot of issues and any help you can give is much appreciated.
Afaik, this is not supported. However, it would be possible to create a filter that reads a secondary file as a parameters (similar to AddFieldArrays filter) in order to provide time values to the pipeline. Not an easy task though.
I thought it worked with legacy vtk files but the above suggests not. You could write a simple script to convert your files to .vtp’s Then you can specify timesteps in a pvd file:
Not completely what was asked, but when generating VTK files (legacy and XML) we often generate an additional TimeValue as a FieldData. Since it is field-data, it only adds a few bytes to the file.
The choice of the field name comes from what Catalyst uses. Can extract and display in ParaView.
For human documentation, we sometimes add in an additional XML comment:
<!-- time='...' index='...' -->
This lets you scrape the file header and extract values. Eg, with a shell script to assemble other content.
For associating a series of files (legacy or xml) with time values, the JSON series file is extremenly convenient.
For example,