# paraview crashes when openning a specific variable from openfoam results

**URL:** https://discourse.paraview.org/t/paraview-crashes-when-openning-a-specific-variable-from-openfoam-results/6650
**Category:** ParaView Support
**Created:** [March 8, 2021, 10:27pm UTC](https://discourse.paraview.org/t/paraview-crashes-when-openning-a-specific-variable-from-openfoam-results/6650 "2021-03-08T22:27:53Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![mohammad\_faghih](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mohammad_faghih/32/6098_2.png) [@mohammad\_faghih](https://discourse.paraview.org/u/mohammad_faghih)
#### Post date: [March 8, 2021, 10:27pm UTC](https://discourse.paraview.org/t/paraview-crashes-when-openning-a-specific-variable-from-openfoam-results/6650/1 "2021-03-08T22:27:53Z")

</div>

I have a solution from an openFOAM simulation. In addition to velocity (U) and pressure ( p), I also have a user-defined variable (called D) in each time folder. This D is actually a scalar being transported in my domain.  
When I want to open my results in paraview, it crashes when the variable D is selected to be loaded (it crashes without any error). But when I de-select D and exclude it from loading up, then paraview is happy and show my results for U and p.

Since these results are from a solver I wrote I am just not sure if the issue is from my solver in openfoam, or from paraview.

Below is the link to my openfoam case folder (20 MB, a zip file) with only a few time folders. Can anybody take a look at it and see if you can load it up successfully.

Thanks

> **[ScalarTransportWithSource\_NewSolver.zip](https://drive.google.com/file/d/1Z-VK67XoFjR9xDCTXQtPREdx1cl32mQM/view?usp=sharing)**
>
> Google Drive file.

---

<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: [March 9, 2021, 10:13am UTC](https://discourse.paraview.org/t/paraview-crashes-when-openning-a-specific-variable-from-openfoam-results/6650/2 "2021-03-09T10:13:20Z")

</div>

The error says:

`( 46.610s) [paraview] vtkOpenFOAMReader.cxx:7184 ERR| vtkOpenFOAMReaderPrivate (0x197d1670): Error reading line 18 of /home/glow/tmp/ScalarTransportWithSource_NewSolver/1/D: Expected a number, found a non-digit character .`

Not sure if this is a bug in the OpenFOAM reader or an issue in your file.

FYI @olesenm

---

<div class="post-metadata">

### Author: ![mohammad\_faghih](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mohammad_faghih/32/6098_2.png) [@mohammad\_faghih](https://discourse.paraview.org/u/mohammad_faghih)
#### Post date: [March 9, 2021, 3:46pm UTC](https://discourse.paraview.org/t/paraview-crashes-when-openning-a-specific-variable-from-openfoam-results/6650/3 "2021-03-09T15:46:13Z")

</div>

Thanks @mwestphal ;  
I may have found the reason.  
Will update here if that is the case.

---

<div class="post-metadata">

### Author: ![mohammad\_faghih](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mohammad_faghih/32/6098_2.png) [@mohammad\_faghih](https://discourse.paraview.org/u/mohammad_faghih)
#### Post date: [March 15, 2021, 4:51pm UTC](https://discourse.paraview.org/t/paraview-crashes-when-openning-a-specific-variable-from-openfoam-results/6650/4 "2021-03-15T16:51:03Z")

</div>

@mwestphal  
@olesenm

Ok, I think I have found the reason why paraview is crashing in my case:  
Generally, each variable in time directories from OpenFOAM simulations have their units (dimensions) in a format like this (this one is for velocity as an example):

> dimensions [0 1 -1 0 0 0 0];

It seems like paraview doesn’t like it when the units are not integers. For example, in my case attached above, the unit for D is:

> dimensions [0 0 -1.60261437908 0 0 0 0];

which paraview does not like. But, if I manually change the units to integers, paraview will be happy to load it up.  
You may wonder where such a weird unit (-1.60261437908) is coming from; but when you are dealing with empirical data fitting, you may end up having a variable with non-integer units.  
Can you explain why paraview doesn’t like non-integer units??

Note that OpenFOAM has the dimension checking as a built-in feature, but never complained about my weird unit.

---

<div class="post-metadata">

### Author: ![olesenm](https://discourse.paraview.org/user_avatar/discourse.paraview.org/olesenm/32/17416_2.png) [@olesenm](https://discourse.paraview.org/u/olesenm)
#### Post date: [March 15, 2021, 7:00pm UTC](https://discourse.paraview.org/t/paraview-crashes-when-openning-a-specific-variable-from-openfoam-results/6650/5 "2021-03-15T19:00:49Z")

</div>

> [@mohammad\_faghih](#):
>
> @mwestphal  
> @olesenm
> 
> Ok, I think I have found the reason why paraview is crashing in my case:  
> …  
> It seems like paraview doesn’t like it when the units are not integers. For example, in my case attached above, the unit for D is:
> 
> > dimensions [0 0 -1.60261437908 0 0 0 0];
> 
> which paraview does not like.

Please see the [pending merge-request 7602](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/7602) which also addresses [the issue 18103](https://gitlab.kitware.com/vtk/vtk/-/issues/18103).

Not sure when it will get finalized and merged.

---

<div class="post-metadata">

### Author: ![olesenm](https://discourse.paraview.org/user_avatar/discourse.paraview.org/olesenm/32/17416_2.png) [@olesenm](https://discourse.paraview.org/u/olesenm)
#### Post date: [March 15, 2021, 7:03pm UTC](https://discourse.paraview.org/t/paraview-crashes-when-openning-a-specific-variable-from-openfoam-results/6650/6 "2021-03-15T19:03:03Z")

</div>

> [@mohammad\_faghih](#):
>
> Note that OpenFOAM has the dimension checking as a built-in feature, but never complained about my weird unit.

The OpenFOAM dimension checking is something entirely different. It provides a top-level check to catch inconsistency (Eg, (p + T) =\> dimension error).
