CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ParaView (https://www.cfd-online.com/Forums/paraview/)
-   -   [OpenFOAM] p is not a valid volScalarField (https://www.cfd-online.com/Forums/paraview/185918-p-not-valid-volscalarfield.html)

umbideluca April 5, 2017 12:48

p is not a valid volScalarField
 
Hi,

I am running a simple case of the flow around a cylinder using the simpleFoam solver. I have created the mesh with snappyHexMesh and it looks fine when I open it in Paraview.

However, when I open the .foam file with paraview a error window pops up with one error message saying: "/Users/umberto/openfoam/cylinder/0/p is not a valid volScalarField".

If I ignore the message and run simpleFoam, I get a floating point exception after 14 iterations and the simulation stops.

I suppose the floating point error is linked to the volScalarField issue but I really can't figure out what's wrong with my p file:
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  plus                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField  uniform 0;

boundaryField
{
    inlet
    {
        type            zeroGradient;
    }
    outlet
    {
        type            fixedValue;
        value          0;
    }
    cylinder
    {
        type            zeroGradient;
    }
    upperWall
    {
        type            slip;
    }
    lowerWall
    {
        type            slip;
    }
    frontAndBack
    {
        type            slip;
    }
}

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


piu58 April 5, 2017 14:39

The p field is necessary in the 0 folder: It contains the initial condition. It seems that this file is not correct.

Joshua14 April 5, 2017 15:22

Your dimensions for pressure are as follows:

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

I think the dimensions of pressure for an incompressible case should be:

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

Hope this helps,
Joshua

umbideluca April 5, 2017 17:19

Well spotted. I am note sure why I had the wrong units there. However, changing the units did not solve my problem.

To me it looks like there is something substantial that is wrong with my p file but I really can't figure out what that is. It is also strange that I could not find anyone with the same issue.

Where else could the problem be?

piu58 April 6, 2017 01:04

If you calculate in 2D frontAndBack should be empty.

umbideluca April 6, 2017 05:02

Nope that's not the issue. I am running 3D.

Just for the record, the issue was that I set the outlet value to 0 and not to uniform 0!

piu58 January 21, 2018 01:10

This is a bit late for a useful answer, but I want to add an observation (just for the record):

I had the same message with an p_rgh file. I used the fixedFluxPressure b.c.
If I changed that to fixedValue, the error disappeared. But the solution is not useful anymore :rolleyes:


All times are GMT -4. The time now is 22:51.