|
[Sponsors] |
[OpenFOAM] paraView error: it opens and closes immediatly |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 2, 2018, 06:24 |
paraView error: it opens and closes immediatly
|
#1 |
New Member
Loek
Join Date: Oct 2018
Posts: 14
Rep Power: 7 |
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. To mag(U), Ux and Uy I gave the following code Code:
inlet { type codedFixedValue; value uniform (0 0 0); name velocityProfile; } 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) Sincerely, Me Last edited by wyldckat; November 3, 2018 at 20:38. Reason: Added [CODE][/CODE] markers |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|