# Reading in Velocity Data in a Legacy VTK File

**URL:** https://discourse.paraview.org/t/reading-in-velocity-data-in-a-legacy-vtk-file/2202
**Category:** ParaView Support
**Created:** [July 11, 2019, 5:49pm UTC](https://discourse.paraview.org/t/reading-in-velocity-data-in-a-legacy-vtk-file/2202 "2019-07-11T17:49:46Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Raychel\_Bahnick](https://discourse.paraview.org/user_avatar/discourse.paraview.org/raychel_bahnick/32/1689_2.png) [@Raychel\_Bahnick](https://discourse.paraview.org/u/Raychel_Bahnick)
#### Post date: [July 11, 2019, 5:49pm UTC](https://discourse.paraview.org/t/reading-in-velocity-data-in-a-legacy-vtk-file/2202/1 "2019-07-11T17:49:46Z")

</div>

I am opening legacy vtk files into Paraview. There are x, y, and z coordinates and I am interested in attaching a x-velocity value to each of the points. How do I incorporate this velocity data into my vtk files in such a way that Paraview can read it? I am ultimately trying to contour my cells based on the value of the velocity.

---

<div class="post-metadata">

### Author: ![Raychel\_Bahnick](https://discourse.paraview.org/user_avatar/discourse.paraview.org/raychel_bahnick/32/1689_2.png) [@Raychel\_Bahnick](https://discourse.paraview.org/u/Raychel_Bahnick)
#### Post date: [July 11, 2019, 9:19pm UTC](https://discourse.paraview.org/t/reading-in-velocity-data-in-a-legacy-vtk-file/2202/2 "2019-07-11T21:19:17Z")

</div>

I am using Paraview 4.2 and here is my vtk file so far:

```
# vtk DataFile Version 4.1
vtk output
ASCII
DATASET RECTILINEAR_GRID
DIMENSIONS 7 27 1
X_COORDINATES 7 int
4200	4000	3800	3600	3400	3200	3000
Y_COORDINATES 27 int
400 450 500 550 600 650 700 750 800 850 900 950 1000 1050 
1100 1150 1200 1250 1300 1350 1400 1450 
1500 1550 1600 1650 1700 
Z_COORDINATES 1 int
378

```

How do I incorporate the velocity data that I mentioned before?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [July 12, 2019, 7:24am UTC](https://discourse.paraview.org/t/reading-in-velocity-data-in-a-legacy-vtk-file/2202/3 "2019-07-12T07:24:11Z")

</div>

Here is your file with an added “xVel” point data array.

```
# vtk DataFile Version 4.2
vtk output
ASCII
DATASET RECTILINEAR_GRID
DIMENSIONS 7 27 1
X_COORDINATES 7 int 
4200 4000 3800 3600 3400 3200 3000 
Y_COORDINATES 27 int 
400 450 500 550 600 650 700 750 800 
850 900 950 1000 1050 1100 1150 1200 1250 
1300 1350 1400 1450 1500 1550 1600 1650 1700 

Z_COORDINATES 1 int 
378 
POINT_DATA 189 
SCALARS xVel double
LOOKUP_TABLE default
13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 
13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 
13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 
13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 
13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 
13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 
13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 
13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 
13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 
13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 
13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 
13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 
13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 
13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 
13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 
13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 
13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 
13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 
13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 
13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 
13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07 13.07
```

---

<div class="post-metadata">

### Author: ![arkdtk](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/2acd7d/32.png) [@arkdtk](https://discourse.paraview.org/u/arkdtk)
#### Post date: [December 30, 2024, 2:49pm UTC](https://discourse.paraview.org/t/reading-in-velocity-data-in-a-legacy-vtk-file/2202/4 "2024-12-30T14:49:14Z")

</div>

Could you explain how you added the xVel array, is there an easy method to generalize it for other vtk files?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 30, 2024, 2:51pm UTC](https://discourse.paraview.org/t/reading-in-velocity-data-in-a-legacy-vtk-file/2202/5 "2024-12-30T14:51:52Z")

</div>

You mean in ParaView ?

You can add a Calculator Filter
