CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   rhoSimpleFoam error while run with turbulence (https://www.cfd-online.com/Forums/openfoam-programming-development/241459-rhosimplefoam-error-while-run-turbulence.html)

hiep.nguyentrong February 28, 2022 11:03

rhoSimpleFoam error while run with turbulence
 
When i try to run rhoSimpleFoam or steadyCompressibleFoam (foam-extend-4.1) with turbulence models (kEpsilon or kOmegaSST), i get this error.
My case is transonic flow over NACA0012. It run fine with laminar or other version like OpenFOAM-v2112 or OpenFOAM-dev.

How can i solve this? Is it a bug?

Code:

Selecting RAS turbulence model kEpsilon

Program received signal SIGFPE, Arithmetic exception.
0x00007ffff721d84f in Foam::compressible::RASModels::mutkWallFunctionFvPatchScalarField::calcMut (this=0x555555dd1760) at derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C:69
69                    Cmu25*y[faceI]*sqrt(k[faceCellI])/(muw[faceI]/rhow[faceI]);


mAlletto March 3, 2022 04:47

Seems like a division by zero -> rhok is probably zero some where

hiep.nguyentrong March 7, 2022 03:24

Thank you for reply.
I tried to initiate all turbulence variable with difference value but still get floating point at start :(

mAlletto March 7, 2022 04:27

Usually one adds a small value to the denominator to avoid divisions by zero

hiep.nguyentrong March 8, 2022 03:05

i tried add 0.1 value at wall and internalField, but still get the error. I did same with other field and nothing change :(

Code:

    "(WALL3|WALL4)"
    {
        type            mutkWallFunction;
        Cmu            0.09;
        kappa          0.41;
        E              9.8;
        value          uniform 0.1;
    }


mAlletto March 8, 2022 03:46

The small value like 1.0e-04 should go in the denominator in the source code

hiep.nguyentrong March 8, 2022 03:59

Thank you but i did not solve the problem. Here is my 0 file:

alphat:
Code:

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

internalField  uniform 1e-4;

boundaryField
{
    "(INLE1|PRES2)"
    {
        type            calculated;
        value          uniform 1e-4;
    }

    "(WALL3|WALL4)"
    {
        type            alphatWallFunction;
        value          uniform 1e-4;
    }

}

k:
Code:

boundaryField
{
    "(INLE1|PRES2)"
    {
        type            inletOutlet;
        inletValue      uniform $kInlet;
        value          uniform $kInlet;
    }

    "(WALL3|WALL4)"
    {
        type            kqRWallFunction;
        value          uniform $kInlet;
    }

    //#includeEtc "caseDicts/setConstraintTypes"
}

mut:
Code:

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

internalField  uniform 1e-4;

boundaryField
{
    "(WALL3|WALL4)"
    {
        type            mutkWallFunction;
        Cmu            0.09;
        kappa          0.41;
        E              9.8;
        value          uniform 1e-4;
    }
    "(INLE1|PRES2)"
    {
        type            calculated;
        value          uniform 1e-4;
    }
    frontAndBackPlanes
    {
        type            empty;
    }
}

omega
Code:

//omegaInlet      10;
omegaInlet                4000;

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

internalField  uniform $omegaInlet;

boundaryField
{
    "(INLE1|PRES2)"
    {
        type            inletOutlet;
        inletValue      uniform $omegaInlet;
        value          uniform $omegaInlet;
    }

    "(WALL3|WALL4)"
    {
        type            omegaWallFunction;
        value          uniform $omegaInlet;
    }

    //#includeEtc "caseDicts/setConstraintTypes"
}


mAlletto March 8, 2022 04:23

The keyword value is just a placeholder since the boundary conditions are derived from a fixedValue b.c. you have to modify the source code to avoid a floating point exception


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