CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[General] Text annotation of table cell as function of time?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 28, 2014, 15:40
Default Text annotation of table cell as function of time?
  #1
Member
 
Lourenço SM
Join Date: Jul 2014
Location: Lisboa, Portugal
Posts: 41
Rep Power: 12
lourencosm is on a distinguished road
Hello,

How can I do a text annotation o a table cell as function of time?

I have this csv file:
Quote:
vol
361.981
363.101
364.220
365.339
366.457
367.573
368.688
369.800
370.910
372.018
And I want to do an annotation like this: "vol= %f" % vol[t_index]

The thing is that 't_index' variable is not recognized in this file import pipe, only in .foam pipe.

Anyone knows how to do it?

Thank you,
Lourenço
lourencosm is offline   Reply With Quote

Old   January 29, 2015, 06:30
Default
  #2
Member
 
Lourenço SM
Join Date: Jul 2014
Location: Lisboa, Portugal
Posts: 41
Rep Power: 12
lourencosm is on a distinguished road
I have found a way. It is not the simplest but it works.

1) Create vtk-data unstructured files (.vtu), each one for each time step. In this example, I have some flowrates:

Code:
 <VTKFile type="UnstructuredGrid" version="1.0" byte_order="LittleEndian" header_type="UInt64">
  <UnstructuredGrid>
    <Piece NumberOfPoints="1" NumberOfCells="0">
      <PointData>
        <DataArray type="Float64" Name="Time" format="ascii">
          0
        </DataArray>
        <DataArray type="Float64" Name="volWater" format="ascii">
          361.981
        </DataArray>
        <DataArray type="Float64" Name="frOutlet" format="ascii">
          0
        </DataArray>
        <DataArray type="Float64" Name="frInlet" format="ascii">
          0
        </DataArray>
      </PointData>
      <CellData>
      </CellData>
      <Points>
        <DataArray type="Float32" Name="Points" NumberOfComponents="3" format="ascii">
          0 0 0
        </DataArray>
      </Points>
      <Cells>
        <DataArray type="Int64" Name="connectivity" format="ascii">
          0
        </DataArray>
        <DataArray type="Int64" Name="offsets" format="ascii">
          1
        </DataArray>
        <DataArray type="UInt8" Name="types" format="ascii">
          1
        </DataArray>
      </Cells>
    </Piece>
  </UnstructuredGrid>
</VTKFile>
2) Create a paraview time-series file (.pvd) which links each vtu to a time-step,like this:

Code:
<VTKFile type="Collection" version="1.0" byte_order="LittleEndian" header_type="UInt64">
  <Collection>
    <DataSet timestep="0"  file="domainMassFlow_000.vtu"/>
    <DataSet timestep="0.1"  file="domainMassFlow_001.vtu"/>
    <DataSet timestep="0.2"  file="domainMassFlow_002.vtu"/>
    <DataSet timestep="0.3"  file="domainMassFlow_003.vtu"/>
3) load the .pvd file into Paraview pipe

4) Use a python annotation to extract the information. e.g.:
Code:
'FR Inlet: %.2f m3/s/s' % input.PointData['frInlet'][0]
It works!

Last edited by wyldckat; April 26, 2015 at 15:18. Reason: Added [CODE][/CODE] markers
lourencosm is offline   Reply With Quote

Old   April 20, 2015, 08:00
Default
  #3
Member
 
Lourenço SM
Join Date: Jul 2014
Location: Lisboa, Portugal
Posts: 41
Rep Power: 12
lourencosm is on a distinguished road
Hello wildcat,

Thank you for your attention.

What I really would like is to do a text annotation from a table where the first column is time and the second is a variable.

This table could come from csv text file.

I've manage to find a way with a pvd file and a vtu file for each table row. It requires some extra work but it actually works!

Do you (or anyone) has an ideia how to make it in a simple way?

Lourenço

[ Moderator note: Moved post from http://www.cfd-online.com/Forums/ope...ylinder-2.html ]

Last edited by wyldckat; April 26, 2015 at 15:20. Reason: moved post and added moderator note
lourencosm is offline   Reply With Quote

Old   April 26, 2015, 16:42
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answer: Have a look at this post I wrote a few minutes ago: http://www.cfd-online.com/Forums/ope...tml#post543810 - post #11
wyldckat is offline   Reply With Quote

Reply

Tags
annotation, table, time


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
Setting up Lid driven Cavity Benchmark with 1M cells for multiple cores puneet336 OpenFOAM Running, Solving & CFD 11 April 7, 2019 01:58
pimpleDyMFoam computation randomly stops babapeti OpenFOAM Running, Solving & CFD 5 January 24, 2018 06:28
How to export time series of variables for one point? mary mor OpenFOAM Post-Processing 8 July 19, 2017 11:54
Running UDF with Supercomputer roi247 FLUENT 4 October 15, 2015 14:41
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20


All times are GMT -4. The time now is 11:14.