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/)
-   -   Error during initialization of "rhoSimpleFoam" (https://www.cfd-online.com/Forums/openfoam-solving/123564-error-during-initialization-rhosimplefoam.html)

kornickel September 16, 2013 08:58

Error during initialization of "rhoSimpleFoam"
 
Hello everyone,

I am running a "rhoSimpleFoam" case and got an error message while it just initialized the case (see below).

At my walls I am using: "alphatWallFunction", "compressible::epsilonWallFunction", "compressible::kqRWallFunction", and "mutkWallFunction".

I can't see where I did a mistake, does anybody know what's wrong?

Best regards,
Frank


The error message:

Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.2.1                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.2.1-57f3c3617a2d
Exec  : rhoSimpleFoam
Date  : Sep 16 2013
Time  : 14:05:28
Host  : "korn-cae-ubuntu"
PID    : 20302
Case  : /home/korn/Arbeitsfläche/case_rotating_compressible
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


SIMPLE: convergence criteria
    field p        tolerance 1e-05
    field U        tolerance 1e-05
    field "(k|epsilon)"        tolerance 0.0001

Reading thermophysical properties

Selecting thermodynamics package
{
    type            hePsiThermo;
    mixture        pureMixture;
    transport      const;
    thermo          hConst;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleEnthalpy;
}

Reading field U

Reading/calculating face flux field phi

Creating turbulence model

Selecting RAS turbulence model kEpsilon
#0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2  in "/lib/x86_64-linux-gnu/libc.so.6"
#3  Foam::compressible::mutkWallFunctionFvPatchScalarField::calcMut() const in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so"
#4  Foam::compressible::mutWallFunctionFvPatchScalarField::updateCoeffs() in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so"
#5  Foam::fvPatchField<double>::evaluate(Foam::UPstream::commsTypes) in "/opt/openfoam221/platforms/linux64GccDPOpt/bin/rhoSimpleFoam"
#6  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::evaluate() in "/opt/openfoam221/platforms/linux64GccDPOpt/bin/rhoSimpleFoam"
#7  Foam::compressible::RASModels::kEpsilon::kEpsilon(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::fluidThermo const&, Foam::word const&, Foam::word const&) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so"
#8  Foam::compressible::RASModel::adddictionaryConstructorToTable<Foam::compressible::RASModels::kEpsilon>::New(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::fluidThermo const&, Foam::word const&) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so"
#9  Foam::compressible::RASModel::New(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::fluidThermo const&, Foam::word const&) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so"
#10 
 in "/opt/openfoam221/platforms/linux64GccDPOpt/bin/rhoSimpleFoam"
#11  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#12 
 in "/opt/openfoam221/platforms/linux64GccDPOpt/bin/rhoSimpleFoam"
floating-point-exception


my "thermophysicalProperties" file:

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.6                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "constant";
    object      thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

thermoType
{
type                hePsiThermo;
mixture                pureMixture;
transport        const;
thermo                hConst;
equationOfState        perfectGas;
specie                specie;
energy                sensibleEnthalpy;
}

pRef            101325;

mixture
{
        specie
        {
            nMoles        1;
            molWeight        28.9583;
        }
        thermodynamics
        {
            Cp                1006.4;
            Hf                0;
        }
        transport
        {
            mu                18.205e-06;
            Pr                0.7081;
        }
}

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


my "fvSolution" file:

Code:

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

solvers
{
    p
    {
        solver          GAMG;
        tolerance        1e-7;
        relTol          0.05;
        smoother        GaussSeidel;
        nPreSweeps      0;
        nPostSweeps      2;
        cacheAgglomeration on;
        agglomerator    faceAreaPair;
        nCellsInCoarsestLevel 10;       
        mergeLevels      1;
    }

    U
    {
        solver          smoothSolver;
        smoother        GaussSeidel;
        tolerance        1e-7;
        relTol          0.1;
        nSweeps          3;
    }

    h 
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance      1e-06;
        relTol          0.1;
    }

    "(k|epsilon)"
    {
        solver          smoothSolver;
        smoother        GaussSeidel;
        tolerance        1e-6;
        relTol          0.1;
        nSweeps          3;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 2; 

    rhoMin          rhoMin [ 1 -3 0 0 0 ] 0.5;
    rhoMax          rhoMax [ 1 -3 0 0 0 ] 1.5;

    residualControl
    {
        p              1e-5;
        U              1e-5;
        "(k|epsilon)"  1e-4;
//        T                1e-5;
    }
}

relaxationFactors
{

        p              0.15;
        U              0.3;
        h                0.3;
        rho                1; 
        k              0.3;
        epsilon        0.3;

}

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


TReviol September 16, 2013 10:42

Hello,

you could try to start your simulation without using a turbulence model.

When the solver doesn't blow up, you should check the physical plausibility of the initial conditions for the turbulence model.

Regards

Thomas

kornickel September 16, 2013 13:21

Thanks, Thomas! I did it and it actually ran through without a turbulence model. So it seems something's wrong with my turbulence settings. Do you mean the k and Epsilon initial values with initial conditions for the turbulence model?

TReviol September 16, 2013 14:31

Hello,

yes, I meant k and epsilon (or which values your turbulent model is modelling).
There is a very usefull tool on cfd-online to estimate k, epsilon, omega and nut. Follow this link.
Consider the turbulent length scale! In Fluent it is 7% (I am not Sure about this value) of a length, that is characteristic for your Problem. There is also a hint on the URL above.
Since I initialize with the "Fluent-definition", my Simulation is not/rarely blowing up because initial problems.

Regards

Thomas

kornickel September 16, 2013 14:34

Oh wow, that's neat! Thank you so much! I already calculated k, eps and mut but my values seem to be unrealistic low. I'll try this calculator :)

kornickel September 16, 2013 15:01

Alright I got reasonable values for k&eps but it's still the same error message... I've found THIS site where it's explained where "sigfpe" originates from and it seems that it can only be a "division by 0 from having an initial field set to 0" issue.

I actually do have some initial fields set to 0 (pressure, alphat, mut) but that shouldn't be a problem, right?

TReviol September 17, 2013 02:29

Hmm ..ok, there seems to be another mistake. I often set pressure to zero. Did you run checkMesh? Maybe there are bad elements?

You can also unset the Floating Point Exception control by using this command "unset FOAM_SIGFPE". Sometimes, the calculation became stable after a few Iteration steps.

kornickel September 17, 2013 05:08

Yes, I did checkMesh and there are actually some high aspect ratio cells. But I did some incompressible simpleFoam calculations before with this mesh and I never had with those before. I also changed the inlet- and outlet types of k/eps but the error message remains the same.

It's interesting that the message occurs even before the first iteration started, does the solver even check the plausibility of the bc valued in this state?

If I unset sigFpe it actually runs through to the first iteration. The Ux/Uy/Uz residuals are pretty reasonable but my h-initial-residual is already at 10^-6 at the first iteration. And every following one (T, k, eps) are "nan".

In a different post I found this if the "nan" error occurs:

Quote:

(a) double/triple/quatro check your BC settings.
(b) think about your initial conditions. do you start from zero or some converged solution
(c) have a look where is your Co so high.
(c) is not relevant since it's a steadyState case. So it seems I actually screwed something up in my bcs. I tried to avoid that since I have an endless amount of boundaries but could someone please have a look at my bc-files? I can't find any mistake :confused:

In the T-file I just defined a fixedValue at the inlet and a inletOutlet at the outlet.

In the pressure-file I defined a totalPressure inlet and a fixedValue outlet.

And in the U-file I defined a pressureInletVelocity inlet and a zeroGradient outlet.

The simulation with the U- and p-bcs worked fine with simpleFoam.


my k-file:

Code:

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

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

internalField  uniform 3.6;

boundaryField
{

    //FAN

    fan_hub
    {
        type            compressible::kqRWallFunction;
        value          $internalField;
    }
    fan_wall
    {
        type            compressible::kqRWallFunction;
        value          $internalField;
    }
    fan_cyclic_right
    {
        type            cyclic;
    }
    fan_cyclic_left
    {
        type            cyclic;
    }
    fan_blade_front
    {
        type            compressible::kqRWallFunction;
        value          $internalField;
    }
    fan_blade_back
    {
        type            compressible::kqRWallFunction;
        value          $internalField;
    }
    fan_blade_wall
    {
        type            compressible::kqRWallFunction;
        value          $internalField;
    }


    //INLET

    inlet
    {
        type            turbulentIntensityKineticEnergyInlet;  //was fixedvalue
        intensity      0.05;
        value          uniform 3.6;
    }
    inlet_cyclic_right
    {
        type            cyclic;
    }
    inlet_cyclic_left
    {
        type            cyclic;
    }
    inlet_wall
    {
        type            compressible::kqRWallFunction;
        value          $internalField;
    }
    inlet_hub_fan
    {
        type            compressible::kqRWallFunction;
        value          $internalField;
    }
    inlet_front_wall
    {
        type            compressible::kqRWallFunction;
        value          $internalField;
    }


    //OUTLET

    outlet
    {
        type            inletOutlet;
        inletValue        uniform 3.6;
        value          uniform 3.6;
    }
    outlet_cyclic_right
    {
        type            cyclic;
    }
    outlet_cyclic_left
    {
        type            cyclic;
    }
    outlet_hub
    {
        type            compressible::kqRWallFunction;
        value          $internalField;
    }
    outlet_fan_hub
    {
        type            compressible::kqRWallFunction;
        value          $internalField;
    }
    outlet_back_wall
    {
        type            compressible::kqRWallFunction;
        value          $internalField;
    }
    outlet_case_wall
    {
        type            compressible::kqRWallFunction;
        value          $internalField;
    }
    outlet_wall
    {
        type            compressible::kqRWallFunction;
        value          $internalField;
    }
}


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


my eps-file:

Code:

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

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

internalField  uniform 27;

boundaryField
{
    //FAN

    fan_hub
    {
        type            compressible::epsilonWallFunction;
        value          $internalField;
    }
    fan_wall
    {
        type            compressible::epsilonWallFunction;
        value          $internalField;
    }
    fan_cyclic_right
    {
        type            cyclic;
    }
    fan_cyclic_left
    {
        type            cyclic;
    }
    fan_blade_front
    {
        type            compressible::epsilonWallFunction;
        value          $internalField;
    }
    fan_blade_back
    {
        type            compressible::epsilonWallFunction;
        value          $internalField;
    }
    fan_blade_wall
    {
        type            compressible::epsilonWallFunction;
        value          $internalField;
    }


    //INLET

    inlet
    {
        type            compressible::turbulentMixingLengthDissipationRateInlet; 
        mixingLength        0.005;
        value          uniform 27;
    }
    inlet_cyclic_right
    {
        type            cyclic;
    }
    inlet_cyclic_left
    {
        type            cyclic;
    }
    inlet_wall
    {
        type            compressible::epsilonWallFunction;
        value          $internalField;
    }
    inlet_hub_fan
    {
        type            compressible::epsilonWallFunction;
        value          $internalField;
    }
    inlet_front_wall
    {
        type            compressible::epsilonWallFunction;
        value          $internalField;
    }


    //OUTLET

    outlet
    {
        type            inletOutlet;
        inletValue        uniform 27;
        value          uniform 27;
    }
    outlet_cyclic_right
    {
        type            cyclic;
    }
    outlet_cyclic_left
    {
        type            cyclic;
    }
    outlet_hub
    {
        type            compressible::epsilonWallFunction;
        value          $internalField;
    }
    outlet_fan_hub
    {
        type            compressible::epsilonWallFunction;
        value          $internalField;
    }
    outlet_back_wall
    {
        type            compressible::epsilonWallFunction;
        value          $internalField;
    }
    outlet_case_wall
    {
        type            compressible::epsilonWallFunction;
        value          $internalField;
    }
    outlet_wall
    {
        type            compressible::epsilonWallFunction;
        value          $internalField;
    }
}


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


my mut-file:

Code:

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

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

internalField  uniform 0;

boundaryField
{
    //FAN

    fan_hub
    {
        type            mutkWallFunction;
        value          uniform 0;
    }
    fan_wall
    {
        type            mutkWallFunction;
        value          uniform 0;
    }
    fan_cyclic_right
    {
        type            cyclic;
    }
    fan_cyclic_left
    {
        type            cyclic;
    }
    fan_blade_front
    {
        type            mutkWallFunction;
        value          uniform 0;
    }
    fan_blade_back
    {
        type            mutkWallFunction;
        value          uniform 0;
    }
    fan_blade_wall
    {
        type            mutkWallFunction;
        value          uniform 0;
    }


    //INLET

    inlet
    {
        type            calculated;
        value          uniform 0;
    }
    inlet_cyclic_right
    {
        type            cyclic;
    }
    inlet_cyclic_left
    {
        type            cyclic;
    }
    inlet_wall
    {
        type            mutkWallFunction;
        value          uniform 0;
    }
    inlet_hub_fan
    {
        type            mutkWallFunction;
        value          uniform 0;
    }
    inlet_front_wall
    {
        type            mutkWallFunction;
        value          uniform 0;
    }


    //OUTLET

    outlet
    {
        type            calculated;
        value          uniform 0;
    }
    outlet_cyclic_right
    {
        type            cyclic;
    }
    outlet_cyclic_left
    {
        type            cyclic;
    }
    outlet_hub
    {
        type            mutkWallFunction;
        value          uniform 0;
    }
    outlet_fan_hub
    {
        type            mutkWallFunction;
        value          uniform 0;
    }
    outlet_back_wall
    {
        type            mutkWallFunction;
        value          uniform 0;
    }
    outlet_case_wall
    {
        type            mutkWallFunction;
        value          uniform 0;
    }
    outlet_wall
    {
        type            mutkWallFunction;
        value          uniform 0;
    }
}


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


my alphat-file:

Code:

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

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

internalField  uniform 0.0001;

boundaryField
{
    //FAN
    fan_hub
    {
        type            alphatWallFunction;
        value          $internalField;
    }
    fan_wall
    {
        type            alphatWallFunction;
        value          $internalField;
    }
    fan_cyclic_right
    {
        type            cyclic;
    }
    fan_cyclic_left
    {
        type            cyclic;
    }
    fan_blade_front
    {
        type            alphatWallFunction;
        value          $internalField;
    }
    fan_blade_back
    {
        type            alphatWallFunction;
        value          $internalField;
    }
    fan_blade_wall
    {
        type            alphatWallFunction;
        value          $internalField;
    }


    //INLET

    inlet
    {
        type            calculated;
        value          $internalField;
    }
    inlet_cyclic_right
    {
        type            cyclic;
    }
    inlet_cyclic_left
    {
        type            cyclic;
    }
    inlet_wall
    {
        type            alphatWallFunction;
        value          $internalField;
    }
    inlet_hub_fan
    {
        type            alphatWallFunction;
        value          $internalField;
    }
    inlet_front_wall
    {
        type            alphatWallFunction;
        value          $internalField;
    }


    //OUTLET

    outlet
    {
        type            calculated;
        value          $internalField;
    }
    outlet_cyclic_right
    {
        type            cyclic;
    }
    outlet_cyclic_left
    {
        type            cyclic;
    }
    outlet_hub
    {
        type            alphatWallFunction;
        value          $internalField;
    }
    outlet_fan_hub
    {
        type            alphatWallFunction;
        value          $internalField;
    }
    outlet_back_wall
    {
        type            alphatWallFunction;
        value          $internalField;
    }
    outlet_case_wall
    {
        type            alphatWallFunction;
        value          $internalField;
    }
    outlet_wall
    {
        type            alphatWallFunction;
        value          $internalField;
    }
}

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


TReviol September 17, 2013 05:37

On a first view, I didn't see a mistake in your conditions (although the values for k and epsilon seems to be realy high). Could you send me a PM with a zip-file from your case? Then I will try to find out whats wrong.

Thomas


All times are GMT -4. The time now is 13:47.