CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ParaView (https://www.cfd-online.com/Forums/paraview/)
-   -   [OpenFOAM] paraView error: it opens and closes immediatly (https://www.cfd-online.com/Forums/paraview/210709-paraview-error-opens-closes-immediatly.html)

Loekatoni November 2, 2018 06:24

paraView error: it opens and closes immediatly
 
Hello readers,

I'm new to openFoam and new to C++ and I'm trying to learn both. Now I'm trying to make a script which gives a velocity profile to the inlet of my system. To solve my problem I have a couple of resources to my disposal: the openFoam extended code guide on the internet, the user guid, the basic tutorial, the foundation training and the advanced training and I have also looked up this forum. I did not find the information I needed.

My system is a slice out of a channel, with the slice going from -2.5 degree to +2.5 degree, very long L and a tiny diameter D. The system worked with a different BC at the inlet, so I know that the problem lies in my current BC at the inlet.

I'm trying to make the inlet with the codedFixedValue BC and want to make a profile dependent on the x-position (or r-position), with a graded mesh with smaller dx on the wallside of the channel. The profile is calculated with the Hagen-Poisseuille equation.

To be honest , I do not fully understand what the code says yet. I numbered the components (//1 untill //4) I do not fully grasp and will try to explain what I think it does, feedback on my thoughts are welcome!
My code in 0/U looks as follows:

Code:

inlet
    {
        type            codedFixedValue;
        value          uniform (0 0 0);
        name            velocityProfile; //1

        code
        #{
                scalar A = 0.9041;
                scalar B = 0.035;
                scalar R = 0.0005;

                fixedValueFvPatchVectorField inlet(*this); //2

                forAll(this->patch().Cf(),i) //3
                {
                        inlet[i]= vector(0, 0, A*(Foam::pow(this->patch().Cf()[i]/R, 2)-1)-B);
                }
                operator == (inlet); //4
          #};

//1 This spot looks like it needs a pre-defined name. This one I just thought of as a fitting name, but it looks like it needs a name from a library, I could not find any information on this.

//2 the *this operator points towards the memorylocation of something, in this case it looks to the vectorfield, noted by fixedValueFvPatchVectorField of patch inlet. So now "this" has the values assigned to the memorylocations of the different boundary faces which are part of patch inlet. If this is true, than I still do not see how "this" retrieves the data, as in: how does it know where to look up the data?

//3 initialize a loop over specific data stored in "this". The term "patch().Cf()" is the same as the x-position i read somewhere, so it seems a logical loop, that loops over al the x-position values stored in "this". If this is correct, I still do not understand the formulation "patch().Cf()", so either way some remarks on this are welcome.

//4 Now the calculated values for the z-velocity need te be assigned to an operator, in this case U, to be used as the BC.

The profile being the z-velocity, I gave the same input to 0/Uz.

To mag(U), Ux and Uy I gave the following code
Code:

inlet
    {
type            codedFixedValue;
        value          uniform (0 0 0);
        name            velocityProfile;
}

Now the error message I get is:
Code:

Created temporary 'longChannelProfile.foam'
paraview: /build/paraview-lH8wFv/paraview-5.4.1+dfsg3/VTK/IO/Geometry/vtkOpenFOAMReader.cxx:3798: void vtkFoamEntryValue::ReadList(vtkFoamIOobject&): Assertion `"Label type not set!" && this->GetLabelType() != NO_LABEL_TYPE' failed.
 Aborted (core dumped)

With this error being the last question of my post, I cannot read anything in this error at all. Does anybody know what is says? And do you have any advice on learning to read those errors?

Sincerely,
Me

wyldckat November 3, 2018 20:42

Quick answer: "longChannelProfile.foam" - this means that the internal reader that ParaView/VTK has got is not able to handle the more complex types of boundary conditions that OpenFOAM has got. It can only handle the more basic types.

You will either have to rely on foamToVTK to export the case first to VTK format and then open the files inside the folder VTK directly in ParaView; or you will have to use the official OpenFOAM reader, which requires using the Deb packages that are provided by the OpenFOAM Foundation or do a custom build of OpenFOAM+ParaView yourself.

Loekatoni November 8, 2018 03:23

Dear Bruno,


Thanks for your reply, I will look into that.


Sincerely

Loek

mra-cfd August 14, 2020 09:13

Hey Bruno,

I have the same problem and error and as you described, using the "paraFoam" command, I can view simple boundaries with ParaView, but not more complicated ones such as baffles and cyclic faces.

I am using OpenFoam v2006 from "openfoam.com". I am trying to understand your answer. If I understood you correctly, there are 3 solutions:

1) Converting to VTK format
2) Using Debian package (which I assume you mean using openfoam.org version, right?)
3) Compiling paraView from source which seems to be a difficult task as it is written here and my own experience confirms that.

So the only reasonably feasible option seems to be the first one. Is this correct?

Akimlav November 12, 2020 04:50

openfoam-v1912 paraFoam crashes after start
 
Installed OF from source, trying to open in paraview case reactingHeterogenousParcelFoam/rectangularDuct

paraFoam -builtin and click Apply button it crashes

I got this message

Created temporary 'rectangularDuct.foam'
paraview: /build/paraview-lH8wFv/paraview-5.4.1+dfsg3/VTK/IO/Geometry/vtkOpenFOAMReader.cxx:2977: bool vtkFoamEntryValue::ReadField(vtkFoamIOobject&): Assertion `"Label type not set!" && this->GetLabelType() != NO_LABEL_TYPE' failed.
Aborted (core dumped)

:mad::mad::mad:

Turhan January 23, 2023 05:40

Quote:

Originally Posted by Akimlav (Post 787515)
Installed OF from source, trying to open in paraview case reactingHeterogenousParcelFoam/rectangularDuct

paraFoam -builtin and click Apply button it crashes

I got this message

Created temporary 'rectangularDuct.foam'
paraview: /build/paraview-lH8wFv/paraview-5.4.1+dfsg3/VTK/IO/Geometry/vtkOpenFOAMReader.cxx:2977: bool vtkFoamEntryValue::ReadField(vtkFoamIOobject&): Assertion `"Label type not set!" && this->GetLabelType() != NO_LABEL_TYPE' failed.
Aborted (core dumped)

:mad::mad::mad:

I have the exact same issue, has this been resolved by someone?

vonboett December 4, 2023 10:30

Assertion `"Label type not set!"
 
same with me, never had that before. I ran subsetMesh on this case, could that be the reason? However, with foamToVTK it works


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