CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

How to write general constants data in a vtk file?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 2, 2019, 07:57
Default How to write general constants data in a vtk file?
  #1
New Member
 
Dinesh
Join Date: Dec 2018
Posts: 2
Rep Power: 0
bitbotboop is on a distinguished road
Hello all,

I am doing a rigid body simulation using particles. For some frequent steps I dump the data as a unstructures grid into vtk file. The file looks like

```
# vtk DataFile Version 4.1
Data
ASCII

DATASET UNSTRUCTURED_GRID
POINTS 8 float
0.5674292 -0.0773167 1 1.0674142 -0.073434755 1 0.56354725 0.42266828 1 1.0635322 0.4265502 1 0.5674292 -0.0773167 1.5 1.0674142 -0.073434755 1.5 0.56354725 0.42266828 1.5 1.0635322 0.4265502 1.5

CELLS 0 0


CELL_TYPES 0


CELL_DATA 0

POINT_DATA 8

VECTORS Forces float
0 -2452.5 0 0 -2452.5 0 0 -2452.5 0 0 -2452.5 0 0 -2452.5 0 0 -2452.5 0 0 -2452.5 0 0 -2452.5 0

VECTORS Velocity float
91.1642 35.48708 -0.00000000017143556 91.16366 35.55712 0.00000000015566408 91.094154 35.486534 -0.00000000015566408 91.09361 35.556576 0.00000000017143556 91.1642 35.48708 -0.00000000017143556 91.16366 35.55712 0.00000000015566408 91.094154 35.486534 -0.00000000015566408 91.09361 35.556576 0.00000000017143556

SCALARS h float 1
LOOKUP_TABLE default
0 0 0 0 0 0 0 0

SCALARS m float 1
LOOKUP_TABLE default
250 250 250 250 250 250 250 250
```

I want use these files to postprocess and generate the results such that it is reproducible.
For that reason I need to know the information about the time of each file. I have seen some examples but I haven't found a file which puts the information about the time in its legacy file. And also I have some other properties of the rigid body such as center of mass, total mass, moment of inertia, etc.

All I found is putting point data but I can't find information on saving such constants. Any help.
bitbotboop is offline   Reply With Quote

Old   January 7, 2019, 16:33
Default
  #2
Senior Member
 
Join Date: Oct 2011
Posts: 242
Rep Power: 17
naffrancois is on a distinguished road
Hello, I do it this way:

# vtk DataFile Version 2.0
Unstructured Grid 2D Dataset
ASCII

DATASET UNSTRUCTURED_GRID
FIELD FieldData 2
TIME 1 1 double
0.0000000000000000
MASS 1 1 double
1.0000000000000000
POINTS 2042 float
.................................................

This way TIME and MASS appear as a constant for each vtk file.
naffrancois is offline   Reply With Quote

Old   January 7, 2019, 20:35
Default
  #3
New Member
 
Dinesh
Join Date: Dec 2018
Posts: 2
Rep Power: 0
bitbotboop is on a distinguished road
Thank you for the reply. How about a array constants, as center of mad, as these are three values. Or say a array of constants like

P=[2, 6, 77, 87,66, 997]
bitbotboop 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
[swak4Foam] swak4foam for OpenFOAM 4.0 mnikku OpenFOAM Community Contributions 80 May 17, 2022 09:06
[swak4Foam] funkyDoCalc with OF2.3 massflow NiFl OpenFOAM Community Contributions 14 November 25, 2020 04:30
[swak4Foam] groovyBC in openFOAM-2.0 for parabolic velocity bc ofslcm OpenFOAM Community Contributions 25 March 6, 2017 11:03
[Other] Adding solvers from DensityBasedTurbo to foam-extend 3.0 Seroga OpenFOAM Community Contributions 9 June 12, 2015 18:18
Trouble compiling utilities using source-built OpenFOAM Artur OpenFOAM Programming & Development 14 October 29, 2013 11:59


All times are GMT -4. The time now is 16:31.