CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   simpleFoam: problem with the U file (https://www.cfd-online.com/Forums/openfoam-solving/98895-simplefoam-problem-u-file.html)

samiam1000 March 21, 2012 11:41

simpleFoam: problem with the U file
 
Dear all,

I am trying to run simpleFoam, getting a very strange error. I am pretty sure that the same case worked until a couple of weeks ago.

Anyway, that's the error that I get:
Code:

lab@lab-laptop:~/Documenti/cases_OF/OF_case8_incomp_T_vol$ simpleFoam
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.1.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.1.0-0bc225064152
Exec  : simpleFoam
Date  : Mar 21 2012
Time  : 16:36:28
Host  : "lab-laptop"
PID    : 7436
Case  : /home/lab/Documenti/cases_OF/OF_case8_incomp_T_vol
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading field p

Reading field U



--> FOAM FATAL IO ERROR:
wrong token type - expected word, found on line 50 the doubleScalar 0.0034803

file: /home/lab/Documenti/cases_OF/OF_case8_incomp_T_vol/0/U::boundaryField::bc_hc1_ext::flowRate at line 50.

    From function operator>>(Istream&, word&)
    in file primitives/strings/word/wordIO.C at line 74.

FOAM exiting

and this is my U file:
Code:

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

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

internalField  uniform (0 0 0);

boundaryField
{
    wall-air_external
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    wall-air_internal
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    bc_intake
    {
        type            zeroGradient;
    }
    bc_hc2_ext
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    bc_hc2_int
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    bc_hc1_ext
    {
        type            flowRateInletVelocity;
        flowRate        0.0034803; // It's an incompressible case, hence the flow has to be in [m^3/s] (+ inlet, - outlet)
        value          uniform (-0.8203572715 0 -0.0717719589);
    }
    bc_hc1_int
    {
        type            flowRateInletVelocity;
        flowRate        0.0034803; // It's an incompressible case, hence the flow has to be in [m^3/s] (+ inlet, - outlet)
        value          uniform (-0.8203572715 0 -0.0717719589);
    }
    bc_back_1
    {
        type            flowRateInletVelocity;
        flowRate        0.0016784;
        value          uniform (0 0 -0.097500752);
    }
    bc_back_2
    {
        type            flowRateInletVelocity;
        flowRate        0.0014643;
        value          uniform (0 0 -0.1386807915);
    }
    bc_back_3
    {
        type            flowRateInletVelocity;
        flowRate        0.0014643;
        value          uniform (0 0 -0.1386807915);
    }
    bc_back_4
    {
        type            flowRateInletVelocity;
        flowRate        0.0014643;
        value          uniform (0 0 -0.1386807915);
    }
    bc_back_5
    {
        type            flowRateInletVelocity;
        flowRate        0.0014643;
        value          uniform (0 0 -0.1386807915);
    }
    bc_back_6
    {
        type            flowRateInletVelocity;
        flowRate        0.0014643;
        value          uniform (0 0 -0.1386807915);
    }
    symmetry-air_infinite
    {
        type        symmetryPlane;
    }
    symmetry-air_internal
    {
        type        symmetryPlane;
    }
    symmetry-air_external
    {
        type        symmetryPlane;
    }
    packs_front_6
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    packs_front_4
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    packs_front_5
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    packs_front_3
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    packs_front_2
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    walls_air_infinite
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    walls_ceiling
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    walls_floor-air_infinite
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    walls_floor-air_external
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    symmetry_2-air_infinite
    {
        type        symmetryPlane;
    }
    symmetry_2-air_internal
    {
        type        symmetryPlane;
    }
    symmetry_2-air_external
    {
        type        symmetryPlane;
    }
    bc_outlet_external
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    chamber_inlet
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    chamber_outlet
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
}
// ************************************************************************* //

Could anyone help?

Thanks,

Samuele

wyldckat March 21, 2012 15:07

Greetings Samuele,

Did the case work back then with OpenFOAM 2.0.1 or 2.1.0?
According to the output and file, it looks like a few weeks ago you were still using 2.0.1 and now are using 2.1.0.

The solution should be something like this on the line that gives the error:
Code:

flowRate                    uniform 0.0034803;
Here is a recent and similar reported issue: http://www.openfoam.org/mantisbt/view.php?id=471

Best regards,
Bruno

samiam1000 March 22, 2012 03:46

Thanks for answering.

Got it!

Samuele

idrama December 17, 2012 07:22

Hallo,

instead of uniform write constant. It's better.

Cheers

Alhasan November 10, 2015 14:05

Similar Problem
 
Hi All,

I am trying to run a DDES simulations, So I ran a sepearate RANS simulation first with the same mesh and then copied the U and p in to the 0 of the DDES case and started the simuation and I got this error,

Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.2.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.2.0
Exec  : pimpleFoam
Date  : Nov 10 2015
Time  : 18:00:57
Host  : "IT000968"
PID    : 27209
Case  : /mnt/hdd/WorkspaceHDD/Morphing/20ms/NWF/SmallInlet/Test3D/C1-A0Sp-IDDES
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type RASModel
Selecting RAS turbulence model SpalartAllmaras
SpalartAllmarasCoeffs
{
    sigmaNut        0.66666;
    kappa          0.41;
    Cb1            0.1355;
    Cb2            0.622;
    Cw2            0.3;
    Cw3            2;
    Cv1            7.1;
    Cv2            5;
}

Creating finite volume options
No finite volume options present


PIMPLE: Operating solver in PISO mode


Starting time loop



--> FOAM FATAL IO ERROR:
wrong token type - expected int, found on line 50 the doubleScalar 0.01

file: /mnt/hdd/WorkspaceHDD/Morphing/20ms/NWF/SmallInlet/Test3D/C1-A0Sp-IDDES/system/controlDict.functions.fieldAverage1.outputInterval at line 50.

    From function operator>>(Istream&, int&)
    in file primitives/ints/int/intIO.C at line 68.

FOAM exiting

But somewhere in my memory I rember doing this for an LES case and it worked,

- Is this the right way to intiate a Unsteady case with a steady simulation or am i doing some thing wrong,

Code:

application pimpleFoam;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 0.2;
deltaT 5.5e-6;
writeControl adjustableRunTime;
writeInterval 0.01;
purgeWrite 0;
writeFormat binary;
writePrecision 6;
writeCompression compressed;
timeFormat general;
timePrecision 6;
graphFormat raw;
runTimeModifiable yes;
maxDeltaT 2.25e-5;//2.25e-5
maxCo 1;//0.9
adjustTimeStep yes;
libs
(
);
functions
{
fieldAverage1
    {
        type            fieldAverage;
        functionObjectLibs ( "libfieldFunctionObjects.so" );
        enabled        true;
        timeStart          0.1;// at 10FTT start measuring
        timeEnd            0.25;// end after simulation end
        outputControl      outputTime;
        outputInterval    0.01;// every flow through time
        resetOnOutput    false;
               

        fields
        (
            U
            {
                mean        on;
                prime2Mean  on;
                base        time;
            }

            p
            {
                mean        on;
                prime2Mean  on;
                base        time;
            }
        );
    }

- How can i get rid of this error. I am trying to do the mean and save it I have out same out put as write interval never seems to work, but long ago it worked with different number whats happening here

Regards,
Hasan K.J

wyldckat November 10, 2015 16:47

Quick answer:
Quote:

Originally Posted by Alhasan (Post 572808)
Code:

--> FOAM FATAL IO ERROR:
wrong token type - expected int, found on line 50 the doubleScalar 0.01

file: [...]/system/controlDict.functions.fieldAverage1.outputInterval at line 50.

[...]

Code:

fieldAverage1
    {
        type            fieldAverage;
        functionObjectLibs ( "libfieldFunctionObjects.so" );
        enabled        true;
        timeStart          0.1;// at 10FTT start measuring
        timeEnd            0.25;// end after simulation end
        outputControl      outputTime;
        outputInterval    0.01;// every flow through time
        resetOnOutput    false;


In other words, change this:
Code:

outputInterval    0.01;// every flow through time
To something like this:
Code:

outputInterval    1;// every flow through time


All times are GMT -4. The time now is 02:00.