CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   reconstructPar super weird error (https://www.cfd-online.com/Forums/openfoam-post-processing/228401-reconstructpar-super-weird-error.html)

miotto June 30, 2020 11:28

reconstructPar super weird error
 
Hi guys.
I'm trying to reconstruct an interFoam simulation, but I'm getting a super strange error.
If I run a plain reconstructPar, I get:


Code:

--> FOAM FATAL ERROR:
Not implemented

    From function virtual Foam::Istream& Foam::ITstream::read(char*, std::streamsize)
    in file db/IOstreams/Tstreams/ITstream.C at line 159.

FOAM aborting

(You can check the code for the mentioned function here: https://github.com/OpenFOAM/OpenFOAM...Tstream.C#L157)


I noticed this happens when it tries to reconstruct p_rgh.
Therefore, if, for instance, I run:
Code:

reconstructPar -fields '(U alpha.water)'
Everything is fine.:)


But if I try:
Code:

reconstructPar -fields '(p_rgh)'
Then, the error comes up. :(


Any idea what might be causing this?


I'm using v1812.
This problem does not happen on v7.
But if I run interFoam on v1812 and reconstructPar on v7, the error persists.

HPE June 30, 2020 15:51

Can you test

reconstructPar -fields 'p_rgh'

miotto June 30, 2020 16:12

Thanks for the reply, HPE.




Quote:

Originally Posted by HPE (Post 776477)
Can you test

reconstructPar -fields 'p_rgh'


Results in:


Code:

--> FOAM FATAL IO ERROR:
incorrect first token, expected <int> or '(', found on line 0 the word 'p_rgh'


I think, the correct syntax is really the one I sent.

miotto June 30, 2020 16:14

Just for completeness, here is the full error message (including stack trace):


Code:

--> FOAM FATAL ERROR:
Not implemented

    From function virtual Foam::Istream& Foam::ITstream::read(char*, std::streamsize)
    in file db/IOstreams/Tstreams/ITstream.C at line 159.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::abort() at ??:?
#2  Foam::ITstream::read(char*, long) at ??:?
#3  Foam::Istream& Foam::operator>><int>(Foam::Istream&, Foam::List<int>&) in "/opt/openfoam7/platforms/linux64GccDPInt32Opt/bin/reconstructPar"
#4  Foam::Function1Types::CSV<double>::CSV(Foam::word const&, Foam::dictionary const&) at ??:?
#5  Foam::Function1<double>::adddictionaryConstructorToTable<Foam::FieldFunction1<Foam::Function1Types::CSV<double> > >::New(Foam::word const&, Foam::dictionary const&) at ??:?
#6  Foam::Function1<double>::New(Foam::word const&, Foam::dictionary const&) at ??:?
#7  Foam::fvPatchField<double>::adddictionaryConstructorToTable<Foam::uniformFixedValueFvPatchField<double> >::New(Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) at ??:?
#8  Foam::fvPatchField<double>::New(Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) in "/opt/openfoam7/platforms/linux64GccDPInt32Opt/bin/reconstructPar"
#9  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::Boundary::readField(Foam::DimensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) in "/opt/openfoam7/platforms/linux64GccDPInt32Opt/bin/reconstructPar"
#10  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::readFields(Foam::dictionary const&) in "/opt/openfoam7/platforms/linux64GccDPInt32Opt/bin/reconstructPar"
#11  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::readFields() in "/opt/openfoam7/platforms/linux64GccDPInt32Opt/bin/reconstructPar"
#12  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::IOobject const&, Foam::fvMesh const&) in "/opt/openfoam7/platforms/linux64GccDPInt32Opt/bin/reconstructPar"
#13  ? in "/opt/openfoam7/platforms/linux64GccDPInt32Opt/bin/reconstructPar"
#14  ? in "/opt/openfoam7/platforms/linux64GccDPInt32Opt/bin/reconstructPar"
#15  ? in "/opt/openfoam7/platforms/linux64GccDPInt32Opt/bin/reconstructPar"
#16  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#17  ? in "/opt/openfoam7/platforms/linux64GccDPInt32Opt/bin/reconstructPar"


HPE July 1, 2020 04:09

reconstructPar -fields 'p_rgh'

has been working for my v1812 and v2006 setups, just tested them for

"tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom".

But, your error might be related to one of the boundary conditions in "p_rgh", likely related to "Function1".

Could you please share your boundary condition file for "p_rgh", if possible?

Thank you.

miotto July 1, 2020 04:57

Quote:

Originally Posted by HPE (Post 776531)
reconstructPar -fields 'p_rgh'

has been working for my v1812 and v2006 setups, just tested them for

"tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom".

But, your error might be related to one of the boundary conditions in "p_rgh", likely related to "Function1".

Could you please share your boundary condition file for "p_rgh", if possible?

Thank you.


Sure, here it is:


Code:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  7
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    object      p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [1 -1 -2 0 0 0 0];

internalField  uniform 0;

boundaryField
{
    pres_inlet
    {
        type            uniformFixedValue;
        uniformValue
        {
            type                csvFile;
            nHeaderLine        19;  // number of lines in the header
            refColumn          0;  //time column index
            componentColumns    (1);  // pressure column index
            separator          ",";
            mergeSeparators    no;
            file                "$FOAM_CASE/inlet.csv";
        }
    }
    nozzle
    {
        type            fixedFluxPressure;
        value          uniform 0;
    }
    nozzle_plate_0
    {
        type            fixedFluxPressure;
        value          uniform 0;
    }
    nozzle_plate_1
    {
        type            fixedFluxPressure;
        value          uniform 0;
    }
    nozzle_plate_2
    {
        type            fixedFluxPressure;
        value          uniform 0;
    }
    nozzle_plate_3
    {
        type            fixedFluxPressure;
        value          uniform 0;
    }
    nozzle_plate_4
    {
        type            fixedFluxPressure;
        value          uniform 0;
    }
    nozzle_plate_outer
    {
        type            fixedFluxPressure;
        value          uniform 0;
    }
    atm_side
    {
        type            totalPressure;
        p0              uniform 0;
    }
    atm_bottom
    {
        type            totalPressure;
        p0              uniform 0;
    }
    defaultFaces
    {
        type            empty;
    }
}

// ************************************************************************* //

And here is an example of the inlet.csv file:




Code:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  7
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      IOobject;
    object      inlet.csv;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//
//
//  DATA SHOULD START ON LINE 20
//
0.000000000000, 8346
0.000040000000, -1849
0.000120000000, 7919
0.000400000000, 10230
0.000840000000, 8381
0.001160000000, -58
0.002960000000, -1862
0.003000000000, 9366


HPE July 1, 2020 08:11

Hi,

I have tested your setup with v1812, and v2006, and it did not produce any error with the command I have suggested.

I had a second look at the error message you posted, and it seems the error belongs to OFv7, not v1812.

Therefore, I suggest you to issue a bug ticket in the OpenFOAM.org issue tracker for which you can find a link below by attaching your case in your issue ticket, so that they can reproduce the error.

miotto July 1, 2020 08:46

Quote:

Originally Posted by HPE (Post 776559)
Hi,

I have tested your setup with v1812, and v2006, and it did not produce any error with the command I have suggested.

I had a second look at the error message you posted, and it seems the error belongs to OFv7, not v1812.

Therefore, I suggest you to issue a bug ticket in the OpenFOAM.org issue tracker for which you can find a link below by attaching your case in your issue ticket, so that they can reproduce the error.


Thanks for the suggestion, HPE.
The message is indeed from v7, but I get the same thing with v1812. (I'll post later on)


One question, do you see anything wrong with the way I'm using the csv? I wondering if I'm doing something that is not allowed by v1812...

HPE July 1, 2020 09:29

"One question, do you see anything wrong with the way I'm using the csv?"

Not so far, but my mind is very tired. :)

miotto July 1, 2020 09:43

I'm now 100% sure that the problem is with v1812. Here are the results of some experiments.


  • if I run decomposePar, interFoam and reconstrucPar all on v7, no problems occur.

  • if I run decomposePar, interFoam and reconstrucPar all on v2006, also no problems occur.

  • if I try to run decomposePar, interFoam and reconstrucPar all on v1812, I can't get passed the decomposePar, because it raises this "Not implemeted error"

  • if I run decomposePar on v7 and interFoam on v1812, then reconstrucPar will raise the error on both v7 or v1812.
In other words, as long as v1812 is in the mix, it will break everything.



Sadly I have to run my simulations on a cluster (big shout-out to the folks from NEMO hpc), and they only have v1812. So I'm f***.

miotto July 1, 2020 09:48

Here is the error raised by decomposePar v1812.
It seems to be related to reading the csv...

Code:

--> FOAM FATAL ERROR:
Not implemented

    From function virtual Foam::Istream& Foam::ITstream::read(char*, std::streamsize)
    in file db/IOstreams/Tstreams/ITstream.C at line 281.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::abort() at ??:?
#2  Foam::ITstream::read(char*, long) at ??:?
#3  Foam::Istream& Foam::operator>><int>(Foam::Istream&, Foam::List<int>&) at ??:?
#4  Foam::Function1Types::CSV<double>::CSV(Foam::word const&, Foam::dictionary const&, Foam::fileName const&) at ??:?
#5  Foam::Function1<double>::adddictionaryConstructorToTable<Foam::FieldFunction1<Foam::Function1Types::CSV<double> > >::New(Foam::word const&, Foam::dictionary const&) at ??:?
#6  Foam::Function1<double>::New(Foam::word const&, Foam::dictionary const&, Foam::word const&) at ??:?
#7  Foam::PatchFunction1<double>::adddictionaryConstructorToTable<Foam::PatchFunction1Types::UniformValueField<double> >::New(Foam::polyPatch const&, Foam::word const&, Foam::word const&, Foam::dictionary const&, bool) at ??:?
#8  Foam::PatchFunction1<double>::New(Foam::polyPatch const&, Foam::word const&, Foam::dictionary const&, bool) at ??:?
#9  Foam::uniformFixedValueFvPatchField<double>::uniformFixedValueFvPatchField(Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) at ??:?
#10  Foam::fvPatchField<double>::adddictionaryConstructorToTable<Foam::uniformFixedValueFvPatchField<double> >::New(Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) at ??:?
#11  Foam::fvPatchField<double>::New(Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) at ??:?
#12  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::Boundary::readField(Foam::DimensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) at ??:?
#13  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::readFields(Foam::dictionary const&) at ??:?
#14  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::readFields() at ??:?
#15  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::IOobject const&, Foam::fvMesh const&, bool) at ??:?
#16  ? at ??:?
#17  ? at ??:?
#18  __libc_start_main in /lib64/libc.so.6
#19  ? at ??:?
Aborted (core dumped)


HPE July 1, 2020 11:08

Hmm. If you get an error with v1812, and I don't get it with v1812, it only means that we have different instances of v1812. Sometimes, bug fixes are pushed to the previous versions as maintenance activities.

If you are working on a cluster, you can definitely compile your own version (e.g. v1812 or v2006) in your local area. Just consult the cluster maintainers, or the cluster wiki. I am sure that you can do that since I have been doing this for my entire life (in fact, I have never used the system-wide compilations of OpenFOAM in our supercomputer facilities). So, you are definitely not f.cked up, don't worry :).

miotto July 2, 2020 11:31

Dear HPE,


Thanks for your help all the way!
Your last post was really an eye opener. I did exactly as you suggested, and it worked! I'm new to this cluster thing, therefore I had to research it a bit, but it was totally worth it.


Thanks again. You saved my skin!


All times are GMT -4. The time now is 08:36.